diff options
author | Hansong Zhang <hsz@google.com> | 2018-11-12 14:04:33 -0800 |
---|---|---|
committer | Chienyuan <chienyuanhuang@google.com> | 2019-01-02 21:25:10 +0800 |
commit | 8476119b90f4e01c213dd3a2e89848468e12828a (patch) | |
tree | e18269c19a2139a5e16692ca7f5afde4e76d0be0 /src | |
parent | d55c856b38a56af6998d029a6750002148cfac85 (diff) | |
download | android_packages_apps_Bluetooth-8476119b90f4e01c213dd3a2e89848468e12828a.tar.gz android_packages_apps_Bluetooth-8476119b90f4e01c213dd3a2e89848468e12828a.tar.bz2 android_packages_apps_Bluetooth-8476119b90f4e01c213dd3a2e89848468e12828a.zip |
MAP: Don't start/stop on broadcast intent
Only use start/stop command from adapter service
Bug: 113172399
Bug: 122228393
Test: manual
Change-Id: Id36b375382995178cc50f963e3ab0b010a027386
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/bluetooth/map/BluetoothMapService.java | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapService.java b/src/com/android/bluetooth/map/BluetoothMapService.java index c00b39ba0..bfb1d3fcb 100644 --- a/src/com/android/bluetooth/map/BluetoothMapService.java +++ b/src/com/android/bluetooth/map/BluetoothMapService.java @@ -348,9 +348,7 @@ public class BluetoothMapService extends ProfileService { updateMasInstancesHandler(); break; case START_LISTENER: - if (mAdapter.isEnabled()) { - startSocketListeners(msg.arg1); - } + startSocketListeners(msg.arg1); break; case MSG_MAS_CONNECT: onConnectHandler(msg.arg1); @@ -606,7 +604,6 @@ public class BluetoothMapService extends ProfileService { IntentFilter filter = new IntentFilter(); filter.addAction(BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY); - filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED); filter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED); filter.addAction(BluetoothDevice.ACTION_SDP_RECORD); filter.addAction(ACTION_SHOW_MAPS_SETTINGS); @@ -988,30 +985,11 @@ public class BluetoothMapService extends ProfileService { private class MapBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - if (DEBUG) { - Log.d(TAG, "onReceive"); - } String action = intent.getAction(); if (DEBUG) { Log.d(TAG, "onReceive: " + action); } - if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { - int state = - intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); - if (state == BluetoothAdapter.STATE_TURNING_OFF) { - if (DEBUG) { - Log.d(TAG, "STATE_TURNING_OFF"); - } - sendShutdownMessage(); - } else if (state == BluetoothAdapter.STATE_ON) { - if (DEBUG) { - Log.d(TAG, "STATE_ON"); - } - // start ServerSocket listener threads - sendStartListenerMessage(-1); - } - - } else if (action.equals(USER_CONFIRM_TIMEOUT_ACTION)) { + if (action.equals(USER_CONFIRM_TIMEOUT_ACTION)) { if (DEBUG) { Log.d(TAG, "USER_CONFIRM_TIMEOUT ACTION Received."); } |