Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +3 −13 Original line number Original line Diff line number Diff line Loading @@ -4342,9 +4342,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { Preconditions.checkArgument(timeoutMs >= 0, "Timeout must not be a negative number."); Preconditions.checkArgument(timeoutMs >= 0, "Timeout must not be a negative number."); // timeoutMs with value 0 means that the admin doesn't participate // timeoutMs with value 0 means that the admin doesn't participate // timeoutMs is clamped to the interval in case the internal constants change in the future // timeoutMs is clamped to the interval in case the internal constants change in the future final long minimumStrongAuthTimeout = getMinimumStrongAuthTimeoutMs(); if (timeoutMs != 0 && timeoutMs < MINIMUM_STRONG_AUTH_TIMEOUT_MS) { if (timeoutMs != 0 && timeoutMs < minimumStrongAuthTimeout) { timeoutMs = MINIMUM_STRONG_AUTH_TIMEOUT_MS; timeoutMs = minimumStrongAuthTimeout; } } if (timeoutMs > DevicePolicyManager.DEFAULT_STRONG_AUTH_TIMEOUT_MS) { if (timeoutMs > DevicePolicyManager.DEFAULT_STRONG_AUTH_TIMEOUT_MS) { timeoutMs = DevicePolicyManager.DEFAULT_STRONG_AUTH_TIMEOUT_MS; timeoutMs = DevicePolicyManager.DEFAULT_STRONG_AUTH_TIMEOUT_MS; Loading Loading @@ -4388,19 +4387,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { strongAuthUnlockTimeout = Math.min(timeout, strongAuthUnlockTimeout); strongAuthUnlockTimeout = Math.min(timeout, strongAuthUnlockTimeout); } } } } return Math.max(strongAuthUnlockTimeout, getMinimumStrongAuthTimeoutMs()); return Math.max(strongAuthUnlockTimeout, MINIMUM_STRONG_AUTH_TIMEOUT_MS); } } } } private long getMinimumStrongAuthTimeoutMs() { if (!mInjector.isBuildDebuggable()) { return MINIMUM_STRONG_AUTH_TIMEOUT_MS; } return Math.min(mInjector.systemPropertiesGetLong("persist.sys.min_strong_auth_timeout", MINIMUM_STRONG_AUTH_TIMEOUT_MS), MINIMUM_STRONG_AUTH_TIMEOUT_MS); } @Override @Override public void lockNow(boolean parent) { public void lockNow(boolean parent) { if (!mHasFeature) { if (!mHasFeature) { Loading Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +3 −13 Original line number Original line Diff line number Diff line Loading @@ -4342,9 +4342,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { Preconditions.checkArgument(timeoutMs >= 0, "Timeout must not be a negative number."); Preconditions.checkArgument(timeoutMs >= 0, "Timeout must not be a negative number."); // timeoutMs with value 0 means that the admin doesn't participate // timeoutMs with value 0 means that the admin doesn't participate // timeoutMs is clamped to the interval in case the internal constants change in the future // timeoutMs is clamped to the interval in case the internal constants change in the future final long minimumStrongAuthTimeout = getMinimumStrongAuthTimeoutMs(); if (timeoutMs != 0 && timeoutMs < MINIMUM_STRONG_AUTH_TIMEOUT_MS) { if (timeoutMs != 0 && timeoutMs < minimumStrongAuthTimeout) { timeoutMs = MINIMUM_STRONG_AUTH_TIMEOUT_MS; timeoutMs = minimumStrongAuthTimeout; } } if (timeoutMs > DevicePolicyManager.DEFAULT_STRONG_AUTH_TIMEOUT_MS) { if (timeoutMs > DevicePolicyManager.DEFAULT_STRONG_AUTH_TIMEOUT_MS) { timeoutMs = DevicePolicyManager.DEFAULT_STRONG_AUTH_TIMEOUT_MS; timeoutMs = DevicePolicyManager.DEFAULT_STRONG_AUTH_TIMEOUT_MS; Loading Loading @@ -4388,19 +4387,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { strongAuthUnlockTimeout = Math.min(timeout, strongAuthUnlockTimeout); strongAuthUnlockTimeout = Math.min(timeout, strongAuthUnlockTimeout); } } } } return Math.max(strongAuthUnlockTimeout, getMinimumStrongAuthTimeoutMs()); return Math.max(strongAuthUnlockTimeout, MINIMUM_STRONG_AUTH_TIMEOUT_MS); } } } } private long getMinimumStrongAuthTimeoutMs() { if (!mInjector.isBuildDebuggable()) { return MINIMUM_STRONG_AUTH_TIMEOUT_MS; } return Math.min(mInjector.systemPropertiesGetLong("persist.sys.min_strong_auth_timeout", MINIMUM_STRONG_AUTH_TIMEOUT_MS), MINIMUM_STRONG_AUTH_TIMEOUT_MS); } @Override @Override public void lockNow(boolean parent) { public void lockNow(boolean parent) { if (!mHasFeature) { if (!mHasFeature) { Loading