catch USER_ALL in badging check

Bug: 38264652
Test: runtest systemui-notification
Change-Id: Id482ed4984eef83ad0e9876acda5addb65aca5f9
This commit is contained in:
Chris Wren
2017-05-12 15:02:06 -04:00
parent 28f0fd7a2d
commit 13f157feed
2 changed files with 12 additions and 0 deletions

View File

@@ -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(),

View File

@@ -1231,6 +1231,15 @@ public class RankingHelperTest extends NotificationTestCase {
assertFalse(mHelper.badgingEnabled(USER));
}
@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(),