summaryrefslogtreecommitdiff
path: root/framework/java/android
diff options
context:
space:
mode:
authorWilliam Escande <wescande@google.com>2022-04-15 16:07:25 -0700
committerWilliam Escande <wescande@google.com>2022-04-15 16:12:37 -0700
commitef67156ab814526f18c2aaac306ff6f09110f8b6 (patch)
treed3969cfdd79e3f7153642b71bbc9273c40bc51e4 /framework/java/android
parentb190025d78ac49a4608fff163a3661267d186b57 (diff)
Restore devices volume after bluetooth restart
At AvrcpVolumeManager startup, we tried to read the sharedPref and to save it in the memory. A clean is performed on this list to remove non-bonded devices. The issue here is that the getBondState was returning BOND_NONE for all devices due to check perform on the adapter State. We don't know why the adapter is not reported as STATE_ON at this point but this check was added on all method to sanitize the shutdown process. Because this is a cached value there is no risk from a crash at shutdown Fix: 228415780 Ignore-AOSP-First: No caching done on AOSP Test: Manual testing Change-Id: I52362c3b511054abcb88e0cb83df95ba74c62ef4
Diffstat (limited to 'framework/java/android')
-rw-r--r--framework/java/android/bluetooth/BluetoothDevice.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java
index 222df3286a..d1e33c4454 100644
--- a/framework/java/android/bluetooth/BluetoothDevice.java
+++ b/framework/java/android/bluetooth/BluetoothDevice.java
@@ -1914,7 +1914,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
if (DBG) log("getBondState() uncached");
final IBluetooth service = sService;
final int defaultValue = BOND_NONE;
- if (service == null || !isBluetoothEnabled()) {
+ if (service == null) {
Log.e(TAG, "BT not enabled. Cannot get bond state");
if (DBG) log(Log.getStackTraceString(new Throwable()));
} else {