[Q] troublesome alarms

8 posts
Thanks Meter: 0
By GLantern, Junior Member on 22nd August 2014, 05:18 AM
Post Reply Subscribe to Thread Email Thread
ok I know we can't remove alarmmanager because is part of system, but some behaviors are idiotic

After I recharged my phone I check battery and statistics with battery monitor widget
first 4 hours only eats 5%
wakelocks android system/alarmmanager had only 4 or 8
in some time after this android eats battery excessively
10 hours 37%
wakelocks android system/alammanager had 200+

I have greenify for skype face navigator
google apps (except gmail) and samsung trashes uninstalled with titanium backup
data, wifi, bt,gps and rotate off (I only turn on when I need some...)
many services disabled with autostart disabler (redundant XD )

dump of alarm give me this

Current Alarm Manager state:
  Realtime wakeup (now=2014-08-21 11:27:01):
  RTC_WAKEUP #4: Alarm{423efd98 type 0}
    type=0 when=+21h42m58s793ms repeatInterval=0 count=0
    operation=PendingIntent{423efd18: PendingIntentRecord{423efc78 broadcastIntent}}
  RTC_WAKEUP #3: Alarm{420dc790 type 0}
    type=0 when=+21h42m58s793ms repeatInterval=0 count=0
    operation=PendingIntent{420dc710: PendingIntentRecord{420dc670 broadcastIntent}}
  RTC_WAKEUP #2: Alarm{42252fe8 type 0}
    type=0 when=+21h42m38s793ms repeatInterval=0 count=0
    operation=PendingIntent{42252f68: PendingIntentRecord{42252e78 broadcastIntent}}
  RTC_WAKEUP #1: Alarm{4245a4c0 type 0}
    type=0 when=+21h42m38s793ms repeatInterval=0 count=0
    operation=PendingIntent{420dc9c0: PendingIntentRecord{4245a3b0 broadcastIntent}}
  RTC_WAKEUP #0: Alarm{41ebf518 type 0 android}
    type=0 when=+8m2s392ms repeatInterval=3697267 count=1
    operation=PendingIntent{41d7c9d0: PendingIntentRecord{422197f8 android broadcastIntent}}
  RTC #2: Alarm{4200b440 type 1}
    type=1 when=+12h33m35s18ms repeatInterval=86400000 count=1
    operation=PendingIntent{4200b3c0: PendingIntentRecord{4200b2d0 broadcastIntent}}
  RTC #1: Alarm{420c4588 type 1 com.kk.launcher}
    type=1 when=+12h2m54s37ms repeatInterval=86400000 count=0
    operation=PendingIntent{41dd0a90: PendingIntentRecord{4219d990 com.kk.launcher startService}}
  RTC #0: Alarm{41f5a6a8 type 1 android}
    type=1 when=+32m58s793ms repeatInterval=0 count=0
    operation=PendingIntent{41d1e068: PendingIntentRecord{4220ed20 android broadcastIntent}}
  Elapsed realtime wakeup (now=+12h12m5s990ms):
  ELAPSED_WAKEUP #4: Alarm{41fbfa28 type 2 android}
    type=2 when=+20m0s913ms repeatInterval=0 count=0
    operation=PendingIntent{41d179b0: PendingIntentRecord{41fbf918 android broadcastIntent}}
  ELAPSED_WAKEUP #3: Alarm{420b4830 type 2 android}
    type=2 when=+18m4s927ms repeatInterval=0 count=0
    operation=PendingIntent{420321a0: PendingIntentRecord{420f9818 android broadcastIntent}}
  ELAPSED_WAKEUP #2: Alarm{42091018 type 2 android}
    type=2 when=+15m45s488ms repeatInterval=0 count=0
    operation=PendingIntent{42026c28: PendingIntentRecord{41f8bea0 android broadcastIntent}}
  ELAPSED_WAKEUP #1: Alarm{421005f8 type 2 android}
    type=2 when=+12m12s841ms repeatInterval=0 count=0
    operation=PendingIntent{41bb9510: PendingIntentRecord{42109978 android broadcastIntent}}
  ELAPSED_WAKEUP #0: Alarm{41d60d58 type 2 android}
    type=2 when=+10m33s436ms repeatInterval=0 count=0
    operation=PendingIntent{4214f928: PendingIntentRecord{41e2d400 android broadcastIntent}}
  ELAPSED #4: Alarm{421fd5f0 type 3}
    type=3 when=+4h2m54s10ms repeatInterval=28800000 count=1
    operation=PendingIntent{41dd7180: PendingIntentRecord{41f72048 broadcastIntent}}
  ELAPSED #3: Alarm{42331880 type 3 android}
    type=3 when=+6m26s93ms repeatInterval=0 count=0
    operation=PendingIntent{41ee8130: PendingIntentRecord{4221a2f0 android broadcastIntent}}
  ELAPSED #2: Alarm{421a7670 type 3 android}
    type=3 when=+2m54s10ms repeatInterval=1800000 count=1
    operation=PendingIntent{421a7330: PendingIntentRecord{421a7290 android broadcastIntent}}
  ELAPSED #1: Alarm{423277c8 type 3 android}
    type=3 when=+58s766ms repeatInterval=0 count=0
    operation=PendingIntent{41d45120: PendingIntentRecord{4220ebf8 android broadcastIntent}}
  ELAPSED #0: Alarm{42182c48 type 3}
    type=3 when=+15s438ms repeatInterval=60000 count=1
    operation=PendingIntent{420b1d80: PendingIntentRecord{41f43710 broadcastIntent}}
  Broadcast ref count: 0
  Alarm Stats:
    50384ms running, 15 wakeups
    4 alarms: flg=0x14
    200 alarms: act=android.intent.action.TIME_TICK flg=0x40000014
    24 alarms: flg=0x14
    58 alarms: flg=0x14
    11 alarms: flg=0x40000014
    5ms running, 2 wakeups
    2 alarms: flg=0x4
    601ms running, 2 wakeups
    1 alarms: flg=0x14
    1 alarms: flg=0x14
    133ms running, 0 wakeups
    1 alarms: flg=0x14
    420ms running, 0 wakeups
    2 alarms: flg=0x14
    1210ms running, 0 wakeups
    60 alarms: flg=0x10000014

it's seems in this code lays the key to delete or expand the delay of the alarms

I'm not an expert in android but I think is possible

have a nice day
27th August 2014, 05:53 PM |#2  
OP Junior Member
Thanks Meter: 0
I have an idea

RTC_WAKEUP #4: Alarm{423efd98 type 0}
after "alarm" we can see a alphanumeric code (maybe the alarm ID) and the guilty app
so if we could got this parameters from dumpsys in some android app and extract the class from guilty app
we could use this code:
Intent intent = new Intent(this, ┐class?.class);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(
                this.getApplicationContext(),┐id?, intent, 0);
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);

and kill those alarms and save battery
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes