Loading android/app/src/com/android/bluetooth/hfp/HeadsetService.java +2 −2 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class HeadsetService extends ProfileService { // Step 3: Initialize system interface mSystemInterface = HeadsetObjectsFactory.getInstance().makeSystemInterface(this); // Step 4: Initialize native interface setHeadsetService(this); mMaxHeadsetConnections = mAdapterService.getMaxConnectedAudioDevices(); mNativeInterface = HeadsetObjectsFactory.getInstance().getNativeInterface(); // Add 1 to allow a pending device to be connecting or disconnecting Loading @@ -197,7 +198,6 @@ public class HeadsetService extends ProfileService { filter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED); registerReceiver(mHeadsetReceiver, filter); // Step 7: Mark service as started setHeadsetService(this); mStarted = true; BluetoothDevice activeDevice = getActiveDevice(); String deviceAddress = activeDevice != null ? Loading @@ -223,7 +223,6 @@ public class HeadsetService extends ProfileService { AdapterService.ACTIVITY_ATTRIBUTION_NO_ACTIVE_DEVICE_ADDRESS; mAdapterService.notifyActivityAttributionInfo(getAttributionSource(), deviceAddress); mStarted = false; setHeadsetService(null); // Step 6: Tear down broadcast receivers unregisterReceiver(mHeadsetReceiver); synchronized (mStateMachines) { Loading Loading @@ -256,6 +255,7 @@ public class HeadsetService extends ProfileService { } // Step 4: Destroy native interface mNativeInterface.cleanup(); setHeadsetService(null); // Step 3: Destroy system interface mSystemInterface.stop(); // Step 2: Stop handler thread Loading Loading
android/app/src/com/android/bluetooth/hfp/HeadsetService.java +2 −2 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class HeadsetService extends ProfileService { // Step 3: Initialize system interface mSystemInterface = HeadsetObjectsFactory.getInstance().makeSystemInterface(this); // Step 4: Initialize native interface setHeadsetService(this); mMaxHeadsetConnections = mAdapterService.getMaxConnectedAudioDevices(); mNativeInterface = HeadsetObjectsFactory.getInstance().getNativeInterface(); // Add 1 to allow a pending device to be connecting or disconnecting Loading @@ -197,7 +198,6 @@ public class HeadsetService extends ProfileService { filter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED); registerReceiver(mHeadsetReceiver, filter); // Step 7: Mark service as started setHeadsetService(this); mStarted = true; BluetoothDevice activeDevice = getActiveDevice(); String deviceAddress = activeDevice != null ? Loading @@ -223,7 +223,6 @@ public class HeadsetService extends ProfileService { AdapterService.ACTIVITY_ATTRIBUTION_NO_ACTIVE_DEVICE_ADDRESS; mAdapterService.notifyActivityAttributionInfo(getAttributionSource(), deviceAddress); mStarted = false; setHeadsetService(null); // Step 6: Tear down broadcast receivers unregisterReceiver(mHeadsetReceiver); synchronized (mStateMachines) { Loading Loading @@ -256,6 +255,7 @@ public class HeadsetService extends ProfileService { } // Step 4: Destroy native interface mNativeInterface.cleanup(); setHeadsetService(null); // Step 3: Destroy system interface mSystemInterface.stop(); // Step 2: Stop handler thread Loading