summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-05-16 18:43:55 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-05-16 18:44:00 +0000
commit3a01c85646e1446266c99bfdcdc77c490db41005 (patch)
treea3b2683f58db2a1985f344d917d6f05a646655c7
parent4dc5766846464bad0299d52c083880dec1f4f1b5 (diff)
parent13f157feeddbac0d0303759214c6db3c5c477007 (diff)
Merge "catch USER_ALL in badging check" into oc-dev
-rw-r--r--services/core/java/com/android/server/notification/RankingHelper.java3
-rw-r--r--services/tests/notification/src/com/android/server/notification/RankingHelperTest.java9
2 files changed, 12 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/notification/RankingHelper.java b/services/core/java/com/android/server/notification/RankingHelper.java
index e83d453d1938..e184f839e805 100644
--- a/services/core/java/com/android/server/notification/RankingHelper.java
+++ b/services/core/java/com/android/server/notification/RankingHelper.java
@@ -1158,6 +1158,9 @@ public class RankingHelper implements RankingConfig {
public boolean badgingEnabled(UserHandle userHandle) {
int userId = userHandle.getIdentifier();
+ if (userId == UserHandle.USER_ALL) {
+ return false;
+ }
if (mBadgingEnabled.indexOfKey(userId) < 0) {
mBadgingEnabled.put(userId,
Secure.getIntForUser(mContext.getContentResolver(),
diff --git a/services/tests/notification/src/com/android/server/notification/RankingHelperTest.java b/services/tests/notification/src/com/android/server/notification/RankingHelperTest.java
index 0f8c815bb2a2..cb0ee2566bee 100644
--- a/services/tests/notification/src/com/android/server/notification/RankingHelperTest.java
+++ b/services/tests/notification/src/com/android/server/notification/RankingHelperTest.java
@@ -1232,6 +1232,15 @@ public class RankingHelperTest extends NotificationTestCase {
}
@Test
+ public void testBadgingForUserAll() throws Exception {
+ try {
+ mHelper.badgingEnabled(UserHandle.ALL);
+ } catch (Exception e) {
+ fail("just don't throw");
+ }
+ }
+
+ @Test
public void testBadgingOverrideUserIsolation() throws Exception {
Secure.putIntForUser(getContext().getContentResolver(),
Secure.NOTIFICATION_BADGING, 0,