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

Commit b7718e76 authored by Raman Tenneti's avatar Raman Tenneti Committed by Michael Bestas
Browse files

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
parent dcefd879
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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)