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
This commit is contained in:
mingliang.x.lei
2016-03-09 14:30:55 +08:00
committed by Yoshinori Hirano
parent 3cbae7d6b5
commit 36c25af6a1

View File

@@ -210,6 +210,7 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
@Override @Override
public void onStop() { public void onStop() {
super.onStop(); super.onStop();
mPairedDevicesCategory.removeAll();
if (mBluetoothEnabler != null) { if (mBluetoothEnabler != null) {
mBluetoothEnabler.pause(); mBluetoothEnabler.pause();
} }