Skip to content

Commit 00baebe

Browse files
author
Craig Mautner
committed
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
1 parent cd03a26 commit 00baebe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,9 @@ private void maybeCreateKeyguardLocked(boolean enableScreenRotation) {
164164
}
165165

166166
private void inflateKeyguardView() {
167-
if (mKeyguardView != null) {
168-
mKeyguardHost.removeView(mKeyguardView);
167+
View v = mKeyguardHost.findViewById(R.id.keyguard_host_view);
168+
if (v != null) {
169+
mKeyguardHost.removeView(v);
169170
}
170171
// TODO: Remove once b/7094175 is fixed
171172
Slog.d(TAG, "inflateKeyguardView: b/7094175 mContext.config="

0 commit comments

Comments
 (0)