Battery optimization not available - Wear OS Q&A, Help & Troubleshooting

Hello,
I'm developing a tracking application that runs on Wear OS watches. I have some troubles when the watch goes to sleep. As soon as the watch goes to Deep Idle mode, all sensors acquisition stops. For that I'll need to whitelist the app using:
Code:
Intent intent = new Intent();
intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
intent.setData(Uri.parse("package:" + packageName));
context.startActivity(intent);
This piece of code works well on mobile version but nothing happen on Wear OS version. I realized that Wear OS as no UI to set the battery optimization mode which should be the cause of the fact that nothing happens when trying to change the optimization.
I also used a wake lock to keep the CPU partially awake with:
Code:
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MY-WAKELOCK");
But even with that the watch goes to deep sleep after about 15min ?
The last solution I see is to force the screen on or at least dimmed but it will drain the battery very fast.
Is there another solution to keep sensors working ? How can I whitelist my app on a Wear OS device as no UI seems available ? As anyone already encountered this issue?

Related

Doze mode not working

Nexus 6P, All Stock, Marshmallow w/ May security updates. [non-rooted]
A while back, I noticed Doze had stopped working. I always leave my phone unplugged overnight, and the battery graph used to be a mostly flat line overnight, with no wake activity. Recently, the graph is sloped, and there is a lot of activity overnight. I tried disabling WIFI and Google Now, but that didn't help.
I really do not want to do a factory reset. I don't think that will help. Also, I haven't installed any new apps - I'm not sure what it is. The phone displays a lot of wake locks throughout the day as well.
Has anyone run into this problem before and has a more specific solution or approach to troubleshoot? I wish Google hadn't dumbed down their battery info, you really can't get any meaningful information with 3rd party apps. Is there a way to identify what woke up the phone during those time it was dozing?
Looks pretty normal to me. I see just a handful of wakelocks for you. You could always try setting Location to battery-saving mode. Make sure bluetooth is off, see if that helps.
I have the same issue even when in battery saver mode overnight. Sometimes I'll lose 40% in just six or seven hours.
Sent from my Nexus 6P using XDA-Developers mobile app
So nobody have a solution to this problem? Sometimes it loses 1-2 percent per night, but sometimes about 15, obviously it processes something, I can't understand what, I don't install new applications in monthes.
Most battery stat apps need root after 4.4 but you could use adb if your keen...
Dumpsys System Diagnostics
Viewing Battery Use Data
Battery Historian Graph
Edit: Wakelock Detector has a pc version which could be easier if it works...
having the same issue!!! i also notice my wifi line to be constant even when wifi is switched off!!! which is absolutely strange!!!!
Happy news from me.
I successfully restored Doze Mode in my phone MiA1 Android One 8.1.0 Dec 2018.
Here is how. Go to Developer options, Background check.
Turn the Switches to Off for most Apps except the Critical ones. (Don't Rush, it's not easy to determine the Critical Apps. Choose in stages till the Doze mode kicks in).
Here's a list of System Apps which I have switched off
ANT HALL Service
Calendar
Chrome
FactoryKit Test
Gmail
Google
Google Play ... (all of them)
Maps
Settings
Spock
Translate
____________
You may have to do some experiments.
I could not pinpoint which System Apps were the rogue ones.
I eliminated the possibility of all apps that I installed as the cause.
The rogue apps which prevented my phone entering the doze mode were unknown components of Android OS and Android system (I am hundred percent sure).
My approach is a trial and error one and I expect some malfunction in the future.
BUT, I reconfirm that in my phone Doze Mode is now working.
Here is some inside info. My MiA1 Android One 8.1.0 (Dec 2018) Phone's Doze Node did work for some time after I did all that mentioned, but NOT GOOD enough; again it malfunctioned and continuous 3% per hour battery consumption by Android OS was noticed with totally idle phone.
(Then deleted cache data of all apps including system ones. DID NOT HELP. So my advice is don't waste your time doing this).
(Remote all syncing of all apps. DID NOT HELP).
LAST Attempt. Deleted App data and also cache data of Google Play services. It takes some time to initiate and it was OK. May have worked, not sure as Google/Android meanwhile updated its Google and other related apps in the Google Play Store.
Now the REAL Good News
It's now 3 days my phone's Doze Mode is ACTUALLY WORKING!!
Now the screen-off battery consumption is 0.7% per hour which includes non-doze mode. The doze mode works even when the phone is in the pocket and moving. You only need the screen to be switched off.
This has been my phone's normal behaviour for last 3 years (since September 2017)
I perhaps want to thank @google / @ANDROID for getting rid of the buggy update of August 19 on September 5.

No deep sleep and high battery usage

Hi everyone,
most of the time, my Axon 7 eats the battery absurdly fast, when only lying around (Standby). I opened a different thread that I caught it once discharging the battery even when turned off, but several other times, it did not do that again.
I noticed that BetterBatteryStats tells me that there is almost 0 time for "Deep Sleep" (3s) while it is "Awake (Screen Off)" almost all the time. Since I have no root, I do not know how reliable the data is (100% Awake + 21% Screen On + 0% Deep Sleep = 121% = lol).
I have checked the power management for all apps. All have "Allow deep sleep" activated.
The battery discharging is so heavy that one charge is not enough for one day of usage (with some hours screen on time).
Do you have experienced something like this, even with a different phone? Any ideas are welcome.
Regards,
Puni
You must have some app eating your battery. Try to remove some latest apps and reboot. If that doesn't work clear cache.. After that is only factory reset left...
FATPunisher said:
I noticed that BetterBatteryStats tells me that there is almost 0 time for "Deep Sleep" (3s) while it is "Awake (Screen Off)" almost all the time.
Click to expand...
Click to collapse
Okay, this is not really specific to the Axon 7, but it will work anyway. I precise I'm NOT ROOTED as well.
First :
- you better also install Gsam Battery Monitor, you'll have access to a better looking stats for Doze Mode. However, under Battery Manager (sorry, doesn't know how it is in english) / Battery Usage / Time battery used, you should have "Awake time" and monitor it here as well
- install Greenify as well, to try to apply Doze mode asap.
Second:
- Wifi on the axon, even when "turned off while screen is off", isn't. Manually switch the wifi off if needed.
- The same is for the GPS/Location services. Even when the toggle is OFF, you are still being tracked. Long-clic on the toggle, and make sure location is disabled (unless you need it). It will reset if you 'allow' Google Maps to enable location for yourself. Don't do it.
Third :
- Fiddle with Energy management, and learn about the 4 available toggles (disallow at startup, force close when screen is off, delay wake up, do not allow wakeup when in doze mode). Be careful about notifications tho, activating some switches might remove or delay them
- Go to security, administrators : do you have an app that shouldn't be there (which can wake up the phone)?
- Go to acessibility, same
- Do a reboot
- Watch what happens next
- Please report back here with BBStats + Gsam + Energy manager screenshots at least
Thanks a lot!
I will try your hints.
But disabling Wifi and GPS/Location is not really useful for me, because I need both all of the time. Could try it for seeing if it helps though.
Activating Air Plane mode allows Deep Sleep. Not useful, but nevertheless interesting.
I noticed that my Medion tablet with Android 4.4.2 (!) has the same issue. Must be an app installed on both I guess.
Wakelock Detector says it's Android System, AlarmManager. That is not too helpful.
On my Axon 7, Bluetooth triggers the Wakelock. It's 100% reproducible. Cannot be the whole story though, there must be more. The battery lasts at least twice as long without Bluetooth.
Solved!
Solved it!
It was the app MeinVodafone. It causes Wakelocks when Bluetooth is enabled.
I found a forum posting by somebody else confirming that.
Very nasty.
Thanks everybody!
P.S.: My tablet is a different story. Bluetooth is never active there. The wakelock vanished, but I have no idea what happened. Doesn't matter, unrelated.

IS it possible to install android wear on a smartphone?

As mentined above I vould like to install wear on an smartphone.... STOP don't laugh
I would like to use an android weare enabled smartphone as a "Notification device" on my desk, as I don't like to have my (main)smartphone sreen always on (battery and so on)
Thx in adwance
Yes you can with Android's Doze mode. It is the feature that Android launched with Marshmallow to save battery life. If you don't know what that is, Doze mode puts your phone and its apps to sleep when your phone is sitting still and not plugged in charging. This is a really good option even for mobile application developers as it gives freedom to develop apps that send notifications and yet allow users to save their battery life.

Disabled Package causes phone to never Deep Sleep, help me.

Greetings people.
I have an Exynos S7 Edge, while my battery life is fine (2-3% idle drain) 3.5-4h HEAVY use SoT, i noticed, that my device - according to GSAM Battery, never goes to Deep Sleep state.
http://imgur.com/thTfuI0
According to other S7 Edge users, 0% deep sleep IS bad behaviour, so I'm starting my investigation.
First idea: malicous app - put this to the side for now.
Real first idea - ENABLE all packages that are disabled in Package Disabler pro.
And voilá, my device is already speeling like a baby when left alone:
http://imgur.com/JGe2xTb
So here's my question, how on earth is a DISABLED package causing the CPU from going Deep Sleep state, furthermore WHICH package is responsibe for this?
Here's my exported xml of disabled packages:
https://drive.google.com/file/d/0B1oJj1HFpAS1clo3OFZoR3huVHM/view?usp=sharing
Can't seem to find any big system packages you have disabled...
I have Gsam Pro myself but can't find the wake lock info inside the app?

Disable native sleep tracker on wear os Oppo Watch 46mm 1st gen

Hello!
I recently got a Oppo Watch to replace my previous wear os device because the battery of the previous one drained too fast.
Battery actually behaves way better, except for one thing: the sleep tracking, which drains between X5 and x9 of the previous model (and when I say x9 I mean almost an entire charge in 6 hours of sleeping)
I bought a smartwatch mainly to get a smart alarm. The previous one didn't have an integrated sleep monitoring app, so I chosen a third party one that included both sleep monitor and smart alarm... And consumed around 10% per night.
Oppo lasts longer for the rest, but during night drains 48-89% depending on the app used (I'm trying various options).
Now, without a third party app, the battery consumption at night is at normal levels (11%), so I suspect that the problem is that I run a second sleep tracker from the third party app while the native one of the device is running at the same time.. And the combination of the two put it under efforts that kills the battery.
For this reason, I would like to know how to disable the native sleep monitoring, so to check how the battery behaves running only the third party app one.
I navigated across all the app settings, but can't identify the sleep tracker to disable it.
Would somebody help me with exact indications on how to disable it?
Thank you in advance

Categories

Resources