summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2012-09-28 15:22:39 -0700
committerCraig Mautner <cmautner@google.com>2012-09-28 15:32:31 -0700
commit00baebe124701903db8eb35abb087767c5d769a5 (patch)
tree9bbd5bc532be58258b7b2e98932c4b030bae4f9c /policy
parentcd03a26f4f5663b40d4679de102519ccc163fa10 (diff)
downloadframeworks_base-00baebe124701903db8eb35abb087767c5d769a5.zip
frameworks_base-00baebe124701903db8eb35abb087767c5d769a5.tar.gz
frameworks_base-00baebe124701903db8eb35abb087767c5d769a5.tar.bz2
Keep callback reference from being null.
The hide call delays removal of mKeyguardView but the inflate call occurred before the delay expired. The method inflateKeyguardView would have removed it except hide() also nulled out mKeyguardView. Consequently there were two KeyguardHostViews in the view hierarchy. The findViewById returned the first view which got the callback assigned. Later that view was removed from the hierarchy and when the new view was called it had no callback assigned => NPE! This fix removes the KeyguardHostView from the mKeyguardHost by referncing the id rather than the null mKeyguardView. Fixes bug 7250008. Change-Id: Ic9da3415d72187628f06271c12d5184f9d01059b
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
index ebdb116..1abcc10 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
@@ -164,8 +164,9 @@ public class KeyguardViewManager {
}
private void inflateKeyguardView() {
- if (mKeyguardView != null) {
- mKeyguardHost.removeView(mKeyguardView);
+ View v = mKeyguardHost.findViewById(R.id.keyguard_host_view);
+ if (v != null) {
+ mKeyguardHost.removeView(v);
}
// TODO: Remove once b/7094175 is fixed
Slog.d(TAG, "inflateKeyguardView: b/7094175 mContext.config="