Loading core/java/android/app/KeyguardManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ public class KeyguardManager { */ public Intent createConfirmFactoryResetCredentialIntent( CharSequence title, CharSequence description, CharSequence alternateButtonLabel) { if (!LockPatternUtils.frpCredentialEnabled()) { if (!LockPatternUtils.frpCredentialEnabled(mContext)) { Log.w(TAG, "Factory reset credentials not supported."); return null; } Loading core/java/com/android/internal/widget/LockPatternUtils.java +10 −9 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ public class LockPatternUtils { } public void reportFailedPasswordAttempt(int userId) { if (userId == USER_FRP && frpCredentialEnabled()) { if (userId == USER_FRP && frpCredentialEnabled(mContext)) { return; } getDevicePolicyManager().reportFailedPasswordAttempt(userId); Loading @@ -311,7 +311,7 @@ public class LockPatternUtils { } public void reportSuccessfulPasswordAttempt(int userId) { if (userId == USER_FRP && frpCredentialEnabled()) { if (userId == USER_FRP && frpCredentialEnabled(mContext)) { return; } getDevicePolicyManager().reportSuccessfulPasswordAttempt(userId); Loading @@ -319,21 +319,21 @@ public class LockPatternUtils { } public void reportPasswordLockout(int timeoutMs, int userId) { if (userId == USER_FRP && frpCredentialEnabled()) { if (userId == USER_FRP && frpCredentialEnabled(mContext)) { return; } getTrustManager().reportUnlockLockout(timeoutMs, userId); } public int getCurrentFailedPasswordAttempts(int userId) { if (userId == USER_FRP && frpCredentialEnabled()) { if (userId == USER_FRP && frpCredentialEnabled(mContext)) { return 0; } return getDevicePolicyManager().getCurrentFailedPasswordAttempts(userId); } public int getMaximumFailedPasswordsForWipe(int userId) { if (userId == USER_FRP && frpCredentialEnabled()) { if (userId == USER_FRP && frpCredentialEnabled(mContext)) { return 0; } return getDevicePolicyManager().getMaximumFailedPasswordsForWipe( Loading Loading @@ -1768,11 +1768,12 @@ public class LockPatternUtils { return getLong(SYNTHETIC_PASSWORD_ENABLED_KEY, 0, UserHandle.USER_SYSTEM) != 0; } public static boolean userOwnsFrpCredential(UserInfo info) { return info != null && info.isPrimary() && info.isAdmin() && frpCredentialEnabled(); public static boolean userOwnsFrpCredential(Context context, UserInfo info) { return info != null && info.isPrimary() && info.isAdmin() && frpCredentialEnabled(context); } public static boolean frpCredentialEnabled() { return FRP_CREDENTIAL_ENABLED; public static boolean frpCredentialEnabled(Context context) { return FRP_CREDENTIAL_ENABLED && context.getResources().getBoolean( com.android.internal.R.bool.config_enableCredentialFactoryResetProtection); } } core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -1116,6 +1116,11 @@ <!-- Is the lock-screen disabled for new users by default --> <bool name="config_disableLockscreenByDefault">false</bool> <!-- If true, enables verification of the lockscreen credential in the factory reset protection flow. This should be true if gatekeeper / weaver credentials can still be checked after a factory reset. --> <bool name="config_enableCredentialFactoryResetProtection">true</bool> <!-- Control the behavior when the user long presses the home button. 0 - Nothing 1 - Launch all apps intent Loading core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -3019,6 +3019,8 @@ <java-symbol type="string" name="foreground_service_tap_for_details" /> <java-symbol type="string" name="foreground_service_multiple_separator" /> <java-symbol type="bool" name="config_enableCredentialFactoryResetProtection" /> <!-- ETWS primary messages --> <java-symbol type="string" name="etws_primary_default_message_earthquake" /> <java-symbol type="string" name="etws_primary_default_message_tsunami" /> Loading packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java +9 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Handler; import android.os.Trace; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -94,10 +95,15 @@ public class DozeScreenBrightness implements DozeMachine.Part, SensorEventListen @Override public void onSensorChanged(SensorEvent event) { Trace.beginSection("DozeScreenBrightness.onSensorChanged" + event.values[0]); try { if (mRegistered) { mLastSensorValue = (int) event.values[0]; updateBrightnessAndReady(); } } finally { Trace.endSection(); } } private void updateBrightnessAndReady() { Loading Loading
core/java/android/app/KeyguardManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ public class KeyguardManager { */ public Intent createConfirmFactoryResetCredentialIntent( CharSequence title, CharSequence description, CharSequence alternateButtonLabel) { if (!LockPatternUtils.frpCredentialEnabled()) { if (!LockPatternUtils.frpCredentialEnabled(mContext)) { Log.w(TAG, "Factory reset credentials not supported."); return null; } Loading
core/java/com/android/internal/widget/LockPatternUtils.java +10 −9 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ public class LockPatternUtils { } public void reportFailedPasswordAttempt(int userId) { if (userId == USER_FRP && frpCredentialEnabled()) { if (userId == USER_FRP && frpCredentialEnabled(mContext)) { return; } getDevicePolicyManager().reportFailedPasswordAttempt(userId); Loading @@ -311,7 +311,7 @@ public class LockPatternUtils { } public void reportSuccessfulPasswordAttempt(int userId) { if (userId == USER_FRP && frpCredentialEnabled()) { if (userId == USER_FRP && frpCredentialEnabled(mContext)) { return; } getDevicePolicyManager().reportSuccessfulPasswordAttempt(userId); Loading @@ -319,21 +319,21 @@ public class LockPatternUtils { } public void reportPasswordLockout(int timeoutMs, int userId) { if (userId == USER_FRP && frpCredentialEnabled()) { if (userId == USER_FRP && frpCredentialEnabled(mContext)) { return; } getTrustManager().reportUnlockLockout(timeoutMs, userId); } public int getCurrentFailedPasswordAttempts(int userId) { if (userId == USER_FRP && frpCredentialEnabled()) { if (userId == USER_FRP && frpCredentialEnabled(mContext)) { return 0; } return getDevicePolicyManager().getCurrentFailedPasswordAttempts(userId); } public int getMaximumFailedPasswordsForWipe(int userId) { if (userId == USER_FRP && frpCredentialEnabled()) { if (userId == USER_FRP && frpCredentialEnabled(mContext)) { return 0; } return getDevicePolicyManager().getMaximumFailedPasswordsForWipe( Loading Loading @@ -1768,11 +1768,12 @@ public class LockPatternUtils { return getLong(SYNTHETIC_PASSWORD_ENABLED_KEY, 0, UserHandle.USER_SYSTEM) != 0; } public static boolean userOwnsFrpCredential(UserInfo info) { return info != null && info.isPrimary() && info.isAdmin() && frpCredentialEnabled(); public static boolean userOwnsFrpCredential(Context context, UserInfo info) { return info != null && info.isPrimary() && info.isAdmin() && frpCredentialEnabled(context); } public static boolean frpCredentialEnabled() { return FRP_CREDENTIAL_ENABLED; public static boolean frpCredentialEnabled(Context context) { return FRP_CREDENTIAL_ENABLED && context.getResources().getBoolean( com.android.internal.R.bool.config_enableCredentialFactoryResetProtection); } }
core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -1116,6 +1116,11 @@ <!-- Is the lock-screen disabled for new users by default --> <bool name="config_disableLockscreenByDefault">false</bool> <!-- If true, enables verification of the lockscreen credential in the factory reset protection flow. This should be true if gatekeeper / weaver credentials can still be checked after a factory reset. --> <bool name="config_enableCredentialFactoryResetProtection">true</bool> <!-- Control the behavior when the user long presses the home button. 0 - Nothing 1 - Launch all apps intent Loading
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -3019,6 +3019,8 @@ <java-symbol type="string" name="foreground_service_tap_for_details" /> <java-symbol type="string" name="foreground_service_multiple_separator" /> <java-symbol type="bool" name="config_enableCredentialFactoryResetProtection" /> <!-- ETWS primary messages --> <java-symbol type="string" name="etws_primary_default_message_earthquake" /> <java-symbol type="string" name="etws_primary_default_message_tsunami" /> Loading
packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java +9 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Handler; import android.os.Trace; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -94,10 +95,15 @@ public class DozeScreenBrightness implements DozeMachine.Part, SensorEventListen @Override public void onSensorChanged(SensorEvent event) { Trace.beginSection("DozeScreenBrightness.onSensorChanged" + event.values[0]); try { if (mRegistered) { mLastSensorValue = (int) event.values[0]; updateBrightnessAndReady(); } } finally { Trace.endSection(); } } private void updateBrightnessAndReady() { Loading