-1

The API documentation for AlarmManager shows a cancel() method but requires you to pass in the PendingIntent fired by your application. However, is there a way (either using AlarmManager or something else) to delete alarms set by other applications or alarms set manually by the user in the stock Android clock application?

Am I misunderstanding how Android represents alarms? Since it's a system service my intuition tells me that all applications (with the appropriate permissions) are able to access it, or does Android only represent alarms as Java objects that exist sandboxed in each application?

Bill Mei
  • 717
  • 1
  • 10
  • 22

1 Answers1

0

However, is there a way (either using AlarmManager or something else) to delete alarms set by other applications

No.

or alarms set manually by the user in the stock Android clock application?

No.

Since it's a system service my intuition tells me that all applications (with the appropriate permissions) are able to access it

There is no permission required to set and cancel your app's alarms via AlarmManager. There is no permission available to allow you to cancel alarms set by other apps.

or does Android only represent alarms as Java objects that exist sandboxed in each application?

Whether or not they are Java objects, I can't say. They are "sandboxed" insofar as one app cannot cancel another app's alarms, barring some security flaw in Android.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491