summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin Chyn <kchyn@google.com> 2020-06-18 04:48:59 +0000
committer Kevin Chyn <kchyn@google.com> 2020-06-17 22:15:05 -0700
commit508c327d77beaf694c88a452343ca9324d8433eb (patch)
tree663928736654e1de526aef4cf6822fd74dfac6f1
parent278f00319f535da507aae31c114e41a678355ec2 (diff)
Revert "Add SafetyNet logging for b/79776455"
Bug: 159260556 Bug: 79776455 This reverts commit 6a9945a3c8cb57197bccf7b04122167c18d9ec62. Reason for revert: b/159260556 Change-Id: Ib2d293c82eebdbff172a89290a6bd6bba2b3ee15
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java36
1 files changed, 12 insertions, 24 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 7914d864da0f..34c85877577b 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -79,7 +79,6 @@ import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener;
import android.telephony.TelephonyManager;
-import android.util.EventLog;
import android.util.Log;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
@@ -1075,17 +1074,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
!= LockPatternUtils.StrongAuthTracker.STRONG_AUTH_NOT_REQUIRED;
}
- private boolean isUserEncryptedOrLockdown(int userId) {
- // Biometrics should not be started in this case. Think carefully before modifying this
- // method, see b/79776455
- final int strongAuth = mStrongAuthTracker.getStrongAuthForUser(userId);
- final boolean isLockDown =
- containsFlag(strongAuth, STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW)
- || containsFlag(strongAuth, STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN);
- final boolean isEncrypted = containsFlag(strongAuth, STRONG_AUTH_REQUIRED_AFTER_BOOT);
- return isLockDown || isEncrypted;
- }
-
private boolean containsFlag(int haystack, int needle) {
return (haystack & needle) != 0;
}
@@ -1916,6 +1904,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
final boolean allowedOnBouncer =
!(mFingerprintLockedOut && mBouncer && mCredentialAttempted);
final int user = getCurrentUser();
+ final int strongAuth = mStrongAuthTracker.getStrongAuthForUser(user);
+ final boolean isLockDown =
+ containsFlag(strongAuth, STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW)
+ || containsFlag(strongAuth, STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN);
+ final boolean isEncrypted = containsFlag(strongAuth, STRONG_AUTH_REQUIRED_AFTER_BOOT);
// Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
// instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
@@ -1924,7 +1917,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
shouldListenForFingerprintAssistant() || (mKeyguardOccluded && mIsDreaming))
&& !mSwitchingUser && !isFingerprintDisabled(getCurrentUser())
&& (!mKeyguardGoingAway || !mDeviceInteractive) && mIsPrimaryUser
- && allowedOnBouncer && !isUserEncryptedOrLockdown(user);
+ && allowedOnBouncer && !isLockDown && !isEncrypted;
return shouldListen;
}
@@ -1938,6 +1931,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
&& !statusBarShadeLocked;
final int user = getCurrentUser();
final int strongAuth = mStrongAuthTracker.getStrongAuthForUser(user);
+ final boolean isLockDown =
+ containsFlag(strongAuth, STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW)
+ || containsFlag(strongAuth, STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN);
+ final boolean isEncrypted =
+ containsFlag(strongAuth, STRONG_AUTH_REQUIRED_AFTER_BOOT);
final boolean isTimedOut =
containsFlag(strongAuth, STRONG_AUTH_REQUIRED_AFTER_TIMEOUT);
@@ -1960,7 +1958,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
&& !mSwitchingUser && !isFaceDisabled(user) && becauseCannotSkipBouncer
&& !mKeyguardGoingAway && mFaceSettingEnabledForUser.get(user) && !mLockIconPressed
&& strongAuthAllowsScanning && mIsPrimaryUser
- && !mSecureCameraLaunched && !isUserEncryptedOrLockdown(user);
+ && !mSecureCameraLaunched && !isLockDown && !isEncrypted;
// Aggregate relevant fields for debug logging.
if (DEBUG_FACE || DEBUG_SPEW) {
@@ -2033,11 +2031,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
if (mFingerprintCancelSignal != null) {
mFingerprintCancelSignal.cancel();
}
-
- if (isUserEncryptedOrLockdown(userId)) {
- // If this happens, shouldListenForFingerprint() is wrong. SafetyNet for b/79776455
- EventLog.writeEvent(0x534e4554, "79776455", "startListeningForFingerprint");
- }
mFingerprintCancelSignal = new CancellationSignal();
mFpm.authenticate(null, mFingerprintCancelSignal, 0, mFingerprintAuthenticationCallback,
null, userId);
@@ -2056,11 +2049,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
if (mFaceCancelSignal != null) {
mFaceCancelSignal.cancel();
}
-
- if (isUserEncryptedOrLockdown(userId)) {
- // If this happens, shouldListenForFace() is wrong. SafetyNet for b/79776455
- EventLog.writeEvent(0x534e4554, "79776455", "startListeningForFace");
- }
mFaceCancelSignal = new CancellationSignal();
mFaceManager.authenticate(null, mFaceCancelSignal, 0,
mFaceAuthenticationCallback, null, userId);