diff options
author | Dave Mankoff <mankoff@google.com> | 2020-08-03 11:51:50 -0400 |
---|---|---|
committer | Dave Mankoff <mankoff@google.com> | 2020-08-24 12:57:23 -0400 |
commit | 93dd88388b075e21f7deae648c553335fd49805c (patch) | |
tree | cddc1569d4b98cd80a05d1c35e112b831735aff3 /packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java | |
parent | cd42c08702ef6cc25b974521ef9376e3b0d48bf8 (diff) |
Remove ref to Controller from KeyguardSliceView
This removes the reference that the view has to its controller,
moving click handling up to the controller.
Fixes: 162525274
Test: atest SystemUITEsts
Change-Id: Ia99ff4e643fa84fa138720cc5c01c51597f1169d
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java index 33985bcb8c49..be21d203411e 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java @@ -131,6 +131,7 @@ public class KeyguardDisplayManager { Presentation presentation = mPresentations.get(displayId); if (presentation == null) { final Presentation newPresentation = new KeyguardPresentation(mContext, display, + mKeyguardStatusViewComponentFactory, mInjectableInflater.injectable(LayoutInflater.from(mContext))); newPresentation.setOnDismissListener(dialog -> { if (newPresentation.equals(mPresentations.get(displayId))) { @@ -145,9 +146,6 @@ public class KeyguardDisplayManager { presentation = null; } if (presentation != null) { - mKeyguardStatusViewComponentFactory - .build(presentation.findViewById(R.id.clock)) - .getKeyguardClockSwitchController().init(); mPresentations.append(displayId, presentation); return true; } @@ -251,7 +249,9 @@ public class KeyguardDisplayManager { static final class KeyguardPresentation extends Presentation { 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 LayoutInflater mInjectableLayoutInflater; + private KeyguardClockSwitchController mKeyguardClockSwitchController; private View mClock; private int mUsableWidth; private int mUsableHeight; @@ -269,8 +269,10 @@ public class KeyguardDisplayManager { }; KeyguardPresentation(Context context, Display display, + KeyguardStatusViewComponent.Factory keyguardStatusViewComponentFactory, LayoutInflater injectionLayoutInflater) { super(context, display, R.style.Theme_SystemUI_KeyguardPresentation); + mKeyguardStatusViewComponentFactory = keyguardStatusViewComponentFactory; mInjectableLayoutInflater = injectionLayoutInflater; getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); setCancelable(false); @@ -312,6 +314,12 @@ public class KeyguardDisplayManager { // Avoid screen burn in mClock.post(mMoveTextRunnable); + + mKeyguardClockSwitchController = mKeyguardStatusViewComponentFactory + .build(findViewById(R.id.clock)) + .getKeyguardClockSwitchController(); + + mKeyguardClockSwitchController.init(); } } } |