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

Commit 367c9d02 authored by Alex Florescu's avatar Alex Florescu
Browse files

Add Feature Flag for guarding development of two-column notification

shade

Bug: 171917882
Test: manual
Change-Id: I12b2885f4b59199397af5a1316e8a7c14f8c0afb
parent fc015503
Loading
Loading
Loading
Loading
+12 −4
Original line number Original line Diff line number Diff line
@@ -50,18 +50,26 @@ public class FeatureFlags {
    @Inject
    @Inject
    public FeatureFlags(@Background Executor executor) {
    public FeatureFlags(@Background Executor executor) {
        DeviceConfig.addOnPropertiesChangedListener(
        DeviceConfig.addOnPropertiesChangedListener(
                "systemui",
                /* namespace= */ "systemui",
                executor,
                executor,
                this::onPropertiesChanged);
                this::onPropertiesChanged);
    }
    }


    public boolean isNewNotifPipelineEnabled() {
    public boolean isNewNotifPipelineEnabled() {
        return getDeviceConfigFlag("notification.newpipeline.enabled", true);
        return getDeviceConfigFlag("notification.newpipeline.enabled", /* defaultValue= */ true);
    }
    }


    public boolean isNewNotifPipelineRenderingEnabled() {
    public boolean isNewNotifPipelineRenderingEnabled() {
        return isNewNotifPipelineEnabled()
        return isNewNotifPipelineEnabled()
                && getDeviceConfigFlag("notification.newpipeline.rendering", false);
                && getDeviceConfigFlag("notification.newpipeline.rendering", /* defaultValue= */
                false);
    }

    /**
     * Flag used for guarding development of b/171917882.
     */
    public boolean isTwoColumnNotificationShadeEnabled() {
        return getDeviceConfigFlag("notification.twocolumn", /* defaultValue= */ false);
    }
    }


    private void onPropertiesChanged(@NonNull DeviceConfig.Properties properties) {
    private void onPropertiesChanged(@NonNull DeviceConfig.Properties properties) {
@@ -76,7 +84,7 @@ public class FeatureFlags {
        synchronized (mCachedDeviceConfigFlags) {
        synchronized (mCachedDeviceConfigFlags) {
            Boolean flag = mCachedDeviceConfigFlags.get(key);
            Boolean flag = mCachedDeviceConfigFlags.get(key);
            if (flag == null) {
            if (flag == null) {
                flag = DeviceConfig.getBoolean("systemui", key, defaultValue);
                flag = DeviceConfig.getBoolean(/* namespace= */ "systemui", key, defaultValue);
                mCachedDeviceConfigFlags.put(key, flag);
                mCachedDeviceConfigFlags.put(key, flag);
            }
            }
            return flag;
            return flag;