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

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

Merge "Hide overlay notification" into pi-dev

parents 196cf03f af78a797
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.service.notification.StatusBarNotification;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Log;
import android.util.Slog;
import android.util.SparseArray;

import com.android.internal.messages.nano.SystemMessageProto;
@@ -174,9 +175,9 @@ public class ForegroundServiceControllerImpl

    @Override
    public boolean isSystemAlertNotification(StatusBarNotification sbn) {
        // TODO: tag system alert notifications so they can be suppressed if app's notification
        // is tagged
        return false;
        return sbn.getPackageName().equals("android")
                && sbn.getTag() != null
                && sbn.getTag().contains("AlertWindowNotification");
    }

    /**
+12 −1
Original line number Diff line number Diff line
@@ -368,6 +368,17 @@ public class ForegroundServiceControllerTest extends SysuiTestCase {
        assertFalse(fsc.isDungeonNeededForUser(USERID_TWO));
    }

    @Test
    public void testOverlayPredicate() {
        StatusBarNotification sbn_user1_app1 = makeMockSBN(USERID_ONE, "com.example.app1",
                5000, "monkeys", Notification.FLAG_AUTO_CANCEL);
        StatusBarNotification sbn_user1_overlay = makeMockSBN(USERID_ONE, "android",
                0, "AlertWindowNotification", Notification.FLAG_NO_CLEAR);

        assertTrue(fsc.isSystemAlertNotification(sbn_user1_overlay));
        assertFalse(fsc.isSystemAlertNotification(sbn_user1_app1));
    }

    @Test
    public void testStdLayoutBasic() {
        final String PKG1 = "com.example.app0";
@@ -439,7 +450,7 @@ public class ForegroundServiceControllerTest extends SysuiTestCase {
        when(sbn.getNotification()).thenReturn(n);
        when(sbn.getId()).thenReturn(id);
        when(sbn.getPackageName()).thenReturn(pkg);
        when(sbn.getTag()).thenReturn(null);
        when(sbn.getTag()).thenReturn(tag);
        when(sbn.getUserId()).thenReturn(userid);
        when(sbn.getUser()).thenReturn(new UserHandle(userid));
        when(sbn.getKey()).thenReturn("MOCK:"+userid+"|"+pkg+"|"+id+"|"+tag);