Tuesday, October 13, 2015

Bluetooth Turning ON

Once Phone Bootup is complete, then BT initilization will be go...com.android.bluetooth and com.btservice.AdapterService will get started.

1. Device supporting profile is get added to config.(like, a2dp, hid, pan,map,etc)
2. Register IBluetoothManagerCallback.
3. Init Bluedroid, Load bt_stack.conf and Start BTIF.
4. BluetoothServiceConnection
5. getAdapterPropertiesNative --> get_adapter_properties(at the time of init)
6. Adapterpropertychangedcallback with Set_adapter_property: address, Name.

*********************************************************************
User action: Enable BT(Tuning ON):
once the user turn on BT, the state will go from 10 to 11(turning on )
then it will start all the profile services (hidservice, a2dpservice...),then call will go for the enable BT to JNI-->HAL-->BTIF-->BTE-->HCI--> vendor specific--> UART.
btif will wait for th trigger to init chip and stack. This trigger will be received by btu_task once the UART is opened and ready.


Call flow of BT ON from the APP side:

1. /packages/apps/Settings/src/com/android/settings/bluetooth/BluetoothEnabler.java
call-->  mLocalAdapter.setBluetoothEnabled(isChecked);
2. /packages/apps/Settings/src/com/android/settings/bluetooth/LocalBluetoothAdapter.java
call--> mAdapter.enable();
3.[BluetoothAdapter.java] return mManagerService.enable();
NOTE: 1. Show toast message : BT is not allowed in Airplane Mode.
4. [LocalBluetoothAdapter.java]private static final int SCAN_EXPIRATION_MS = 5 * 60 * 1000; // 5 mins
6. Once BT came to TURN ON then it will initilize or update the local profile objects.(a2dp or handsfree profile)
   call -->  updateLocalProfiles();
7. notifyAdapterStateChange()[AdapterState.java]--> This is responsible for the state change managment.

No comments:

Post a Comment

Qualcomm Short Term

  113 is the SL. 1st Target by mid July.

Total Pageviews