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

Commit 49a2ad1f authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Stop showing ADB and MTP/PTP/USB notifications at the top.

Two parts to this:
1. Stop treating FLAG_ONGOING_EVENT notifications specially
   (in particular, ordering them at the top of the panel).
2. Set the priority bits on the system UI notifications
   appropriately (low).

Change-Id: I3bde7e573654c5aad5e1c5d29e6a21ba94edcc5b
parent f3b73432
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ public class NotificationManagerService extends INotificationManager.Stub
    private static final long[] DEFAULT_VIBRATE_PATTERN = {0, 250, 250, 250};

    private static final int DEFAULT_STREAM_TYPE = AudioManager.STREAM_NOTIFICATION;
    private static final boolean SCORE_ONGOING_HIGHER = false;

    final Context mContext;
    final IActivityManager mAm;
@@ -720,7 +721,7 @@ public class NotificationManagerService extends INotificationManager.Stub
        // Migrate notification flags to scores
        if (0 != (notification.flags & Notification.FLAG_HIGH_PRIORITY)) {
            if (notification.priority < Notification.PRIORITY_MAX) notification.priority = Notification.PRIORITY_MAX;
        } else if (0 != (notification.flags & Notification.FLAG_ONGOING_EVENT)) {
        } else if (SCORE_ONGOING_HIGHER && 0 != (notification.flags & Notification.FLAG_ONGOING_EVENT)) {
            if (notification.priority < Notification.PRIORITY_HIGH) notification.priority = Notification.PRIORITY_HIGH;
        }
        
+2 −0
Original line number Diff line number Diff line
@@ -591,6 +591,7 @@ public class UsbDeviceManager {
                    notification.defaults = 0; // please be quiet
                    notification.sound = null;
                    notification.vibrate = null;
                    notification.priority = Notification.PRIORITY_MIN;

                    Intent intent = Intent.makeRestartActivityTask(
                            new ComponentName("com.android.settings",
@@ -624,6 +625,7 @@ public class UsbDeviceManager {
                    notification.defaults = 0; // please be quiet
                    notification.sound = null;
                    notification.vibrate = null;
                    notification.priority = Notification.PRIORITY_MIN;

                    Intent intent = Intent.makeRestartActivityTask(
                            new ComponentName("com.android.settings",