Skip to content
Christophe Gevrey edited this page Aug 2, 2013 · 4 revisions

AlarmManager

Author(s): sven, credits to andy2na @xda-dev

Ranking: n/a

Speaking Name: Alarm Manager

Rationale: AlarmManager provides access to the system alarm services. These allow you to schedule an application to be run at some point in the future. When an alarm goes off, the Intent that has been registered for it is broadcasted by the system, automatically starting the target application if it is not already running. Registered alarms are retained while the device is asleep (and can optionally wake the device up if they go off during that time), but will be cleared if it is turned off and rebooted. The Alarm Manager holds a CPU wake lock as long as the alarm receiver's onReceive() method is executing. This guarantees that the phone will not sleep until you have finished handling the broadcast. Once onReceive() returns, the Alarm Manager releases this wake lock. This means that the phone will in some cases sleep as soon as your onReceive() method completes.

Know actions: AlarmManager itself is not generating partial wakelocks but the applications (intents) that were set to be called when an alarm goes off do. Alarms can be listed through the menu "Actions - Alarms".

Here is a comprehensive guide to analyse Alarms: In order to find those Intents run the command dumpsys alarm.

This will dump all the alarm events so you can see what is invoking AlarmManager as a wakelock. From there you can find the culprits that have a lot of wakeups. In some instances, you cant do anything about it (Android System), but in others, you can uninstall or disable notifications. Hope this helps in solving your excessive AlarmManager problems.

Scroll to the " Alarm Stats" near the bottom, it should look like this:

com.levelup.beautifulwidgets

246776ms running, 10 wakeups

10 alarms: act=com.levelup.beautifulwidgets.ACTION_UPDATEWEATHER flg=0x4

1583 alarms: act=com.levelup.beautifulwidgets.ACTION_UPDATECLOCK flg=0x4

com.motorola.blur.datamanager.app

22ms running, 0 wakeups

1 alarms: act=com.motorola.blur.datamanager.app.checkin.timeout flg=0x4 cmp=com.motorola.blur.datamanager.app/.DataManagerCheckinService

ccc71.bmw

130743ms running, 1585 wakeups

1585 alarms: flg=0x4

com.motorola.kpilogger

2156ms running, 0 wakeups

13 alarms: act=com.motorola.kpilogger.START_LOG flg=0x4

com.gau.go.launcherex

528ms running, 10 wakeups

6 alarms: act=com.jiubang.intent.action.AUTO_CHECK_UPDATE flg=0x4

4 alarms: act=com.jiubang.intent.action.SCAN_APPS flg=0x4

As you can see, in my case, the services that have invoked AlarmManager seem to be BeautifulWidgets (to update the clock everytime the minute changes - 1583 alarms: act=com.levelup.beautifulwidgets.ACTION_UPDATECLOC K flg=0x4)

Battery Monitor Widget (obviously to pull the mW of the battery) - 130743ms running, 1585 wakeups

You could also reduce the amount of AlarmManager events by simply turning off Wireless location, Signing out of Google Talk, and turning off notifications or updates in apps you dont really use.

TLDR: AlarmManager is a universal process that MANY apps use to update time, push you notifications, etc. In most cases, it is a necessity; in other cases, you should really check it out and disable/uninstall things that have invoked it too much.

Known conditions of occurence:

Related wakelocks:

References:

http://forum.xda-developers.com/showpost.php?p=17207454&postcount=861

http://developer.android.com/reference/android/app/AlarmManager.html

Clone this wiki locally