From 7a6cfcc3af84ec10766d764c853dba7a3daaf266 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 27 Apr 2023 18:46:20 +0000 Subject: 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 c8c3fada61c3..98652c2e1c44 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -986,7 +986,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); } /** -- cgit v1.2.3-59-g8ed1b