Merge "catch USER_ALL in badging check" into oc-dev
am: 3a01c85646
Change-Id: Icf5dc0fd6fd5d2686de01b3f053c211ffb8abb25
This commit is contained in:
@@ -1158,6 +1158,9 @@ public class RankingHelper implements RankingConfig {
|
|||||||
|
|
||||||
public boolean badgingEnabled(UserHandle userHandle) {
|
public boolean badgingEnabled(UserHandle userHandle) {
|
||||||
int userId = userHandle.getIdentifier();
|
int userId = userHandle.getIdentifier();
|
||||||
|
if (userId == UserHandle.USER_ALL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (mBadgingEnabled.indexOfKey(userId) < 0) {
|
if (mBadgingEnabled.indexOfKey(userId) < 0) {
|
||||||
mBadgingEnabled.put(userId,
|
mBadgingEnabled.put(userId,
|
||||||
Secure.getIntForUser(mContext.getContentResolver(),
|
Secure.getIntForUser(mContext.getContentResolver(),
|
||||||
|
|||||||
@@ -1231,6 +1231,15 @@ public class RankingHelperTest extends NotificationTestCase {
|
|||||||
assertFalse(mHelper.badgingEnabled(USER));
|
assertFalse(mHelper.badgingEnabled(USER));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBadgingForUserAll() throws Exception {
|
||||||
|
try {
|
||||||
|
mHelper.badgingEnabled(UserHandle.ALL);
|
||||||
|
} catch (Exception e) {
|
||||||
|
fail("just don't throw");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBadgingOverrideUserIsolation() throws Exception {
|
public void testBadgingOverrideUserIsolation() throws Exception {
|
||||||
Secure.putIntForUser(getContext().getContentResolver(),
|
Secure.putIntForUser(getContext().getContentResolver(),
|
||||||
|
|||||||
Reference in New Issue
Block a user