Change a nullable get to getOrDefault(,false)
Implicitly casting from a Map<,Boolean> to a boolean will cause a
NullPointerException if the map isn't populated yet. The default
should be false because this is more conservative with respect to
how users are allowed to unlock their device if the real information
isn't available yet (or won't be available because the device doesn't
have a keyguard yet still calls this API).
Test: adb reboot; adb logcat | grep NullPointerException
Fix: 231987867
Change-Id: Ie631286a30eaa1d9db36d8a149b9165df292429d
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 121ac29..59dc2be 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -2795,7 +2795,7 @@
* Note: checking fingerprint enrollment directly with the AuthController requires an IPC.
*/
public boolean getCachedIsUnlockWithFingerprintPossible(int userId) {
- return mIsUnlockWithFingerprintPossible.get(userId);
+ return mIsUnlockWithFingerprintPossible.getOrDefault(userId, false);
}
private boolean isUnlockWithFacePossible(int userId) {