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

Commit f44439cd authored by Alex Florescu's avatar Alex Florescu Committed by Android (Google) Code Review
Browse files

Merge "Add Feature Flag for guarding development of two-column notification shade"

parents d47c351b 367c9d02
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;