Enabling Monochromatic on droidfood

Changing from default false to true

Test: Manual
Bug: 241778903
Change-Id: I822548737679f9f09f0460a8994a72e89edc0de1
This commit is contained in:
Marcelo Arteiro
2023-01-25 12:35:51 +00:00
parent 41f9aa412e
commit e720aea81a
4 changed files with 20 additions and 5 deletions

View File

@@ -181,6 +181,9 @@ object CustomizationProviderContract {
/** Flag denoting whether the Wallpaper preview should use the full screen UI. */
const val FLAG_NAME_WALLPAPER_FULLSCREEN_PREVIEW = "wallpaper_fullscreen_preview"
/** Flag denoting whether the Monochromatic Theme is enabled. */
const val FLAG_NAME_MONOCHROMATIC_THEME = "is_monochromatic_theme_enabled"
object Columns {
/** String. Unique ID for the flag. */
const val NAME = "name"

View File

@@ -311,9 +311,7 @@ object Flags {
val SCREEN_CONTENTS_TRANSLATION = unreleasedFlag(803, "screen_contents_translation")
// 804 - monochromatic themes
@JvmField
val MONOCHROMATIC_THEMES =
sysPropBooleanFlag(804, "persist.sysui.monochromatic", default = false)
@JvmField val MONOCHROMATIC_THEME = releasedFlag(804, "monochromatic")
// 900 - media
// TODO(b/254512697): Tracking Bug

View File

@@ -154,7 +154,11 @@ constructor(
val slots = repository.get().getSlotPickerRepresentations()
val slot = slots.find { it.id == slotId } ?: return false
val selections =
repository.get().getCurrentSelections().getOrDefault(slotId, emptyList()).toMutableList()
repository
.get()
.getCurrentSelections()
.getOrDefault(slotId, emptyList())
.toMutableList()
val alreadySelected = selections.remove(affordanceId)
if (!alreadySelected) {
while (selections.size > 0 && selections.size >= slot.maxSelectedAffordances) {
@@ -203,7 +207,11 @@ constructor(
}
val selections =
repository.get().getCurrentSelections().getOrDefault(slotId, emptyList()).toMutableList()
repository
.get()
.getCurrentSelections()
.getOrDefault(slotId, emptyList())
.toMutableList()
return if (selections.remove(affordanceId)) {
repository
.get()
@@ -367,6 +375,10 @@ constructor(
name = Contract.FlagsTable.FLAG_NAME_WALLPAPER_FULLSCREEN_PREVIEW,
value = featureFlags.isEnabled(Flags.WALLPAPER_FULLSCREEN_PREVIEW),
),
KeyguardPickerFlag(
name = Contract.FlagsTable.FLAG_NAME_MONOCHROMATIC_THEME,
value = featureFlags.isEnabled(Flags.MONOCHROMATIC_THEME)
)
)
}

View File

@@ -115,6 +115,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
private final SecureSettings mSecureSettings;
private final Executor mMainExecutor;
private final Handler mBgHandler;
private final boolean mIsMonochromaticEnabled;
private final Context mContext;
private final boolean mIsMonetEnabled;
private final UserTracker mUserTracker;
@@ -364,6 +365,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
UserTracker userTracker, DumpManager dumpManager, FeatureFlags featureFlags,
@Main Resources resources, WakefulnessLifecycle wakefulnessLifecycle) {
mContext = context;
mIsMonochromaticEnabled = featureFlags.isEnabled(Flags.MONOCHROMATIC_THEME);
mIsMonetEnabled = featureFlags.isEnabled(Flags.MONET);
mDeviceProvisionedController = deviceProvisionedController;
mBroadcastDispatcher = broadcastDispatcher;