[GUIDE] 0% [0.0%/h] Idle Battery Drain on Stock ROM (XPosed & Amplify Required!)

Status
Not open for further replies.
Search This thread

anon1135

Senior Member
Jan 23, 2017
840
176
They shouldn't. Either you have the option "scanning is always available even with WLAN turned off" or applications on your phone other than android are trying to make connections.

thx. might be all the different messaging apps thought I greenified or blocked all of them during doze/powernap. I'll test another night
 

galvao10

Member
Sep 16, 2014
21
5
Alarms: 556, Intent: *job.deadline*
Alarms: 1133, Intent: *job.delay*
JobScheduler running wild due to rogue app(s)? If BBS decides to explain Services stats properly there might be clues there.

"sec-battery-monitor" (): 10 m 7 s
Does Samsung have some battery monitor that can be turned off?


I will investigate these *job.deadline* and *job.delay* but I might be related to HEBF optimizer app that has a doze function on it ( see sceenshot)

About "sec-battery-monitor" I have no idea. Is there any way to find out?
 

galvao10

Member
Sep 16, 2014
21
5
I will investigate these *job.deadline* and *job.delay* but I might be related to HEBF optimizer app that has a doze function on it ( see sceenshot)

About "sec-battery-monitor" I have no idea. Is there any way to find out?

I forgot the sceenshot.
 

Attachments

  • Screenshot_20171110-095200.png
    Screenshot_20171110-095200.png
    94.2 KB · Views: 462

Celestial Fury

Senior Member
Aug 19, 2013
1,000
1,434
Sim City
I will investigate these *job.deadline* and *job.delay* but I might be related to HEBF optimizer app that has a doze function on it ( see sceenshot)

About "sec-battery-monitor" I have no idea. Is there any way to find out?
HEBF optimizer
Disable it and see what's the difference. Note: A single log with and without it disabled isn't conclusive. More logs increases likelihood.

sec-battery-monitor
Does enabling the WiFi setting turn wifi off when asleep reduces it? Note: Check if this impacts your push notifications. Mostly Samsung phones seem to have issues with sec-battery-monitor.
 
  • Like
Reactions: galvao10

anon1135

Senior Member
Jan 23, 2017
840
176
anyone using setcpu to help save battery during screen off? I don't see it in any guides and I think latest version doesn't work on nougat. wanted to know if it's really useful
 

anon1135

Senior Member
Jan 23, 2017
840
176
anyone using setcpu to help save battery during screen off? I don't see it in any guides and I think latest version doesn't work on nougat. wanted to know if it's really useful

I tried it on mm and it doesn't seem bad but if max cpu is set too low then recieving calls will be delayed or too laggy to accept. things like Bluetooth audio could also sound choppy at times. for me around 700 was fine. I'm not sure how people can be fine with it set to as low as 300. some were doing that in guides when I checked but they're a bit outdated since it's an old app. I was thinking maybe some roms can already clock that low by default without any user changes during screen off possibly making this app unnecessary

edit - sorry didn't mean to double post I thought I clicked the edit instead of quote button
 
Last edited:

xt7xda

Senior Member
May 13, 2015
109
16
Moto X Play
Xiaomi Redmi 4X
Hi,

While travelling, I listen to music a lot, for 3-4 hrs daily. I'm using Moto X Play with Lineage OS 14.1 20171109/Magisk/Xposed/Amplify/ForceDoze.

Can android doze while playing music (Poweramp) with screen off, facedown and motion sensor off? Is it possible?

Thanks...
 
Last edited:

smallKING81

Senior Member
Oct 20, 2011
254
51
Novosibirsk
I got the problem with whatsapp when I limited alarm com.google.android.gms.common.receiver.LOG_CORE_ANALYTICS up to 9999999 seconds.
I do not receive notification of an incoming message until I enter to whatsapp. With the disabled restriction, notifications arrive excellent.
 

Celestial Fury

Senior Member
Aug 19, 2013
1,000
1,434
Sim City
I got the problem with whatsapp when I limited alarm com.google.android.gms.common.receiver.LOG_CORE_ANALYTICS up to 9999999 seconds.
I do not receive notification of an incoming message until I enter to whatsapp. With the disabled restriction, notifications arrive excellent.
Android version?
How many copies of WhatsApp on the phone?
If yes, which has a problem - first or second?
Have you checked that none of the push notification alarms (red cloud icon) have been limited?
Is WhatsApp greenified/dozed/in stamina mode?
Doe it happen every time - reproducible?
 
  • Like
Reactions: smallKING81

smallKING81

Senior Member
Oct 20, 2011
254
51
Novosibirsk
Android version?
How many copies of WhatsApp on the phone?
If yes, which has a problem - first or second?
Have you checked that none of the push notification alarms (red cloud icon) have been limited?
Is WhatsApp greenified/dozed/in stamina mode?
Doe it happen every time - reproducible?
Ohh, I found my mistake...I limited alarm com.google.android.intent.action.GCM_RECONNECT
Now everything is OK. Thank you!
 

patrickdrd

Senior Member
Mar 24, 2015
752
156
big big no, NEVER EVER touch that one if you want notifications!
limit everything else, everything you want except this!
 

sohebq

Senior Member
Aug 20, 2011
3,438
604
RAWALPINDI
It doesn't matter how many times I limit facebook Orca. It will generate a new similar service. I am tired of this. The faceook alternate suggested was not that good.
 

Attachments

  • Screenshot_20171215-110511.png
    Screenshot_20171215-110511.png
    218.2 KB · Views: 1,229
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 327
    * how to do it *

    What you need

    You can debloat, freeze, greenify but what can really bring your idle battery drain to 0.0%/h is Amplify (forum link). This guide (based on Xperia Z1 KitKat (now Lolipop) / my apps / my usage patterns) will list the alarms & wakelocks and time that they've been limited that I've used to gain the result I've shown you. NOTE: This is a guide and your phone/apps/usage patterns WILL be different. See Post #3 (especially Step 7) on how to test. Do NOT limit anything that doesn't drain for you (unless it's ads or privacy related).

    Strikeouts mean that the alarms/wakelocks used to drain but no longer seem to but should still be safe for you to limit if they drain for you.

    FIX for
    suspend_backoff (kernel wakelock)

    Alarms (Allow every 7200 seconds or 2 hours)
    *
    cloud-red.png
    affects push notifications (alerts from mail, social apps, etc.) Things may get delayed if the phone has been idle for a while. Turning on the screen, connecting to a new WiFi or any event that wakes up the phone can trigger push notifications.


    - ALARM_WAKEUP_CACHE_UPDATER
    - android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSED
    - com.android.vending/com.google.android.finsky.services.ContentSyncService
    cloud-red.png

    - com.google.android.apps.sidekick.SCHEDULED_REFRESH
    - com.google.android.sidekick.shared.a.a.UPDATE_CALENDAR_ACTION
    - com.google.android.apps.gsa.kato.ACTION_ALARM
    - com.google.android.googlequicksearchbox/com.google.android.sidekick.main.TrafficIntentService
    - com.whatsapp.alarm.AVAILABLE_TIMEOUT
    - com.whatsapp.MessagingService.RECONNECT
    cloud-red.png



    Alarms (Allow every 43200 seconds or 12 hours)

    - android.content.syncmanager.SYNC_ALARM
    cloud-red.png

    - com.android.providers.calendar.intent.CalendarProvider2
    (use alternative calendar here)

    - com.facebook.push.mqtt.keepalive.KeepaliveManager.ACTION_INEXACT_ALARM.com.facebook.katana
    - com.facebook.common.executors.WakingExecutorService.ACTION.ALARM.com.facebook.katana.Mqtt_Wakeup
    - com.facebook.common.executors.WakingExecutorService.ACTION.ALARM.com.facebook.katana

    - com.google.android.gms.gcm.ACTION_CHECK_QUEUE
    cloud-red.png

    - com.google.android.intent.action.GCM_RECONNECT
    cloud-red.png

    (may break push notifications for custom ROMs)

    - com.google.android.gms.gcm.HEARTBEAT_ALARM
    cloud-red.png

    - com.google.android.intent.action.MCS_HEARTBEAT
    cloud-red.png

    - com.google.android.intent.action.SEND_IDLE

    - com.whatsapp.alarm.CLIENT_PING_TIMEOUT
    - com.whatsapp.messaging.MessageService.LOGOUT.ACTION
    - com.whatsapp.messaging.MessageService.CLIENT_PINGER_ACTION
    cloud-red.png


    Alarms (Allow every 86400 seconds or 24 hours)
    Custom Regex
    CONTEXT_MANAGER_ALARM_WAKEUP_[0-9]{4,}

    - android.app.backup.intent.RUN
    - com.android.internal.telephony.data-stall (reported to break WiFi calling)
    - com.google.android.gms/.checkin.EventLogService$Receiver
    - com.google.android.gms/checkin.CheckinService%Receiver

    Location alarms (both rough and fine)
    * They wake up your device to get a fix (from GPS/network/cell towers) by Google Play Services for apps like Google Now and for Google's own database. GPS may be delayed in the background for Google apps like Google Now. Refresh manually. Navigation apps do not rely on these location alarms. They access the GPS directly.
    - ALARM_WAKEUP_ACTIVITY_DETECTION
    - ALARM_WAKEUP_ACTIVE_COLLECTOR
    - ALARM_WAKEUP_BURST_COLLECTOR
    - ALARM_WAKEUP_BURST_COLLECTION_TRIGGER
    - ALARM_WAKEUP_PASSIVE_COLLECTOR

    - com.google.android.gms.flp.BATCH_FLUSH
    - com.google.android.gms.location.fused.GPS_ALARM_BALANCED_ACCURACY
    - com.google.android.location.reporting.ACTION_UPDATE_WORLD
    - com.google.android.location.ALARM_WAKEUP_IN_OUT_DOOR_COLLECTOR
    - com.google.android.location.ALARM_WAKEUP_SENSOR_COLLECTOR
    - com.google.android.location.ALARM_WAKEUP_SENSOR_UPLOADER

    - com.google.android.gms.nlp.ALARM_WAKEUP_ACTIVE_COLLECTOR
    - com.google.android.gms.nlp.ALARM_WAKEUP_ACTIVITY_DETECTION
    - com.google.android.gms.nlp.ALARM_WAKEUP_BURST_COLLECTOR
    - com.google.android.gms.nlp.ALARM_WAKEUP_BURST_COLLECTION_TRIGGER
    - com.google.android.gms.nlp.ALARM_WAKEUP_LOCATOR
    - com.google.android.gms.nlp.ALARM_WAKEUP_PASSIVE_COLLECTOR

    - GPS_ALARM_BALANCED_ACCURACY


    Alarms (Allow every 9999999 seconds or max)
    - com.facebook.analytics.service.AnalyticsEventUploader.ACTION_ALARM
    - com.google.android.gms.common.receiver.LOG.CORE_ANALYTICS
    - com.google.android.gms.common.receiver.LOG_CORE_ANALYTICS
    - com.google.android.gms.analytics.ANALYTICS_DISPATCH
    - com.google.location.internal.AnalyticsUploadIntentService


    Wakelocks (Allow every 7200 seconds or 2 hours)
    - *net_scheduler*
    - AlarmService#updateNTP
    - ConnectivityService
    - StartingDockService
    - wake:com.whatsapp/.AlarmService


    Wakelocks (Allow every 43200 seconds or 12 hours)
    -

    Wakelocks (Allow every 86400 seconds or 24 hours)

    - QcConnectivityService

    Location wakelocks (both rough and fine)
    - NlpWakeLock
    - NlpCollectorWakeLock

    Wakelocks (Allow every 9999999 seconds or max)
    - Analytics Wakelock
    - *job*/com.facebook.katana/com.facebook.analytics2.logger.LollipopUploadService
    - JobSchedulerHack-com.facebook.analytics2.logger.LollipopUploadService
    - UploadServiceLogic-com.facebook.analytics2.logger.LollipopUploadService


    DANGEROUS - DO NOT LIMIT / DENY
    Wakelocks
    - *backup* -(CAUSES REBOOT)
    - AlarmManager (alarm clock can stop working, etc.)
    - Icing (reported to force close Google Play services, etc.)
    - pkg_move_lock (bootloop reported)
    - UlrDispatchingService (Google play services has stopped)

    Alarms
    - com.oasisfeng.greenify.CLEAN_NOW (Greenify stops hibernating apps)
    - com.system.analytics.cpa.service.Myservice (reported to force close FB Messenger)

    Services
    - com.google.android.gms/.checkin.CheckinService (its related wakelock will run wild)
    - com.google.android.gms/.checkin.EventLogService (its related wakelock will run wild)
    - com.google.android.gms/com.google.android.libraries.social.autobackup.FingerprintScannerIntentService (its related wakelock will run wild)

    (also see other recommendations within Amplify)


    Not Recommended
    Wakelocks
    - ALARM_WAKEUP_LOCATOR (required for "in Vehicle" trigger in Automation apps)
    anim-new5.gif

    - AudioMix - affects notification sound
    - ALARM_ACTION(#####) - WeChat will just create another (number)
    - android.appwidget.action.APPWIDGET_UPDATE - affects widget accuracy (widgets drain battery, your call
    - StartingAlertService - calendar notifications won't trigger
    (also see other recommendations within Amplify)


    Deny these Ads/Privacy related Services
    After disabling any service, reboot the phone because it is dangerous to disable any service on-the-fly according to Amplify so it's only disabled on a reboot. Read warning here.

    - com.facebook.katana/com.facebook.backgroundlocation.reporting.BackgroundLocationReportingNewImplService
    - com.facebook.katana/com.facebook.analytics.service.AnalyticsService
    - com.facebook.katana/com.facebook.analytics2.logger.LollipopUploadService
    - com.facebook.katana/com.facebook.analytics2.logger.GooglePlayUploadService
    - com.facebook.katana/com.facebook.videoads.scheduler.VideoAdsFetchService

    - com.google.android.gms/ads.jam.NegotiationService (reported to force close Google Play Services on some devices)
    - com.google.android.gms/.ads.social.GcmSchedulerWakeupService
    - com.google.android.gms/.analytics.AnalyticsService
    - com.google.android.gms/.analytics.service.PlayLogMonitorIntervalService
    - com.google.android.gms/.analytics.service.RefreshEnabledStateService
    - com.google.android.gms/com.google.android.location.internal.AnalyticsSamplerService
    - com.google.android.gms/common.analytics.CoreAnalyticsIntentService

    - com.sonymobile.enterprise.service/.GoogleAnalyticsLogger
    - com.sonyericsson.android.socialphonebook/.analytics.GaInitService
    - com.sonyericsson.conversations/com.sonymobile.conversations.analytics.GaInitService
    - com.sonyericsson.extras.liveware/.analytics.AnalyticsService


    NOW TESTING (please help to test and confirm, thank you!)
    Nothing.
    321
    The ORIGINAL:good: Amplify Guide Thread

    View attachment 3106730
    On the Portal News! Jan 8, 2015

    bitbag-logo-white.png

    TheBitBag Thursday, January 15th, 2015

    logo_ns.png

    Noob’s Space, 2015年08月30日


    THIS IS REAL. This also goes against traditional methods/advice of reducing battery drain while idle. Idle battery drain comes mostly from Alarms and Wakelocks that want to work when they're supposed to be sleeping. This GUIDE will help you reduce your idle battery drain to 0% [0.0%/h] without turning your smartphone into a dumbphone. The EVIDENCE is all in the attachments.

    0% [0.0%/h] does not mean no battery drain. BetterBatteryStats only detects up to one decimal point so 0.0% means you have a drain of between 0.01% - 0.09% or less than 0.1% so it shows 0.0%.

    What you DON'T have to do
    NO disabling GPS
    NO disabling Auto Sync
    NO disabling Google Now
    NO disabling Location Services
    NO disabling Location History
    NO disabling Android Backup
    NO disabling WiFi
    NO disabling Google Services Framework
    NO disabling Receivers
    NO disabling Google Maps
    NO disabling Facebook / social apps
    NO converting Google Play Services to a User App
    NO breaking Push Notifications
    NO Tasker/Automation battery saving rules
    NO Custom ROM involved
    NO Init.d Battery saving scripts involved
    NO Underclocking involved
    NO changing of Governors involved
    NO blocking Google IP addresses with Firewall

    Doing any one of these "NO's" will reduce battery drain BUT you then mostly lose functionality. So how is it possible, what is involved, what do you get, and how do you do it?

    What is possible
    GPS - High Accuracy :good:
    Choose Battery Saving and no near instantaneous GPS lock. Choose Device Only and Google Maps shows your last GPS location lock (which may not be your current location).
    Auto Sync All your Accounts :good:
    Google Now, Location Services & History working :good:
    Turn off Location Services & History and Google Now doesn't work or as well and your GPS gets turned off.
    Android Backup is on :good:
    If turned off all your backups will be deleted (it's not a toggle) - thanks Google - not!
    WiFi can be kept awake (even during deep sleep) :good:
    Scanning always available :good:
    Google Services Framework is not disturbed:good:
    Receivers are not disturbed :good:
    Google Maps is available :good:
    It's still the best and has the most up-to-date maps.
    Facebook /Social Apps are available :good:
    They can be used as they are meant to be. These app can be tamed (with the exception of WeChat(!) - Whatsapp ok, Line Ok).
    Google Play Services remains a system app :good:
    As it should be - avoid complications.
    * Instant Push Notifications :good:
    (mileage may vary)
    anim-new5.gif

    No need for Tasker/Automation battery saving rules :good:
    Too many rules and they can also drain the battery. They tend to have one wakelock/alarm for each rule!
    Completely Stock Rom (rooted) without need of Init.d, Governors, underclocking, Min/Max CPU, and everything Google is working :good:

    Attachment 1: Other
    6h 29m 19s Bat.: 0% [0.0%/h]
    Deep Sleep
    6h 28m 24s 99.8%
    Awake
    54s 0.2%
    As you can see in the status bar, b & kb are being transmitted and the battery temp as well as the time, they are green in colour indicating that the device is connected to a live network - meaning WiFi is on and was never off.

    Attachment 2: Kernel Wakelock
    All under 15s for nearly 7 hours - if you have kernel wakelock problems, this guide can't help you. Amplify can't limit kernel wakelocks.

    Attachment 3: Partial Wakelock
    1s for nearly 7 hours - do you like what you see? ;)

    Attachment 4: Alarms
    Wakeups: 1 for nearly 7 hours - do you like what you see? ;) Com.google.android.gms puts all its alarms under this but each of its alarms is also Wakeups: 1 (see Attachment 5 in next thread).
    227
    * how to test *

    Screen On needs to be less than a minute as we want to find out what's draining in idle mode. If you've used the phone then there's no way to tell what's acting up when it shouldn't be and there's no way to separate the active from idle.

    In BBS Settings - Advanced
    Untick Alarms using API & Kernel Wakelocks using API (it's less accurate) unless using API is the only way to show alarms & wakelocks for your phone.


    STEPS

    Establish Baseline (battery ONLY drain)
    1. Charge battery to full (100%).
    2. Switch phone OFF.
    3. After 7 hours or so turn it on.
    4. To get drain / hour, divide % of battery reduction with number of hours the phone was off. Example, if battery % dropped by 1% after 7 hours, then 1 / 7 = [0.1%/h]. This is your battery only drain, without drain from Android OS, radio signal, WiFi, data, wakelocks, & alarms. You can't get a better drain than this without removing your battery.

    Establish Baseline (Airplane Mode)
    1. Charge battery to full (100%).
    2. Switch phone to Airplane Mode.
    3. After 7 hours or so turn off Airplane Mode.
    4. Check drain in BBS. This is your battery drain, without drain from radio signal, WiFi, and data. You can't get a better drain than your battery only baseline.

    Test Idle Battery Drain
    1. Charge battery to full (100%).
    2. Reset Amplify Device Stats NOT Reset to defaults.
      (Useful for troubleshooting which limited alarm/wakelock is causing trouble)
    3. Leave phone idle for 7 hours or more.
    4. Check phone for any unknown reboot (running time in Amplify & BBS must be the same. If BBS has a MUCH shorter time or if it shows "Boot" instead of "Unplugged" then there was a reboot as BBS doesn't keep stats after reboot).
    5. Report here for the cause of reboot and do not limit it anymore.
    6. It is easier to use BBS as a guide for battery drain. Increase time of limited alarm/wakelock and/or limit other alarms or wakelocks. Don't limit something that doesn't cause drain for you (unless it's ads/privacy).
    7. Repeat Step 1.
      Your PHONE can't get a better drain than the two baselines.

    [LINK] Why charge to 100% instead of setting custom reference and measuring from there?
    Sometimes battery levels have been observed getting stucked at lower levels and not draining at all despite being in used for over half an hour. That is level lost and voltage lost are sometimes not in sync.
    Level lost [%]: Bat.: -2%(71% to 69%) [0.3%/h]
    Voltage lost [mV]: (4066-4066) [0.0%/h]

    Level lost but no voltage lost or vice versa is not logical.
    anim-new5.gif


    How to find problems with limited alarms/wakelocks
    1. If it's not in the guide, you'll have to test it yourself.
    2. In Amplify, RESET Device Stats.
    3. Use the app you have a problem with.
    4. Check in Amplify what alarms/partial wakelocks were triggered.
    5. OR Disable Amplify, reboot and see if your problem still occurs.

    If you need help

    (Don't start using phone first - I can tell from screen on time)
    ATTACH a Text Dumpfile - in BBS, --> Share --> Text Dumpfile and ATTACH as an ATTACHMENT (not post) the textfile. (Don't attach screenshots if there's a dump available)

    IF Alarms & Wakelocks are already low OR if you have severe drain, then attach idle BBS text dumpfile + attach (as an attachment, NOT post): IDLE screenshots of

    (Android) Settings - Power management
    • Battery usage (to see app usage)
    • History details (to see mobile network signal and coverage and others)

    BetterBatteryStats
    • Graphs - in 3-vertical-dot menu (to see more detailed wakelock graph)
    • History - in 3-vertical-dot menu (to check for skipping and abnormal drain)

    WiFi Connection Manager

    • Spectrum (to check for ovelapping with other WiFi networks)

    Facing problems with abnormal battery % and shutdown ?
    (from Sony support forum - removable/built-in batteries)
    WARNING
    To be safe, turn OFF your WiFI before using this battery trick. All your saved WiFi passwords can disappear with a hard forced shutdown/restart). WiFi passwords are supposed to be saved to Google (if you have backup enabled) but they're NOT restored by Google.

    Use WiFi Connection Manager to save all your WiFi passwords onto the SD Card.

    BBS note

    NO posting in multiple threads for help (unless you didn't get a reply after a few days or want a different opinion).
    14
    Hi!

    You can also stop them by using
    So for example, the regex ALARM_WAKEUP[0-9]{6,} will restrict all ALARM_WAKEUP with six digits
    Not exactly: this regex will restrict all ALARM_WAKEUP with six digits or more.
    This is the behavior:
    {count}
    matches exactly count occurrences of the preceding regular expression;
    {min,}
    matches min or more occurrences of the preceding regular expression;
    {min, max}
    matches at least min but no more than max occurrences of the preceding regular expression.

    So, this guide can be simplified a bit: if you have ALARM_WAKEUP[0-9]{4,} then you don't really need other regexps with higher number.
    13
    Post #1 is DONE. Comments? Criticisms? Photoshop accusations? :p