diff options
author | Winson Chung <winsonc@google.com> | 2012-11-01 18:05:04 -0700 |
---|---|---|
committer | The Android Automerger <android-build@android.com> | 2012-11-01 23:43:30 -0700 |
commit | 90d0db346a203e196eb5b405a6c488dd5bf6164b (patch) | |
tree | 117a15d1c4fce01dd29103642c72574b24084e74 | |
parent | 4b22662d95952790e607044cb425e9225b9ca191 (diff) | |
download | frameworks_base-90d0db346a203e196eb5b405a6c488dd5bf6164b.zip frameworks_base-90d0db346a203e196eb5b405a6c488dd5bf6164b.tar.gz frameworks_base-90d0db346a203e196eb5b405a6c488dd5bf6164b.tar.bz2 |
Cleaning up keyguard persistence threads when the pager is detached. (Bug 7460991)
Change-Id: I28ebbd04d90a1ea2a721c28d3bce7ccea31a33e9
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java index b023573..f04c4df 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java @@ -98,6 +98,16 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit mBgPersistenceWorkerHandler = new Handler(mBgPersistenceWorkerThread.getLooper()); } + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + + // Clean up the persistence worker thread + if (mBgPersistenceWorkerThread != null) { + mBgPersistenceWorkerThread.quit(); + } + } + public void setViewStateManager(KeyguardViewStateManager viewStateManager) { mViewStateManager = viewStateManager; } |