Loading tests/robotests/src/com/android/settings/testutils/shadow/ShadowLockPatternUtils.java +21 −3 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public class ShadowLockPatternUtils { 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() { Loading @@ -48,6 +48,7 @@ public class ShadowLockPatternUtils { sUserToProfileComplexityMap.clear(); sUserToMetricsMap.clear(); sUserToProfileMetricsMap.clear(); sUserToIsSecureMap.clear(); sDeviceEncryptionEnabled = false; } Loading @@ -57,9 +58,17 @@ public class ShadowLockPatternUtils { } @Implementation protected boolean isSecure(int id) { 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 protected int getActivePasswordQuality(int userId) { Loading Loading @@ -144,4 +153,13 @@ public class ShadowLockPatternUtils { sUserToProfileMetricsMap.put(UserHandle.myUserId(), metrics); } @Implementation public boolean isLockScreenDisabled(int userId) { return false; } @Implementation public boolean isSeparateProfileChallengeEnabled(int userHandle) { return false; } } Loading
tests/robotests/src/com/android/settings/testutils/shadow/ShadowLockPatternUtils.java +21 −3 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public class ShadowLockPatternUtils { 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() { Loading @@ -48,6 +48,7 @@ public class ShadowLockPatternUtils { sUserToProfileComplexityMap.clear(); sUserToMetricsMap.clear(); sUserToProfileMetricsMap.clear(); sUserToIsSecureMap.clear(); sDeviceEncryptionEnabled = false; } Loading @@ -57,9 +58,17 @@ public class ShadowLockPatternUtils { } @Implementation protected boolean isSecure(int id) { 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 protected int getActivePasswordQuality(int userId) { Loading Loading @@ -144,4 +153,13 @@ public class ShadowLockPatternUtils { sUserToProfileMetricsMap.put(UserHandle.myUserId(), metrics); } @Implementation public boolean isLockScreenDisabled(int userId) { return false; } @Implementation public boolean isSeparateProfileChallengeEnabled(int userHandle) { return false; } }