In my android application I'm using the setAlarmClock()
function to schedule an alarm. This alarm, as the android documentation states:
represents an alarm clock,
which means that the little alarm clock icon should be displayed on the notification bar indicating that there is an alarm pending.
My android phone has a MIUI overlay
- it is a Xiaomi phone (SDK 29
). Now, when I schedule the alarm:
alarmManager.setAlarmClock(
new AlarmManager.AlarmClockInfo(calendar.getTimeInMillis(), alarmPendingIntent),
alarmPendingIntent);
it works fine; it goes off at provided time, wakes the device up as expected etc. But the aformentioned icon indicator is missing - after setting the alarm the notification bar should (at least in theory) look like this:
but, obviously, it looks like this:
For comparison, on another android device (SDK 24
), this time with the EMUI overlay
(Huawei), the setAlarmClock()
function makes the alarm icon show up on the notification bar.
Now I don't know if the issue is MIUI
specific or some settings are wrong. Is there a possible fix to my problem?
Update: From what I've seen, this issue relates to android devices operating under the MIUI
other than mine as well. Seems like Xiaomi is using its own and what seems like more private API, to control the status bar events.