Why Alarm icon is not shown ONLY on Samsung Android 9 devices when set with AlarmManager.setAlarmClock()?
Asked Answered
K

1

12

I use AlarmManager.setAlarmClock() to set an alarm. Alarm is fired on all devices, including Samsung, but the small alarm icon near the clock (top right corner of the screen) is missing on Samsung devices with Android 9. What am I missing here?

I know that the issue has also affected Google Clock application, but it was fixed recently.

My code:

val pendingAlarm = Intent(ACTION_FIRED)
    .apply {
        setClass(mContext, AlarmsReceiver::class.java)
        putExtra(EXTRA_ID, id)
        putExtra(EXTRA_TYPE, typeName)
     }
     .let { PendingIntent.getBroadcast(mContext, pendingAlarmRequestCode, it, PendingIntent.FLAG_UPDATE_CURRENT) }

 val pendingShowList = PendingIntent.getActivity(
     mContext,
     100500,
     Intent(mContext, AlarmsListActivity::class.java), PendingIntent.FLAG_UPDATE_CURRENT)

 am.setAlarmClock(AlarmManager.AlarmClockInfo(calendar.timeInMillis, pendingShowList), pendingAlarm)
Koontz answered 14/7, 2019 at 14:43 Comment(4)
is the phone making use of Good Lock ?Truncated
I have asked some users - no Good Lock is involved.Koontz
@YuriyKulikov, have you managed to find a fix? Having the same problem and it's driving me nuts.Thinnish
Hello, no, no fix is available as of today.Koontz
T
3

From what I can tell, I think this is because of samsungs specific implementation of the android OS and seems to be related to the samsung OS implementation itself.

I found one thread discussing something very similar, which might be of some help: enter image description here (found here: https://www.reddit.com/r/GalaxyS9/comments/anck2x/google_clock_no_upcoming_alarm_iconnotification/)

and i found another discussion regarding the same topic found here : (https://forums.androidcentral.com/samsung-galaxy-note-9/952204-alarm-icon.html) enter image description here

enter image description here

it seems as if the OS only shows alarm indications a specific amount of time before the alarm goes off (some people are saying 30 minutes roughly, maybe OP can test to verify that)

This answer is not extremely useful and it's a bit all-over, but it seems to be reliant on the specific implementation of the android OS on the samsung device

Truncated answered 16/7, 2019 at 19:0 Comment(4)
Upcoming alarm is a notification. I mean an icon in the right top screen corner. It is not a notification, it is an icon shown by AlarmManager (normally).Koontz
@YuriyKulikov the samsung OS might be treating this as a notification internallyTruncated
you are mixing two things. One is "upcoming alarm notification" which is shown by some applications, for example Google clock. This is a notification. What I need is not a notification. I need a small icon in the right top corner of the screen, next to the clock, this is shown (on all devices except Samsung) when I call this: am.setAlarmClock(AlarmManager.AlarmClockInfo(calendar.timeInMillis, pendingShowList), pendingAlarm)Koontz
yes, that's what i'm trying to explain to you. it is the samsung version of the android OS which handles UPCOMING ALARMS as notifications.Truncated

© 2022 - 2024 — McMap. All rights reserved.