summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2011-10-16 12:46:06 -0700
committerJim Miller <jaggies@google.com>2011-10-16 12:46:06 -0700
commit7b5dd87351ac476dd872c51f9b819d2a3e572382 (patch)
tree9556f77ffdb632a6005059e9cf5932ee580b4d55 /policy
parente6b680364dd992907a8d2037685a2e500d188dfb (diff)
downloadframeworks_base-7b5dd87351ac476dd872c51f9b819d2a3e572382.zip
frameworks_base-7b5dd87351ac476dd872c51f9b819d2a3e572382.tar.gz
frameworks_base-7b5dd87351ac476dd872c51f9b819d2a3e572382.tar.bz2
Fix 5466793: Fix memory leak in system process when face lock is enabled.
Previously, the code was not unregistering the callback when we unlocked the device, which kept a reference to LockPatternKeyguardView indirectly by a reference to mFaceLockCallback. It now correcly removes the callback when we unlock the device. Change-Id: Ie592d007a1dfc2416b9e8956aba2c34e3d0120ee
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
index b91503b..ebf380a 100644
--- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
+++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java
@@ -782,6 +782,15 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
mUnlockScreen = null;
}
mUpdateMonitor.removeCallback(this);
+ if (mFaceLockService != null) {
+ try {
+ mFaceLockService.unregisterCallback(mFaceLockCallback);
+ } catch (RemoteException e) {
+ // Not much we can do
+ }
+ stopFaceLock();
+ mFaceLockService = null;
+ }
}
private boolean isSecure() {
@@ -1206,6 +1215,13 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
if (mBoundToFaceLockService) {
if (DEBUG) Log.d(TAG, "before unbind from FaceLock service");
+ if (mFaceLockService != null) {
+ try {
+ mFaceLockService.unregisterCallback(mFaceLockCallback);
+ } catch (RemoteException e) {
+ // Not much we can do
+ }
+ }
mContext.unbindService(mFaceLockConnection);
if (DEBUG) Log.d(TAG, "after unbind from FaceLock service");
mBoundToFaceLockService = false;