Fix memory leak in Bluetooth settings
Bluetooth settings screen has two categories. Each category should call
removeAll() method to unregister a callback from CachedBluetoothDevice.
But the method is not called for mPairedDevicesCategory.
Bug: 30004142
Test: manual - connect to Bluetooth device and then
open and close Bluetooth settings screen repeatedly
Change-Id: I5a72994473ee2bb5fc3ad00176d9a930b4839099
diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java
index c352e47..a8e56bf 100644
--- a/src/com/android/settings/bluetooth/BluetoothSettings.java
+++ b/src/com/android/settings/bluetooth/BluetoothSettings.java
@@ -210,6 +210,7 @@
@Override
public void onStop() {
super.onStop();
+ mPairedDevicesCategory.removeAll();
if (mBluetoothEnabler != null) {
mBluetoothEnabler.pause();
}