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

Commit c2322518 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE Force-enable media feature flag" into rvc-dev

parents 70a24c32 6965ddce
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -129,9 +129,7 @@ public class Utils {
     * Off by default, but can be disabled by setting to 0
     */
    public static boolean useQsMediaPlayer(Context context) {
        int flag = Settings.Global.getInt(context.getContentResolver(),
                Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1);
        return flag > 0;
        return true;
    }

    /**
+0 −7
Original line number Diff line number Diff line
@@ -1621,8 +1621,6 @@ public class NotificationManagerService extends SystemService {
                = Settings.Global.getUriFor(Settings.Global.MAX_NOTIFICATION_ENQUEUE_RATE);
        private final Uri NOTIFICATION_HISTORY_ENABLED
                = Settings.Secure.getUriFor(Settings.Secure.NOTIFICATION_HISTORY_ENABLED);
        private final Uri NOTIFICATION_SHOW_MEDIA_ON_QUICK_SETTINGS_URI
                = Settings.Global.getUriFor(Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS);

        SettingsObserver(Handler handler) {
            super(handler);
@@ -1640,8 +1638,6 @@ public class NotificationManagerService extends SystemService {
                    false, this, UserHandle.USER_ALL);
            resolver.registerContentObserver(NOTIFICATION_HISTORY_ENABLED,
                    false, this, UserHandle.USER_ALL);
            resolver.registerContentObserver(NOTIFICATION_SHOW_MEDIA_ON_QUICK_SETTINGS_URI,
                    false, this, UserHandle.USER_ALL);
            update(null);
        }

@@ -1678,9 +1674,6 @@ public class NotificationManagerService extends SystemService {
                            Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0) == 1);
                }
            }
            if (uri == null || NOTIFICATION_SHOW_MEDIA_ON_QUICK_SETTINGS_URI.equals(uri)) {
                mPreferencesHelper.updateMediaNotificationFilteringEnabled();
            }
        }
    }

+2 −12
Original line number Diff line number Diff line
@@ -166,7 +166,8 @@ public class PreferencesHelper implements RankingConfig {

    private SparseBooleanArray mBadgingEnabled;
    private boolean mBubblesEnabledGlobally = DEFAULT_GLOBAL_ALLOW_BUBBLE;
    private boolean mIsMediaNotificationFilteringEnabled = DEFAULT_MEDIA_NOTIFICATION_FILTERING;
    private final boolean mIsMediaNotificationFilteringEnabled =
            DEFAULT_MEDIA_NOTIFICATION_FILTERING;
    private boolean mAreChannelsBypassingDnd;
    private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS;

@@ -186,7 +187,6 @@ public class PreferencesHelper implements RankingConfig {

        updateBadgingEnabled();
        updateBubblesEnabled();
        updateMediaNotificationFilteringEnabled();
        syncChannelsBypassingDnd(mContext.getUserId());
    }

@@ -2292,16 +2292,6 @@ public class PreferencesHelper implements RankingConfig {
        return mBubblesEnabledGlobally;
    }

    /** Requests check of the feature setting for showing media notifications in quick settings. */
    public void updateMediaNotificationFilteringEnabled() {
        final boolean newValue = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1) > 0;
        if (newValue != mIsMediaNotificationFilteringEnabled) {
            mIsMediaNotificationFilteringEnabled = newValue;
            updateConfig();
        }
    }

    /** Returns true if the setting is enabled for showing media notifications in quick settings. */
    public boolean isMediaNotificationFilteringEnabled() {
        return mIsMediaNotificationFilteringEnabled;
+0 −16
Original line number Diff line number Diff line
@@ -2087,22 +2087,6 @@ public class PreferencesHelperTest extends UiServiceTestCase {
        assertFalse(mHelper.bubblesEnabled());
    }

    @Test
    public void testShowQSMediaOverrideTrue() {
        Global.putInt(getContext().getContentResolver(),
                Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1);
        mHelper.updateMediaNotificationFilteringEnabled(); // would be called by settings observer
        assertTrue(mHelper.isMediaNotificationFilteringEnabled());
    }

    @Test
    public void testShowQSMediaOverrideFalse() {
        Global.putInt(getContext().getContentResolver(),
                Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 0);
        mHelper.updateMediaNotificationFilteringEnabled(); // would be called by settings observer
        assertFalse(mHelper.isMediaNotificationFilteringEnabled());
    }

    @Test
    public void testOnLocaleChanged_updatesDefaultChannels() throws Exception {
        String newLabel = "bananas!";