diff options
Diffstat (limited to 'src/com/android/launcher3/config/BaseFlags.java')
-rw-r--r-- | src/com/android/launcher3/config/BaseFlags.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/launcher3/config/BaseFlags.java b/src/com/android/launcher3/config/BaseFlags.java index dc60c8fff..fa4ff752e 100644 --- a/src/com/android/launcher3/config/BaseFlags.java +++ b/src/com/android/launcher3/config/BaseFlags.java @@ -20,6 +20,7 @@ import static androidx.core.util.Preconditions.checkNotNull; import android.content.Context; import android.content.SharedPreferences; +import android.provider.Settings; import androidx.annotation.GuardedBy; import androidx.annotation.Keep; @@ -51,8 +52,10 @@ abstract class BaseFlags { throw new UnsupportedOperationException("Don't instantiate BaseFlags"); } - public static boolean showFlagTogglerUi() { - return Utilities.IS_DEBUG_DEVICE; + public static boolean showFlagTogglerUi(Context context) { + return Utilities.IS_DEBUG_DEVICE && + Settings.Global.getInt(context.getApplicationContext().getContentResolver(), + Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0; } public static final boolean IS_DOGFOOD_BUILD = false; @@ -85,8 +88,8 @@ abstract class BaseFlags { public static final boolean OVERVIEW_USE_SCREENSHOT_ORIENTATION = true; public static void initialize(Context context) { - // Avoid the disk read for builds without the flags UI. - if (showFlagTogglerUi()) { + // Avoid the disk read for user builds + if (Utilities.IS_DEBUG_DEVICE) { SharedPreferences sharedPreferences = context.getSharedPreferences(FLAGS_PREF_NAME, Context.MODE_PRIVATE); synchronized (sLock) { |