OSDN Git Service

Fix memory leak and slowness in keyguard
authorJim Miller <jaggies@google.com>
Wed, 16 Oct 2013 03:09:07 +0000 (20:09 -0700)
committerJim Miller <jaggies@google.com>
Wed, 16 Oct 2013 03:11:50 +0000 (20:11 -0700)
This fixes an issue where the mUpdateSeekBars runnable was being
repeatedly posted to the handler while keeping a reference to
the transport control (and hence keyguard).  Even after the view
was detached from keyguard it would continue to post events that
would ultimately keep the instance of keyguard from being GC'd and
cause keyguard to slow down.

Fixes 11169793

Change-Id: If2bb238adf6d78101589926b60a61d9f187c6d1c

packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java

index b7720ef..a48f23e 100644 (file)
@@ -322,6 +322,7 @@ public class KeyguardTransportControlView extends FrameLayout {
         mAudioManager.unregisterRemoteController(mRemoteController);
         KeyguardUpdateMonitor.getInstance(mContext).removeCallback(mUpdateMonitor);
         mUserSeeking = false;
+        removeCallbacks(mUpdateSeekBars);
     }
 
     void setBadgeIcon(Drawable bmp) {