Home > Back-end >  Why does AlarmManager.AlarmClockInfo catch silent alarms from Tasker?
Why does AlarmManager.AlarmClockInfo catch silent alarms from Tasker?

Time:01-18

I am developing a clock app that needs to get the next Alarm triggering time. By "Alarm" I mean the noisy ones to wake up. I do this with

 AlarmManager.AlarmClockInfo aci = ((AlarmManager) getSystemService(Context.ALARM_SERVICE)).getNextAlarmClock();

The problem is that my app is catching Tasker "alarms" (that I have no idea where they come from), instead of the usual Clock alarms.

How do I catch a "true" noisy clock alarm? Or how do I tell AlarmManager to ignore Tasker alarms?

CodePudding user response:

AlarmManager is for setting some actions to be performed at certain moment by apps. This may be "true noisy alarm" or any other action, e.g. showing reminder notification or do some sync with servers in background. check out some related DOC

There is no such thing like "system alarm" - you have some clock app installed on your device and it have feature to set "true noisy alarm" in the future. It may use AlarmManager for getting informed that time for making noise comes, but may also use any other mechanism, like WorkManager

So there is no way/API for getting information about "true noisy alarms" set in system. Because such thing doesn't exists, alarm is a feature of app, you may have few clock apps, you may uninstall all available on device. One and only chance for getting list of "true noisy alarms" is to communicate with setting-alarms-app in any way (broadcast? aidl?), I very doubt any app this type is providing any api for this check...

  • Related