Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a01c856 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "catch USER_ALL in badging check" into oc-dev

parents 4dc57668 13f157fe
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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(),
+9 −0
Original line number Diff line number Diff line
@@ -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(),