Disable fingerprint when remotely reset by DPM

When the device is lost or stolen, it's safer to
fall back to strong authentication (pin, pattern or
password).  This disables fingerprint like we do with
trust agents.

Fixes bug 21620081

Change-Id: I7bbe54be3721b2f160b783daeb3acbe434705046
This commit is contained in:
Jim Miller
2015-08-05 13:03:21 -07:00
parent 881cd15519
commit 8ae1be1208
2 changed files with 12 additions and 1 deletions

View File

@@ -548,6 +548,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (DEBUG) Log.d(TAG, "received broadcast " + action);
@@ -599,6 +600,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private final BroadcastReceiver mBroadcastAllReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED.equals(action)) {
@@ -713,6 +715,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
return new SimData(state, slotId, subId);
}
@Override
public String toString() {
return "SimData{state=" + simState + ",slotId=" + slotId + ",subId=" + subId + "}";
}
@@ -895,7 +898,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
}
private boolean shouldListenForFingerprint() {
return mKeyguardIsVisible && !mSwitchingUser;
return mKeyguardIsVisible && !mSwitchingUser &&
mTrustManager.hasUserAuthenticatedSinceBoot(
ActivityManager.getCurrentUser());
}
private void startListeningForFingerprint() {

View File

@@ -579,8 +579,14 @@ public class TrustManagerService extends SystemService {
private void clearUserHasAuthenticated(int userId) {
if (userId == UserHandle.USER_ALL) {
mUserHasAuthenticated.clear();
synchronized (mUserHasAuthenticatedSinceBoot) {
mUserHasAuthenticatedSinceBoot.clear();
}
} else {
mUserHasAuthenticated.put(userId, false);
synchronized (mUserHasAuthenticatedSinceBoot) {
mUserHasAuthenticatedSinceBoot.put(userId, false);
}
}
}