Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 048a82af authored by Steve Elliott's avatar Steve Elliott
Browse files

Add new FeatureFlagsClassic alias

Deprecate the old FeatureFlags name.

This change is in preparation for the introduction of the new
aconfig-based flagging system, which also utilizes a class called
FeatureFlags. To prevent the need for qualified names, as well as
general naming confusion, we are moving usage of the "classic" feature
flags to a new name going forward.

Bug: 292511372
Test: make
Change-Id: Ieeb339c0311cd7a81aacd68e8808ee812b6bb018
parent 7dce61f0
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -33,8 +33,7 @@ import javax.inject.Named
    SettingsUtilModule::class,
])
abstract class FlagsModule {
    @Binds
    abstract fun bindsFeatureFlagDebug(impl: FeatureFlagsDebug): FeatureFlags
    @Binds abstract fun bindsFeatureFlagDebug(impl: FeatureFlagsClassicDebug): FeatureFlagsClassic

    @Binds
    @IntoSet
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ import javax.inject.Named
])
abstract class FlagsModule {
    @Binds
    abstract fun bindsFeatureFlagRelease(impl: FeatureFlagsRelease): FeatureFlags
    abstract fun bindsFeatureFlagRelease(impl: FeatureFlagsClassicRelease): FeatureFlagsClassic

    @Binds
    @IntoSet
+2 −2
Original line number Diff line number Diff line
@@ -44,12 +44,12 @@ constructor(
    private var androidRestartRequested = false

    override fun restartSystemUI(reason: String) {
        Log.d(FeatureFlagsDebug.TAG, "SystemUI Restart requested. Restarting when idle.")
        Log.d(FeatureFlagsClassicDebug.TAG, "SystemUI Restart requested. Restarting when idle.")
        scheduleRestart(reason)
    }

    override fun restartAndroid(reason: String) {
        Log.d(FeatureFlagsDebug.TAG, "Android Restart requested. Restarting when idle.")
        Log.d(FeatureFlagsClassicDebug.TAG, "Android Restart requested. Restarting when idle.")
        androidRestartRequested = true
        scheduleRestart(reason)
    }
+16 −1
Original line number Diff line number Diff line
@@ -23,6 +23,21 @@ import android.util.Dumpable
 *
 * See [Flags] for instructions on defining new flags.
 */
interface FeatureFlagsClassic : FeatureFlags

/**
 * Class to manage simple DeviceConfig-based feature flags.
 *
 * See [Flags] for instructions on defining new flags.
 */
@Deprecated(
    message = "Use FeatureFlagsClassic instead.",
    replaceWith =
        ReplaceWith(
            "FeatureFlagsClassic",
            "com.android.systemui.flags.FeatureFlagsClassic",
        ),
)
interface FeatureFlags : FlagListenable, Dumpable {
    /** Returns a boolean value for the given flag.  */
    fun isEnabled(flag: UnreleasedFlag): Boolean
+2 −2
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ import javax.inject.Named;
 * To restore a flag back to its default, leave the `--ez value <0|1>` off of the command.
 */
@SysUISingleton
public class FeatureFlagsDebug implements FeatureFlags {
public class FeatureFlagsClassicDebug implements FeatureFlagsClassic {
    static final String TAG = "SysUIFlags";

    private final FlagManager mFlagManager;
@@ -116,7 +116,7 @@ public class FeatureFlagsDebug implements FeatureFlags {
            };

    @Inject
    public FeatureFlagsDebug(
    public FeatureFlagsClassicDebug(
            FlagManager flagManager,
            Context context,
            GlobalSettings globalSettings,
Loading