I would like to know if there is a way (probably a system broadcast) to know that the alarm clock default application is now start ringing.
if not - I\'ll be satisfied a
I highly doubt that you'll find a solution for this.
Alarms are maintained by AlarmManagerService
. Since it is not included in the SDK, reflection might be the only way to get something out of it. But from the looks of it, even reflection cannot help you here:
Seems like a dead end to me. You cannot instantiate AlarmManagerService
- not even by accessing and invoking its constructor (because it calls a native method).
Another line of reasoning: Here's a look at AlarmManagerService$Alarm
class:
public static class Alarm {
public int type;
public int count;
public long when;
public long windowLength;
public long whenElapsed; // 'when' in the elapsed time base
public long maxWhen; // also in the elapsed time base
public long repeatInterval;
public PendingIntent operation; <<<<<<============Problem==============
public WorkSource workSource;
....
....
}
If one can gain access to the PendingIntent
, what's stopping them from cancelling alarms at will - alarms that have been set by other apps?
Still, I hope someone here can help you out.
Link: AlarmManagerService