Android AlarmManager Javadoc Status
When an alarm goes off, the Intent that had been registered for it is broadcast by the system,
The demos of the APIs shipped with Android have AlarmService (package com.example.android.apis.app) that demonstrate the use of AlarmService.
In it we have the following (edited for clarity):
PendingIntent mAlarmSender = PendingIntent.getService(AlarmService.this, 0, new Intent(AlarmService.this, AlarmService_Service.class), 0); AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE); am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstTime, 30*1000, mAlarmSender);
So, in this example, it does not do PendingIntent mAlarmSender = PendingIntent.getBroadcast(...); , but does getService , which Javadoc never refers to.
The reason I'm asking about this is due to the consequences of blocking processor tracking. Javadoc says that the AlarmManger lock will be released after the onReceive() repeater onReceive() .
What interests me is what are the consequences of tracking blocking if you use Alarm, as in the example? Javadok does not seem to address this. If something seems like you should use the broadcast technique when setting up alarms.
android alarmmanager android-wake-lock
Tim
source share