Skip to content

Commit 49a2ad1

Browse files
committed
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
1 parent f3b7343 commit 49a2ad1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

services/java/com/android/server/NotificationManagerService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public class NotificationManagerService extends INotificationManager.Stub
7979
private static final long[] DEFAULT_VIBRATE_PATTERN = {0, 250, 250, 250};
8080

8181
private static final int DEFAULT_STREAM_TYPE = AudioManager.STREAM_NOTIFICATION;
82+
private static final boolean SCORE_ONGOING_HIGHER = false;
8283

8384
final Context mContext;
8485
final IActivityManager mAm;
@@ -720,7 +721,7 @@ public void enqueueNotificationInternal(String pkg, int callingUid, int callingP
720721
// Migrate notification flags to scores
721722
if (0 != (notification.flags & Notification.FLAG_HIGH_PRIORITY)) {
722723
if (notification.priority < Notification.PRIORITY_MAX) notification.priority = Notification.PRIORITY_MAX;
723-
} else if (0 != (notification.flags & Notification.FLAG_ONGOING_EVENT)) {
724+
} else if (SCORE_ONGOING_HIGHER && 0 != (notification.flags & Notification.FLAG_ONGOING_EVENT)) {
724725
if (notification.priority < Notification.PRIORITY_HIGH) notification.priority = Notification.PRIORITY_HIGH;
725726
}
726727

services/java/com/android/server/usb/UsbDeviceManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ private void updateUsbNotification() {
591591
notification.defaults = 0; // please be quiet
592592
notification.sound = null;
593593
notification.vibrate = null;
594+
notification.priority = Notification.PRIORITY_MIN;
594595

595596
Intent intent = Intent.makeRestartActivityTask(
596597
new ComponentName("com.android.settings",
@@ -624,6 +625,7 @@ private void updateAdbNotification() {
624625
notification.defaults = 0; // please be quiet
625626
notification.sound = null;
626627
notification.vibrate = null;
628+
notification.priority = Notification.PRIORITY_MIN;
627629

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

0 commit comments

Comments
 (0)