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

Commit 862095a7 authored by Gus Prevas's avatar Gus Prevas
Browse files

Changes notification auto-demotion to use secure setting.

This change modifies the code which auto-demotes high priority
notifications to use the secure setting which is also used by the
notifications UI, instead of using a system property.

Test: n/a
Change-Id: If206341865d39ea83bf9b8e6da6f3a73e5addcba
parent ab96fe0b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -78,8 +78,6 @@ import java.util.Map;
public class Assistant extends NotificationAssistantService {
    private static final String TAG = "ExtAssistant";
    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
    public static final boolean AUTO_DEMOTE_NOTIFICATIONS = SystemProperties.getBoolean(
            "debug.demote_notifs", false);
    public static final boolean AGE_NOTIFICATIONS = SystemProperties.getBoolean(
            "debug.age_notifs", false);

@@ -242,7 +240,8 @@ public class Assistant extends NotificationAssistantService {
        if (!smartReplies.isEmpty()) {
            signals.putCharSequenceArrayList(Adjustment.KEY_SMART_REPLIES, smartReplies);
        }
        if (AUTO_DEMOTE_NOTIFICATIONS) {
        if (Settings.Secure.getInt(getContentResolver(),
                Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL, 0) == 1) {
            if (mNotificationCategorizer.shouldSilence(entry)) {
                final int importance = entry.getImportance() < IMPORTANCE_LOW
                        ? entry.getImportance() : IMPORTANCE_LOW;