DO NOT MERGE Force-enable media feature flag am: 6965ddcea0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12118650 Change-Id: I6580e945a1a561caccb1c5ddf590b52c0d1e983c
This commit is contained in:
@@ -129,9 +129,7 @@ public class Utils {
|
|||||||
* Off by default, but can be disabled by setting to 0
|
* Off by default, but can be disabled by setting to 0
|
||||||
*/
|
*/
|
||||||
public static boolean useQsMediaPlayer(Context context) {
|
public static boolean useQsMediaPlayer(Context context) {
|
||||||
int flag = Settings.Global.getInt(context.getContentResolver(),
|
return true;
|
||||||
Settings.Global.SHOW_MEDIA_ON_QUICK_SETTINGS, 1);
|
|
||||||
return flag > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1621,8 +1621,6 @@ public class NotificationManagerService extends SystemService {
|
|||||||
= Settings.Global.getUriFor(Settings.Global.MAX_NOTIFICATION_ENQUEUE_RATE);
|
= Settings.Global.getUriFor(Settings.Global.MAX_NOTIFICATION_ENQUEUE_RATE);
|
||||||
private final Uri NOTIFICATION_HISTORY_ENABLED
|
private final Uri NOTIFICATION_HISTORY_ENABLED
|
||||||
= Settings.Secure.getUriFor(Settings.Secure.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) {
|
SettingsObserver(Handler handler) {
|
||||||
super(handler);
|
super(handler);
|
||||||
@@ -1640,8 +1638,6 @@ public class NotificationManagerService extends SystemService {
|
|||||||
false, this, UserHandle.USER_ALL);
|
false, this, UserHandle.USER_ALL);
|
||||||
resolver.registerContentObserver(NOTIFICATION_HISTORY_ENABLED,
|
resolver.registerContentObserver(NOTIFICATION_HISTORY_ENABLED,
|
||||||
false, this, UserHandle.USER_ALL);
|
false, this, UserHandle.USER_ALL);
|
||||||
resolver.registerContentObserver(NOTIFICATION_SHOW_MEDIA_ON_QUICK_SETTINGS_URI,
|
|
||||||
false, this, UserHandle.USER_ALL);
|
|
||||||
update(null);
|
update(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1678,9 +1674,6 @@ public class NotificationManagerService extends SystemService {
|
|||||||
Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0) == 1);
|
Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0) == 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (uri == null || NOTIFICATION_SHOW_MEDIA_ON_QUICK_SETTINGS_URI.equals(uri)) {
|
|
||||||
mPreferencesHelper.updateMediaNotificationFilteringEnabled();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,8 @@ public class PreferencesHelper implements RankingConfig {
|
|||||||
|
|
||||||
private SparseBooleanArray mBadgingEnabled;
|
private SparseBooleanArray mBadgingEnabled;
|
||||||
private boolean mBubblesEnabledGlobally = DEFAULT_GLOBAL_ALLOW_BUBBLE;
|
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 mAreChannelsBypassingDnd;
|
||||||
private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS;
|
private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS;
|
||||||
|
|
||||||
@@ -186,7 +187,6 @@ public class PreferencesHelper implements RankingConfig {
|
|||||||
|
|
||||||
updateBadgingEnabled();
|
updateBadgingEnabled();
|
||||||
updateBubblesEnabled();
|
updateBubblesEnabled();
|
||||||
updateMediaNotificationFilteringEnabled();
|
|
||||||
syncChannelsBypassingDnd(mContext.getUserId());
|
syncChannelsBypassingDnd(mContext.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2292,16 +2292,6 @@ public class PreferencesHelper implements RankingConfig {
|
|||||||
return mBubblesEnabledGlobally;
|
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. */
|
/** Returns true if the setting is enabled for showing media notifications in quick settings. */
|
||||||
public boolean isMediaNotificationFilteringEnabled() {
|
public boolean isMediaNotificationFilteringEnabled() {
|
||||||
return mIsMediaNotificationFilteringEnabled;
|
return mIsMediaNotificationFilteringEnabled;
|
||||||
|
|||||||
@@ -2087,22 +2087,6 @@ public class PreferencesHelperTest extends UiServiceTestCase {
|
|||||||
assertFalse(mHelper.bubblesEnabled());
|
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
|
@Test
|
||||||
public void testOnLocaleChanged_updatesDefaultChannels() throws Exception {
|
public void testOnLocaleChanged_updatesDefaultChannels() throws Exception {
|
||||||
String newLabel = "bananas!";
|
String newLabel = "bananas!";
|
||||||
|
|||||||
Reference in New Issue
Block a user