summaryrefslogtreecommitdiff
path: root/packages/Keyguard
diff options
context:
space:
mode:
authorMichal Karpinski <mkarpinski@google.com>2017-01-13 18:18:49 +0000
committerMichal Karpinski <mkarpinski@google.com>2017-01-23 14:53:56 +0000
commite71f583c782a98e977d6a5c450dff856b132e5c6 (patch)
tree01b800cc4f6a54d4937e174d4e164129bdef638a /packages/Keyguard
parentcc9224c8d4f74987d08cef3c70f88873ae06656d (diff)
Strong auth timeout refactor
Move timeout scheduling mechanism from KeyguardUpdateMonitor to LockSettingsStrongAuth. Move reporting about successful strong auth unlock from KeyguardUpdateMonitor#reportSuccessfulStrongAuthUnlockAttempt() to LockSettingsService#doVerifyCredential() - the latter also covers work challenge strong auth unlocking. Test: manual with all types of strong and non-strong auth, including work challenge Bug: 29825955 Change-Id: I38e51b21e3a455b95e3c857e091fe07ee388c7f8
Diffstat (limited to 'packages/Keyguard')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java38
1 files changed, 0 insertions, 38 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 0a7bdbf01e43..80d4a264cac8 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -26,7 +26,6 @@ import static android.os.BatteryManager.EXTRA_MAX_CHARGING_CURRENT;
import static android.os.BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE;
import static android.os.BatteryManager.EXTRA_PLUGGED;
import static android.os.BatteryManager.EXTRA_STATUS;
-import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_TIMEOUT;
import android.app.ActivityManager;
import android.app.AlarmManager;
@@ -106,12 +105,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private static final String ACTION_FACE_UNLOCK_STOPPED
= "com.android.facelock.FACE_UNLOCK_STOPPED";
- private static final String ACTION_STRONG_AUTH_TIMEOUT =
- "com.android.systemui.ACTION_STRONG_AUTH_TIMEOUT";
- private static final String USER_ID = "com.android.systemui.USER_ID";
-
- private static final String PERMISSION_SELF = "com.android.systemui.permission.SELF";
-
// Callback messages
private static final int MSG_TIME_UPDATE = 301;
private static final int MSG_BATTERY_UPDATE = 302;
@@ -203,7 +196,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private boolean mDeviceInteractive;
private boolean mScreenOn;
private SubscriptionManager mSubscriptionManager;
- private AlarmManager mAlarmManager;
private List<SubscriptionInfo> mSubscriptionInfo;
private TrustManager mTrustManager;
private UserManager mUserManager;
@@ -588,26 +580,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
public void reportSuccessfulStrongAuthUnlockAttempt() {
- scheduleStrongAuthTimeout();
if (mFpm != null) {
byte[] token = null; /* TODO: pass real auth token once fp HAL supports it */
mFpm.resetTimeout(token);
}
}
- private void scheduleStrongAuthTimeout() {
- final DevicePolicyManager dpm =
- (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
- long when = SystemClock.elapsedRealtime() + dpm.getRequiredStrongAuthTimeout(null,
- sCurrentUser);
- Intent intent = new Intent(ACTION_STRONG_AUTH_TIMEOUT);
- intent.putExtra(USER_ID, sCurrentUser);
- PendingIntent sender = PendingIntent.getBroadcast(mContext,
- sCurrentUser, intent, PendingIntent.FLAG_CANCEL_CURRENT);
- mAlarmManager.set(AlarmManager.ELAPSED_REALTIME, when, sender);
- notifyStrongAuthStateChanged(sCurrentUser);
- }
-
private void notifyStrongAuthStateChanged(int userId) {
for (int i = 0; i < mCallbacks.size(); i++) {
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
@@ -723,17 +701,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
};
- private final BroadcastReceiver mStrongAuthTimeoutReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (ACTION_STRONG_AUTH_TIMEOUT.equals(intent.getAction())) {
- int userId = intent.getIntExtra(USER_ID, -1);
- mLockPatternUtils.requireStrongAuth(STRONG_AUTH_REQUIRED_AFTER_TIMEOUT, userId);
- notifyStrongAuthStateChanged(userId);
- }
- }
- };
-
private final FingerprintManager.LockoutResetCallback mLockoutResetCallback
= new FingerprintManager.LockoutResetCallback() {
@Override
@@ -1034,7 +1001,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private KeyguardUpdateMonitor(Context context) {
mContext = context;
mSubscriptionManager = SubscriptionManager.from(context);
- mAlarmManager = context.getSystemService(AlarmManager.class);
mDeviceProvisioned = isDeviceProvisionedInSettingsDb();
mStrongAuthTracker = new StrongAuthTracker(context);
@@ -1094,10 +1060,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
e.rethrowAsRuntimeException();
}
- IntentFilter strongAuthTimeoutFilter = new IntentFilter();
- strongAuthTimeoutFilter.addAction(ACTION_STRONG_AUTH_TIMEOUT);
- context.registerReceiver(mStrongAuthTimeoutReceiver, strongAuthTimeoutFilter,
- PERMISSION_SELF, null /* handler */);
mTrustManager = (TrustManager) context.getSystemService(Context.TRUST_SERVICE);
mTrustManager.registerTrustListener(this);
mLockPatternUtils = new LockPatternUtils(context);