diff options
author | Raman Tenneti <rtenneti@google.com> | 2020-07-13 11:40:02 -0700 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-12-08 19:39:11 +0200 |
commit | b7718e76ef472d0500af936c111c3ab36a00620a (patch) | |
tree | 7884b17b44b68acf5368a51796ab8012beaf53f5 | |
parent | dcefd879853aeaf2b50ec1b4292195d576e9ccda (diff) |
AOSP/DeskClock: Improve AlarmNotification priority to pop up alarm notification.
Root cause: Because alarm notification is IMPORT_DEFAULT in AOSP R,
there is no alarm alert pop up when alarm on time.
Solution: Improve the priority to IMPORT_HIGH.
Merging b/153362039#comment6 and I have added HIGH at one of the missed locations.
Changed IMPORTANCE_DEFAULT to IMPORTANCE_HIGH in showHighPriorityNotification,
updateUpcomingAlarmGroupNotification and updateMissedAlarmGroupNotification methods.
BUG: 153362039
Test: manual - Tested the DeskClock UI manually and tested the alarm, stopwatch and timer.
$ make -j 40
$ ls -l out/target/product/bonito/product/app/DeskClock/DeskClock.apk
-rw-r----- 1 rtenneti primarygroup 6117353 Jul 13 11:35 out/target/product/bonito/product/app/DeskClock/DeskClock.apk
$ adb install -r out/target/product/bonito/product/app/DeskClock/DeskClock.apk
+ Verified by setting up the alaram and waiting for the alarm to go off.
Change-Id: I7d97fe6a39b016a9b9850849b38e1a1b98410807
-rw-r--r-- | src/com/android/deskclock/alarms/AlarmNotifications.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/deskclock/alarms/AlarmNotifications.java b/src/com/android/deskclock/alarms/AlarmNotifications.java index b01413796..c7994966b 100644 --- a/src/com/android/deskclock/alarms/AlarmNotifications.java +++ b/src/com/android/deskclock/alarms/AlarmNotifications.java @@ -213,7 +213,7 @@ final class AlarmNotifications { NotificationChannel channel = new NotificationChannel( ALARM_HIGH_PRIORITY_NOTIFICATION_CHANNEL_ID, context.getString(R.string.default_label), - NotificationManagerCompat.IMPORTANCE_DEFAULT); + NotificationManagerCompat.IMPORTANCE_HIGH); nm.createNotificationChannel(channel); } final Notification notification = builder.build(); @@ -285,7 +285,7 @@ final class AlarmNotifications { NotificationChannel channel = new NotificationChannel( ALARM_NOTIFICATION_CHANNEL_ID, context.getString(R.string.default_label), - NotificationManagerCompat.IMPORTANCE_DEFAULT); + NotificationManagerCompat.IMPORTANCE_HIGH); nm.createNotificationChannel(channel); } @@ -326,7 +326,7 @@ final class AlarmNotifications { NotificationChannel channel = new NotificationChannel( ALARM_NOTIFICATION_CHANNEL_ID, context.getString(R.string.default_label), - NotificationManagerCompat.IMPORTANCE_DEFAULT); + NotificationManagerCompat.IMPORTANCE_HIGH); nm.createNotificationChannel(channel); } @@ -344,7 +344,7 @@ final class AlarmNotifications { NotificationChannel channel = new NotificationChannel( ALARM_MISSED_NOTIFICATION_CHANNEL_ID, context.getString(R.string.default_label), - NotificationManagerCompat.IMPORTANCE_DEFAULT); + NotificationManagerCompat.IMPORTANCE_HIGH); nm.createNotificationChannel(channel); } summary = new NotificationCompat.Builder(context, ALARM_NOTIFICATION_CHANNEL_ID) |