diff options
author | Dave Mankoff <mankoff@google.com> | 2020-09-09 17:32:05 -0400 |
---|---|---|
committer | Dave Mankoff <mankoff@google.com> | 2020-09-16 16:24:11 -0400 |
commit | 21d6698b4a4c9725f2ad88dda8db486d40e73c17 (patch) | |
tree | 04352d468cbdc661166e5d6fdba96101c0ce9ccc /packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java | |
parent | 2f557d8922031f62bf3194589e990a7dd8378e64 (diff) |
6/N Add Controller for KeyguardPatternView
Test: manual && atest SystemUITests
Bug: 166448040
Change-Id: I90ab99b2f241e21fdfcaeefb2e9443a1d3f2c9be
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java index 83fcac6579f2..552e62052e6f 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java @@ -19,6 +19,7 @@ package com.android.keyguard; import android.content.res.ColorStateList; import android.view.MotionEvent; +import com.android.internal.util.LatencyTracker; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.systemui.util.ViewController; @@ -27,18 +28,21 @@ import javax.inject.Inject; /** Controller for a {@link KeyguardSecurityView}. */ -public class KeyguardInputViewController extends ViewController<KeyguardInputView> +public class KeyguardInputViewController<T extends KeyguardInputView> extends ViewController<T> implements KeyguardSecurityView { private final SecurityMode mSecurityMode; private final LockPatternUtils mLockPatternUtils; + private final KeyguardSecurityCallback mKeyguardSecurityCallback; + private KeyguardMessageAreaController mMessageAreaController; - private KeyguardInputViewController(KeyguardInputView view, SecurityMode securityMode, + protected KeyguardInputViewController(T view, SecurityMode securityMode, LockPatternUtils lockPatternUtils, KeyguardSecurityCallback keyguardSecurityCallback) { super(view); mSecurityMode = securityMode; mLockPatternUtils = lockPatternUtils; + mKeyguardSecurityCallback = keyguardSecurityCallback; mView.setKeyguardCallback(keyguardSecurityCallback); } @@ -143,17 +147,31 @@ public class KeyguardInputViewController extends ViewController<KeyguardInputVie /** Factory for a {@link KeyguardInputViewController}. */ public static class Factory { + private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final LockPatternUtils mLockPatternUtils; + private final LatencyTracker mLatencyTracker; + private final KeyguardMessageAreaController.Factory mMessageAreaControllerFactory; @Inject - public Factory(LockPatternUtils lockPatternUtils) { + public Factory(KeyguardUpdateMonitor keyguardUpdateMonitor, + LockPatternUtils lockPatternUtils, + LatencyTracker latencyTracker, + KeyguardMessageAreaController.Factory messageAreaControllerFactory) { + mKeyguardUpdateMonitor = keyguardUpdateMonitor; mLockPatternUtils = lockPatternUtils; + mLatencyTracker = latencyTracker; + mMessageAreaControllerFactory = messageAreaControllerFactory; } /** Create a new {@link KeyguardInputViewController}. */ public KeyguardInputViewController create(KeyguardInputView keyguardInputView, SecurityMode securityMode, KeyguardSecurityCallback keyguardSecurityCallback) { - return new KeyguardInputViewController(keyguardInputView, securityMode, + if (keyguardInputView instanceof KeyguardPatternView) { + return new KeyguardPatternViewController((KeyguardPatternView) keyguardInputView, + mKeyguardUpdateMonitor, securityMode, mLockPatternUtils, + keyguardSecurityCallback, mLatencyTracker, mMessageAreaControllerFactory); + } + return new KeyguardInputViewController<>(keyguardInputView, securityMode, mLockPatternUtils, keyguardSecurityCallback); } } |