summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java54
1 files changed, 11 insertions, 43 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
index c73149c7a8b9..552e62052e6f 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
@@ -17,31 +17,32 @@
package com.android.keyguard;
import android.content.res.ColorStateList;
-import android.content.res.Resources;
-import android.telephony.TelephonyManager;
import android.view.MotionEvent;
-import android.view.inputmethod.InputMethodManager;
import com.android.internal.util.LatencyTracker;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
-import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.util.ViewController;
-import com.android.systemui.util.concurrency.DelayableExecutor;
import javax.inject.Inject;
/** Controller for a {@link KeyguardSecurityView}. */
-public abstract class KeyguardInputViewController<T extends KeyguardInputView>
- extends ViewController<T> implements KeyguardSecurityView {
+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;
protected KeyguardInputViewController(T view, SecurityMode securityMode,
+ LockPatternUtils lockPatternUtils,
KeyguardSecurityCallback keyguardSecurityCallback) {
super(view);
mSecurityMode = securityMode;
+ mLockPatternUtils = lockPatternUtils;
+ mKeyguardSecurityCallback = keyguardSecurityCallback;
mView.setKeyguardCallback(keyguardSecurityCallback);
}
@@ -150,29 +151,16 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView>
private final LockPatternUtils mLockPatternUtils;
private final LatencyTracker mLatencyTracker;
private final KeyguardMessageAreaController.Factory mMessageAreaControllerFactory;
- private final InputMethodManager mInputMethodManager;
- private final DelayableExecutor mMainExecutor;
- private final Resources mResources;
- private LiftToActivateListener mLiftToActivateListener;
- private TelephonyManager mTelephonyManager;
@Inject
public Factory(KeyguardUpdateMonitor keyguardUpdateMonitor,
LockPatternUtils lockPatternUtils,
LatencyTracker latencyTracker,
- KeyguardMessageAreaController.Factory messageAreaControllerFactory,
- InputMethodManager inputMethodManager, @Main DelayableExecutor mainExecutor,
- @Main Resources resources, LiftToActivateListener liftToActivateListener,
- TelephonyManager telephonyManager) {
+ KeyguardMessageAreaController.Factory messageAreaControllerFactory) {
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mLockPatternUtils = lockPatternUtils;
mLatencyTracker = latencyTracker;
mMessageAreaControllerFactory = messageAreaControllerFactory;
- mInputMethodManager = inputMethodManager;
- mMainExecutor = mainExecutor;
- mResources = resources;
- mLiftToActivateListener = liftToActivateListener;
- mTelephonyManager = telephonyManager;
}
/** Create a new {@link KeyguardInputViewController}. */
@@ -182,29 +170,9 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView>
return new KeyguardPatternViewController((KeyguardPatternView) keyguardInputView,
mKeyguardUpdateMonitor, securityMode, mLockPatternUtils,
keyguardSecurityCallback, mLatencyTracker, mMessageAreaControllerFactory);
- } else if (keyguardInputView instanceof KeyguardPasswordView) {
- return new KeyguardPasswordViewController((KeyguardPasswordView) keyguardInputView,
- mKeyguardUpdateMonitor, securityMode, mLockPatternUtils,
- keyguardSecurityCallback, mMessageAreaControllerFactory, mLatencyTracker,
- mInputMethodManager, mMainExecutor, mResources);
- } else if (keyguardInputView instanceof KeyguardPINView) {
- return new KeyguardPinViewController((KeyguardPINView) keyguardInputView,
- mKeyguardUpdateMonitor, securityMode, mLockPatternUtils,
- keyguardSecurityCallback, mMessageAreaControllerFactory, mLatencyTracker,
- mLiftToActivateListener);
- } else if (keyguardInputView instanceof KeyguardSimPinView) {
- return new KeyguardSimPinViewController((KeyguardSimPinView) keyguardInputView,
- mKeyguardUpdateMonitor, securityMode, mLockPatternUtils,
- keyguardSecurityCallback, mMessageAreaControllerFactory, mLatencyTracker,
- mLiftToActivateListener, mTelephonyManager);
- } else if (keyguardInputView instanceof KeyguardSimPukView) {
- return new KeyguardSimPukViewController((KeyguardSimPukView) keyguardInputView,
- mKeyguardUpdateMonitor, securityMode, mLockPatternUtils,
- keyguardSecurityCallback, mMessageAreaControllerFactory, mLatencyTracker,
- mLiftToActivateListener, mTelephonyManager);
}
-
- throw new RuntimeException("Unable to find controller for " + keyguardInputView);
+ return new KeyguardInputViewController<>(keyguardInputView, securityMode,
+ mLockPatternUtils, keyguardSecurityCallback);
}
}
}