diff options
author | weichinweng <weichinweng@google.com> | 2020-03-05 10:37:44 +0800 |
---|---|---|
committer | Weichin Weng <weichinweng@google.com> | 2020-03-09 05:09:08 +0000 |
commit | e18a909013a8f521a0876ab5fd67c2ec8d151323 (patch) | |
tree | 473cb31bda93669b416a0f91cf590af57c1be9f4 /framework/java/android/bluetooth/BluetoothAdapter.java | |
parent | 8e5098e0fa6485c9587faf466ae3efd78606a9e1 (diff) |
Fix bluetooth can't turn off during network reset (2/3)
Remove disable Bluetooth action from AdapterService and move to
BluetoothManagerService.
Add factory reset reason into Bluetooth enable/disable reason list.
Bug: 110181479
Test: manual
Change-Id: I4bff3c3bb75fbb0d1e13c459c0d9d3fd3b8b3195
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index 66bfcbd27c..6ae68fcad6 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -1229,10 +1229,11 @@ public final class BluetoothAdapter { public boolean factoryReset() { try { mServiceLock.readLock().lock(); - if (mService != null) { - return mService.factoryReset(); + if (mService != null && mService.factoryReset() + && mManagerService != null && mManagerService.onFactoryReset()) { + return true; } - Log.e(TAG, "factoryReset(): IBluetooth Service is null"); + Log.e(TAG, "factoryReset(): Setting persist.bluetooth.factoryreset to retry later"); SystemProperties.set("persist.bluetooth.factoryreset", "true"); } catch (RemoteException e) { Log.e(TAG, "", e); |