Add some functionality to Settings ShadowLockPatternUtils
Test: make RunSettingsRoboTests Bug: 218885287 Change-Id: If8a28a1680f0fc62f2bff5a927ccf876441bafa5
This commit is contained in:
@@ -40,7 +40,7 @@ public class ShadowLockPatternUtils {
|
|||||||
private static Map<Integer, Integer> sUserToProfileComplexityMap = new HashMap<>();
|
private static Map<Integer, Integer> sUserToProfileComplexityMap = new HashMap<>();
|
||||||
private static Map<Integer, PasswordMetrics> sUserToMetricsMap = new HashMap<>();
|
private static Map<Integer, PasswordMetrics> sUserToMetricsMap = new HashMap<>();
|
||||||
private static Map<Integer, PasswordMetrics> sUserToProfileMetricsMap = new HashMap<>();
|
private static Map<Integer, PasswordMetrics> sUserToProfileMetricsMap = new HashMap<>();
|
||||||
|
private static Map<Integer, Boolean> sUserToIsSecureMap = new HashMap<>();
|
||||||
|
|
||||||
@Resetter
|
@Resetter
|
||||||
public static void reset() {
|
public static void reset() {
|
||||||
@@ -48,6 +48,7 @@ public class ShadowLockPatternUtils {
|
|||||||
sUserToProfileComplexityMap.clear();
|
sUserToProfileComplexityMap.clear();
|
||||||
sUserToMetricsMap.clear();
|
sUserToMetricsMap.clear();
|
||||||
sUserToProfileMetricsMap.clear();
|
sUserToProfileMetricsMap.clear();
|
||||||
|
sUserToIsSecureMap.clear();
|
||||||
sDeviceEncryptionEnabled = false;
|
sDeviceEncryptionEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,8 +58,16 @@ public class ShadowLockPatternUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Implementation
|
@Implementation
|
||||||
protected boolean isSecure(int id) {
|
protected boolean isSecure(int userId) {
|
||||||
return true;
|
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
|
@Implementation
|
||||||
@@ -144,4 +153,13 @@ public class ShadowLockPatternUtils {
|
|||||||
sUserToProfileMetricsMap.put(UserHandle.myUserId(), metrics);
|
sUserToProfileMetricsMap.put(UserHandle.myUserId(), metrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Implementation
|
||||||
|
public boolean isLockScreenDisabled(int userId) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Implementation
|
||||||
|
public boolean isSeparateProfileChallengeEnabled(int userHandle) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user