diff options
author | Ben Murdoch <benm@google.com> | 2021-01-11 11:42:41 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2021-01-20 12:58:40 +0000 |
commit | 31369c21638e16f5c1c5dcb2e8c3c68dc22e064c (patch) | |
tree | 4a3e6cd84b29fac81a7b8f798280ebab3242ad7a /packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java | |
parent | cfcab3dc3cd8ad71bea304547cf578a567f5de36 (diff) |
Workaround SysUI crash with incorrect Context for Theme.
Using Context without the Theme information attached means we end up
crashing on the keyguard on a secondary display.
Bug: 175669925
Test: Manually verify no longer crashing
Change-Id: I24dcc128c21f5f719645d8298c43825eb6388694
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java index 77e568c66a9d..a40dc7abf063 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java @@ -255,6 +255,7 @@ public class KeyguardDisplayManager { private static final int VIDEO_SAFE_REGION = 80; // Percentage of display width & height private static final int MOVE_CLOCK_TIMEOUT = 10000; // 10s private final KeyguardStatusViewComponent.Factory mKeyguardStatusViewComponentFactory; + private final Context mContext; private KeyguardClockSwitchController mKeyguardClockSwitchController; private View mClock; private int mUsableWidth; @@ -278,6 +279,7 @@ public class KeyguardDisplayManager { WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); mKeyguardStatusViewComponentFactory = keyguardStatusViewComponentFactory; setCancelable(false); + mContext = context; } @Override @@ -301,7 +303,7 @@ public class KeyguardDisplayManager { mMarginLeft = (100 - VIDEO_SAFE_REGION) * bounds.width() / 200; mMarginTop = (100 - VIDEO_SAFE_REGION) * bounds.height() / 200; - setContentView(LayoutInflater.from(getContext()) + setContentView(LayoutInflater.from(mContext) .inflate(R.layout.keyguard_presentation, null)); // Logic to make the lock screen fullscreen |