Loading src/com/android/launcher3/config/BaseFlags.java +7 −4 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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) { Loading src/com/android/launcher3/settings/SettingsActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ public class SettingsActivity extends Activity case FLAGS_PREFERENCE_KEY: // Only show flag toggler UI if this build variant implements that. return FeatureFlags.showFlagTogglerUi(); return FeatureFlags.showFlagTogglerUi(getContext()); } return true; Loading Loading
src/com/android/launcher3/config/BaseFlags.java +7 −4 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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) { Loading
src/com/android/launcher3/settings/SettingsActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ public class SettingsActivity extends Activity case FLAGS_PREFERENCE_KEY: // Only show flag toggler UI if this build variant implements that. return FeatureFlags.showFlagTogglerUi(); return FeatureFlags.showFlagTogglerUi(getContext()); } return true; Loading