Loading core/java/android/provider/Settings.java +0 −1 Original line number Diff line number Diff line Loading @@ -9015,7 +9015,6 @@ public final class Settings { ASSIST_GESTURE_WAKE_ENABLED, VR_DISPLAY_MODE, NOTIFICATION_BADGING, NOTIFICATION_BUBBLES, // moved to global NOTIFICATION_DISMISS_RTL, QS_AUTO_ADDED_TILES, SCREENSAVER_ENABLED, Loading services/core/java/com/android/server/notification/BubbleExtractor.java +1 −2 Original line number Diff line number Diff line Loading @@ -41,10 +41,9 @@ public class BubbleExtractor implements NotificationSignalExtractor { if (DBG) Slog.d(TAG, "missing config"); return null; } boolean userWantsBubbles = mConfig.bubblesEnabled(record.sbn.getUser()); boolean appCanShowBubble = mConfig.areBubblesAllowed(record.sbn.getPackageName(), record.sbn.getUid()); if (!userWantsBubbles || !appCanShowBubble) { if (!mConfig.bubblesEnabled() || !appCanShowBubble) { record.setAllowBubble(false); } else { if (record.getChannel() != null) { Loading services/core/java/com/android/server/notification/NotificationManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1359,7 +1359,7 @@ public class NotificationManagerService extends SystemService { private final Uri NOTIFICATION_BADGING_URI = Settings.Secure.getUriFor(Settings.Secure.NOTIFICATION_BADGING); private final Uri NOTIFICATION_BUBBLES_URI = Settings.Secure.getUriFor(Settings.Secure.NOTIFICATION_BUBBLES); = Settings.Secure.getUriFor(Settings.Global.NOTIFICATION_BUBBLES); private final Uri NOTIFICATION_LIGHT_PULSE_URI = Settings.System.getUriFor(Settings.System.NOTIFICATION_LIGHT_PULSE); private final Uri NOTIFICATION_RATE_LIMIT_URI Loading Loading @@ -4843,7 +4843,7 @@ public class NotificationManagerService extends SystemService { // Does the app want to bubble & is able to bubble boolean canBubble = intentCanBubble && mPreferencesHelper.areBubblesAllowed(pkg, userId) && mPreferencesHelper.bubblesEnabled(r.sbn.getUser()) && mPreferencesHelper.bubblesEnabled() && r.getChannel().canBubble() && !mActivityManager.isLowRamDevice(); Loading services/core/java/com/android/server/notification/PreferencesHelper.java +8 −29 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ public class PreferencesHelper implements RankingConfig { private final ZenModeHelper mZenModeHelper; private SparseBooleanArray mBadgingEnabled; private SparseBooleanArray mBubblesEnabled; private boolean mBubblesEnabled; private boolean mAreChannelsBypassingDnd; private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS; Loading Loading @@ -1818,39 +1818,18 @@ public class PreferencesHelper implements RankingConfig { } public void updateBubblesEnabled() { if (mBubblesEnabled == null) { mBubblesEnabled = new SparseBooleanArray(); } boolean changed = false; // update the cached values for (int index = 0; index < mBubblesEnabled.size(); index++) { int userId = mBubblesEnabled.keyAt(index); final boolean oldValue = mBubblesEnabled.get(userId); final boolean newValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.NOTIFICATION_BUBBLES, DEFAULT_ALLOW_BUBBLE ? 1 : 0, userId) != 0; mBubblesEnabled.put(userId, newValue); changed |= oldValue != newValue; } if (changed) { final boolean newValue = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.NOTIFICATION_BUBBLES, DEFAULT_ALLOW_BUBBLE ? 1 : 0) == 1; if (newValue != mBubblesEnabled) { mBubblesEnabled = newValue; updateConfig(); } } public boolean bubblesEnabled(UserHandle userHandle) { int userId = userHandle.getIdentifier(); if (userId == UserHandle.USER_ALL) { return false; public boolean bubblesEnabled() { return mBubblesEnabled; } if (mBubblesEnabled.indexOfKey(userId) < 0) { mBubblesEnabled.put(userId, Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.NOTIFICATION_BUBBLES, DEFAULT_ALLOW_BUBBLE ? 1 : 0, userId) != 0); } return mBubblesEnabled.get(userId, DEFAULT_ALLOW_BUBBLE); } public void updateBadgingEnabled() { if (mBadgingEnabled == null) { Loading services/core/java/com/android/server/notification/RankingConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ public interface RankingConfig { boolean canShowBadge(String packageName, int uid); boolean badgingEnabled(UserHandle userHandle); boolean areBubblesAllowed(String packageName, int uid); boolean bubblesEnabled(UserHandle userHandle); boolean bubblesEnabled(); boolean isGroupBlocked(String packageName, int uid, String groupId); Collection<NotificationChannelGroup> getNotificationChannelGroups(String pkg, Loading Loading
core/java/android/provider/Settings.java +0 −1 Original line number Diff line number Diff line Loading @@ -9015,7 +9015,6 @@ public final class Settings { ASSIST_GESTURE_WAKE_ENABLED, VR_DISPLAY_MODE, NOTIFICATION_BADGING, NOTIFICATION_BUBBLES, // moved to global NOTIFICATION_DISMISS_RTL, QS_AUTO_ADDED_TILES, SCREENSAVER_ENABLED, Loading
services/core/java/com/android/server/notification/BubbleExtractor.java +1 −2 Original line number Diff line number Diff line Loading @@ -41,10 +41,9 @@ public class BubbleExtractor implements NotificationSignalExtractor { if (DBG) Slog.d(TAG, "missing config"); return null; } boolean userWantsBubbles = mConfig.bubblesEnabled(record.sbn.getUser()); boolean appCanShowBubble = mConfig.areBubblesAllowed(record.sbn.getPackageName(), record.sbn.getUid()); if (!userWantsBubbles || !appCanShowBubble) { if (!mConfig.bubblesEnabled() || !appCanShowBubble) { record.setAllowBubble(false); } else { if (record.getChannel() != null) { Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1359,7 +1359,7 @@ public class NotificationManagerService extends SystemService { private final Uri NOTIFICATION_BADGING_URI = Settings.Secure.getUriFor(Settings.Secure.NOTIFICATION_BADGING); private final Uri NOTIFICATION_BUBBLES_URI = Settings.Secure.getUriFor(Settings.Secure.NOTIFICATION_BUBBLES); = Settings.Secure.getUriFor(Settings.Global.NOTIFICATION_BUBBLES); private final Uri NOTIFICATION_LIGHT_PULSE_URI = Settings.System.getUriFor(Settings.System.NOTIFICATION_LIGHT_PULSE); private final Uri NOTIFICATION_RATE_LIMIT_URI Loading Loading @@ -4843,7 +4843,7 @@ public class NotificationManagerService extends SystemService { // Does the app want to bubble & is able to bubble boolean canBubble = intentCanBubble && mPreferencesHelper.areBubblesAllowed(pkg, userId) && mPreferencesHelper.bubblesEnabled(r.sbn.getUser()) && mPreferencesHelper.bubblesEnabled() && r.getChannel().canBubble() && !mActivityManager.isLowRamDevice(); Loading
services/core/java/com/android/server/notification/PreferencesHelper.java +8 −29 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ public class PreferencesHelper implements RankingConfig { private final ZenModeHelper mZenModeHelper; private SparseBooleanArray mBadgingEnabled; private SparseBooleanArray mBubblesEnabled; private boolean mBubblesEnabled; private boolean mAreChannelsBypassingDnd; private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS; Loading Loading @@ -1818,39 +1818,18 @@ public class PreferencesHelper implements RankingConfig { } public void updateBubblesEnabled() { if (mBubblesEnabled == null) { mBubblesEnabled = new SparseBooleanArray(); } boolean changed = false; // update the cached values for (int index = 0; index < mBubblesEnabled.size(); index++) { int userId = mBubblesEnabled.keyAt(index); final boolean oldValue = mBubblesEnabled.get(userId); final boolean newValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.NOTIFICATION_BUBBLES, DEFAULT_ALLOW_BUBBLE ? 1 : 0, userId) != 0; mBubblesEnabled.put(userId, newValue); changed |= oldValue != newValue; } if (changed) { final boolean newValue = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.NOTIFICATION_BUBBLES, DEFAULT_ALLOW_BUBBLE ? 1 : 0) == 1; if (newValue != mBubblesEnabled) { mBubblesEnabled = newValue; updateConfig(); } } public boolean bubblesEnabled(UserHandle userHandle) { int userId = userHandle.getIdentifier(); if (userId == UserHandle.USER_ALL) { return false; public boolean bubblesEnabled() { return mBubblesEnabled; } if (mBubblesEnabled.indexOfKey(userId) < 0) { mBubblesEnabled.put(userId, Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.NOTIFICATION_BUBBLES, DEFAULT_ALLOW_BUBBLE ? 1 : 0, userId) != 0); } return mBubblesEnabled.get(userId, DEFAULT_ALLOW_BUBBLE); } public void updateBadgingEnabled() { if (mBadgingEnabled == null) { Loading
services/core/java/com/android/server/notification/RankingConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ public interface RankingConfig { boolean canShowBadge(String packageName, int uid); boolean badgingEnabled(UserHandle userHandle); boolean areBubblesAllowed(String packageName, int uid); boolean bubblesEnabled(UserHandle userHandle); boolean bubblesEnabled(); boolean isGroupBlocked(String packageName, int uid, String groupId); Collection<NotificationChannelGroup> getNotificationChannelGroups(String pkg, Loading