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

Commit f0f629ff authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Introduce IMPORTANCE_MIN.

Allow HUNs for >= IMPORTANCE_HIGH.
Allow full screen intents for IMPORTANCE_MAX.

Bug: 22960980
Bug: 26918284
Change-Id: Id4d2b90ea2e21563dbc716db411060d826e73699
parent 3070d75b
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -34570,10 +34570,11 @@ package android.service.notification {
    method public int getSuppressedVisualEffects();
    method public boolean isAmbient();
    method public boolean matchesInterruptionFilter();
    field public static final int IMPORTANCE_DEFAULT = 2; // 0x2
    field public static final int IMPORTANCE_HIGH = 3; // 0x3
    field public static final int IMPORTANCE_LOW = 1; // 0x1
    field public static final int IMPORTANCE_MAX = 4; // 0x4
    field public static final int IMPORTANCE_DEFAULT = 3; // 0x3
    field public static final int IMPORTANCE_HIGH = 4; // 0x4
    field public static final int IMPORTANCE_LOW = 2; // 0x2
    field public static final int IMPORTANCE_MAX = 5; // 0x5
    field public static final int IMPORTANCE_MIN = 1; // 0x1
    field public static final int IMPORTANCE_NONE = 0; // 0x0
    field public static final int IMPORTANCE_UNSPECIFIED = -1000; // 0xfffffc18
  }
+5 −4
Original line number Diff line number Diff line
@@ -37113,10 +37113,11 @@ package android.service.notification {
    method public int getSuppressedVisualEffects();
    method public boolean isAmbient();
    method public boolean matchesInterruptionFilter();
    field public static final int IMPORTANCE_DEFAULT = 2; // 0x2
    field public static final int IMPORTANCE_HIGH = 3; // 0x3
    field public static final int IMPORTANCE_LOW = 1; // 0x1
    field public static final int IMPORTANCE_MAX = 4; // 0x4
    field public static final int IMPORTANCE_DEFAULT = 3; // 0x3
    field public static final int IMPORTANCE_HIGH = 4; // 0x4
    field public static final int IMPORTANCE_LOW = 2; // 0x2
    field public static final int IMPORTANCE_MAX = 5; // 0x5
    field public static final int IMPORTANCE_MIN = 1; // 0x1
    field public static final int IMPORTANCE_NONE = 0; // 0x0
    field public static final int IMPORTANCE_UNSPECIFIED = -1000; // 0xfffffc18
  }
+5 −4
Original line number Diff line number Diff line
@@ -34585,10 +34585,11 @@ package android.service.notification {
    method public int getSuppressedVisualEffects();
    method public boolean isAmbient();
    method public boolean matchesInterruptionFilter();
    field public static final int IMPORTANCE_DEFAULT = 2; // 0x2
    field public static final int IMPORTANCE_HIGH = 3; // 0x3
    field public static final int IMPORTANCE_LOW = 1; // 0x1
    field public static final int IMPORTANCE_MAX = 4; // 0x4
    field public static final int IMPORTANCE_DEFAULT = 3; // 0x3
    field public static final int IMPORTANCE_HIGH = 4; // 0x4
    field public static final int IMPORTANCE_LOW = 2; // 0x2
    field public static final int IMPORTANCE_MAX = 5; // 0x5
    field public static final int IMPORTANCE_MIN = 1; // 0x1
    field public static final int IMPORTANCE_NONE = 0; // 0x0
    field public static final int IMPORTANCE_UNSPECIFIED = -1000; // 0xfffffc18
  }
+17 −10
Original line number Diff line number Diff line
@@ -929,26 +929,31 @@ public abstract class NotificationListenerService extends Service {
        public static final int IMPORTANCE_NONE = 0;

        /**
         * Low notification importance: only shows in the shade, below the fold.
         * Min notification importance: only shows in the shade, below the fold.
         */
        public static final int IMPORTANCE_LOW = 1;
        public static final int IMPORTANCE_MIN = 1;

        /**
         * Default notification importance: shows everywhere, but is not intrusive.
         * Low notification importance: shows everywhere, but is not intrusive.
         */
        public static final int IMPORTANCE_DEFAULT = 2;
        public static final int IMPORTANCE_LOW = 2;

        /**
         * Higher notification importance: shows everywhere, makes noise,
         * Default notification importance: shows everywhere, allowed to makes noise,
         * but does not visually intrude.
         */
        public static final int IMPORTANCE_HIGH = 3;
        public static final int IMPORTANCE_DEFAULT = 3;

        /**
         * Highest notification importance: shows everywhere, makes noise,
         * and also visually intrudes.
         * Higher notification importance: shows everywhere, allowed to makes noise and peek.
         */
        public static final int IMPORTANCE_MAX = 4;
        public static final int IMPORTANCE_HIGH = 4;

        /**
         * Highest notification importance: shows everywhere, allowed to makes noise, peek, and
         * use full screen intents.
         */
        public static final int IMPORTANCE_MAX = 5;

        private String mKey;
        private int mRank = -1;
@@ -1041,7 +1046,7 @@ public abstract class NotificationListenerService extends Service {
                CharSequence explanation) {
            mKey = key;
            mRank = rank;
            mIsAmbient = importance < IMPORTANCE_DEFAULT;
            mIsAmbient = importance < IMPORTANCE_LOW;
            mMatchesInterruptionFilter = matchesInterruptionFilter;
            mVisibilityOverride = visibilityOverride;
            mSuppressedVisualEffects = suppressedVisualEffects;
@@ -1058,6 +1063,8 @@ public abstract class NotificationListenerService extends Service {
                    return "UNSPECIFIED";
                case IMPORTANCE_NONE:
                    return "NONE";
                case IMPORTANCE_MIN:
                    return "MIN";
                case IMPORTANCE_LOW:
                    return "LOW";
                case IMPORTANCE_DEFAULT:
+9 −4
Original line number Diff line number Diff line
@@ -1219,6 +1219,8 @@

    <!-- Notification importance title, blocked status-->
    <string name="blocked_importance">Blocked</string>
    <!-- Notification importance title, min status-->
    <string name="min_importance">Min importance</string>
    <!-- Notification importance title, low status-->
    <string name="low_importance">Low importance</string>
    <!-- Notification importance title, normal status-->
@@ -1231,17 +1233,20 @@
    <!-- [CHAR LIMIT=100] Notification Importance slider: blocked importance level description -->
    <string name="notification_importance_blocked">Never show these notifications</string>

    <!-- [CHAR LIMIT=100] Notification Importance slider: min importance level description -->
    <string name="notification_importance_min">Silently show at the bottom of the notification list</string>

    <!-- [CHAR LIMIT=100] Notification Importance slider: low importance level description -->
    <string name="notification_importance_low">Silently show at the bottom of the notification list</string>
    <string name="notification_importance_low">Silently show these notifications</string>

    <!-- [CHAR LIMIT=100] Notification Importance slider: normal importance level description -->
    <string name="notification_importance_default">Silently show these notifications</string>
    <string name="notification_importance_default">Allow these notification to make sounds</string>

    <!-- [CHAR LIMIT=100] Notification Importance slider: high importance level description -->
    <string name="notification_importance_high">Show at the top of the notifications list and allow sound</string>
    <string name="notification_importance_high">Peek onto the screen and allow sound and allow sound</string>

    <!-- [CHAR LIMIT=100] Notification Importance slider: max importance level description -->
    <string name="notification_importance_max">Peek onto the screen and allow sound</string>
    <string name="notification_importance_max">Show at the top of the notifications list, peek onto the screen and allow sound</string>

    <!-- Notification: Control panel: Label for button that launches notification settings. [CHAR LIMIT=NONE] -->
    <string name="notification_more_settings">More settings</string>
Loading