WO2025035666A1 - 一种通信方法、存储介质及电子设备 - Google Patents

一种通信方法、存储介质及电子设备 Download PDF

Info

Publication number
WO2025035666A1
WO2025035666A1 PCT/CN2023/138227 CN2023138227W WO2025035666A1 WO 2025035666 A1 WO2025035666 A1 WO 2025035666A1 CN 2023138227 W CN2023138227 W CN 2023138227W WO 2025035666 A1 WO2025035666 A1 WO 2025035666A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
bluetooth
hfp
connection
mobile phone
Prior art date
Application number
PCT/CN2023/138227
Other languages
English (en)
French (fr)
Inventor
李炜
Original Assignee
荣耀终端股份有限公司
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 荣耀终端股份有限公司 filed Critical 荣耀终端股份有限公司
Priority to EP23925586.2A priority Critical patent/EP4531444A4/en
Publication of WO2025035666A1 publication Critical patent/WO2025035666A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/16Communication-related supplementary services, e.g. call-transfer or call-hold
    • 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/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/72412User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W60/00Affiliation to network, e.g. registration; Terminating affiliation with the network, e.g. de-registration
    • H04W60/005Multiple registrations, e.g. multihoming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/40Connection management for selective distribution or broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/60Substation equipment, e.g. for use by subscribers including speech amplifiers
    • H04M1/6033Substation equipment, e.g. for use by subscribers including speech amplifiers for providing handsfree use or a loudspeaker mode in telephone sets
    • H04M1/6041Portable telephones adapted for handsfree use
    • H04M1/6058Portable telephones adapted for handsfree use involving the use of a headset accessory device connected to the portable telephone
    • H04M1/6066Portable telephones adapted for handsfree use involving the use of a headset accessory device connected to the portable telephone including a wireless connection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/02Details of telephonic subscriber devices including a Bluetooth interface

Definitions

  • the present application relates to the field of Bluetooth technology, and in particular to a communication method, a storage medium and an electronic device.
  • the Bluetooth audio transmission model agreement (Advanced Audio Distribution Profile, A2DP) and the telephone service agreement (Hands-free Profile, HFP) are two protocols for transmitting audio services in the first electronic device (hereinafter described by a mobile phone as an example), that is, through A2DP and HFP, the mobile phone can transmit audio data to the second electronic device with Bluetooth function (hereinafter described by a Bluetooth headset as an example) through Bluetooth.
  • A2DP has the characteristic of non-real-time audio transmission and is used to implement multimedia services, such as playing music.
  • HFP has the characteristic of real-time audio transmission and is used to implement call services, such as real-time voice.
  • Bluetooth physical links are divided into synchronous links (synchronous connection oriented, SCO) and asynchronous links (asynchronous connection less, ACL).
  • SCO links are used to transmit data with high real-time requirements, such as audio data for call services.
  • ACL links are used to transmit data with non-real-time requirements, such as audio data for music applications. Therefore, in order to ensure call quality, the call service of the mobile phone needs to transmit audio data through HFP on the SCO link.
  • the mobile phone will play the incoming call ring tone through the Bluetooth headset according to the Bluetooth protocol, so the mobile phone will establish a connection with the Bluetooth headset.
  • the getProfileProxy function is used to register the Bluetooth transmission-related HFP and A2DP protocols, since the registration process of A2DP is faster than that of HFP, the mobile phone will first transmit the incoming call ring tone through A2DP, and then switch to transmitting the incoming call ring tone through HFP.
  • the mobile phone will suspend the audio data transmission of the incoming call ring tone, which will cause the incoming call ring tone of the mobile phone to freeze.
  • the present application provides a communication method, a storage medium and an electronic device.
  • the present application provides a communication method, comprising: corresponding to a first electronic device satisfying a first condition, the first electronic device completes registration of a telephone service protocol HFP and a Bluetooth audio transmission model protocol A2DP; the first electronic device receives an incoming call message, and detects a second electronic device that has been Bluetooth paired with the first electronic device but has not established a Bluetooth connection; the first electronic device establishes a Bluetooth connection with the second electronic device, and the first electronic device first establishes a telephone service protocol HFP connection to transmit audio data to the second electronic device through the telephone service protocol HFP, wherein the audio data includes an incoming call ringtone corresponding to the incoming call message, and the first electronic device establishes a Bluetooth audio transmission model protocol A2DP connection after establishing the telephone service protocol HFP connection.
  • the first electronic device mentioned in this application includes any electronic device that can make voice calls and has Bluetooth function, such as a mobile phone
  • the second electronic device mentioned in this application includes any electronic device that has Bluetooth function and audio data playback function, such as a Bluetooth headset.
  • the mobile phone completes the registration of HFP and A2DP in advance.
  • the mobile phone first chooses to establish an HFP connection with the Bluetooth headset according to the type of call service, and the incoming call ringtone of the mobile phone will be played on the Bluetooth headset through HFP.
  • the mobile phone establishes an A2DP connection with the Bluetooth headset, and the mobile phone no longer chooses to play the incoming call ringtone through A2DP. This avoids the phenomenon of the incoming call ringtone being stuck when the mobile phone's incoming call ringtone switches from playing on the Bluetooth headset through A2DP to playing on the Bluetooth headset through HFP, improving the user's call experience.
  • the first condition includes at least one of the following: entering the power-on phase, the Bluetooth function is turned on, and an electronic device that has been Bluetooth paired is detected.
  • the first condition mentioned in this application may be that the mobile phone is in the initialization stage, and the initialization stage of the mobile phone includes but is not limited to entering the power-on stage, the Bluetooth function is turned on, and an electronic device that has been paired with Bluetooth is detected.
  • the first electronic device establishes a telephone service protocol HFP connection in the following manner: an audio manager application in the first electronic device sends a message to a Bluetooth application to establish a telephone service protocol HFP connection with the second electronic device, and the Bluetooth application establishes a telephone service protocol HFP connection.
  • audio data is transmitted to a second electronic device via the telephone service protocol HFP, including: a telephone application in the first electronic device receives information that the telephone service protocol HFP is successfully established, and sends an instruction to the audio framework to switch the sound device; the audio framework selects the sound device as the second electronic device that has established a telephone service protocol HFP connection with the first electronic device, and transmits audio data to the second electronic device.
  • the sound-emitting device may also be a speaker or receiver of a mobile phone, or an audio device connected to the mobile phone. This application does not limit the type of the sound-emitting device.
  • the first electronic device establishes a Bluetooth audio transmission model protocol A2DP connection after establishing a telephone service protocol HFP connection, including: after the first electronic device establishes the telephone service protocol HFP connection, the audio butler application in the first electronic device sends a message to the Bluetooth application to establish a Bluetooth audio transmission model protocol A2DP connection with the second electronic device, and the Bluetooth application establishes the Bluetooth audio transmission model protocol A2DP connection.
  • the mobile phone needs to establish a dual connection with the Bluetooth headset, namely the Bluetooth audio transmission model protocol A2DP and the telephone service protocol HFP. After the mobile phone and the Bluetooth headset establish the HFP connection, the mobile phone and the Bluetooth headset establish the A2DP connection.
  • the communication method further includes: after the first electronic device establishes a Bluetooth audio transmission model protocol A2DP connection with the second electronic device, the audio framework in the first electronic device no longer reselects the sound-emitting device.
  • the audio framework selects the sound device as the Bluetooth headset that establishes an HFP connection with the mobile phone, and no longer reselects the sound device.
  • the first electronic device completes the registration of the telephone service protocol HFP and the Bluetooth audio transmission model protocol A2DP, including: the first electronic device completes the registration of the telephone service protocol HFP and the Bluetooth audio transmission model protocol A2DP by executing a first preset function.
  • the first preset function includes the getProfileProxy function.
  • the Bluetooth application establishes a telephone service protocol HFP connection, including a Bluetooth
  • the application establishes a telephone service protocol HFP connection with the second electronic device by calling a second preset function.
  • the second preset function includes the ConnectHfp function in the onServiceConnected function.
  • the Bluetooth application establishes a Bluetooth audio transmission model protocol A2DP connection, including: the first electronic device establishes a Bluetooth audio transmission model protocol A2DP connection with the second electronic device by calling a third preset function.
  • the third preset function includes the ConnectA2dp function in the onServiceConnected function.
  • the present application provides a computer-readable storage medium having instructions stored thereon.
  • the instructions When the instructions are executed on an electronic device, the electronic device implements the above-mentioned first aspect and any possible communication method of the first aspect.
  • the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device; and a processor for executing the instructions stored in the memory to implement the above-mentioned first aspect and any possible communication method of the first aspect.
  • FIG1( a ) shows a schematic diagram of a scenario in which a mobile phone 20 receives an incoming call according to some embodiments of the present application
  • FIG1( b ) shows another schematic diagram of a scenario in which a mobile phone 20 receives a call according to some embodiments of the present application
  • FIG2 shows a schematic diagram of a software architecture of a mobile phone 20 according to some embodiments of the present application
  • FIG3 shows a schematic diagram of interaction of a mobile phone 20 according to some embodiments of the present application.
  • FIG4 shows a schematic diagram of an interaction of a mobile phone 20 according to some embodiments of the present application.
  • FIG5 shows a schematic diagram of the hardware structure of a mobile phone 20 according to some embodiments of the present application.
  • the illustrative embodiments of the present application include, but are not limited to, a communication method, a storage medium, and an electronic device.
  • the first electronic device mentioned in the present application may be any electronic device that can make voice calls and has Bluetooth function, including but not limited to mobile phones, media players, tablet computers, laptop computers, ultra-mobile personal computers (UMPC), personal digital assistants (PDA).
  • UMPC ultra-mobile personal computers
  • PDA personal digital assistants
  • the present application takes the first electronic device as a mobile phone 20 as an example for introduction.
  • the second electronic device mentioned in this application can be any electronic device with Bluetooth function and audio data playback function, including but not limited to wireless headphones, wireless speakers, wireless bracelets, wireless car-mounted devices, wireless smart glasses, wireless watches, augmented reality (AR)/virtual reality (VR) devices and other devices.
  • This application does not impose any special restrictions on the specific form of the second electronic device.
  • this application takes the second electronic device as a Bluetooth headset 10 and a tablet computer 30 as an example for introduction.
  • FIG1(a) shows a schematic diagram of a scenario in which a mobile phone 20 receives an incoming call.
  • the Bluetooth headset 10 and the tablet computer 30 are in a paired and connected state, that is, the Bluetooth headset 10 and the tablet computer 30 have established a trusted relationship through authentication, and the output audio of the tablet computer 30 can be played through the Bluetooth headset 10.
  • the mobile phone 20 turns on the Bluetooth function and is in a paired but unconnected state with the Bluetooth headset 10, that is, the Bluetooth headset 10 and the mobile phone 20 have previously established a trusted relationship through authentication, the output audio of the mobile phone 20 can be played through the local speaker, but cannot be played through the Bluetooth headset 10.
  • the mobile phone 20 receives an incoming call, according to the provisions of the Bluetooth protocol, the mobile phone 20 will seize the Bluetooth headset 10, that is, the mobile phone 20 will connect to the Bluetooth headset 10.
  • FIG1(b) shows another schematic diagram of a scenario in which a call is coming from a mobile phone 20.
  • the mobile phone 20 The Bluetooth function is turned on, and the Bluetooth headset 10 is paired but not connected, that is, the Bluetooth headset 10 and the mobile phone 20 have established a trusted relationship through authentication, but the user manually disconnects the Bluetooth headset 10 from the mobile phone 20, that is, the output audio of the mobile phone 20 can be played through the speaker of the mobile phone, but cannot be played through the Bluetooth headset 10.
  • the mobile phone 20 receives an incoming call, according to the provisions of the Bluetooth protocol, the mobile phone 20 will connect to the Bluetooth headset 10.
  • the mobile phone 20 when the mobile phone 20 receives an incoming call message, in order to allow the incoming call ringtone of the mobile phone 20 to be played from the Bluetooth headset 10, the mobile phone 20 needs to establish HFP and A2DP connections, and there is a phenomenon that the incoming call ringtone of the mobile phone will be stuck during the process of establishing the connection. Specifically, after receiving the incoming call message, the mobile phone 20 will first register the protocol for transmitting audio services, including HFP, which is a protocol for implementing call services, and A2DP, which is a protocol for implementing multimedia services, and then establish the A2DP and HFP connection between the mobile phone 20 and the Bluetooth headset 10.
  • HFP which is a protocol for implementing call services
  • A2DP which is a protocol for implementing multimedia services
  • the mobile phone 20 can perform Bluetooth transmission of audio data, that is, play the incoming call ringtone on the Bluetooth headset 10.
  • the process of the mobile phone 20 registering HFP and A2DP is a parallel process, that is, the mobile phone 20 will register HFP and A2DP at the same time.
  • the speed of the mobile phone 20 registering A2DP is faster, that is, the mobile phone 20 completes the registration of A2DP first.
  • the mobile phone 20 Since the process of establishing HFP and A2DP connection between the mobile phone 20 and the Bluetooth headset 10 is a serial process, that is, after the mobile phone 20 completes the A2DP registration, the mobile phone 20 will first establish an A2DP connection with the Bluetooth headset 10. For example, the mobile phone 20 can first establish an A2DP connection with the Bluetooth headset 10 by executing the ConnectA2dp function in the onServiceConnected function, and play the incoming call ringtone on the Bluetooth headset 10 through A2DP.
  • the mobile phone 20 In order to ensure that both the call service and multimedia service in the mobile phone 20 can be played through the Bluetooth headset 10, after the mobile phone 20 receives the incoming call message, the mobile phone 20 needs to establish a dual connection of A2DP and HFP with the Bluetooth headset 10. After the mobile phone 20 establishes the A2DP connection with the Bluetooth headset 10, the mobile phone 20 can complete the HFP registration after a period of time. After the mobile phone 20 completes the HFP registration, the mobile phone 20 can establish the HFP connection with the Bluetooth headset 10. For example, the mobile phone 20 can establish the HFP connection with the Bluetooth headset 10 by executing the ConnectHfp function in the onServiceConnected function.
  • the call service is the audio data transmitted through HFP on the SCO link, which has the characteristics of real-time audio transmission.
  • the mobile phone 20 After the mobile phone 20 establishes the HFP connection with the Bluetooth headset 10, the mobile phone 20 will give priority to playing the incoming call ring tone on the Bluetooth headset 10 through HFP, that is, the mobile phone 20 will switch from playing the incoming call ring tone on the Bluetooth headset 10 through A2DP to playing the incoming call ring tone on the Bluetooth headset 10 through HFP.
  • the incoming call ring tone of the mobile phone 20 In the process of switching the incoming call ring tone of the mobile phone 20, since the mobile phone 20 will pause the audio stream of the incoming call ring tone, the incoming call ring tone of the mobile phone 20 will be stuck.
  • the present application provides a method for solving the problem of jamming of incoming call ringtones.
  • the mobile phone can be controlled to complete the registration of HFP and A2DP in advance. For example, the mobile phone completes the registration of HFP and A2DP through the getProfileProxy function when it is turned on, when the Bluetooth function is turned on, or when the mobile phone detects a Bluetooth headset that has been paired but not connected before. Then, if the mobile phone receives an incoming call message, it can choose to establish an HFP connection with the Bluetooth headset first, and then establish an A2DP connection with the Bluetooth headset.
  • the mobile phone establishes an HFP connection with the Bluetooth headset by executing the ConnectHfp function in the onServiceConnected function; and then establishes an A2DP connection with the Bluetooth headset by executing the ConnectA2dp function in the onServiceConnected function.
  • the incoming call ringtone of the mobile phone will be played on the Bluetooth headset through HFP.
  • the incoming call ringtone of the mobile phone is jammed when the incoming call ringtone is switched from playing on the Bluetooth headset through A2DP to playing on the Bluetooth headset through HFP, thereby improving the user's call experience.
  • FIG. 2 shows a schematic diagram of the software architecture of the mobile phone 20.
  • the software architecture of the mobile phone 20 is respectively an application layer 101, a framework layer 102, an Android library 103 and a driver layer 104 from top to bottom.
  • the application layer 101 may include applications such as the main interface, phone, Bluetooth, and audio housekeeper.
  • the application layer 101 may also include other applications, such as payment applications, shopping applications, banking applications, chat applications, or financial management applications, etc., which are not limited in this application.
  • the phone application is used to send a broadcast of an incoming call to the mobile phone 20, and to send an audio stream of an incoming call ringtone in the mobile phone 20 to the framework layer 102.
  • the audio housekeeper application is used to register A2DP and HFP, and to send a message to the Bluetooth application to establish an HFP and A2DP connection with the Bluetooth headset 10.
  • the Bluetooth application is used to establish an HFP and A2DP connection with the Bluetooth headset 10, and to send a broadcast of a successful connection to the framework layer 102.
  • the framework layer 102 includes a telephone framework, a Bluetooth framework, an audio framework, etc.
  • the framework layer 102 provides a multi-language framework for the application layer 101, such as computing power (which may include CPU computing power, graphics processing unit (GPU) computing power, image signal processor (ISP) computing power, etc.), voice recognition capability (which may include microphone voice recognition capability, voice recognition capability, etc.), security capability in terms of device security protection (which may include trusted operating environment security level, etc.), display capability (which may include screen resolution, screen size, etc.), playback capability (including sound amplification capability, stereo sound capability, etc.), and storage capability (which may include device memory capability, random access memory (RAM) capability, etc.), without limitation here.
  • the application of the application layer 101 can implement the corresponding functions by calling the functions corresponding to the various capabilities provided by the framework layer 102.
  • the phone framework is used to provide communication functions for the mobile phone 20. For example, the management of call status (including connecting, hanging up, etc.).
  • the Bluetooth framework is used to provide Bluetooth services for the mobile phone 20.
  • the audio framework receives audio services sent by each application of the application layer 101, identifies the type of audio services, and performs service arbitration and preemption.
  • the audio framework is used to select the sound device as a Bluetooth headset 20 that establishes an A2DP or HFP connection with the mobile phone 20, and is used to receive the ringtone audio stream.
  • the Android library 103 includes a surface manager, a media library, a 3D graphics processing library, an Android runtime, and the like.
  • the surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of multiple commonly used audio and video formats, as well as static image files.
  • the media library can support multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the three-dimensional graphics processing library (for example, OpenGL ES) is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing.
  • the Android runtime includes a core library and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
  • the core library contains two parts: one part is the function function that the Java language needs to call, and the other part is the Android core library.
  • the application layer 101 and the framework layer 102 run in the virtual machine.
  • the virtual machine executes the Java files of the application layer 101 and the framework layer 102 as binary files.
  • the virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the driver layer 104 can provide the mobile phone 20 with unified peripheral access capabilities and management framework, including display drivers, Bluetooth drivers, audio drivers, etc.
  • the software architecture of the mobile phone 20 shown in Figure 2 is only an example.
  • the software architecture applicable to the embodiments of the present application may include more or less, and may also split or merge parts, and may also adopt other architectures, which are not limited here.
  • FIG3 shows a schematic diagram of a process of interaction in the mobile phone 20. As shown in FIG3, the interaction process includes the following steps:
  • the Bluetooth application sends a Bluetooth on broadcast to the audio manager application.
  • the Bluetooth application When the Bluetooth of the mobile phone 20 is turned on, the Bluetooth application sends a broadcast indicating that the Bluetooth is turned on to the audio manager application.
  • S102 The phone application sends a ring tone audio stream to the audio framework.
  • the phone application When a call comes in to the mobile phone 20, the phone application sends a ring tone audio stream to the audio framework.
  • the ring tone audio stream sent by the phone application is of the type of the stream_ring function, and the present application does not impose any limitation on the type of the ring tone audio stream.
  • S103 The phone application sends an incoming call broadcast to the audio manager application.
  • the phone application When a call comes in to the mobile phone 20, the phone application sends an incoming call broadcast to the audio manager application.
  • step S102 may also be performed after step S103, that is, the phone application first sends the incoming call broadcast of the mobile phone 20 to the audio manager application, and then sends the ringtone audio stream to the audio framework.
  • the embodiment of the present application does not limit the order in which the phone application sends the ringtone audio stream and the incoming call broadcast.
  • the incoming call broadcast may include the incoming call phone number, the incoming call operator information, etc.
  • S104 The audio manager application registers HFP and A2DP.
  • the audio manager application After receiving the incoming call broadcast from the mobile phone 20, the audio manager application registers HFP and A2DP.
  • the audio manager application can register HFP and A2DP by executing the getProfileProxy function. This application does not limit the specific implementation method of the audio manager application registering HFP and A2DP.
  • the process of the audio manager application registering HFP and A2DP is a parallel process, that is, the audio manager application will register HFP and A2DP at the same time. If the mobile phone 20 executes the getProfileProxy function, the audio manager application registers A2DP faster, that is, the audio manager application completes the registration with A2DP first.
  • HFP has the characteristic of real-time audio transmission and is used to implement call services, such as real-time voice, etc.
  • A2DP has the characteristic of non-real-time audio transmission and is used to implement multimedia services, such as playing music, etc.
  • the audio manager application sends a message to the Bluetooth application to establish an A2DP connection with the Bluetooth headset 10.
  • the process of establishing HFP and A2DP connection between the mobile phone 20 and the Bluetooth headset 10 is a serial process, after the audio manager application completes the A2DP registration, the audio manager application sends a message to the Bluetooth application to establish an A2DP connection with the Bluetooth headset 10.
  • the Bluetooth application first establishes an A2DP connection with the Bluetooth headset 10 by executing the ConnectA2dp function in the onServiceConnected function.
  • S106 The Bluetooth application sends a broadcast of successful connection to the audio framework.
  • the Bluetooth application sends a broadcast to the audio framework to establish an A2DP connection with the Bluetooth headset 10.
  • the Bluetooth application may send a broadcast of successful connection through the Context.sendBroadcast function.
  • the audio framework selects a sound output device.
  • the audio framework selects the sound device as the Bluetooth headset 10 that establishes an A2DP connection with the mobile phone 20.
  • the sound-emitting device may also be a speaker or receiver of the mobile phone 20, or a device such as an audio device connected to the mobile phone 20.
  • the present application does not limit the type of the sound-emitting device.
  • the audio manager application sends a message to the Bluetooth application to establish an HFP connection with the Bluetooth headset 10.
  • the mobile phone 20 needs to establish a dual connection of A2DP and HFP with the Bluetooth headset 10. After the mobile phone 20 establishes the A2DP connection with the Bluetooth headset 10, the mobile phone 20 can complete the HFP registration after a period of time. When the mobile phone 20 completes the HFP registration, the audio manager application sends a message to the Bluetooth application to establish the HFP connection with the Bluetooth headset 10.
  • the Bluetooth application executes the ConnectHfp function in the onServiceConnected function.
  • An HFP connection is established with the Bluetooth headset 10 .
  • S109 The Bluetooth application sends a broadcast indicating successful connection to the phone application.
  • the Bluetooth application sends a broadcast to the phone application to establish an HFP connection with the Bluetooth headset 10 .
  • the Bluetooth application may send a broadcast of successful connection through the Context.sendBroadcast function.
  • S110 The phone application sends a message to the audio framework to select a sound device.
  • the phone application After receiving the broadcast of establishing an HFP connection with the Bluetooth headset 10, the phone application sends a message to the audio framework to select a sound device.
  • the audio framework selects a sound output device.
  • the audio framework selects the sound device as the Bluetooth headset 10 that establishes an HFP connection with the mobile phone 20.
  • the mobile phone 20 When the mobile phone 20 switches from playing the incoming call ring tone on the Bluetooth headset 10 through A2DP to playing the incoming call ring tone on the Bluetooth headset 10 through HFP, the mobile phone 20 will suspend the audio data transmission of the incoming call ring tone, so that the incoming call ring tone of the mobile phone 20 becomes stuck.
  • FIG. 4 shows a schematic diagram of a process of interaction in the mobile phone 20. As shown in FIG. 4, the interaction process includes the following steps:
  • the Bluetooth application sends a broadcast indicating that Bluetooth is turned on to the audio manager application.
  • the Bluetooth application When the Bluetooth of the mobile phone 20 is turned on, the Bluetooth application sends a broadcast indicating that the Bluetooth is turned on to the audio manager application.
  • S202 The audio manager application registers HFP and A2DP.
  • the audio manager application registers HFP and A2DP.
  • the audio manager application can register HFP and A2DP by executing the getProfileProxy function. This application does not limit the specific implementation method of the audio manager application registering HFP and A2DP.
  • the implementation logic of the registration service may be included in the getProfileProxy function, registering HFP by executing the getProfileProxy(context, mBluetoothListener, BluetoothProfile.HEADSET) function, and registering A2DP by executing the getProfileProxy(context, mBluetoothListener, BluetoothProfile.A2DP) function.
  • HFP has the characteristic of real-time audio transmission and is used to implement call services, such as real-time voice, etc.
  • A2DP has the characteristic of non-real-time audio transmission and is used to implement multimedia services, such as playing music, etc.
  • the process of the audio manager application registering HFP and A2DP is a parallel process, that is, the audio manager application will register HFP and A2DP at the same time.
  • S203 The phone application sends a ring tone audio stream to the audio framework.
  • the phone application When a call comes in to the mobile phone 20, the phone application sends a ring tone audio stream to the audio framework.
  • the ring tone audio stream sent by the phone application is of the type of the stream_ring function, and the present application does not impose any limitation on the type of the ring tone audio stream.
  • S204 The phone application sends an incoming call broadcast to the audio manager application.
  • the phone application When a call comes in to the mobile phone 20, the phone application sends an incoming call broadcast to the audio manager application.
  • step S203 may also be performed after step S204, that is, the phone application first sends a request to the audio manager application.
  • the incoming call broadcast of the mobile phone 20 is sent, and then the ring tone audio stream is sent to the audio framework.
  • the embodiment of the present application does not limit the order in which the phone application sends the ring tone audio stream and the incoming call broadcast.
  • the incoming call broadcast may include the incoming call phone number, the incoming call operator information, etc.
  • the audio manager application sends a message to the Bluetooth application to establish an HFP connection with the Bluetooth headset 10.
  • the audio manager application sends a message to the Bluetooth application to establish an HFP connection with the Bluetooth headset 10.
  • the Bluetooth application can call the ConnectHfp function in the onServiceConnected function when executing the onServiceConnected function, so that the Bluetooth application first establishes an HFP connection with the Bluetooth headset 10.
  • the implementation logic of establishing an HFP connection with the Bluetooth headset 10 may include entering the onServiceConnected function after the mobile phone 20 successfully registers the HFP, and using the connectHFP(bluetoothDevice) function to enable the Bluetooth application to first establish an HFP connection with the Bluetooth headset 10.
  • S206 The Bluetooth application sends a broadcast of successful connection to the phone application.
  • the Bluetooth application sends a broadcast to the phone application to establish an HFP connection with the Bluetooth headset 10 .
  • the Bluetooth application may send a broadcast of successful connection through the Context.sendBroadcast function.
  • S207 The phone application sends a message to the audio framework to switch out of the sound device.
  • the phone application After receiving the message for establishing the HFP connection with the Bluetooth headset 10, the phone application sends a message for switching out the sound device to the audio framework.
  • the audio framework selects a sound output device.
  • the audio framework selects the sound device as the Bluetooth headset 10 that establishes an HFP connection with the mobile phone 20.
  • the sound-emitting device may also be a speaker or receiver of the mobile phone 20, or a device such as an audio device connected to the mobile phone 20.
  • the present application does not limit the type of the sound-emitting device.
  • S209 The audio manager application sends a message to the Bluetooth application to establish an A2DP connection with the Bluetooth headset 10.
  • the mobile phone 20 needs to establish a dual connection of A2DP and HFP with the Bluetooth headset 10. After the mobile phone 20 establishes an HFP connection with the Bluetooth headset 10, the audio manager application sends a message to the Bluetooth application to establish an A2DP connection with the Bluetooth headset 10.
  • the Bluetooth application can establish an AD2P connection with the Bluetooth headset 10 by executing the onServiceConnected function, for example, by calling the ConnectA2dp function in the onServiceConnected function, so that the Bluetooth application establishes an A2DP connection with the Bluetooth headset 10.
  • the implementation logic of establishing an A2DP connection with the Bluetooth headset 10 may include, after the mobile phone 20 successfully registers A2DP, going to the onServiceConnected function, and establishing an A2DP connection between the Bluetooth application and the Bluetooth headset 10 through the connectA2dp(bluetoothDevice) function.
  • S210 The Bluetooth application sends a broadcast of successful connection to the audio framework.
  • the Bluetooth application sends a broadcast to the audio framework to establish an A2DP connection with the Bluetooth headset 10.
  • the Bluetooth application may send a broadcast of successful connection through the Context.sendBroadcast function.
  • the audio framework selects the sound device as the Bluetooth headset 10 that establishes an HFP connection with the mobile phone 20. Then reselect the sound device.
  • the mobile phone 20 completes the registration of HFP and A2DP during initialization. If the mobile phone 20 receives an incoming call, according to the characteristics that the audio data of the call service is suitable for transmission through HFP, the mobile phone 20 chooses to establish an HFP connection with the Bluetooth headset 10 first, and then establish an A2DP connection with the Bluetooth headset 10. For example, the mobile phone 20 establishes an HFP connection with the Bluetooth headset 10 by executing the ConnectHfp function in the onServiceConnected function; and then establishes an A2DP connection with the Bluetooth headset 10 by executing the ConnectA2dp function in the onServiceConnected function.
  • the incoming ringtone of the mobile phone 20 will be played in the Bluetooth headset 10 through HFP. Thereby avoiding the phenomenon that the incoming ringtone of the mobile phone 20 is stuck when switching from playing in the Bluetooth headset 10 through A2DP to playing in the Bluetooth headset 10 through HFP, thereby improving the user's call experience.
  • FIG5 shows a schematic diagram of the hardware structure of the mobile phone 20.
  • the mobile phone 20 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the mobile phone 20.
  • the mobile phone 20 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently.
  • the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc.
  • different processing units can be independent devices or integrated in one or more processors.
  • the controller can be the nerve center and command center of the mobile phone 20.
  • the controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
  • the processor 110 can execute the communication method mentioned in the present application.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the processor 110 may execute the communication method mentioned in the present application based on the instructions and data.
  • the charging management module 140 is used to receive charging input from the charger.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the wireless communication function of the mobile phone 20 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Block 150 can provide solutions for wireless communications including 2G/3G/4G/5G applied on the mobile phone 20.
  • the wireless communication module 160 can provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc. applied on the mobile phone 20.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • IR infrared technology
  • Bluetooth can be used to establish a Bluetooth connection with a Bluetooth headset 10.
  • the mobile phone 20 implements the display function through a GPU, a display screen 194, and an application processor.
  • the GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, etc.
  • the mobile phone 20 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
  • the mobile phone 20 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
  • the incoming call ringtone of the mobile phone 20 can convert digital audio information into analog audio signal output through the audio module 170.
  • the speaker 170A also called a "speaker" is used to convert audio electrical signals into sound signals.
  • the mobile phone 20 can listen to music or listen to hands-free calls through the speaker 170A.
  • the speaker 170A of the mobile phone 20 can be used as a sound device for the incoming call ringtone.
  • the receiver 170B also called a "handset" is used to convert audio electrical signals into sound signals.
  • the voice can be received by placing the receiver 170B close to the ear.
  • Microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by putting his mouth close to microphone 170C to input the sound signal into microphone 170C.
  • the mobile phone 20 can be provided with at least one microphone 170C. In other embodiments, the mobile phone 20 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the mobile phone 20 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, and directional recording functions, etc.
  • the earphone interface 170D is used to connect a wired earphone.
  • the earphone interface 170D may be the USB interface 130, or may be a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the mobile phone 20 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently.
  • the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
  • the present application provides a computer-readable storage medium, wherein instructions are stored on the computer-readable storage medium, and the instructions are stored on the electronic device. When executed, the electronic device implements the communication method provided by the present application.
  • the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device; and a processor for executing the instructions stored in the memory to implement the communication method provided by the present application.
  • a logical unit/module can be a physical unit/module, or a part of a physical unit/module, or can be implemented as a combination of multiple physical units/modules.
  • the physical implementation method of these logical units/modules themselves is not the most important.
  • the combination of functions implemented by these logical units/modules is the key to solving the technical problems proposed by the present application.
  • the above-mentioned device embodiments of the present application do not introduce units/modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units/modules in the above-mentioned device embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请涉及蓝牙技术领域,尤其涉及一种通信方法、存储介质及电子设备。本申请公开的通信方法中,手机在初始化阶段,完成电话服务协议HFP和蓝牙音频传输模型协定A2DP的注册。当手机来电时,手机与蓝牙耳机建立HFP连接,手机的来电铃音通过HFP在蓝牙耳机上播放,之后,手机与蓝牙耳机建立A2DP连接。如此,手机的来电铃音将通过HFP在蓝牙耳机上播放,从而避免了手机的来电铃音从通过A2DP在蓝牙耳机上播放切换到从通过HFP在蓝牙耳机上播放时导致来电铃音卡顿的现象,提升了用户的通话体验。

Description

一种通信方法、存储介质及电子设备
本申请要求2023年08月15日提交中国专利局、申请号为202311026635.4、申请名称为“一种通信方法、存储介质及电子设备”的中国专利申请的优先权,上述申请的全部内容通过引用结合在本申请中。
技术领域
本申请涉及蓝牙技术领域,尤其涉及一种通信方法、存储介质及电子设备。
背景技术
蓝牙音频传输模型协定(advanced audio distribution profile,A2DP)和电话服务协议(hands-free profile,HFP)是第一电子设备(下文以手机为例进行说明)中用于传输音频业务的两种协议,即通过A2DP和HFP,手机可以通过蓝牙将音频数据传到具有蓝牙功能的第二电子设备(下文以蓝牙耳机为例进行说明)中。其中,A2DP具有音频传输非实时性的特点,用于实现多媒体业务,例如播放音乐等。HFP具有音频传输实时性的特点,用于实现通话业务,例如实时语音等。
蓝牙物理链路分为同步链路(synchronous connection oriented,SCO)和异步链路(asynchronous connection less,ACL)。SCO链路用于传输对实时性要求高的数据,例如通话业务的音频数据。ACL链路用于传输非实时性要求的数据,例如音乐应用的音频数据等。因此,为了保证通话质量,手机的通话业务需要在SCO链路上通过HFP传输音频数据。
然而,在一些情况下,例如手机打开了蓝牙功能,与蓝牙耳机处于已配对但未连接的状态,如果手机接收到来电信息,则根据蓝牙协议的规定,手机会通过蓝牙耳机来播放来电铃音,因此手机会与蓝牙耳机建立连接。在手机与蓝牙耳机建立连接时,如果通过getProfileProxy函数来注册蓝牙传输相关的HFP和A2DP协议,由于A2DP的注册进程快于HFP的注册进程,手机会先通过A2DP进行来电铃音的传输,后切换至通过HFP进行来电铃音的传输,切换的过程中手机会暂停来电铃音的音频数据传输,从而使得手机的来电铃音出现卡顿的现象。
发明内容
为了解决上述手机的来电铃音出现卡顿的现象,本申请提供了一种通信方法、存储介质及电子设备。
第一方面,本申请提供了一种通信方法,包括:对应于第一电子设备满足第一条件,第一电子设备完成电话服务协议HFP和蓝牙音频传输模型协定A2DP的注册;第一电子设备接收到来电信息,并且检测到与第一电子设备进行过蓝牙配对且未建立蓝牙连接的第二电子设备;第一电子设备与第二电子设备建立蓝牙连接,并且第一电子设备先建立电话服务协议HFP连接,以通过电话服务协议HFP向第二电子设备传输音频数据,其中音频数据包括来电信息对应的来电铃音,并且第一电子设备在建立电话服务协议HFP连接之后建立蓝牙音频传输模型协定A2DP连接。
可以理解本申请提及的第一电子设备包括手机等能够进行语音通话并且具有蓝牙功能的任意电子设备,本申请提及的第二电子设备包括蓝牙耳机等具有蓝牙功能并且具有音频数据播放功能的任意电子设备。
如此,手机提前完成HFP和A2DP的注册,当手机来电时,手机根据通话业务的类型,首先选择与蓝牙耳机建立HFP连接,手机的来电铃音将通过HFP在蓝牙耳机上播放。之后,手机与蓝牙耳机建立A2DP连接,手机不再选择通过A2DP播放来电铃音。从而避免了手机的来电铃音从通过A2DP在蓝牙耳机上播放切换到从通过HFP在蓝牙耳机上播放时导致来电铃音卡顿的现象,提升了用户的通话体验。
在上述第一方面的一种可能实现中,第一条件包括下列中的至少一种:进入开机阶段、蓝牙功能被打开、检测到已进行过蓝牙配对的电子设备。
可以理解,本申请提及的第一条件可以为手机处于初始化阶段,手机的初始化阶段包括但不限于进入开机阶段、蓝牙功能被打开、检测到已进行过蓝牙配对的电子设备。
在上述第一方面的一种可能实现中,第一电子设备通过以下方式建立电话服务协议HFP连接:第一电子设备中的音频管家应用向蓝牙应用发送与第二电子设备建立电话服务协议HFP连接的消息,蓝牙应用建立电话服务协议HFP连接。
在上述第一方面的一种可能实现中,通过电话服务协议HFP向第二电子设备传输音频数据,包括:第一电子设备中的电话应用接收到电话服务协议HFP建立成功的信息,向音频框架发送切出声设备指令;音频框架选择出声设备为与第一电子设备建立电话服务协议HFP连接的第二电子设备,向第二电子设备传输音频数据。
可以理解,出声设备也可以是手机的扬声器、听筒,或者是与手机连接的音响等设备,本申请对于出声设备的类型不做限制。
在上述第一方面的一种可能实现中,第一电子设备在建立电话服务协议HFP连接之后建立蓝牙音频传输模型协定A2DP连接,包括:第一电子设备在建立电话服务协议HFP连接之后,第一电子设备中的音频管家应用向蓝牙应用发送与第二电子设备建立蓝牙音频传输模型协定A2DP连接的消息,蓝牙应用建立蓝牙音频传输模型协定A2DP连接。
可以理解,为了保证手机中的通话业务和多媒体业务都能通过蓝牙耳机播放,手机需要与蓝牙耳机建立蓝牙音频传输模型协定A2DP和电话服务协议HFP的双重连接。在手机与蓝牙耳机建立HFP连接后,手机与蓝牙耳机建立A2DP连接。
在上述第一方面的一种可能实现中,通信方法还包括:当第一电子设备与第二电子设备建立蓝牙音频传输模型协定A2DP连接后,第一电子设备中的音频框架不再重新选择出声设备。
可以理解,由于通话业务是在SCO链路上通过HFP传输的音频数据,具有音频传输实时性的特点,为了保证通话质量,音频框架选择出声设备为与手机建立HFP连接的蓝牙耳机,而不再重新选择出声设备。
在上述第一方面的一种可能实现中,第一电子设备完成电话服务协议HFP和蓝牙音频传输模型协定A2DP的注册,包括:第一电子设备通过执行第一预设函数完成电话服务协议HFP和蓝牙音频传输模型协定A2DP的注册。
可以理解,第一预设函数包括getProfileProxy函数。
在上述第一方面的一种可能实现中,蓝牙应用建立电话服务协议HFP连接,包括蓝牙 应用通过调用第二预设函数,与第二电子设备建立电话服务协议HFP连接。
可以理解,第二预设函数包括onServiceConnected函数中ConnectHfp函数。
在上述第一方面的一种可能实现中,蓝牙应用建立蓝牙音频传输模型协定A2DP连接,包括:第一电子设备通过调用第三预设函数,与第二电子设备建立蓝牙音频传输模型协定A2DP连接。
可以理解,第三预设函数包括onServiceConnected函数中ConnectA2dp函数。
第二方面,本申请提供一种计算机可读存储介质,可读存储介质上存储有指令,指令在电子设备上执行时使电子设备实现上述第一方面及第一方面的任意一种可能实现的通信方法。
第三方面,本申请提供一种电子设备,包括:存储器,用于存储由电子设备的一个或多个处理器执行的指令;以及处理器,用于执行存储器中存储的指令以实现上述第一方面及第一方面的任意一种可能实现的通信方法。
附图说明
图1(a)根据本申请的一些实施例,示出了一种手机20来电的场景示意图;
图1(b)根据本申请的一些实施例,示出了另一种手机20来电的场景示意图;
图2根据本申请的一些实施例,示出了一种手机20的软件架构示意图;
图3根据本申请的一些实施例,示出了一种手机20的交互示意图;
图4根据本申请的一些实施例,示出了一种手机20的交互示意图;
图5根据本申请的一些实施例,示出了一种手机20的硬件结构示意图。
具体实施方式
本申请的说明性实施例包括但不限于一种通信方法、存储介质及电子设备。
本申请提及的第一电子设备可以是能够进行语音通话并且具有蓝牙功能的任意电子设备,包括但不限于手机、媒体播放器、平板电脑、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、个人数字助理(personal digital assistant,PDA),为了便于描述,本申请以第一电子设备为手机20为例进行介绍。
本申请提及的第二电子设备可以是具有蓝牙功能并且具有音频数据播放功能的任意电子设备,包括但不限于无线耳机、无线音箱、无线手环、无线车载、无线智能眼镜、无线手表、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备等设备。本申请对第二电子设备的具体形态不做特殊限制。为了便于描述,本申请以第二电子设备为蓝牙耳机10和平板电脑30为例进行介绍。
下面结合附图对本申请的一些实施例的技术方案进行描述。
图1(a)示出了一种手机20来电的场景示意图。如图1(a)所示,蓝牙耳机10与平板电脑30处于已配对且连接的状态,即蓝牙耳机10与平板电脑30已经通过认证建立可信关系,并且,平板电脑30的输出音频可以通过蓝牙耳机10播放。此时,如果手机20打开了蓝牙功能,与蓝牙耳机10处于已配对但未连接的状态,即蓝牙耳机10与手机20之前已经通过认证建立可信关系,手机20的输出音频可以通过本机的喇叭外放,而不能通过蓝牙耳机10播放。此时,如果手机20接收到来电,根据蓝牙协议的规定,手机20会抢占蓝牙耳机10,即手机20会与蓝牙耳机10进行连接。
图1(b)示出了另一种手机20来电的场景示意图。如图1(b)所示,如果手机20 打开了蓝牙功能,与蓝牙耳机10处于已配对但未连接的状态,即蓝牙耳机10与手机20已经通过认证建立可信关系,但是,用户手动断开了蓝牙耳机10与手机20的连接,即手机20的输出音频可以通过本机的喇叭外放,而不能通过蓝牙耳机10播放。此时,如果手机20接收到来电,根据蓝牙协议的规定,手机20将会与蓝牙耳机10进行连接。
如前所述,当手机20收到来电消息后,为了能让手机20的来电铃音从蓝牙耳机10中播放,手机20需要建立HFP和A2DP连接,而建立连接的过程中存在手机的来电铃音会出现卡顿的现象。具体地,手机20在接收到来电消息后,将首先注册用于传输音频业务的协议,包括HFP即用于实现通话业务的协议,和A2DP即用于实现多媒体业务的协议,然后建立手机20与蓝牙耳机10的A2DP和HFP连接。当手机20与蓝牙耳机10的建立A2DP和HFP连接后,手机20可以进行音频数据的蓝牙传输,即在蓝牙耳机10上播放来电铃音。其中,手机20注册HFP和A2DP的进程是并行的进程,即手机20将同时注册HFP和A2DP。但是,如果手机20执行getProfileProxy函数,手机20注册A2DP的速度更快,即手机20先完成注册A2DP。由于手机20与蓝牙耳机10建立HFP和A2DP连接的进程是串行的进程,即当手机20完成注册A2DP后,手机20将与蓝牙耳机10首先建立A2DP连接。例如,手机20可以通过执行onServiceConnected函数中的ConnectA2dp函数与蓝牙耳机10首先建立A2DP连接,并通过A2DP在蓝牙耳机10上播放来电铃音。
为了保证手机20中的通话业务和多媒体业务都能通过蓝牙耳机10播放,在手机20收到来电消息后,手机20需要与蓝牙耳机10建立A2DP和HFP的双重连接。当手机20与蓝牙耳机10建立A2DP连接后,一段时间后手机20才能完成HFP的注册,当手机20完成HFP的注册后,手机20才能与蓝牙耳机10建立HFP连接,例如,手机20可以通过执行onServiceConnected函数中的ConnectHfp函数与蓝牙耳机10建立HFP连接。而通话业务是在SCO链路上通过HFP传输的音频数据,具有音频传输实时性的特点。当手机20与蓝牙耳机10建立HFP连接后,手机20将优先选择通过HFP在蓝牙耳机10上播放来电铃音,即手机20将从通过A2DP在蓝牙耳机10上播放来电铃音切换至通过HFP在蓝牙耳机10上播放来电铃音。而在手机20切换来电铃音的过程中,由于手机20会暂停来电铃音的音频流,导致手机20的来电铃音将会出现卡顿的现象。
为了解决上述问题,本申请提供了一种解决来电铃音卡顿的方法。具体地,可以提前控制手机完成HFP和A2DP的注册,例如,手机在开机阶段、打开蓝牙功能时或者手机在检测到之前配对过但未连接的蓝牙耳机时,通过getProfileProxy函数完成HFP和A2DP的注册。然后,如果手机接收到来电信息,则可以选择先与蓝牙耳机建立HFP连接,然后再与蓝牙耳机建立A2DP连接。例如,手机通过执行onServiceConnected函数中的ConnectHfp函数,使得手机先与蓝牙耳机建立HFP连接;再通过执行onServiceConnected函数中的ConnectA2dp函数,使得手机与蓝牙耳机建立A2DP连接。如此,手机的来电铃音将通过HFP在蓝牙耳机上播放。从而避免了手机的来电铃音从通过A2DP在蓝牙耳机上播放切换到通过HFP在蓝牙耳机上播放时导致来电铃音卡顿的现象,提升了用户的通话体验。
下面结合图2介绍本申请提及的手机20的软件架构。图2示出了一种手机20的软件架构的示意图。如图2所示,手机20软件架构从上到下分别为应用程序层101、框架层102、安卓库103和驱动层104。
应用程序层101可以包括主界面、电话、蓝牙、音频管家等应用程序。应用程序层101还可以包括其他应用程序,例如支付应用,购物应用、银行应用、聊天应用或理财应用等,本申请不做限定。本申请中,电话应用用于发送手机20来电的广播,以及用于向框架层102发送手机20中来电铃音的音频流。音频管家应用用于注册A2DP和HFP,以及用于向蓝牙应用发送与蓝牙耳机10建立HFP和A2DP连接的消息。蓝牙应用用于与蓝牙耳机10建立HFP和A2DP连接,以及用于向框架层102发送连接成功的广播。
框架层102包括电话框架、蓝牙框架、音频框架等。框架层102为应用程序层101提供多语言框架,例如运算能力(可以包括CPU算力、图形处理器(Graphics Processing Unit,GPU)算力、图像信号处理器(Image Signal Processor,ISP)算力等)、识音能力(可以包括麦克风识音能力、语音识别能力等)、设备安全防护方面的安全能力(可以包括可信任运行环境安全等级等)、显示能力(可以包括屏幕分辨率、屏幕尺寸等)、播放能力(包括扩音能力、立体声效能力等、以及存储能力(可以包括设备的内存能力、随机存取存储器(random access memory,RAM)能力等)),在此不做限制。应用程序层101的应用程序可以通过调用框架层102所提供的各个能力对应的函数,来实现相应的功能。
其中,电话框架用于提供手机20的通信功能。例如通话状态的管理(包括接通,挂断等)。蓝牙框架用于提供手机20的蓝牙服务。音频框架接收应用程序层101各个应用程序发送的音频业务,识别音频业务的类型;以及进行业务仲裁和抢占。本申请中,音频框架用于选择出声设备为与手机20建立A2DP或者HFP连接的蓝牙耳机20,以及用于接收铃声音频流。
安卓库103包括表面管理器、媒体库、三维图形处理库、安卓运行时等。
其中,表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。三维图形处理库(例如,OpenGL ES),用于实现三维图形绘图,图像渲染,合成,和图层处理等。安卓运行时(Android Runtime)包括核心库和虚拟机。安卓运行时负责安卓系统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层101和框架层102运行在虚拟机中。虚拟机将应用程序层101和框架层102的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
驱动层104可以为手机20提供统一外设访问能力和管理框架,包括显示驱动、蓝牙驱动、音频驱动等。
可以理解,图2所示的手机20的软件架构只是一种示例,在另一些实施例中,本申请实施例适用的软件架构可以包括更多或更少的,也可以拆分或合并部分,还可以采用其他架构,在此不做限定。
下面结合图3和手机20的软件架构,介绍目前当手机20来电时手机20中交互的具体流程。图3示出了一种手机20中交互的流程示意图,如图3所示,交互流程包括如下步骤:
S101:蓝牙应用向音频管家应用发送蓝牙打开广播。
当手机20的蓝牙打开时,蓝牙应用向音频管家应用发送蓝牙打开的广播。
S102:电话应用向音频框架发送铃声音频流。
当手机20来电时,电话应用向音频框架发送铃声音频流。
在一些实施例中,电话应用发送的铃声音频流为stream_ring函数的类型,本申请对于铃声音频流的类型不做限制。
S103:电话应用向音频管家应用发送来电广播。
当手机20来电时,电话应用向音频管家应用发送来电广播。
在一些实施例中,步骤S102也可以在步骤S103之后执行,即电话应用首先向音频管家应用发送手机20的来电广播,再向音频框架发送铃声音频流。本申请实施例对于电话应用发送铃声音频流和来电广播的顺序不做限制。
在一些实施例中,来电广播可以包括来电电话号码、来电运营商信息等。
S104:音频管家应用注册HFP和A2DP。
当收到手机20的来电广播后,音频管家应用注册HFP和A2DP。
在一些实施例中,音频管家应用可以通过执行getProfileProxy函数注册HFP和A2DP,本申请对于音频管家应用注册HFP和A2DP的具体实现方式不做限制。
音频管家应用注册HFP和A2DP的进程是并行的进程,即音频管家应用将同时注册HFP和A2DP,如果手机20执行getProfileProxy函数,音频管家应用注册A2DP的速度更快,即音频管家应用先完成注册与A2DP。
如前所述,HFP具有音频传输实时性的特点,用于实现通话业务,例如实时语音等。A2DP具有音频传输非实时性的特点,用于实现多媒体业务,例如播放音乐等。
S105:音频管家应用向蓝牙应用发送与蓝牙耳机10建立A2DP连接的消息。
如前所述,由于手机20与蓝牙耳机10建立HFP和A2DP连接的进程是串行的进程,当音频管家应用注册完成A2DP后,音频管家应用向蓝牙应用发送与蓝牙耳机10建立A2DP连接的消息。
在一些实施例中,蓝牙应用通过执行onServiceConnected函数中的ConnectA2dp函数,与蓝牙耳机10首先建立A2DP连接。
S106:蓝牙应用向音频框架发送连接成功的广播。
蓝牙应用向音频框架发送与蓝牙耳机10建立A2DP连接的广播。
在一些实施例中,蓝牙应用可以通过Context.sendBroadcast函数发送连接成功的广播。
S107:音频框架选择出声设备。
音频框架选择出声设备为与手机20建立A2DP连接的蓝牙耳机10。
在一些实施例中,出声设备也可以是手机20的扬声器、听筒,或者是与手机20连接的音响等设备,本申请对于出声设备的类型不做限制。
S108:音频管家应用向蓝牙应用发送与蓝牙耳机10建立HFP连接的消息。
为了保证手机20中的通话业务和多媒体业务都能通过蓝牙耳机10播放,手机20需要与蓝牙耳机10建立A2DP和HFP的双重连接。在手机20与蓝牙耳机10建立A2DP连接后,过一段时间后手机20才能完成HFP的注册,当手机20才能完成注册HFP后,音频管家应用向蓝牙应用发送与蓝牙耳机10建立HFP连接的消息。
在一些实施例中,蓝牙应用通过执行onServiceConnected函数中的ConnectHfp函数, 与蓝牙耳机10建立HFP连接。
S109:蓝牙应用向电话应用发送连接成功的广播。
蓝牙应用向电话应用发送与蓝牙耳机10建立HFP连接的广播。
在一些实施例中,蓝牙应用可以通过Context.sendBroadcast函数发送连接成功的广播。
S110:电话应用向音频框架发送选择出声设备的消息。
电话应用在接收到与蓝牙耳机10建立HFP连接的广播后,向音频框架发送选择出声设备的消息。
S111:音频框架选择出声设备。
如前所述,由于通话业务是在SCO链路上通过HFP传输的音频数据,具有音频传输实时性的特点,为了保证通话质量,音频框架选择出声设备为与手机20建立HFP连接的蓝牙耳机10。
而在手机20从通过A2DP在蓝牙耳机10上播放来电铃音切换到通过HFP在蓝牙耳机10上播放来电铃音的过程中,手机20会暂停来电铃音的音频数据传输,从而使得手机20的来电铃音出现卡顿的现象。
下面结合图4和手机20的软件架构,介绍当手机20来电时手机20中交互的具体流程。图4示出了一种手机20中交互的流程示意图,如图4所述,交互流程包括如下步骤:
S201:蓝牙应用向音频管家应用发送蓝牙打开的广播。
当手机20的蓝牙打开时,蓝牙应用向音频管家应用发送蓝牙打开的广播。
S202:音频管家应用注册HFP和A2DP。
在手机20初始化的阶段,例如手机20的开机阶段、用户手动打开蓝牙应用的阶段或者手机20检测到之前配对过但未连接的蓝牙耳机10时,音频管家应用注册HFP和A2DP。
在一些实施例中,音频管家应用可以通过执行getProfileProxy函数注册HFP和A2DP,本申请对于音频管家应用注册HFP和A2DP的具体实现方式不做限制。
在一些实施例中,注册服务的实现逻辑可以包括在getProfileProxy函数中,通过执行getProfileProxy(context,mBluetoothListener,BluetoothProfile.HEADSET)函数注册HFP,通过执行getProfileProxy(context,mBluetoothListener,BluetoothProfile.A2DP)函数注册A2DP。
如前所述,HFP具有音频传输实时性的特点,用于实现通话业务,例如实时语音等。A2DP具有音频传输非实时性的特点,用于实现多媒体业务,例如播放音乐等。
音频管家应用注册HFP和A2DP的进程是并行的进程,即音频管家应用将同时注册HFP和A2DP。
S203:电话应用向音频框架发送铃声音频流。
当手机20来电时,电话应用向音频框架发送铃声音频流。
在一些实施例中,电话应用发送的铃声音频流为stream_ring函数的类型,本申请对于铃声音频流的类型不做限制。
S204:电话应用向音频管家应用发送来电广播。
当手机20来电时,电话应用向音频管家应用发送来电广播。
在一些实施例中,步骤S203也可以在步骤S204之后,即电话应用首先向音频管家应 用发送手机20的来电广播,再向音频框架发送铃声音频流。本申请实施例对于电话应用发送铃声音频流和来电广播的顺序不做限制。
在一些实施例中,来电广播可以包括来电电话号码、来电运营商信息等。
S205:音频管家应用向蓝牙应用发送与蓝牙耳机10建立HFP连接的消息。
当手机20收到来电消息后,根据通话业务的音频数据适合通过HFP传输的特点,音频管家应用向蓝牙应用发送与蓝牙耳机10建立HFP连接的消息,蓝牙应用可以在执行onServiceConnected函数中,通过调用onServiceConnected函数中ConnectHfp函数,使得蓝牙应用首先与蓝牙耳机10建立HFP连接。
在一些实施例中,与蓝牙耳机10建立HFP连接的实现逻辑可以包括当手机20成功注册HFP后,进入onServiceConnected函数中,通过connectHFP(bluetoothDevice)函数使得蓝牙应用首先与蓝牙耳机10建立HFP连接。
S206:蓝牙应用向电话应用发送连接成功的广播。
蓝牙应用向电话应用发送与蓝牙耳机10建立HFP连接的广播。
在一些实施例中,蓝牙应用可以通过Context.sendBroadcast函数发送连接成功的广播。
S207:电话应用向音频框架发送切出声设备的消息。
电话应用在接收到与蓝牙耳机10建立HFP连接的消息后,向音频框架发送切出声设备的消息。
S208:音频框架选择出声设备。
音频框架选择出声设备为与手机20建立HFP连接的蓝牙耳机10。
在一些实施例中,出声设备也可以是手机20的扬声器、听筒,或者是与手机20连接的音响等设备,本申请对于出声设备的类型不做限制。
S209:音频管家应用向蓝牙应用发送与蓝牙耳机10建立A2DP连接的消息。
为了保证手机20中的通话业务和多媒体业务都能通过蓝牙耳机10播放,手机20需要与蓝牙耳机10建立A2DP和HFP的双重连接。在手机20与蓝牙耳机10建立HFP连接后,音频管家应用向蓝牙应用发送与蓝牙耳机10建立A2DP连接的消息。
本申请中,蓝牙应用可以通过执行onServiceConnected函数与蓝牙耳机10建立AD2P连接,例如通过调用onServiceConnected函数中的ConnectA2dp函数,使得蓝牙应用与蓝牙耳机10建立A2DP连接。
在一些实施例中,与蓝牙耳机10建立A2DP连接的实现逻辑可以包括当手机20成功注册A2DP后,转到onServiceConnected函数中,通过connectA2dp(bluetoothDevice)函数使得蓝牙应用与蓝牙耳机10建立A2DP连接。
S210:蓝牙应用向音频框架发送连接成功的广播。
蓝牙应用向音频框架发送与蓝牙耳机10建立A2DP连接的广播。
在一些实施例中,蓝牙应用可以通过Context.sendBroadcast函数发送连接成功的广播。
S211:音频框架不再重新选择出声设备。
由于通话业务是在SCO链路上通过HFP传输的音频数据,具有音频传输实时性的特点,为了保证通话质量,音频框架选择出声设备为与手机20建立HFP连接的蓝牙耳机10,不 再重新选择出声设备。
本申请中,如果手机20与蓝牙耳机10处于已配对但未连接的状态,手机20在初始化时完成注册HFP和A2DP。如果手机20接收到来电,根据通话业务的音频数据适合通过HFP传输的特点,手机20选择先与蓝牙耳机10建立HFP连接,然后再与蓝牙耳机10建立A2DP连接。例如,手机20通过执行onServiceConnected函数中的ConnectHfp函数,使得手机20先与蓝牙耳机10建立HFP连接;再通过执行onServiceConnected函数中的ConnectA2dp函数,使得手机20与蓝牙耳机10建立A2DP连接。如此,手机20的来电铃音将通过HFP在蓝牙耳机10中播放。从而避免了手机20的来电铃音从通过A2DP在蓝牙耳机10中播放切换到从通过HFP在蓝牙耳机10中播放时导致来电铃音卡顿的现象,提升了用户的通话体验。
下面结合图5介绍手机20的硬件结构。示例性的,图5示出了一种手机20的硬件结构示意图。手机20可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对手机20的具体限定。在本申请另一些实施例中,手机20可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是手机20的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。例如,本申请的一些实施例中,处理器110可以执行本申请提及的通信方法。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。处理器110可以基于指令和数据执行本申请提及的通信方法。
充电管理模块140用于从充电器接收充电输入。电源管理模块141用于连接电池142,充电管理模块140与处理器110。手机20的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。移动通信模 块150可以提供应用在手机20上的包括2G/3G/4G/5G等无线通信的解决方案。无线通信模块160可以提供应用在手机20上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。例如,本申请实施例中,蓝牙可以用于与蓝牙耳机10建立蓝牙连接。
手机20通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。手机20可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
手机20可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。例如,本申请的一些实施例中,手机20的来电铃音可以通过音频模块170将数字音频信息转换成模拟音频信号输出。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。手机20可以通过扬声器170A收听音乐,或收听免提通话。例如,本申请实施例中,手机20的扬声器170A可以作为来电铃音的发声设备。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当手机20接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。手机20可以设置至少一个麦克风170C。在另一些实施例中,手机20可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,手机20还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
以上介绍了手机20可能具有的硬件结构,可以理解的是,本申请实施例示意的结构并不构成对手机20的具体限定。在本申请另一些实施例中,手机20可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
本申请提供一种计算机可读存储介质,可读存储介质上存储有指令,指令在电子设备 上执行时使电子设备实现本申请提供的通信方法。
本申请提供一种电子设备,包括:存储器,用于存储由电子设备的一个或多个处理器执行的指令;以及处理器,用于执行存储器中存储的指令以实现本申请提供的通信方法。
在附图中,可以以特定布置和/或顺序示出一些结构或方法特征。然而,应该理解,可能不需要这样的特定布置和/或排序。而是,在一些实施例中,这些特征可以以不同于说明性附图中所示的方式和/或顺序来布置。另外,在特定图中包括结构或方法特征并不意味着暗示在所有实施例中都需要这样的特征,并且在一些实施例中,可以不包括这些特征或者可以与其他特征组合。
需要说明的是,本申请各设备实施例中提到的各单元/模块都是逻辑单元/模块,在物理上,一个逻辑单元/模块可以是一个物理单元/模块,也可以是一个物理单元/模块的一部分,还可以以多个物理单元/模块的组合实现,这些逻辑单元/模块本身的物理实现方式并不是最重要的,这些逻辑单元/模块所实现的功能的组合才是解决本申请所提出的技术问题的关键。此外,为了突出本申请的创新部分,本申请上述各设备实施例并没有将与解决本申请所提出的技术问题关系不太密切的单元/模块引入,这并不表明上述设备实施例并不存在其它的单元/模块。
需要说明的是,在本申请的示例和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本申请的范围。

Claims (10)

  1. 一种通信方法,应用于第一电子设备,其特征在于:
    对应于所述第一电子设备满足第一条件,所述第一电子设备注册电话服务协议HFP和蓝牙音频传输模型协定A2DP;
    在完成所述电话服务协议HFP和所述蓝牙音频传输模型协定A2DP注册后,所述第一电子设备接收第一呼叫;
    响应于所述第一呼叫,所述第一电子设备与蓝牙耳机建立电话服务协议HFP连接,所述第一电子设备通过所述电话服务协议HFP连接向所述蓝牙耳机发送来电铃音对应的音频数据,在接收所述第一呼叫前,所述第一电子设备与所述蓝牙耳机已完成配对,且没有建立蓝牙连接;
    所述第一电子设备与所述蓝牙耳机建立所述电话服务协议HFP连接后,所述第一电子设备与所述蓝牙耳机建立蓝牙音频传输模型协定A2DP连接,且在完成建立所述蓝牙音频传输模型协定A2DP连接后,所述第一电子设备通过所述电话服务协议HFP连接向所述蓝牙耳机发送所述音频数据。
  2. 根据权利要求1所述的方法,其特征在于,所述对应于所述第一电子设备满足第一条件,所述第一电子设备注册电话服务协议HFP和蓝牙音频传输模型协定A2DP,包括:
    响应于用户操作,所述第一电子设备启动蓝牙服务;
    在启动所述蓝牙服务后,所述第一电子设备注册电话服务协议HFP和蓝牙音频传输模型协定A2DP。
  3. 根据权利要求1所述的通信方法,其特征在于,所述第一电子设备通过以下方式建立电话服务协议HFP连接:
    所述第一电子设备中的音频管家应用向蓝牙应用发送与所述蓝牙耳机建立电话服务协议HFP连接的消息,所述蓝牙应用建立电话服务协议HFP连接。
  4. 根据权利要求3所述的通信方法,其特征在于,所述第一电子设备通过所述电话服务协议HFP连接向所述蓝牙耳机发送来电铃音对应的音频数据,包括:
    所述第一电子设备中的电话应用接收到所述电话服务协议HFP建立成功的信息,向音频框架发送切出声设备指令;
    所述音频框架选择所述出声设备为与所述第一电子设备建立电话服务协议HFP连接的所述蓝牙耳机,向所述蓝牙耳机发送来电铃音对应的音频数据。
  5. 根据权利要求3所述的通信方法,其特征在于,所述第一电子设备与所述蓝牙耳机建立蓝牙音频传输模型协定A2DP连接,包括:
    所述第一电子设备在建立电话服务协议HFP连接之后,所述第一电子设备中的音频管家应用向所述蓝牙应用发送与所述蓝牙耳机建立蓝牙音频传输模型协定A2DP连接的消息,所述蓝牙应用建立蓝牙音频传输模型协定A2DP连接。
  6. 一种通信系统,其特征在于,所述通信系统包括蓝牙耳机、第一电子设备和第二电子设备,所述第一电子设备与所述蓝牙耳机已配对且没有建立蓝牙连接,所述第二电子设备与所述蓝牙耳机已配对且建立蓝牙连接;
    对应于所述第一电子设备满足第一条件,所述第一电子设备注册电话服务协议HFP和蓝牙音频传输模型协定A2DP;
    在完成所述电话服务协议HFP和所述蓝牙音频传输模型协定A2DP注册后,所述第一电子设备接收第一呼叫;
    所述第一电子设备响应于所述第一呼叫,并与所述蓝牙耳机建立电话服务协议HFP连接,所述第一电子设备通过所述电话服务协议HFP连接向所述蓝牙耳机发送来电铃音对应的音频数据;
    所述蓝牙耳机播放所述第一电子设备发送的音频数据;
    所述第一电子设备与所述蓝牙耳机建立所述电话服务协议HFP连接后,所述第一电子设备与所述蓝牙耳机建立蓝牙音频传输模型协定A2DP连接,且在完成建立所述蓝牙音频传输模型协定A2DP连接后,所述第一电子设备通过所述电话服务协议HFP连接向所述蓝牙耳机发送所述音频数据。
  7. 根据权利要求6所述的系统,其特征在于,
    所述第一电子设备响应于用户操作,所述第一电子设备启动蓝牙服务;
    在启动所述蓝牙服务后,所述第一电子设备注册电话服务协议HFP和蓝牙音频传输模型协定A2DP。
  8. 根据权利要求6所述的系统,其特征在于,
    在所述蓝牙耳机播放所述第一电子设备发送的音频数据前,所述蓝牙耳机播放所述第二电子设备发送的音频数据。
  9. 根据权利要求6所述的系统,其特征在于,
    所述第一电子设备接收所述第一呼叫后,所述蓝牙耳机断开与所述第二电子设备的蓝牙连接。
  10. 一种电子设备,其特征在于,包括:
    存储器,用于存储由电子设备的一个或多个处理器执行的指令;
    以及处理器,用于执行所述存储器中存储的指令以实现权利要求1至5中任一项所述的通信方法。
PCT/CN2023/138227 2023-08-15 2023-12-12 一种通信方法、存储介质及电子设备 WO2025035666A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP23925586.2A EP4531444A4 (en) 2023-08-15 2023-12-12 COMMUNICATION METHOD, STORAGE MEDIUM AND ELECTRONIC DEVICE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202311026635.4A CN116744244B (zh) 2023-08-15 2023-08-15 一种通信方法、存储介质及电子设备
CN202311026635.4 2023-08-15

Publications (1)

Publication Number Publication Date
WO2025035666A1 true WO2025035666A1 (zh) 2025-02-20

Family

ID=87906456

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/138227 WO2025035666A1 (zh) 2023-08-15 2023-12-12 一种通信方法、存储介质及电子设备

Country Status (3)

Country Link
EP (1) EP4531444A4 (zh)
CN (2) CN116744244B (zh)
WO (1) WO2025035666A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116744244B (zh) * 2023-08-15 2023-10-31 荣耀终端有限公司 一种通信方法、存储介质及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100069007A1 (en) * 2008-09-12 2010-03-18 Kabushiki Kaisha Toshiba Information processing apparatus and mobile communication apparatus
WO2022007848A1 (zh) * 2020-07-10 2022-01-13 华为技术有限公司 一种通话方法、装置和系统
CN114422984A (zh) * 2022-01-25 2022-04-29 斑马网络技术有限公司 车载通话方法和车载设备
CN115002934A (zh) * 2022-07-18 2022-09-02 荣耀终端有限公司 音频业务处理系统、电子设备及蓝牙耳机
CN116744244A (zh) * 2023-08-15 2023-09-12 荣耀终端有限公司 一种通信方法、存储介质及电子设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4282721B2 (ja) * 2007-01-31 2009-06-24 株式会社東芝 携帯端末装置
CN114079892B (zh) * 2020-08-12 2025-04-04 华为技术有限公司 蓝牙通信方法、可穿戴设备及系统
CN115696283A (zh) * 2021-07-28 2023-02-03 华为技术有限公司 音频控制方法、电子设备、音频设备和存储介质
CN114466099B (zh) * 2021-08-31 2022-12-20 荣耀终端有限公司 蓝牙设备的控制方法、装置和存储介质
CN115915037B (zh) * 2021-09-24 2025-03-18 Oppo广东移动通信有限公司 通话控制方法、装置、电子设备及计算机可读存储介质
CN116419192A (zh) * 2021-12-31 2023-07-11 上海博泰悦臻网络技术服务有限公司 音频管理方法及系统、车载终端及存储介质
CN115442694A (zh) * 2022-08-26 2022-12-06 深圳市和宏实业股份有限公司 一种解决tws无线蓝牙耳机音量自动增益的控制方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100069007A1 (en) * 2008-09-12 2010-03-18 Kabushiki Kaisha Toshiba Information processing apparatus and mobile communication apparatus
WO2022007848A1 (zh) * 2020-07-10 2022-01-13 华为技术有限公司 一种通话方法、装置和系统
CN114422984A (zh) * 2022-01-25 2022-04-29 斑马网络技术有限公司 车载通话方法和车载设备
CN115002934A (zh) * 2022-07-18 2022-09-02 荣耀终端有限公司 音频业务处理系统、电子设备及蓝牙耳机
CN116744244A (zh) * 2023-08-15 2023-09-12 荣耀终端有限公司 一种通信方法、存储介质及电子设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4531444A4

Also Published As

Publication number Publication date
CN116744244B (zh) 2023-10-31
CN116744244A (zh) 2023-09-12
EP4531444A1 (en) 2025-04-02
CN119497049A (zh) 2025-02-21
EP4531444A4 (en) 2025-06-25

Similar Documents

Publication Publication Date Title
CN113395685B (zh) 蓝牙通信系统和无线通信系统
WO2020107466A1 (zh) 一种点对多点的数据传输方法及设备
WO2018032455A1 (zh) 一种蓝牙通信的方法及终端
US20230299806A1 (en) Bluetooth Communication Method, Wearable Device, and System
CN115002934B (zh) 音频业务处理系统、电子设备及蓝牙耳机
EP3986008A1 (en) Method for using remote sim module, and electronic apparatus
CN116033057B (zh) 基于分布式通话录音同步方法、电子设备及可读存储介质
CN115190197A (zh) 基于蓝牙耳机的通话方法、装置及存储介质
CN116471355B (zh) 音频播放的方法及电子设备
CN111556439A (zh) 一种终端的连接控制方法、终端及计算机存储介质
CN1842193B (zh) 再现移动通信终端的音乐文件的方法及实现其的移动终端
WO2025035666A1 (zh) 一种通信方法、存储介质及电子设备
WO2021233398A1 (zh) 无线音频系统、无线通讯方法及设备
CN113954756A (zh) 功能冲突的处理方法、装置、电子设备和可读存储介质
CN116137639A (zh) 一种跨设备音频数据传输的方法和电子设备
CN114885317A (zh) 设备间协同控制的方法、通信系统、电子设备及存储介质
CN115087134A (zh) 一种蓝牙连接的方法和电子设备
CN114496007A (zh) 数据处理方法、装置、设备、存储介质及计算机程序产品
WO2025039495A1 (zh) 一种音频控制方法、电子设备及可读存储介质
CN116887200B (zh) 一种彩信发送方法、电子设备及存储介质
CN118677982A (zh) 来电处理方法、装置、智能穿戴设备及存储介质
WO2024082855A1 (zh) 一种音频业务处理方法、电子设备及计算机存储介质
CN115967928A (zh) 耳机音频播放方法、装置、设备和存储介质
WO2025011354A1 (zh) 通话方法和通话装置
CN119743715A (zh) 音频播放方法、系统、电子设备及计算机可读存储介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2023925586

Country of ref document: EP

Effective date: 20240909

ENP Entry into the national phase

Ref document number: 2023925586

Country of ref document: EP

Effective date: 20240909

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

Ref document number: 23925586

Country of ref document: EP

Kind code of ref document: A1

WWP Wipo information: published in national office

Ref document number: 2023925586

Country of ref document: EP