From e46d3522d0f4b92efc95a9f62a366b04549733ad Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 27 Apr 2023 18:46:20 +0000 Subject: [PATCH] Enable visual feedback when entering FRP pattern When the original lock pattern is verified for Factory Reset Protection (FRP), the original setting of LOCK_PATTERN_VISIBLE is unknown. However, it's likely to be true, since that is the value that gets set automatically when a pattern is first set. It would only be false if the user went into Settings and disabled "Make pattern visible". So, to be consistent with this, fix the low-level default to be true instead of false. This enables visual feedback when entering the FRP pattern. Bug: 270013005 Change-Id: If295999da34510c17ebfb323dd5215418eaa0852 Merged-In: If295999da34510c17ebfb323dd5215418eaa0852 (cherry picked from commit 5162566c0fae79d7e6afd7348100a39296d3ec37) --- core/java/com/android/internal/widget/LockPatternUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index 361bdce715de5..e0183931777bc 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -1082,7 +1082,10 @@ public class LockPatternUtils { */ @UnsupportedAppUsage public boolean isVisiblePatternEnabled(int userId) { - return getBoolean(Settings.Secure.LOCK_PATTERN_VISIBLE, false, userId); + // Default to true, since this gets explicitly set to true when a pattern is first set + // anyway, which makes true the user-visible default. The low-level default should be the + // same, in order for FRP credential verification to get the same default. + return getBoolean(Settings.Secure.LOCK_PATTERN_VISIBLE, true, userId); } /**