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

This commit is contained in:
Lucas Dupin
2020-07-13 16:44:15 +00:00
committed by Android (Google) Code Review
4 changed files with 3 additions and 38 deletions

View File

@@ -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;
}
/**

View File

@@ -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();
}
}
}

View File

@@ -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;

View File

@@ -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!";