Merge "Stop tracking the secure setting because we're in master"
This commit is contained in:
@@ -2405,7 +2405,6 @@ package android.provider {
|
||||
field public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS = "location_access_check_delay_millis";
|
||||
field public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS = "location_access_check_interval_millis";
|
||||
field public static final String NOTIFICATION_BADGING = "notification_badging";
|
||||
field @Deprecated public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
|
||||
field @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds";
|
||||
field public static final String USER_SETUP_COMPLETE = "user_setup_complete";
|
||||
field public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service";
|
||||
|
||||
@@ -7907,16 +7907,6 @@ public final class Settings {
|
||||
@TestApi
|
||||
public static final String NOTIFICATION_BADGING = "notification_badging";
|
||||
|
||||
/**
|
||||
* Whether the notification bubbles are globally enabled
|
||||
* The value is boolean (1 or 0).
|
||||
* @hide
|
||||
* @deprecated use {@link Global#NOTIFICATION_BUBBLES} instead.
|
||||
*/
|
||||
@TestApi
|
||||
@Deprecated
|
||||
public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
|
||||
|
||||
/**
|
||||
* Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right
|
||||
* swipe).
|
||||
|
||||
@@ -114,7 +114,6 @@ public class SecureSettings {
|
||||
Settings.Secure.ASSIST_GESTURE_WAKE_ENABLED,
|
||||
Settings.Secure.VR_DISPLAY_MODE,
|
||||
Settings.Secure.NOTIFICATION_BADGING,
|
||||
Settings.Secure.NOTIFICATION_BUBBLES,
|
||||
Settings.Secure.NOTIFICATION_DISMISS_RTL,
|
||||
Settings.Secure.QS_AUTO_ADDED_TILES,
|
||||
Settings.Secure.SCREENSAVER_ENABLED,
|
||||
|
||||
@@ -157,7 +157,6 @@ public class SecureSettingsValidators {
|
||||
VALIDATORS.put(Secure.ASSIST_GESTURE_WAKE_ENABLED, BOOLEAN_VALIDATOR);
|
||||
VALIDATORS.put(Secure.VR_DISPLAY_MODE, new DiscreteValueValidator(new String[] {"0", "1"}));
|
||||
VALIDATORS.put(Secure.NOTIFICATION_BADGING, BOOLEAN_VALIDATOR);
|
||||
VALIDATORS.put(Secure.NOTIFICATION_BUBBLES, BOOLEAN_VALIDATOR);
|
||||
VALIDATORS.put(Secure.NOTIFICATION_DISMISS_RTL, BOOLEAN_VALIDATOR);
|
||||
VALIDATORS.put(Secure.QS_AUTO_ADDED_TILES, TILE_LIST_VALIDATOR);
|
||||
VALIDATORS.put(Secure.SCREENSAVER_ENABLED, BOOLEAN_VALIDATOR);
|
||||
|
||||
@@ -4385,8 +4385,7 @@ public class SettingsProvider extends ContentProvider {
|
||||
|
||||
if (currentVersion == 182) {
|
||||
// Remove secure bubble settings.
|
||||
getSecureSettingsLocked(userId).deleteSettingLocked(
|
||||
Secure.NOTIFICATION_BUBBLES);
|
||||
getSecureSettingsLocked(userId).deleteSettingLocked("notification_bubbles");
|
||||
|
||||
// Add global bubble settings.
|
||||
getGlobalSettingsLocked().insertSettingLocked(Global.NOTIFICATION_BUBBLES,
|
||||
|
||||
@@ -94,7 +94,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
|
||||
import static com.android.server.am.PendingIntentRecord.FLAG_ACTIVITY_SENDER;
|
||||
import static com.android.server.am.PendingIntentRecord.FLAG_BROADCAST_SENDER;
|
||||
import static com.android.server.am.PendingIntentRecord.FLAG_SERVICE_SENDER;
|
||||
import static com.android.server.notification.PreferencesHelper.DEFAULT_ALLOW_BUBBLE;
|
||||
import static com.android.server.utils.PriorityDump.PRIORITY_ARG;
|
||||
import static com.android.server.utils.PriorityDump.PRIORITY_ARG_CRITICAL;
|
||||
import static com.android.server.utils.PriorityDump.PRIORITY_ARG_NORMAL;
|
||||
@@ -1428,10 +1427,8 @@ public class NotificationManagerService extends SystemService {
|
||||
private final class SettingsObserver extends ContentObserver {
|
||||
private final Uri NOTIFICATION_BADGING_URI
|
||||
= Settings.Secure.getUriFor(Settings.Secure.NOTIFICATION_BADGING);
|
||||
private final Uri NOTIFICATION_BUBBLES_URI_GLOBAL
|
||||
private final Uri NOTIFICATION_BUBBLES_URI
|
||||
= Settings.Global.getUriFor(Settings.Global.NOTIFICATION_BUBBLES);
|
||||
private final Uri NOTIFICATION_BUBBLES_URI_SECURE
|
||||
= Settings.Secure.getUriFor(Settings.Secure.NOTIFICATION_BUBBLES);
|
||||
private final Uri NOTIFICATION_LIGHT_PULSE_URI
|
||||
= Settings.System.getUriFor(Settings.System.NOTIFICATION_LIGHT_PULSE);
|
||||
private final Uri NOTIFICATION_RATE_LIMIT_URI
|
||||
@@ -1449,9 +1446,7 @@ public class NotificationManagerService extends SystemService {
|
||||
false, this, UserHandle.USER_ALL);
|
||||
resolver.registerContentObserver(NOTIFICATION_RATE_LIMIT_URI,
|
||||
false, this, UserHandle.USER_ALL);
|
||||
resolver.registerContentObserver(NOTIFICATION_BUBBLES_URI_GLOBAL,
|
||||
false, this, UserHandle.USER_ALL);
|
||||
resolver.registerContentObserver(NOTIFICATION_BUBBLES_URI_SECURE,
|
||||
resolver.registerContentObserver(NOTIFICATION_BUBBLES_URI,
|
||||
false, this, UserHandle.USER_ALL);
|
||||
update(null);
|
||||
}
|
||||
@@ -1478,41 +1473,9 @@ public class NotificationManagerService extends SystemService {
|
||||
if (uri == null || NOTIFICATION_BADGING_URI.equals(uri)) {
|
||||
mPreferencesHelper.updateBadgingEnabled();
|
||||
}
|
||||
// In QPR we moved the setting to Global rather than Secure so that the setting
|
||||
// applied to work profiles. Unfortunately we need to maintain both to pass CTS without
|
||||
// a change to CTS outside of a normal letter release.
|
||||
if (uri == null || NOTIFICATION_BUBBLES_URI_GLOBAL.equals(uri)) {
|
||||
syncBubbleSettings(resolver, NOTIFICATION_BUBBLES_URI_GLOBAL);
|
||||
if (uri == null || NOTIFICATION_BUBBLES_URI.equals(uri)) {
|
||||
mPreferencesHelper.updateBubblesEnabled();
|
||||
}
|
||||
if (NOTIFICATION_BUBBLES_URI_SECURE.equals(uri)) {
|
||||
syncBubbleSettings(resolver, NOTIFICATION_BUBBLES_URI_SECURE);
|
||||
}
|
||||
}
|
||||
|
||||
private void syncBubbleSettings(ContentResolver resolver, Uri settingToFollow) {
|
||||
boolean followSecureSetting = settingToFollow.equals(NOTIFICATION_BUBBLES_URI_SECURE);
|
||||
|
||||
int secureSettingValue = Settings.Secure.getInt(resolver,
|
||||
Settings.Secure.NOTIFICATION_BUBBLES, DEFAULT_ALLOW_BUBBLE ? 1 : 0);
|
||||
int globalSettingValue = Settings.Global.getInt(resolver,
|
||||
Settings.Global.NOTIFICATION_BUBBLES, DEFAULT_ALLOW_BUBBLE ? 1 : 0);
|
||||
|
||||
if (globalSettingValue == secureSettingValue) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (followSecureSetting) {
|
||||
// Global => secure
|
||||
Settings.Global.putInt(resolver,
|
||||
Settings.Global.NOTIFICATION_BUBBLES,
|
||||
secureSettingValue);
|
||||
} else {
|
||||
// Secure => Global
|
||||
Settings.Secure.putInt(resolver,
|
||||
Settings.Secure.NOTIFICATION_BADGING,
|
||||
globalSettingValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user