Android Bluetooth development - HFP protocol (9)

SDK path: frameworks/base/core/java/android/bluetooth/

Service path: packages/apps/Bluetooth/src/com/android/bluetooth/

        This class cannot be found when using the protocol class, because the Client part or related interfaces of the Bluetooth protocol in the Android source code are hidden by @hide, so android.jar cannot meet the needs of Android source code framework layer developers. Reflection mechanism or reference framework.jar instead of android.jar.

位置:out\target\common\obj\JAVA_LIBRARIES\framework_intermediates\classes.jar

        Both HSP and HFP are formulated to realize Bluetooth calls, and the functions implemented are related to Bluetooth calls. Basically all Bluetooth headsets and car Bluetooth will support these two protocols.

        HSP only implements the most basic call operations: answer the call, hang up the call, adjust the volume, and switch the sound between the mobile phone and the Bluetooth headset. HFP is an extension of HSP in terms of function. In addition to the above functions, it also includes advanced functions such as call rejection and caller display on the headset end.

        In the design of Android, the above two protocols are not displayed separately, but both are expressed as "mobile phone audio". When using it, connect to HFP first, and only try HSP when the other party only supports HSP or HFP connection fails. 

1. SDK interface

        BluetoothHeadsetClient.java: The proxy class of the HFP protocol in the Bluetooth apk, and the application accesses the method of the HFP protocol through this proxy class.

interface name describe
co

Guess you like

Origin blog.csdn.net/c19344881x/article/details/128733312