Merge "Add some functionality to Settings ShadowLockPatternUtils"
diff --git a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowLockPatternUtils.java b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowLockPatternUtils.java
index 20547d7..74e3971 100644
--- a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowLockPatternUtils.java
+++ b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowLockPatternUtils.java
@@ -40,7 +40,7 @@
private static Map<Integer, Integer> sUserToProfileComplexityMap = new HashMap<>();
private static Map<Integer, PasswordMetrics> sUserToMetricsMap = new HashMap<>();
private static Map<Integer, PasswordMetrics> sUserToProfileMetricsMap = new HashMap<>();
-
+ private static Map<Integer, Boolean> sUserToIsSecureMap = new HashMap<>();
@Resetter
public static void reset() {
@@ -48,6 +48,7 @@
sUserToProfileComplexityMap.clear();
sUserToMetricsMap.clear();
sUserToProfileMetricsMap.clear();
+ sUserToIsSecureMap.clear();
sDeviceEncryptionEnabled = false;
}
@@ -57,8 +58,16 @@
}
@Implementation
- protected boolean isSecure(int id) {
- return true;
+ protected boolean isSecure(int userId) {
+ Boolean isSecure = sUserToIsSecureMap.get(userId);
+ if (isSecure == null) {
+ return true;
+ }
+ return isSecure;
+ }
+
+ public static void setIsSecure(int userId, boolean isSecure) {
+ sUserToIsSecureMap.put(userId, isSecure);
}
@Implementation
@@ -144,4 +153,13 @@
sUserToProfileMetricsMap.put(UserHandle.myUserId(), metrics);
}
+ @Implementation
+ public boolean isLockScreenDisabled(int userId) {
+ return false;
+ }
+
+ @Implementation
+ public boolean isSeparateProfileChallengeEnabled(int userHandle) {
+ return false;
+ }
}