[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2020097927A1 - 通话控制方法和装置、计算机可读存储介质、电子设备 - Google Patents

通话控制方法和装置、计算机可读存储介质、电子设备 Download PDF

Info

Publication number
WO2020097927A1
WO2020097927A1 PCT/CN2018/115984 CN2018115984W WO2020097927A1 WO 2020097927 A1 WO2020097927 A1 WO 2020097927A1 CN 2018115984 W CN2018115984 W CN 2018115984W WO 2020097927 A1 WO2020097927 A1 WO 2020097927A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel
target application
audio transmission
transmission channel
function
Prior art date
Application number
PCT/CN2018/115984
Other languages
English (en)
French (fr)
Inventor
李亚军
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to CN201880097707.5A priority Critical patent/CN112805988B/zh
Priority to PCT/CN2018/115984 priority patent/WO2020097927A1/zh
Publication of WO2020097927A1 publication Critical patent/WO2020097927A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones

Definitions

  • the present application relates to the technical field of electronic equipment, in particular to a call control method and device, electronic equipment, and computer-readable storage medium.
  • the audio output channel of the current call will be changed, for example, from the receiver to the speaker, or from the speaker to the receiver, etc., affecting the user's call Experience.
  • the embodiments of the present application provide a call control method and apparatus, a computer-readable storage medium, and an electronic device, which can prohibit other applications from changing the audio transmission channel during a call during a call state to provide a user's call experience.
  • a call control method applied to electronic equipment with multiple audio transmission channels including:
  • the target application When the target application is running in the background and the operation is generated, the target application is prohibited from opening the second audio transmission channel to maintain the first audio transmission channel for calling.
  • a call control device applied to electronic equipment with multiple audio transmission channels including:
  • An obtaining module configured to obtain the first audio transmission channel where the electronic device is in a call state
  • a monitoring module configured to monitor whether the target application program generates an operation for setting a second audio transmission channel in the call state
  • the processing module is configured to, when the target application is running in the background and generating the operation, prohibit the target application from opening the second audio transmission channel to maintain the first audio transmission channel for calling.
  • An electronic device includes a memory and a processor.
  • Computer-readable instructions are stored in the memory.
  • the processor is caused to execute the call control method according to the claims.
  • the above call control method and apparatus, computer readable storage medium, and electronic device can acquire the first audio transmission channel where the electronic device is in a call state; monitor whether the target application program generates the second audio in the call state Operation of the transmission channel; when the target application is running in the background and the operation is generated, the target application is prohibited from turning on the second audio transmission channel to maintain the first audio transmission channel for calling to maintain
  • the current call voice is still the first audio transmission channel, which can prevent the audio output channel from being changed during the call and improve the user's call experience.
  • FIG. 1 is a schematic diagram of the internal structure of an electronic device in an embodiment
  • FIG. 2 is a schematic diagram of a part of the architecture of an Android audio system in an embodiment
  • FIG. 3 is a schematic flowchart of a call control method in an embodiment
  • FIG. 5 is a schematic flowchart of a call control method in another embodiment
  • FIG. 6 is a schematic flow chart of allowing the target application to enable the second audio transmission channel in one embodiment, so that the target application can perform audio transmission through the second audio transmission channel;
  • FIG. 7 is a schematic diagram of a call control device in an embodiment
  • FIG. 8 is a block diagram of a partial structure of a mobile phone related to an electronic device provided by an embodiment of the present application.
  • first, second, etc. used in the present invention may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.
  • the first audio transmission channel may be referred to as the second audio transmission channel, and similarly, the second audio transmission channel may be referred to as the first audio transmission channel.
  • Both the first audio transmission channel and the second audio transmission channel are audio transmission channels, but they are not the same audio transmission channel.
  • FIG. 1 a schematic diagram of an internal structure of an electronic device is provided.
  • the electronic device includes a processor, memory, and display screen connected by a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire electronic device.
  • the memory is used to store data, programs, and / or instruction codes, etc. At least one computer program is stored on the memory, and the computer program can be executed by the processor to implement the call control method for electronic devices provided in the embodiments of the present application.
  • the memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random-access memory (Random-Access-Memory, RAM).
  • the memory includes a non-volatile storage medium and internal memory.
  • the non-volatile storage medium stores the operating system, database, and computer program.
  • the database stores data related to a call control method provided by the above embodiments, for example, information such as the name of each process or application may be stored.
  • the computer program can be executed by the processor to implement a call control method provided by various embodiments of the present application.
  • the internal memory provides a cached operating environment for operating systems, databases, and computer programs in non-volatile storage media.
  • the display screen may be a touch screen, such as a capacitive screen or an electronic screen, which is used to display interface information of applications corresponding to the foreground process, and may also be used to detect a touch operation acting on the display screen, and generate corresponding instructions, such as performing front and background Application switching instructions, etc.
  • the structure shown in FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied.
  • the specific electronic device may It includes more or fewer components than shown in the figure, or some components are combined, or have a different component arrangement.
  • the electronic device further includes a network interface connected through a system bus.
  • the network interface may be an Ethernet card or a wireless network card, etc., and is used to communicate with external electronic devices, for example, it may be used to communicate with a server.
  • a partial architecture diagram of an Android audio system is provided.
  • the architecture system of the Android audio system includes a kernel space layer 210, a local layer 220, a framework layer 230, and a client layer 240.
  • the Kernel space layer 210 may include an Audio driver module 211, where the Audio driver module interacts with the hardware and implements the local layer interface for the upper layer to call normally.
  • ALSA, OSS, and a custom audio driver can be selected.
  • the local layer 220 includes an AtlasService_Jni module 221, an AtlasService Interface module 223, and an AtlasService module 225.
  • the framework layer 230 includes an AtlasManager module 231 and an AtlasService module 233. Among them, the AtlasManager module 231 is provided with a conventional interface and a registration callback interface.
  • the AtlasService module 225 in the local layer 220 and the AtlasService module 233 in the framework layer 230 are used for event reception and processing, information collection, abnormal feedback, and log collection, where the information collection may include the collection of display information and the collection of audio information.
  • the audio information includes playback information, recording information, audio mode setting information, and so on. Because the AtlasService module is set up in the system-level framework layer, it can facilitate interaction with other system services, and at the same time, there is no need to worry about permissions during system calls. Through the above-mentioned architecture, the call control method in each embodiment of the present application can be implemented.
  • a call control method is provided.
  • the call control method is applied to an electronic device having multiple audio transmission channels.
  • the electronic device may include a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a mobile Internet device (Mobile Internet Device (MID), a wearable device (such as a smart watch, smart bracelet, pedometer, etc.) Or other electronic devices with voice call function and speakers.
  • MID Mobile Internet Device
  • a wearable device such as a smart watch, smart bracelet, pedometer, etc.
  • the audio transmission channel includes an earpiece channel, a speaker channel, and a headphone channel; it may also include a microphone channel.
  • the word audio transmission channel may be an earphone channel, a speaker channel, and a headphone channel, where the headphone channel may include a wired headphone channel And Bluetooth headset channel.
  • the call control method includes steps 302-306.
  • Step 302 Obtain the first audio transmission channel where the electronic device is in a call state.
  • the electronic device When the electronic device is in a call state, it can acquire the first audio transmission channel occupied by the current call state. For example, based on the Android operating system built in the electronic device, a new Java class can be created to monitor whether the electronic device is in a call state. Specifically, it can be monitored through the overload of BroadcastReceiver.
  • the electronic device can obtain the first audio transmission channel in the current call state.
  • the first audio transmission channel includes an earphone channel, a speaker channel, a wired headset channel, and a Bluetooth headset channel. If the first audio transmission channel is a receiver channel, it means that the voice of the electronic device is output from the receiver; if the first audio transmission channel is a speaker channel, it indicates that the voice of the electronic device is output from the speaker; if the first audio transmission channel When it is the earphone channel, it means that the voice of the electronic device is output from the earphone.
  • the system function AudioModeProvider.getAudioMode can be called to obtain the first audio transmission channel occupied by the current call state.
  • Step 304 Monitor whether the target application generates an operation for setting the second audio transmission channel in the call state.
  • the target application program may be understood as an application program capable of outputting and / or outputting audio signals, and the number of target application programs may be 1, 2, 3 or more.
  • the target application may include applications such as instant messaging, audio playback, video playback, sound control, and voice input.
  • the electronic device may preset to construct a list or database including all target applications, for storing identification information of the target applications, and the like.
  • the electronic device can monitor the audio behavior of the target application through the built-in monitoring function.
  • the audio behavior includes playback behavior, recording behavior, and audio mode settings.
  • the audio mode setting may be understood as an operation for setting the second audio transmission channel.
  • a system-level monitoring module can be created at the system framework layer (native / framework layer), and the audio behavior of the target application program can be monitored through the monitoring module. For example, you can set up a listener module in the framework layer and run it in the system service program (system_server). Since the listener module is established in the system-level service framework layer, you can easily interact with other system services without worrying about system calls. Permissions issue.
  • the electronic device can also create an independent monitoring process, set up and call a separate monitoring function in the process, which can be set to start automatically after power-on, and monitor the audio mode setting behavior of any other target application in real time.
  • Step 306 When the target application runs in the background and generates an operation, the target application is prohibited from opening the second audio transmission channel to maintain the first audio transmission channel for calling.
  • the electronic device may obtain the running state of the target application, and the running state may include foreground operation or background operation.
  • the electronic device can monitor the process information of the target application program and determine the running state of the target application program according to the process information.
  • the electronic device can also monitor whether the target application is running in the background based on the use of ActivityLifecycleCallbacks. According to the life cycle of the Activity, onStart () indicates that an Activity is in the foreground and onStop () indicates that the Activity is not visible in the background.
  • the electronic device can also obtain the running state of the target application through getRunningTasks, and can also obtain the running state of the target application through the combination of getRunningTasks and RunningAppProcessInfo.
  • there is no further limitation on how the electronic device obtains the running state of the target application program nor is it limited to the above example.
  • the electronic device may prohibit the target application from turning on the second audio transmission channel to Maintain the first audio transmission channel to talk. That is, although the target application sets the second audio transmission channel in the background, the setting action will not be performed, that is, the target application will not turn on the second audio output transmission channel to maintain the current call status of the first An audio transmission channel.
  • the second audio transmission channel may also include a receiver channel, a speaker channel, a wired headset channel and a Bluetooth headset channel. The first audio transmission channel is different from the second audio transmission channel.
  • the target application when the first audio transmission channel in the call state is a receiver channel, and the target application is running in the background, and a second audio transmission channel is set, wherein the second audio transmission channel is a speaker channel or a headphone channel, that is, the target
  • the purpose of the application setting the second audio transmission channel is to call the speaker channel or the headphone channel. If the target application opens the second audio transmission channel, the call voice of its electronic device is output from the speaker or headset channel.
  • the electronic device can prevent the target application from opening the second audio transmission channel to maintain the first audio transmission channel for the call, that is, the current call voice is still output through the first audio transmission channel, which can avoid audio output during the call Channel changes occur.
  • the above call control method can obtain the first audio transmission channel where the electronic device is in a call state; monitor whether the target application generates an operation for setting a second audio transmission channel in the call state; when the target application When running in the background and generating the operation, prohibit the target application from opening the second audio transmission channel to maintain the first audio transmission channel for the call to maintain the current call voice or the first audio transmission channel, The situation that the audio output channel is changed during a call can be avoided, and the user experience can be improved.
  • the call control method includes steps 402-410. among them,
  • Step 402 Obtain the first audio transmission channel where the electronic device is in a call state.
  • Step 404 Monitor whether the target application program calls the preset interface function in the call state.
  • the electronic device may monitor whether the target application program calls the preset interface function in the call state, where the preset interface function is used to set a second audio transmission channel for transmitting audio.
  • the target application can open the second audio transmission channel, and when the function of the preset interface function is invalid, then The target application can call but does not turn on the second audio transmission channel.
  • the electronic device can determine the validity or invalidity of the preset interface function by setting the preset interface function.
  • the preset interface functions include at least the setSpeakerphoneOn () interface function, setMode (AudioManager.MODE_IN_CALL) interface function, isWiredHeadsetOn () interface function or other interface functions for setting the earphone channel and the headphone channel, etc.
  • the electronic device can set the speaker channel by calling the interface function setSpeakerphoneOn () in the AudioManager, that is, the speaker channel can be turned on or off.
  • the electronic device can set the earpiece channel by calling the function setMode (AudioManager.MODE_IN_CALL) in AudioManager or the construction parameter streamType (STREAM_VOICE_CALL); the electronic device can set and detect the earpiece channel by calling the function isWiredHeadsetOn () in AudioManager.
  • the preset interface functions are not limited to the above examples, and different forms of preset interface functions can also be set according to actual needs.
  • the electronic device can monitor whether the target application program calls the preset interface function to apply to the audio device state manager to use the audio transmission channel. If an application is sent to the audio device status manager, it indicates that the target application program has called a preset interface function, that is, the target application program has generated an operation for setting a second audio transmission channel.
  • Step 406 Determine whether the target application is running in the background.
  • the electronic device can obtain the running state of the target application, and the running state can include foreground running or background running, and then can determine whether the target application is running in the background.
  • the electronic device can monitor the process information of the target application program and determine the running state of the target application program according to the process information.
  • the electronic device may obtain the running process information of the target application based on ActivityManager.RunningAppProcessInfo.
  • the process information includes constant type information and variable type information, and according to the acquired process information, it can be determined whether the target application program is running in the background.
  • the electronic device can also monitor whether the target application is running in the background based on ActivityLifecycleCallbacks. According to the life cycle of the Activity, onStart () indicates that an Activity is in the foreground, and onStop () indicates that the Activity is not visible in the background.
  • the electronic device can also obtain the running state of the target application through getRunningTasks, and can also obtain the running state of the target application through a combination of getRunningTasks and RunningAppProcessInfo.
  • Step 408 When the target application is running in the background and generating an operation, the target application is allowed to call the preset interface function, and the function of the preset interface function is disabled, so as to maintain the first audio transmission channel for calling.
  • the target application program if the target application program generates an operation for setting the second audio transmission channel while running in the background, it allows the target application program to call the preset interface function, and the function of the preset interface function is invalid, To maintain the first audio transmission channel for talking.
  • the target application when the first audio channel in the call state is the earpiece channel, the target application is allowed to call the second preset function, and the second preset function is disabled to maintain the earphone channel for the call, where the second The preset function is used to set the speaker channel, or, the second preset function is also used to set the headphone channel.
  • the electronic device may be that the function of the preset interface function is invalid, still Maintain the output of the receiver channel of the current call voice, so that the call voice can be output from the receiver channel, and avoid changing the output channel of the call voice.
  • the target application when the first audio channel is a speaker channel, the target application is allowed to call the second preset function, and the function of the second preset function is disabled to maintain the speaker channel for calling; wherein, the second preset function It is used to set the earpiece channel and also used to set the earphone channel.
  • the electronic device when the call voice is output from the speaker channel, when the target application running in the background calls the preset function function for setting the earphone channel or the headphone channel, the electronic device may be that the function of the preset interface function is invalid and still Maintain the speaker channel output of the current call voice, so that the call voice can be output from the speaker channel, and avoid changing the output channel of the call voice.
  • the target application When the first audio channel is a headphone channel, the target application is allowed to call the second preset function, and the function of the second preset function is disabled to maintain the earphone channel for calling, wherein the second preset function is used to set the earphone channel, It is also used to set up speaker channels.
  • the electronic device may be that the function of the preset interface function is invalid, and still Maintain the current channel output of the voice of the call, so that the voice of the call can be output from the headset channel, and avoid changing the output channel of the voice of the call.
  • the target application running in the background can call the preset interface function for setting the second audio transmission channel, it can control the function of the called preset interface function Disabled to maintain the first audio transmission channel of the current call voice, can make the state of the first audio transmission channel and related parameters normal, thereby avoiding the situation of changing the output channel of the call voice, and improving the user's experience during the call.
  • the call control method includes steps 502-506:
  • Step 502 Obtain the first audio transmission channel where the terminal is in a call state.
  • Step 504 Monitor whether the target application generates an operation for setting the second audio transmission channel in the call state.
  • step 502 and step 504 correspond to step 302 and step 304 in the foregoing embodiment one by one, and will not be repeated here.
  • Step 506 When the target application runs in the foreground and the set second transmission channel meets the preset condition, the target application is allowed to enable the second audio transmission channel, so that the target application performs audio transmission through the second audio transmission channel.
  • the electronic device can monitor whether the target application is running in the foreground based on ActivityLifecycleCallbacks. At the same time, the electronic device can monitor whether the target application running in the foreground calls the preset interface function in the call state, where the preset interface function is used to set a second audio transmission channel for transmitting audio.
  • the target application running in the foreground calls the preset interface function during the call state, that is, when the target application generates an operation for setting the second audio transmission channel while running in the foreground
  • the set second transmission channel can be judged Whether it meets the preset conditions.
  • the preset condition includes that the second audio transmission channel is inconsistent with the first audio transmission channel. That is, when the target application is running in the foreground and the set second transmission channel is inconsistent with the first audio transmission channel, the target application is allowed to enable the second audio transmission channel to enable the target application to perform audio through the second audio transmission channel transmission.
  • the second transmission channel set by the target application running in the foreground is the speaker channel.
  • the target application is allowed to enable the speaker Channel to enable the target application to transmit audio through the speaker channel.
  • the target application is allowed to play the voice to be played by the target application when the speaker channel is enabled.
  • the preset condition includes that the second audio transmission channel is consistent with the first audio transmission channel and that the usage priority of the target application is higher than the usage priority of the call. That is, when the target application is running in the foreground and the set second transmission channel is consistent with the first audio transmission channel and the use priority of the target application is higher than the use priority of the call, the target application is allowed to enable the second audio transmission Channel, so that the target application performs audio transmission through the second audio transmission channel.
  • the use priority can be understood as the priority level that can be used when both the call and the target application need to use the same audio transmission channel.
  • the usage priority of the target application is higher than the usage priority of the call
  • the usage priority is the priority when using the receiver channel. That is, when the target application and the call use the receiver channel at the same time, under certain circumstances, when the use priority of the target application is higher than the use priority of the call, the target application can be allowed to use the receiver channel first, so that The target application transmits audio through the earpiece channel.
  • the target application is an instant messaging application, and the contact A currently in communication in the target application is more important than the current call contact B, the target application can be considered to have a high priority Use priority for calls.
  • allowing the target application to enable the second audio transmission channel to enable the target application to perform audio transmission through the second audio transmission channel includes steps 602-604. among them,
  • Step 602 Detect the idle time period of the call state.
  • the electronic device may detect the idle period of the call state during the call state.
  • the time period during which no input or output voice signal is detected within a preset time period is referred to as an idle time period.
  • the time period in which the input and output voice signals exceed the vocal range within a preset time period is called an idle time period.
  • the vocal range can be understood as the frequency range of sound waves is 20HZ-20KHZ, where the voice range of human speech only occupies a narrow part of the sound range that humans can hear, generally within 100HZ-8KHZ, and 200- 4000HZ is called the fundamental frequency of human voice, and the frequency of most people speaking is within this range.
  • the time period is considered as an idle time period.
  • Step 604 Allow the target application to enable the second audio transmission channel during the idle period, so that the target application can perform audio transmission through the second audio transmission channel.
  • the electronic device can allow the target application to enable the second audio transmission channel during the idle time period, so that the target application can perform audio transmission through the second audio transmission channel. That is, the first audio transmission channel of the communication state of the electronic device will not change, and at the same time, the target application is allowed to enable the second audio transmission channel during the idle time period, so that the target application performs audio transmission through the second audio transmission channel.
  • the first audio transmission channel can be used to restore the current call state, and the first audio transmission channel state and related parameters will not be changed, which improves the user's call process.
  • Experience and flexibility in using the target application can allow the target application to enable the second audio transmission channel during the idle time period, so that the target application can perform audio transmission through the second audio transmission channel. That is, the first audio transmission channel of the communication state of the electronic device will not change, and at the same time, the target application is allowed to enable the second audio transmission channel during the idle time period, so that the target application performs audio transmission through the second audio transmission channel.
  • steps in the flowcharts of FIGS. 3-6 are displayed in order according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless clearly stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least some of the steps in FIGS. 3-6 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. These sub-steps or stages The execution order of is not necessarily sequential, but may be executed in turn or alternately with at least a part of other steps or sub-steps or stages of other steps.
  • the present application also provides a call control device, including: an obtaining module 710, a listening module 720, and a processing module 730. among them,
  • the obtaining module 710 is used to obtain the first audio transmission channel where the terminal is in a call state
  • the monitoring module 720 is configured to monitor whether the target application program generates an operation for setting a second audio transmission channel in a call state
  • the processing module 730 is configured to prohibit the target application from opening the second audio transmission channel when the target application is running in the background and generates an operation, so as to maintain the first audio transmission channel for calling.
  • the above call control device can acquire the first audio transmission channel where the electronic device is in a call state; monitor whether the target application generates an operation for setting a second audio transmission channel in the call state; when the target application When running in the background and generating the operation, prohibit the target application from opening the second audio transmission channel to maintain the first audio transmission channel for the call to maintain the current call voice or the first audio transmission channel, The situation that the audio output channel is changed during a call can be avoided, and the user experience can be improved.
  • the monitoring module 720 includes:
  • a monitoring unit configured to monitor whether the target application program calls a preset interface function in a call state, wherein the preset interface function is used to set a second audio transmission channel for transmitting audio;
  • the generating unit is used for generating an operation when the preset interface function is called.
  • the monitoring unit is further configured to monitor whether the target application program calls the preset interface function to apply to the audio device state manager to use the audio transmission channel.
  • the processing module is further configured to allow the target application to call the preset interface function, and the function of the preset interface function is invalid, so as to maintain the first audio transmission channel for calling.
  • the first audio transmission channel includes an earpiece channel, a speaker channel, and a headphone channel;
  • the target application is allowed to call the second preset function, and the second preset function is disabled to maintain the earphone channel for calling, wherein the second preset function is used to set the speaker channel, It is also used to set the earphone channel;
  • the target application is allowed to call the second preset function, and the function of the second preset function is disabled to maintain the speaker channel for calling; wherein, the second preset function is used to set the receiver channel, It is also used to set the earphone channel;
  • the target application is allowed to call the second preset function, and the function of the second preset function is disabled to maintain the earphone channel for calling, wherein the second preset function is used to set the earphone channel, It is also used to set up speaker channels.
  • the target application running in the background can call the preset interface function for setting the second audio transmission channel, it can control the function of the called preset interface function Disabled to maintain the first audio transmission channel of the current call voice, can make the state of the first audio transmission channel and related parameters normal, thereby avoiding the situation of changing the output channel of the call voice, and improving the user's experience during the call.
  • the call control device further includes:
  • the running module is used to obtain the process information of the target application and determine whether the target application is running in the background according to the process information.
  • the processing module 730 is further configured to allow the target application to enable the second audio transmission channel when the target application is running in the foreground and the set second transmission channel meets the preset condition, so that the target application can pass The second audio transmission channel performs audio transmission.
  • the preset condition is that the second audio transmission channel is inconsistent with the first audio transmission channel, or,
  • the preset condition includes that the second audio transmission channel is consistent with the first audio transmission channel and the use priority of the target application is higher than the use priority of the call.
  • the processing module 730 includes:
  • the detection unit is used to detect the idle time period of the call state
  • the processing unit is configured to allow the target application to enable the second audio transmission channel during the idle time period, so that the target application can perform audio transmission through the second audio transmission channel.
  • the call control device in this embodiment may allow the target application to enable the second audio transmission channel during the idle period, so that the target application performs audio transmission through the second audio transmission channel. That is, the first audio transmission channel of the communication state of the electronic device will not change, and at the same time, the target application is allowed to enable the second audio transmission channel during the idle time period, so that the target application performs audio transmission through the second audio transmission channel.
  • the first audio transmission channel can be used to restore the current call state, and the first audio transmission channel state and related parameters will not be changed, which improves the user's call process. Experience and flexibility in using the target application.
  • each module in the above call control device is for illustration only. In other embodiments, the call control device may be divided into different modules as needed to complete all or part of the functions of the above call control device.
  • Each module in the above call control device may be implemented in whole or in part by software, hardware, or a combination thereof.
  • the above modules may be embedded in the hardware or independent of the processor in the electronic device, or may be stored in the memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • the embodiments of the present application also provide a computer-readable storage medium.
  • One or more non-volatile computer-readable storage media containing computer-executable instructions when the computer-executable instructions are executed by one or more processors, cause the processor to perform the steps of the following call control method:
  • the target application runs in the background and generates an operation, the target application is prohibited from turning on the second audio transmission channel to maintain the first audio transmission channel for calling.
  • one or more non-volatile computer-readable storage media containing computer-executable instructions when the computer-executable instructions are executed by one or more processors, may also cause the processor to perform any of the foregoing implementations Example call control method.
  • a computer program product containing instructions that, when run on a computer, causes the computer to perform the steps of the call control method:
  • the target application runs in the background and generates an operation, the target application is prohibited from turning on the second audio transmission channel to maintain the first audio transmission channel for calling.
  • a computer program product containing instructions when run on a computer, causes the computer to execute the call control method in any of the above embodiments.
  • An embodiment of the present application also provides an electronic device. As shown in FIG. 8, for ease of description, only parts related to the embodiments of the present application are shown, and specific technical details are not disclosed, please refer to the method part of the embodiments of the present application.
  • the electronic device may be any terminal device including a mobile phone, tablet computer, PDA (Personal Digital Assistant), POS (Point of Sales), in-vehicle computer, wearable device, etc. that has a voice call function and has a speaker , Taking an electronic device as a mobile phone as an example:
  • the mobile phone includes: a radio frequency (Radio Frequency) circuit 810, a memory 820, an input unit 830, a display unit 840, a sensor 850, an audio circuit 860, a wireless fidelity (WiFi) module 870, and a processor 880 , And power supply 890 and other components.
  • Radio Frequency Radio Frequency
  • a memory 820 for storing data
  • a sensor 850 for detecting and a wireless fidelity
  • WiFi wireless fidelity
  • processor 880 a processor 880
  • power supply 890 and other components.
  • the structure of the mobile phone shown in FIG. 8 does not constitute a limitation on the mobile phone, and may include more or fewer components than those shown in the figure, or a combination of certain components, or a different component arrangement.
  • the RF circuit 810 can be used to receive and send signals during the sending and receiving of information or during a call. It can receive the downlink information of the base station and process it to the processor 880; it can also send the uplink data to the base station.
  • RF circuits include but are not limited to antennas, at least one amplifier, transceiver, coupler, low noise amplifier (Low Noise Amplifier, LNA), duplexer, and so on.
  • the RF circuit 810 can also communicate with other devices through a wireless communication network.
  • the above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile (GSM), General Packet Radio Service (GPRS), and Code Division Multiple Access (Code Division) Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Message Service (SMS), etc.
  • GSM Global System of Mobile
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Message Service
  • the memory 820 may be used to store software programs and modules.
  • the processor 880 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 820.
  • the memory 820 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system and at least one function-required application program (such as a sound playback function application program, an image playback function application program, etc.), etc.
  • the data storage area can store data (such as audio data, address book, etc.) created according to the use of the mobile phone.
  • the memory 820 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the input unit 830 may be used to receive input numeric or character information, and generate key signal input related to user settings and function control of the mobile phone 800.
  • the input unit 830 may include a touch panel 831 and other input devices 832.
  • the touch panel 831 also known as a touch screen, can collect user's touch operations on or near it (such as the user using any finger, stylus, or any other suitable object or accessory on or near the touch panel 831 Operation), and drive the corresponding connection device according to the preset program.
  • the touch panel 831 may include a touch detection device and a touch controller.
  • the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into contact coordinates, and then sends To the processor 880, and can receive the command sent by the processor 880 and execute it.
  • the touch panel 831 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 830 may also include other input devices 832.
  • other input devices 832 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), and the like.
  • the display unit 840 may be used to display information input by the user or information provided to the user and various menus of the mobile phone.
  • the display unit 840 may include a display panel 841.
  • the display panel 841 may be configured in the form of a liquid crystal display (Liquid Crystal) (LCD), an organic light emitting diode (Organic Light-Emitting Diode, OLED), or the like.
  • the touch panel 831 may cover the display panel 841, and when the touch panel 831 detects a touch operation on or near it, it is transmitted to the processor 880 to determine the type of touch event, and then the processor 880 according to The type of touch event provides a corresponding visual output on the display panel 841.
  • the touch panel 831 and the display panel 841 are implemented as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 831 and the display panel 841 may be integrated and Realize the input and output functions of the mobile phone.
  • the mobile phone 800 may further include at least one sensor 850, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor may close the display panel 841 and / or when the mobile phone moves to the ear Or backlight.
  • the motion sensor may include an acceleration sensor, which can detect the magnitude of acceleration in various directions through the acceleration sensor, and can detect the magnitude and direction of gravity when at rest, and can be used for applications that recognize mobile phone gestures (such as horizontal and vertical screen switching), and vibration recognition-related functions (such as Pedometer, percussion), etc.
  • the mobile phone can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor and so on.
  • the audio circuit 860, the speaker 861, and the microphone 862 may provide an audio interface between the user and the mobile phone.
  • the audio circuit 860 can transmit the converted electrical signal of the received audio data to the speaker 861, which converts the speaker 861 into a sound signal output; on the other hand, the microphone 862 converts the collected sound signal into an electrical signal, which After receiving, it is converted into audio data, and then processed by the audio data output processor 880, and then sent to another mobile phone via the RF circuit 810, or the audio data is output to the memory 820 for subsequent processing.
  • WiFi is a short-range wireless transmission technology.
  • the mobile phone can help users send and receive e-mails, browse web pages, and access streaming media through the WiFi module 870. It provides users with wireless broadband Internet access.
  • FIG. 8 shows the WiFi module 870, it can be understood that it is not a necessary component of the mobile phone 800, and may be omitted as needed.
  • the processor 880 is the control center of the mobile phone, and uses various interfaces and lines to connect the various parts of the entire mobile phone. Various functions and processing data of the mobile phone, so as to monitor the mobile phone as a whole.
  • the processor 880 may include one or more processing units.
  • the processor 880 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, user interface, application programs, etc .; the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 880.
  • the mobile phone 800 further includes a power supply 890 (such as a battery) for powering various components.
  • a power supply 890 (such as a battery) for powering various components.
  • the power supply can be logically connected to the processor 880 through the power management system, so as to realize functions such as charging, discharging, and power management through the power management system.
  • the mobile phone 800 may further include a camera, a Bluetooth module, and the like.
  • the processor 880 included in the electronic device implements the following steps when executing the computer program stored on the memory:
  • the target application When the target application is running in the background and the operation is generated, the target application is prohibited from opening the second audio transmission channel to maintain the first audio transmission channel for calling.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM), which acts as external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR) SDRAM, enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)

Abstract

一种通话控制方法和装置、计算机可读存储介质、电子设备,通话控制方法,应用于具有多个音频传输通道的电子设备,包括:获取电子设备处于通话状态的第一音频传输通道(302);监听目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作(304);当目标应用程序在后台运行且产生操作时,禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话(306)。

Description

通话控制方法和装置、计算机可读存储介质、电子设备 技术领域
本申请涉及电子设备技术领域,特别是涉及通话控制方法和装置、电子设备、计算机可读存储介质。
背景技术
随着电子设备的广泛应用和其功能的日益丰富,电子设备已成为人们日常生活中不可或缺的一部分,尤其是电子设备的通话功能。用户在通话过程中可以选择听筒、扬声器和耳机等音频输出通道来输出通话语音。
但是,在通话过程中,由于三方应用程序的误操作,会使当前通话的音频输出通道发生改变,例如,由听筒变为扬声器外放,或者由扬声器外放变听筒等,影响了用户的通话体验。
发明内容
本申请实施例提供一种通话控制方法和装置、计算机可读存储介质、电子设备,可以在通话状态时禁止其他应用程序改变通话时的音频传输通道,提供用户的通话体验度。
一种通话控制方法,应用于具有多个音频传输通道的电子设备,包括:
获取所述电子设备处于通话状态的第一音频传输通道;
监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;
当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话。
一种通话控制装置,应用于具有多个音频传输通道的电子设备,包括:
获取模块,用于获取所述电子设备处于通话状态的第一音频传输通道;
监听模块,用于监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;
处理模块,用于当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被 处理器执行时实现上述的通话控制方法的步骤。
一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如权利要求上述的通话控制方法。
上述通话控制方法和装置、计算机可读存储介质、电子设备,可以获取所述电子设备处于通话状态的第一音频传输通道;监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话,以维持当前通话语音还是以第一音频传输通道,可以避免通话过程中音频输出通道发生改变的情况发生,提高用户的通话体验度。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他实施例的附图。
图1为一实施例中的电子设备的内部结构示意图;
图2为一实施例中的安卓音频系统的部分架构示意图;
图3为一实施例中的通话控制方法的流程示意图;
图4为另一实施例中的通话控制方法的流程示意图;
图5为又一实施例中的通话控制方法的流程示意图;
图6为一个实施例中允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输的流程示意图;
图7为一个实施例中的通话控制装置的框架示意图;
图8为与本申请实施例提供的电子设备相关的手机的部分结构的框图。
具体实施方式
为了便于理解本发明,下面将参照相关附图对本发明进行更全面的描述。附图中给出了本发明的较佳实施例。但是,本发明可以以许多不同的形式来实现,并不限于本文所描述的实施例。相反地,提供这些实施例的目的是使对本发明的公开内容的理解更加透彻全面。
可以理解,本发明所使用的术语“第一”、“第二”等可在本文中用于描述 各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本发明的范围的情况下,可以将第一音频传输通道称为第二音频传输通道,且类似地,可将第二音频传输通道称为第一音频传输通道。第一音频传输通道和第二音频传输通道两者都是音频传输通道,但其不是同一音频传输通道。
在一个实施例中,如图1所示,提供了一种电子设备的内部结构示意图。该电子设备包括通过系统总线连接的处理器、存储器和显示屏。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器用于存储数据、程序、和/或指令代码等,存储器上存储至少一个计算机程序,该计算机程序可被处理器执行,以实现本申请实施例中提供的适用于电子设备的通话控制方法。存储器可包括磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random-Access-Memory,RAM)等。例如,在一个实施例中,存储器包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统、数据库和计算机程序。该数据库中存储有用于实现以上各个实施例所提供的一种通话控制方法相关的数据,比如可存储有每个进程或应用的名称等信息。该计算机程序可被处理器所执行,以用于实现本申请各个实施例所提供的一种通话控制方法。内存储器为非易失性存储介质中的操作系统、数据库和计算机程序提供高速缓存的运行环境。显示屏可以是触摸屏,比如为电容屏或电子屏,用于显示前台进程对应的应用的界面信息,还可以被用于检测作用于该显示屏的触摸操作,生成相应的指令,比如进行前后台应用的切换指令等。
本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的电子设备的限定,具体的电子设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。如该电子设备还包括通过系统总线连接的网络接口,网络接口可以是以太网卡或无线网卡等,用于与外部的电子设备进行通信,比如可用于同服务器进行通信。
在一个实施例中,如图2所示,提供了一种Android音频系统的部分架构图。其中,该Android音频系统的架构系统中包括内核(Kernel)空间层210、本地层220、框架层230以及Client层240。
内核(Kernel)空间层210上可包含Audio驱动模块211,其中,Audio驱动模块是与硬件进行交互,并且实现本地层的接口供上层正常调用,这里可以选择ALSA,OSS以及自定义的音频驱动。本地层220中包含AtlasService_Jni 模块221、AtlasService Interface模块223以及AtlasService模块225。框架层230中包含AtlasManager模块231和AtlasService模块233。其中,AtlasManager模块231中设有常规接口和注册回调接口。本地层220中的AtlasService模块225以及框架层230中的AtlasService模块233用于事件接收和处理、信息收集、异常反馈以及日志收集,其中,信息收集可包括显示信息的收集和音频信息的收集。其中,音频信息包括播放信息、录音信息、音频模式设置信息等。由于该AtlasService模块设立在系统级的框架层中,可方便与其他系统服务进行交互,同时无需担心系统调用时的权限问题。通过上述的架构,可实现本申请各个实施例中的通话控制方法。
在一个实施例中,如图3所示,提供了一种通话控制方法,该通话控制方法应用于具有多个音频传输通道的电子设备。在一个实施例中,电子设备可以为包括手机、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(Mobile Internet Device,MID)、可穿戴设备(例如智能手表、智能手环、计步器等)或其他等具有语音通话功能并具有扬声器的电子设备。
音频传输通道包括听筒通道、扬声器通道、耳机通道;还可以包括麦克风通道,在本申请实施例中,字音频传输通道可以为听筒通道、扬声器通道和耳机通道,其中,耳机通道可以包括有线耳机通道和蓝牙耳机通道。当音频传输通道为听筒通道时,通话语音由听筒发出;当音频传输通道为扬声器通道时,通话语音由外放扬声器发出;当音频传输通道为耳机通道时,通话语音可通过有线耳机或蓝牙耳机发出。
如图3所示,在一个实施例中,通话控制方法,包括步骤302-步骤306。
步骤302,获取电子设备处于通话状态的第一音频传输通道。
当电子设备处于通话状态时,可以获取当前通话状态所占用的第一音频传输通道。例如,可以基于电子设备中内置的安卓操作系统,新建一个Java类用来监听电子设备是否处于通话状态,具体地可以通过BroadcastReceiver的重载进行监听。
当电子设备处于通话状态时,电子设备可以获取当前通话状态的第一音频传输通道。其中,第一音频传输通道包括听筒通道、扬声器通道、有线耳机通道和蓝牙耳机通道。若第一音频传输通道为听筒通道时,则表明电子设备的通话语音由听筒输出;若第一音频传输通道为扬声器通道时,则表明电子设备的通话语音由扬声器输出;若第一音频传输通道为耳机通道时,则表明电子设备的通话语音由耳机输出。例如,可以基于电子设备中内置的安卓操作系统,可调用系统函数AudioModeProvider.getAudioMode()来获取当前通 话状态所占用的第一音频传输通道。
步骤304,监听目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作。
电子设备在通话状态时,还可以实时检测目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作。其中,目标应用程序可以理解为能够输出和/或输出音频信号的应用程序,且目标应用程序的数量可以为1个2个、3个或更多个。例如,目标应用程序可包括即时通信类、音频播放类、视频播放类、声音控制类、语音输入类等应用程序。
在一个实施例中,电子设备可以预设构建包括所有目标应用程序的列表或数据库,用于存储目标应用程序的标识信息等。
在一个实施例中,电子设备可通过内置的监听函数对目标应用程序的音频行为进行监听。该音频行为包括播放行为、录音行为以及音频模式设置等行为。其中,音频模式设置可以理解为产生了用于设置第二音频传输通道的操作。以具有安卓操作系统的电子设备为例,可在系统框架层(native/framework层)创建系统级的监听模块,通过所述监听模块对目标应用程序的音频行为进行监听。例如,可在框架层设立监听模块并运行在系统服务程序(system_server)中,由于该监听模块设立在系统级的服务框架层中,可方便与其他系统服务进行交互,同时无需担心系统调用时的权限问题。
可选的,电子设备也可以创建独立的监听进程,在该进程中设立并调用单独的监听函数,可设置为开机自启动,并实时对其他任何一个目标应用程序的音频模式设置行为进行监控。
步骤306,当目标应用程序在后台运行且产生操作时,禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话。
在一个实施例中,电子设备可以获取目标应用程序的运行状态,该运行状态可包括前台运行或后台运行。例如,电子设备可以监听目标应用程序的进程信息,并根据进程信息来确定目标应用程序的运行状态。电子设备还可以基于使用ActivityLifecycleCallbacks来监听目标应用程序是否运行在后台的行为,根据Activity的生命周期,其中,onStart()表示一个Activity处于前台,onStop()表示Activity在后台不可见。当然,电子设备还可以通过getRunningTasks获取目标应用程序的运行状态,还可以通过getRunningTasks和RunningAppProcessInfo结合获取目标应用程序的运行状态。在此,对电子设备如何获取目标应用程序的运行状态不做进一步的限定,也不限于上述举例说明。
当电子设备监听到,目标应用程序当前处于后台运行,且在目标应用程序产生了用于设置第二音频传输通道的操作时,则该电子设备可以禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话。也即,虽然目标应用程序在后台设置了第二音频传输通道,但是该设置动作不会被执行,也即,该目标应用程序不会开启第二音频出传输通道,以维持当前通话状态的第一音频传输通道。其中,第二音频传输通道也可包括听筒通道、扬声器通道、有线耳机通道和蓝牙耳机通道。其中,第一音频传输通道与第二音频传输通道不同。
例如,通话状态的第一音频传输通道为听筒通道时,而目标应用程序运行在后台,且设置了第二音频传输通道,其中,第二音频传输通道为扬声器通道或耳机通道,也即,目标应用程序设置第二音频传输通道的目的是为了调用扬声器通道或耳机通道。若目标应用程序开启该第二音频传输通道时,其电子设备的通话语音则回从扬声器或耳机通道输出。电子设备可通过禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话,也即,当前的通话语音还是以第一音频传输通道输出,进而可以避免通话过程中,音频输出通道发生改变的情况发生。
上述通话控制方法,可以获取所述电子设备处于通话状态的第一音频传输通道;监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话,以维持当前通话语音还是以第一音频传输通道,可以避免通话过程中音频输出通道发生改变的情况发生,提高用户体验度。
如图4所示,在一个实施例中,通话控制方法包括步骤402-步骤410。其中,
步骤402,获取电子设备处于通话状态的第一音频传输通道。
步骤404,监听目标应用程序在通话状态中是否调用预设接口函数。
电子设备可以监听目标应用程序在通话状态中是否调用预设接口函数,其中,预设接口函数用于设置传输音频的第二音频传输通道。任何目标应用程序均可以调用该预设接口函数时,当预设接口函数的功能有效时,则该目标应用程序可开启该第二音频传输通道,而当预设接口函数的功能无效时,则该目标应用程序可调用但不开启该第二音频传输通道。具体的,电子设备可以通过对预设接口函数进行设置,以确定该预设接口函数功能的有效或无效性。
进一步的,预设接口函数至少包括setSpeakerphoneOn()接口函数、setMode(AudioManager.MODE_IN_CALL)接口函数、isWiredHeadsetOn()接口函数或其他用于设置听筒通道、耳机通道的接口函数等。
例如,基于安卓操作系统的电子设备中,电子设备可以通过调用AudioManager中的接口函数setSpeakerphoneOn()来设置扬声器通道,也即,可以开启或关闭扬声器通道。电子设备可以通过调用AudioManager中的函数setMode(AudioManager.MODE_IN_CALL)或构造参数streamType(STREAM_VOICE_CALL)设置听筒通道;电子设备可以通过调用AudioManager中的函数isWiredHeadsetOn()来设置并检测听筒通道。
预设接口函数不限于上述举例说明,还可以根据实际需求来设定不同形式的预设接口函数。
进一步的,电子设备可以监听目标应用程序调用预设接口函数是否向音频设备状态管理器申请使用音频传输通道。若向音频设备状态管理器发出了申请,该表明该目标应用程序调用了预设接口函数,也即,目标应用程序用产生了用于设置第二音频传输通道的操作。
步骤406,判断目标应用程序是否在后台运行。
在一个实施例中,电子设备可以获取目标应用程序的运行状态,该运行状态可包括前台运行或后台运行,进而可以判断目标应用程序是否在后台运行。具体地,电子设备可以监听目标应用程序的进程信息,并根据进程信息来确定目标应用程序的运行状态。例如,电子设备可以基于ActivityManager.RunningAppProcessInfo来获取目标应用程序运行中进程信息。其中,进程信息包括常量类型信息和变量类型信息,根据获取的进程信息就可以判断目标应用程序是否在后台运行。
可选的,电子设备还可以基于ActivityLifecycleCallbacks来监听目标应用程序是否运行在后台的行为,根据Activity的生命周期,其中,onStart()表示一个Activity处于前台,onStop()表示Activity在后台不可见。
可选的,电子设备还可以通过getRunningTasks获取目标应用程序的运行状态,还可以通过getRunningTasks和RunningAppProcessInfo结合获取目标应用程序的运行状态。
在此,对电子设备如何获取目标应用程序的运行状态不做进一步的限定,也不限于上述举例说明。
步骤408,当目标应用程序在后台运行且产生操作时,允许目标应用程序调用预设接口函数,且预设接口函数的功能失效,以维持第一音频传输通 道进行通话。
在一个实施例中,若目标应用程序在后台运行时产生了用于设置第二音频传输通道的操作时,其允许目标应用程序调用该预设接口函数,且该预设接口函数的功能失效,以维持第一音频传输通道进行通话。
在一个实施例中,当通话状态的第一音频通道为听筒通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持听筒通道进行通话,其中,第二预设函数用于设置扬声器通道,或,第二预设函数还用于设置耳机通道。例如,当通话语音为听筒通道输出时,其在后台运行的目标应用程序调用了用于设置扬声器通道或耳机通道的预设函数功能时,电子设备可以是该预设接口函数的功能无效,仍维持当前通话语音的听筒通道输出,能够使通话语音从听筒通道输出,而避免改变通话语音的输出通道。
在一个实施例中,当第一音频通道为扬声器通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持扬声器通道进行通话;其中,第二预设函数用于设置听筒通道,还用于设置耳机通道。例如,当通话语音为扬声器通道输出时,其在后台运行的目标应用程序调用了用于设置听筒通道或耳机通道的预设函数功能时,电子设备可以是该预设接口函数的功能无效,仍维持当前通话语音的扬声器通道输出,能够使通话语音从扬声器通道输出,而避免改变通话语音的输出通道。
当第一音频通道为耳机通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持耳机道进行通话,其中,第二预设函数用于设置听筒通道,还用于设置扬声器通道。例如,当通话语音为耳机通道输出时,其在后台运行的目标应用程序调用了用于设置听筒通道或扬声器通道的预设函数功能时,电子设备可以是该预设接口函数的功能无效,仍维持当前通话语音的耳机通道输出,能够使通话语音从耳机通道输出,而避免改变通话语音的输出通道。
本实施例中的通话控制方法,在通话过程中,处于后台运行的目标应用程序虽然能够调用用于设置第二音频传输通道的预设接口函数,但是可以控制该调用的预设接口函数的功能无效,以维持当前通话语音的第一音频传输通道,能够使第一音频传输通道状态及相关参数均正常,从而避免改变通话语音的输出通道的情况发生,提高了用户通话过程中的体验度。
如图5所示,在一个实施例中,通话控制方法包括步骤502-步骤506:
步骤502:获取终端处于通话状态的第一音频传输通道。
步骤504:监听目标应用程序在通话状态中是否产生用于设置第二音频 传输通道的操作。
上述步骤502、步骤504与前述实施例中步骤302、步骤304一一对应,在此,不再赘述。
步骤506:当目标应用程序在前台运行且设置的第二传输通道符合预设条件时,允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。
电子设备可以基于ActivityLifecycleCallbacks来监听目标应用程序是否运行在前台的行为。同时,电子设备可以监听在前台运行的目标应用程序在通话状态中是否调用预设接口函数,其中,预设接口函数用于设置传输音频的第二音频传输通道。当在前台运行的目标应用程序在通话状态中调用了预设接口函数,也即目标应用程序在前台运行时产生了用于设置第二音频传输通道的操作时,可以判断设置的第二传输通道是否符合预设条件。
在一个实施例中,预设条件包括第二音频传输通道与第一音频传输通道不一致。也即,当目标应用程序在前台运行且设置的第二传输通道与第一音频传输通道不一致时,允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。
例如,当通话状态的第一音频通道为听筒通道时,前台运行的目标应用程序设置的第二传输通道为扬声器通道,此时,目标应用程序若需要播放音频信号时,允许目标应用程序启用扬声器通道,以使目标应用程序通过扬声器通道进行音频传输。
进一步的,当第一音频传输通道的无通话语音输入时,允许目标应用程序启用扬声器通道时,并播放目标应用程序待播放的语音。
在一个实施例中,预设条件包括第二音频传输通道与第一音频传输通道一致且目标应用程序的使用优先级高于通话的使用优先级。也即,当目标应用程序在前台运行且设置的第二传输通道与第一音频传输通道一致且目标应用程序的使用优先级高于通话的使用优先级时,允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。其中,使用优先级可以理解的是,当通话与目标应用程序都需要使用同一音频传输通道时,能够优先使用的等级。
具体的,当目标应用程序的使用优先级高于通话的使用优先级时,其该使用优先级为使用听筒通道时的优先级。也即,目标应用程序和通话在同时使用听筒通道时,在一定情况下,其目标应用程序的使用优先级高于通话的使用优先级时,可以在允许目标应用程序先使用听筒通道,以使目标应用程 序通过听筒通道进行音频传输。例如,当该目标应用程序为即时通信类应用程序,该目标应用程序中当前处于通讯状态的联系人A的重要性高于当前通话联系人B时,则可以认为目标应用程序的使用优先级高于通话的使用优先级。
如图6所示,在一个实施例中,允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输,包括步骤602-步骤604。其中,
步骤602,检测通话状态的闲置时间段。
在一个实施例中,电子设备可以在通话状态检测通话状态的闲置时间段。其中,在预设时间段内未检测出输入或输出语音信号的时间段称之为闲置时间段。可选的,若在预设时间段内输入和输出语音信号的超出人声范围的时间段称之为闲置时间段。其中,人声范围可以理解为声波的频率范围为20HZ-20KHZ,其中,人说话的声音范围只在人能够听到的声音范围中占较窄的一部分,一般在100HZ-8KHZ以内,而200-4000HZ被称为人声基频,大部分人说话的频率都在该范围内。当输入和输出语音信号的频率均不在人声范围内时,则认为该时间段为闲置时间段。
步骤604,在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。
电子设备能够在在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。也即,电子设备的通话状态的第一音频传输通道不会改变,同时在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。当目标应用程序通过第二音频传输通道进行音频传输完毕后,可以以第一音频传输通道恢复当前的通话状态,仍然不会改变第一音频传输通道状态及相关参数,提高了用户通话过程中的体验度以及使用目标应用程序的灵活性。
应该理解的是,虽然图3-6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图3-6中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者 交替地执行。
如图7所示,本申请还提供一种通话控制装置,包括:获取模块710、监听模块720以及处理模块730。其中,
获取模块710,用于获取终端处于通话状态的第一音频传输通道;
监听模块720,用于监听目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作;
处理模块730,用于当目标应用程序在后台运行且产生操作时,禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话。
上述通话控制装置,可以获取所述电子设备处于通话状态的第一音频传输通道;监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话,以维持当前通话语音还是以第一音频传输通道,可以避免通话过程中音频输出通道发生改变的情况发生,提高用户体验度。
在一个实施例中,监听模块720,包括:
监听单元,用于监听目标应用程序在通话状态中是否调用预设接口函数,其中,预设接口函数用于设置传输音频的第二音频传输通道;
产生单元,用于当调用预设接口函数时,则产生操作。
在一个实施例中,监听单元,还用于监听目标应用程序调用预设接口函数是否向音频设备状态管理器申请使用音频传输通道。
在一个实施例中,处理模块还用于允许目标应用程序调用预设接口函数,且预设接口函数的功能失效,以维持第一音频传输通道进行通话。
在一个实施例中,第一音频传输通道包括听筒通道、扬声器通道、耳机通道;
当第一音频通道为听筒通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持听筒通道进行通话,其中,第二预设函数用于设置扬声器通道,还用于设置耳机通道;
当第一音频通道为扬声器通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持扬声器通道进行通话;其中,第二预设函数用于设置听筒通道,还用于设置耳机通道;
当第一音频通道为耳机通道时,允许目标应用程序调用第二预设函数,且第二预设函数功能失效,以维持耳机道进行通话,其中,第二预设函数用于设置听筒通道,还用于设置扬声器通道。
本实施例中的通话控制装置,在通话过程中,处于后台运行的目标应用程序虽然能够调用用于设置第二音频传输通道的预设接口函数,但是可以控制该调用的预设接口函数的功能无效,以维持当前通话语音的第一音频传输通道,能够使第一音频传输通道状态及相关参数均正常,从而避免改变通话语音的输出通道的情况发生,提高了用户通话过程中的体验度。
在一个实施例中,通话控制装置进一步包括:
运行模块,用于获取目标应用程序的进程信息并根据进程信息判断目标应用程序是否在后台运行。
在一个实施例中,处理模块730,还用于当目标应用程序在前台运行且设置的第二传输通道符合预设条件时,允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。
在一个实施例中,预设条件为第二音频传输通道与第一音频传输通道不一致,或,
预设条件包括第二音频传输通道与第一音频传输通道一致且目标应用程序的使用优先级高于通话的使用优先级。
在一个实施例中,处理模块730包括:
检测单元,用于检测通话状态的闲置时间段;
处理单元,用于在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。
本实施例中的通话控制装置,可以在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。也即,电子设备的通话状态的第一音频传输通道不会改变,同时在闲置时间段允许目标应用程序启用第二音频传输通道,以使目标应用程序通过第二音频传输通道进行音频传输。当目标应用程序通过第二音频传输通道进行音频传输完毕后,可以以第一音频传输通道恢复当前的通话状态,仍然不会改变第一音频传输通道状态及相关参数,提高了用户通话过程中的体验度以及使用目标应用程序的灵活性。
上述通话控制装置中各个模块的划分仅用于举例说明,在其他实施例中,可将通话控制装置按照需要划分为不同的模块,以完成上述通话控制装置的全部或部分功能。
上述通话控制装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于处理器调用执行以 上各个模块对应的操作。
本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当计算机可执行指令被一个或多个处理器执行时,使得处理器执行以下通话控制方法的步骤:
获取终端处于通话状态的第一音频传输通道;
监听目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作;
当目标应用程序在后台运行且产生操作时,禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话。
需要说明的是,一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当计算机可执行指令被一个或多个处理器执行时,还可以使得处理器执行上述任一实施例中的通话控制方法。
一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行通话控制方法的步骤:
获取终端处于通话状态的第一音频传输通道;
监听目标应用程序在通话状态中是否产生用于设置第二音频传输通道的操作;
当目标应用程序在后台运行且产生操作时,禁止目标应用程序开启第二音频传输通道,以维持第一音频传输通道进行通话。
需要说明的是,一种包含指令的计算机程序产品,当其在计算机上运行时使得计算机执行上述任一实施例中的通话控制方法。
本申请实施例还提供了一种电子设备。如图8所示,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该电子设备可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等具有语音通话功能并具有扬声器的任意终端设备,以电子设备为手机为例:
图8为与本申请实施例提供的电子设备相关的手机的部分结构的框图。参考图8,手机包括:射频(Radio Frequency,RF)电路810、存储器820、输入单元830、显示单元840、传感器850、音频电路860、无线保真(wireless fidelity,WiFi)模块870、处理器880、以及电源890等部件。本领域技术人员可以理解,图8所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
其中,RF电路810可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器880处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路810还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。
存储器820可用于存储软件程序以及模块,处理器880通过运行存储在存储器820的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器820可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所创建的数据(比如音频数据、通讯录等)等。此外,存储器820可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
输入单元830可用于接收输入的数字或字符信息,以及产生与手机800的用户设置以及功能控制有关的键信号输入。具体地,输入单元830可包括触控面板831以及其他输入设备832。触控面板831,也可称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板831上或在触控面板831附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板831可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器880,并能接收处理器880发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板831。除了触控面板831,输入单元830还可以包括其他输入设备832。具体地,其他输入设备832可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)等中的一种或多种。
显示单元840可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元840可包括显示面板841。在一个实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板841。在一个实施例中,触控面板831可覆盖显示面板841,当触控面板831检测到在其上或附近的触摸操作后,传送给处理器880以确定触摸事件的类型,随后处理器880根据触摸事件的类型在显示面板841上提供相应的视觉输出。虽然在图8中,触控面板831与显示面板841是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板831与显示面板841集成而实现手机的输入和输出功能。
手机800还可包括至少一种传感器850,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板841的亮度,接近传感器可在手机移动到耳边时,关闭显示面板841和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。
音频电路860、扬声器861和传声器862可提供用户与手机之间的音频接口。音频电路860可将接收到的音频数据转换后的电信号,传输到扬声器861,由扬声器861转换为声音信号输出;另一方面,传声器862将收集的声音信号转换为电信号,由音频电路860接收后转换为音频数据,再将音频数据输出处理器880处理后,经RF电路810可以发送给另一手机,或者将音频数据输出至存储器820以便后续处理。
WiFi属于短距离无线传输技术,手机通过WiFi模块870可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图8示出了WiFi模块870,但是可以理解的是,其并不属于手机800的必须构成,可以根据需要而省略。
处理器880是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器820内的软件程序和/或模块,以及调用存储在存储器820内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。在一个实施例中,处理器880可包括一个或多个处理单元。在一个实施例中,处理器880可集成应用处理器和调制解调处理器,其中, 应用处理器主要处理操作系统、用户界面和应用程序等;调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器880中。
手机800还包括给各个部件供电的电源890(比如电池),优选的,电源可以通过电源管理系统与处理器880逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
在一个实施例中,手机800还可以包括摄像头、蓝牙模块等。
在本申请实施例中,该电子设备所包括的处理器880执行存储在存储器上的计算机程序时实现以下步骤:
获取所述终端处于通话状态的第一音频传输通道;
监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;
当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话。
需要说明的是,电子设备所包括的处理器880执行存储在存储器上的计算机程序时实现上述任一实施例中的通话控制方法。
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (23)

  1. 一种通话控制方法,应用于具有多个音频传输通道的电子设备,包括:
    获取所述电子设备处于通话状态的第一音频传输通道;
    监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;
    当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话。
  2. 根据权利要求1所述的方法,其中,所述监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作,包括:
    监听所述目标应用程序在所述通话状态中是否调用预设接口函数,其中,所述预设接口函数用于设置传输音频的所述第二音频传输通道;
    当调用所述预设接口函数时,则产生所述操作。
  3. 根据权利要求2所述的方法,其中,所述监听所述目标应用程序在所述通话状态中是否调用所述预设接口函数,包括:
    监听所述目标应用程序调用所述预设接口函数是否向音频设备状态管理器申请使用所述音频传输通道。
  4. 根据权利要求2所述的方法,其中,所述禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话,包括:
    允许所述目标应用程序调用所述预设接口函数,且所述预设接口函数的功能失效,以维持所述第一音频传输通道进行通话。
  5. 根据权利要求4所述的方法,其中,所述第一音频传输通道包括听筒通道、扬声器通道、耳机通道;
    当所述第一音频通道为听筒通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持听筒通道进行通话,其中,所述第二预设函数用于设置所述扬声器通道,或,用于设置所述耳机通道。
  6. 根据权利要求5所述的方法,其中,当所述第一音频通道为扬声器通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持扬声器通道进行通话;其中,所述第二预设函数用于设置所述听筒通道,或,用于设置所述耳机通道。
  7. 根据权利要求5所述的方法,其中,当所述第一音频通道为耳机通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持耳机道进行通话,其中,所述第二预设函数用于设置所述听筒通道,或,用于设置所述扬声器通道。
  8. 根据权利要求1所述的方法,其中,所述方法进一步包括:
    获取所述目标应用程序的进程信息;
    根据所述进程信息判断所述目标应用程序是否在后台运行。
  9. 根据权利要求1所述的方法,其中,所述方法进一步包括:
    当所述目标应用程序在前台运行且设置的所述第二传输通道符合预设条件时,允许所述目标应用程序启用所述第二音频传输通道,以使所述目标应用程序通过所述第二音频传输通道进行音频传输。
  10. 根据权利要求9所述的方法,其中,所述预设条件包括所述第二音频传输通道与所述第一音频传输通道不一致。
  11. 根据权利要求9所述的方法,其中,预设条件包括所述第二音频传输通道与所述第一音频传输通道一致且所述目标应用程序的使用优先级高于所述通话的使用优先级。
  12. 根据权利要求9所述的方法,其中,所述允许所述目标应用程序启用所述第二音频传输通道,以使所述目标应用程序通过所述第二音频传输通道进行音频传输,包括:
    检测所述通话状态的闲置时间段;
    在所述闲置时间段允许所述目标应用程序启用所述第二音频传输通道,以使所述目标应用程序通过所述第二音频传输通道进行音频传输。
  13. 一种通话控制装置,应用于具有多个音频传输通道的电子设备,包括:
    获取模块,用于获取所述电子设备处于通话状态的第一音频传输通道;
    监听模块,用于监听目标应用程序在所述通话状态中是否产生用于设置第二音频传输通道的操作;
    处理模块,用于当所述目标应用程序在后台运行且产生所述操作时,禁止所述目标应用程序开启所述第二音频传输通道,以维持所述第一音频传输通道进行通话。
  14. 根据权利要求13所述的装置,其中,所述监听模块,包括:
    监听单元,用于监听所述目标应用程序在所述通话状态中是否调用预设接口函数,其中,所述预设接口函数用于设置传输音频的所述第二音频传输通道;
    产生单元,用于当调用所述预设接口函数时,则产生所述操作。
  15. 根据权利要求14所述的装置,其中,所述监听单元还用于监听所述目标应用程序调用所述预设接口函数是否向音频设备状态管理器申请使用所述音频传输通道。
  16. 根据权利要求14所述的装置,其中,所述处理模块还用于允许所述目 标应用程序调用所述预设接口函数,且所述预设接口函数的功能失效,以维持所述第一音频传输通道进行通话。
  17. 根据权利要求16所述的装置,其中,所述第一音频传输通道包括听筒通道、扬声器通道、耳机通道;
    当所述第一音频通道为听筒通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持听筒通道进行通话,其中,所述第二预设函数用于设置所述扬声器通道,还用于设置所述耳机通道;
    当所述第一音频通道为扬声器通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持扬声器通道进行通话;其中,所述第二预设函数用于设置所述听筒通道,还用于设置所述耳机通道;
    当所述第一音频通道为耳机通道时,允许所述目标应用程序调用第二预设函数,且所述第二预设函数功能失效,以维持耳机道进行通话,其中,所述第二预设函数用于设置所述听筒通道,还用于设置所述扬声器通道。
  18. 根据权利要求13所述的装置,其中,进一步包括:
    运行模块,用于获取所述目标应用程序的进程信息并根据所述进程信息判断所述目标应用程序是否在后台运行。
  19. 根据权利要求13所述的装置,其中,所述处理模块,还用于当所述目标应用程序在前台运行且设置的所述第二传输通道符合预设条件时,允许所述目标应用程序启用所述第二音频传输通道,以使所述目标应用程序通过所述第二音频传输通道进行音频传输。
  20. 根据权利要求19所述的装置,其中,所述预设条件为所述第二音频传输通道与所述第一音频传输通道不一致,或,
    预设条件包括所述第二音频传输通道与所述第一音频传输通道一致且所述目标应用程序的使用优先级高于所述通话的使用优先级。
  21. 根据权利要求19所述的装置,其中,所述处理模块包括:
    检测单元,用于检测所述通话状态的闲置时间段;
    处理单元,用于在所述闲置时间段允许所述目标应用程序启用所述第二音频传输通道,以使所述目标应用程序通过所述第二音频传输通道进行音频传输。
  22. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至12中任一项所述的通话控制方法的步骤。
  23. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如权利要求1至12中任一项所述的通话控制方法。
PCT/CN2018/115984 2018-11-16 2018-11-16 通话控制方法和装置、计算机可读存储介质、电子设备 WO2020097927A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880097707.5A CN112805988B (zh) 2018-11-16 2018-11-16 通话控制方法和装置、计算机可读存储介质、电子设备
PCT/CN2018/115984 WO2020097927A1 (zh) 2018-11-16 2018-11-16 通话控制方法和装置、计算机可读存储介质、电子设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/115984 WO2020097927A1 (zh) 2018-11-16 2018-11-16 通话控制方法和装置、计算机可读存储介质、电子设备

Publications (1)

Publication Number Publication Date
WO2020097927A1 true WO2020097927A1 (zh) 2020-05-22

Family

ID=70730396

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/115984 WO2020097927A1 (zh) 2018-11-16 2018-11-16 通话控制方法和装置、计算机可读存储介质、电子设备

Country Status (2)

Country Link
CN (1) CN112805988B (zh)
WO (1) WO2020097927A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286856A (zh) * 2020-10-29 2021-01-29 维沃移动通信有限公司 控制方法和电子设备
CN113852780A (zh) * 2021-09-18 2021-12-28 联想(北京)有限公司 一种音频数据处理方法及电子设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535113A (zh) * 2021-07-19 2021-10-22 上海月猫科技有限公司 一种音频共享方法、系统及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090177965A1 (en) * 2008-01-04 2009-07-09 International Business Machines Corporation Automatic manipulation of conflicting media presentations
CN103596641A (zh) * 2012-10-18 2014-02-19 华为终端有限公司 一种音频管理方法及装置
CN105843466A (zh) * 2016-03-14 2016-08-10 广州趣丸网络科技有限公司 一种实时语音的方法及装置
CN106528735A (zh) * 2016-10-27 2017-03-22 北京小米移动软件有限公司 控制浏览器播放媒体资源的方法及装置
CN107707728A (zh) * 2017-07-25 2018-02-16 努比亚技术有限公司 一种音频传输切换方法、终端和计算机可读存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9716957B2 (en) * 2013-04-28 2017-07-25 Innovation Sound Technology Co., Ltd. Headset capable of converting sound channels
CN107229448A (zh) * 2017-06-30 2017-10-03 联想(北京)有限公司 音频播放方法及电子设备
CN108769431A (zh) * 2018-07-03 2018-11-06 Oppo(重庆)智能科技有限公司 音频播放控制方法、装置、存储介质及移动终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090177965A1 (en) * 2008-01-04 2009-07-09 International Business Machines Corporation Automatic manipulation of conflicting media presentations
CN103596641A (zh) * 2012-10-18 2014-02-19 华为终端有限公司 一种音频管理方法及装置
CN105843466A (zh) * 2016-03-14 2016-08-10 广州趣丸网络科技有限公司 一种实时语音的方法及装置
CN106528735A (zh) * 2016-10-27 2017-03-22 北京小米移动软件有限公司 控制浏览器播放媒体资源的方法及装置
CN107707728A (zh) * 2017-07-25 2018-02-16 努比亚技术有限公司 一种音频传输切换方法、终端和计算机可读存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286856A (zh) * 2020-10-29 2021-01-29 维沃移动通信有限公司 控制方法和电子设备
CN113852780A (zh) * 2021-09-18 2021-12-28 联想(北京)有限公司 一种音频数据处理方法及电子设备
CN113852780B (zh) * 2021-09-18 2023-03-21 联想(北京)有限公司 一种音频数据处理方法及电子设备

Also Published As

Publication number Publication date
CN112805988A (zh) 2021-05-14
CN112805988B (zh) 2022-04-12

Similar Documents

Publication Publication Date Title
US11102697B2 (en) Method for controlling earphone switching and earphone
CN112997470B (zh) 音频输出控制方法和装置、计算机可读存储介质、电子设备
CN108391205B (zh) 左右声道切换方法和装置、可读存储介质、终端
WO2021036711A1 (zh) 网络控制方法及相关产品
WO2020118496A1 (zh) 音频通路切换方法和装置、可读存储介质、电子设备
CN113039516B (zh) 一种对应用程序进行处理的方法、装置和电子设备
US11800431B2 (en) Access control method, message broadcasting method, and related devices
WO2018049934A1 (zh) 一种数据迁移的方法及终端
CN108958695B (zh) 音频输出方法、装置及计算机可读存储介质
CN109067965B (zh) 翻译方法、翻译装置、可穿戴装置及存储介质
WO2020097927A1 (zh) 通话控制方法和装置、计算机可读存储介质、电子设备
JP2021508989A (ja) サービス処理方法及び移動通信端末
CN113039518B (zh) 播放控制方法和装置、计算机可读存储介质、电子设备
WO2020103045A1 (zh) 一种对应用程序进行处理的方法、装置和电子设备
CN108668018B (zh) 移动终端、音量控制方法及相关产品
WO2020124541A1 (zh) 音频处理方法和装置、计算机可读存储介质、电子设备
WO2020107177A1 (zh) 一种音频资源调用的方法、装置及电子设备
US20210286588A1 (en) Method and apparatus for playing alarm and electronic device
WO2020103073A1 (zh) 音频资源处理方法和装置、计算机可读存储介质、电子设备
WO2019084757A1 (zh) 控制应用程序使用时间的方法和装置
JP7379714B2 (ja) マルチキャストサービス処理方法、マルチキャストサービス構成方法、端末及びネットワーク機器
WO2018166089A1 (zh) 一种控制声音的方法及移动终端
US11637921B2 (en) Enabling vibration notification based on environmental noise
WO2020107169A1 (zh) 一种音频模式校正的方法、装置及电子设备
CN109246290B (zh) 一种权限管理方法及移动终端

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18939965

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18939965

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 15/09/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18939965

Country of ref document: EP

Kind code of ref document: A1