am b51e34c3: am fb6f6f24: am 2c632c88: Merge "Invoke strong auth callback and default strong auth expired to true" into mnc-dr-dev

* commit 'b51e34c35f5ef979cfc8ea6b1dfec7fc97c15a9a':
  Invoke strong auth callback and default strong auth expired to true
This commit is contained in:
Adrian Roos
2015-08-22 00:41:04 +00:00
committed by Android Git Automerger
5 changed files with 13 additions and 13 deletions

View File

@@ -182,7 +182,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private SparseIntArray mFailedAttempts = new SparseIntArray(); private SparseIntArray mFailedAttempts = new SparseIntArray();
/** Tracks whether strong authentication hasn't been used since quite some time per user. */ /** Tracks whether strong authentication hasn't been used since quite some time per user. */
private ArraySet<Integer> mStrongAuthTimedOut = new ArraySet<>(); private ArraySet<Integer> mStrongAuthNotTimedOut = new ArraySet<>();
private final StrongAuthTracker mStrongAuthTracker = new StrongAuthTracker(); private final StrongAuthTracker mStrongAuthTracker = new StrongAuthTracker();
private final ArrayList<WeakReference<KeyguardUpdateMonitorCallback>> private final ArrayList<WeakReference<KeyguardUpdateMonitorCallback>>
@@ -553,11 +553,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
* while and thus can't unlock with fingerprint, false otherwise * while and thus can't unlock with fingerprint, false otherwise
*/ */
public boolean hasFingerprintUnlockTimedOut(int userId) { public boolean hasFingerprintUnlockTimedOut(int userId) {
return mStrongAuthTimedOut.contains(userId); return !mStrongAuthNotTimedOut.contains(userId);
} }
public void reportSuccessfulStrongAuthUnlockAttempt() { public void reportSuccessfulStrongAuthUnlockAttempt() {
mStrongAuthTimedOut.remove(sCurrentUser); mStrongAuthNotTimedOut.add(sCurrentUser);
scheduleStrongAuthTimeout(); scheduleStrongAuthTimeout();
if (mFpm != null) { if (mFpm != null) {
byte[] token = null; /* TODO: pass real auth token once fp HAL supports it */ byte[] token = null; /* TODO: pass real auth token once fp HAL supports it */
@@ -572,14 +572,14 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
PendingIntent sender = PendingIntent.getBroadcast(mContext, PendingIntent sender = PendingIntent.getBroadcast(mContext,
sCurrentUser, intent, PendingIntent.FLAG_CANCEL_CURRENT); sCurrentUser, intent, PendingIntent.FLAG_CANCEL_CURRENT);
mAlarmManager.set(AlarmManager.ELAPSED_REALTIME, when, sender); mAlarmManager.set(AlarmManager.ELAPSED_REALTIME, when, sender);
notifyStrongAuthTimedOutChanged(sCurrentUser); notifyStrongAuthStateChanged(sCurrentUser);
} }
private void notifyStrongAuthTimedOutChanged(int userId) { private void notifyStrongAuthStateChanged(int userId) {
for (int i = 0; i < mCallbacks.size(); i++) { for (int i = 0; i < mCallbacks.size(); i++) {
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
if (cb != null) { if (cb != null) {
cb.onStrongAuthTimeoutExpiredChanged(userId); cb.onStrongAuthStateChanged(userId);
} }
} }
} }
@@ -674,8 +674,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (ACTION_STRONG_AUTH_TIMEOUT.equals(intent.getAction())) { if (ACTION_STRONG_AUTH_TIMEOUT.equals(intent.getAction())) {
int userId = intent.getIntExtra(USER_ID, -1); int userId = intent.getIntExtra(USER_ID, -1);
mStrongAuthTimedOut.add(userId); mStrongAuthNotTimedOut.remove(userId);
notifyStrongAuthTimedOutChanged(userId); notifyStrongAuthStateChanged(userId);
} }
} }
}; };
@@ -848,7 +848,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
@Override @Override
public void onStrongAuthRequiredChanged(int userId) { public void onStrongAuthRequiredChanged(int userId) {
// do something? notifyStrongAuthStateChanged(userId);
} }
} }

View File

@@ -233,5 +233,5 @@ public class KeyguardUpdateMonitorCallback {
* Called when the state that the user hasn't used strong authentication since quite some time * Called when the state that the user hasn't used strong authentication since quite some time
* has changed. * has changed.
*/ */
public void onStrongAuthTimeoutExpiredChanged(int userId) { } public void onStrongAuthStateChanged(int userId) { }
} }

View File

@@ -649,7 +649,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
} }
@Override @Override
public void onStrongAuthTimeoutExpiredChanged(int userId) { public void onStrongAuthStateChanged(int userId) {
mLockIcon.update(); mLockIcon.update();
} }
}; };

View File

@@ -52,7 +52,7 @@ public class KeyguardBouncer {
private KeyguardUpdateMonitorCallback mUpdateMonitorCallback = private KeyguardUpdateMonitorCallback mUpdateMonitorCallback =
new KeyguardUpdateMonitorCallback() { new KeyguardUpdateMonitorCallback() {
@Override @Override
public void onStrongAuthTimeoutExpiredChanged(int userId) { public void onStrongAuthStateChanged(int userId) {
mBouncerPromptReason = mCallback.getBouncerPromptReason(); mBouncerPromptReason = mCallback.getBouncerPromptReason();
} }
}; };

View File

@@ -145,7 +145,7 @@ public class UnlockMethodCache {
} }
@Override @Override
public void onStrongAuthTimeoutExpiredChanged(int userId) { public void onStrongAuthStateChanged(int userId) {
update(false /* updateAlways */); update(false /* updateAlways */);
} }
}; };