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)
1 Check whether the alarm has been enabled by a third-party app. An alarm icon will be displayed on the status bar if you have set up an alarm or reminder in a third-party app.
The alarm is an Intent broadcast that goes to a broadcast receiver that you registered with Context. registerReceiver(BroadcastReceiver, IntentFilter) or through the <receiver> tag in an AndroidManifest. xml file. Alarm intents are delivered with a data extra of type int called Intent.
Set an exact alarm. The system invokes an exact alarm at a precise moment in the future. If your app targets Android 12 or higher, you must declare one of the "Alarms & reminders" permissions; otherwise, a SecurityException occurs. Your app can set exact alarms using one of the following methods.
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: (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)
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With