Exchange Policy MaxInactivityTimeDeviceLock does not take effect in Android Email

https://msdn.microsoft.com/en-us/library/hh509085(v=exchg.140).aspx

MaxInactivityTimeDeviceLock
Specifies the length of time (in seconds) that the device can be inactive before the password is required to reactivate it . The user can choose a value that is smaller than this, but cannot choose a value that is larger.

Log in to an Exchange account with the MaxInactivityTimeDeviceLock policy set in Android Email, and
find that the policy has no effect.

The reason is that when Policy does not set the password mode and other password-related policies should be set to 0, the mMaxScreenLockTime is also set to 0, and the MaxInactivityTimeDeviceLock policy is invalid.
public void normalize() {
        if (mPasswordMode == PASSWORD_MODE_NONE) {
            mPasswordMaxFails = 0;
            //mMaxScreenLockTime = 0;
            mPasswordMinLength = 0;
            mPasswordComplexChars = 0;
            mPasswordHistory = 0;
            mPasswordExpirationDays = 0;
        } else {
            if ((mPasswordMode != PASSWORD_MODE_SIMPLE) &&
                    (mPasswordMode != PASSWORD_MODE_STRONG)) {
                throw new IllegalArgumentException("password mode");
            }

Its mMaxScreenLockTime = 0; should be removed

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326050256&siteId=291194637