From 36c25af6a1b8fa2b9c5b0a3b5d419935fc9507b5 Mon Sep 17 00:00:00 2001 From: "mingliang.x.lei" Date: Wed, 9 Mar 2016 14:30:55 +0800 Subject: [PATCH] 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 --- src/com/android/settings/bluetooth/BluetoothSettings.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java index c352e4796a6..a8e56bf56e7 100644 --- a/src/com/android/settings/bluetooth/BluetoothSettings.java +++ b/src/com/android/settings/bluetooth/BluetoothSettings.java @@ -210,6 +210,7 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem @Override public void onStop() { super.onStop(); + mPairedDevicesCategory.removeAll(); if (mBluetoothEnabler != null) { mBluetoothEnabler.pause(); }