Fix the memory leak in BatteryStatsImpl.Timebase.mObservers.
The observer does not always remove themself after adding themself into mObservers list. The strong reference in mObservers causes memory leak. The fix is to change mObservers to hold WeakReference. Fix: 80443940 Test: "adb shell cmd battery unplug" and "adb shell cmd battery set ac", observe memory usage from Android Monitor. Change-Id: I27436e350fa0d211c4c64114411a6603824ce599
Loading
Please register or sign in to comment