yashsingh1/xdaforums huggingface dataset:
[Google Pixel 2 Questions & Answers] bleets:
Well in 4% my phone will be charged again, it's staying idle for now so I'll see what battery life is like...it got turned out as it started charging because it decided to drain completely so...if it's draining fast I'll turn wifi off and let you know if there's any difference....I have a data block for mobile data atm though so...yeah fun
[Google Pixel 2 Questions & Answers] armordillo:
Sorry, bud. Well I hope you experience the same as myself so we can see if this is consistent across multiple users.
[Google Pixel 2 Questions & Answers] bleets:
yeah a quick test that was.

in the first hour it dropped 5% when i wasnt using, just looking at it to see what % it was at (i like the fact pie has the battery level on the lock screen).

Turned wifi off because of the very obvious fast drain and in the next hour it hasnt even dropped 1%.

So err...take from that what you will.
[Google Pixel 2 Questions & Answers] armordillo:
Dun dun dun... Sounds like we *may* have a cause if others can confirm this. I'm super curious why Wi-Fi would cause it to drain faster than mobile data. I've never heard that one before.
[Google Pixel 2 Questions & Answers] bleets:
except i don't think it's just wifi.

like i said i tend not to keep wifi on and I have had major drains when on mobile data, 2 of them in fact.
[Google Pixel 2 Questions & Answers] armordillo:
Is there anything you're leaning towards, [MENTION=4350973]bleets[/MENTION]? I watched 'logcat' for about 10 minutes with Wi-Fi on and 10 minutes with Wi-Fi off. Most of the 'errors' I caught repeated no matter what the connection type was. The errors I did see mostly looked like errors that have been out there for years on other Android versions.

My mobile data plan is an unlimited plan (been grandfathered through Sprint for almost 10 years now) so I don't worry about turning particular apps off under any circumstances... I upload to Nextcloud, Google Photos and download from Google Play music whether on Wi-Fi or data...

So I don't have any particular leads...
[Google Pixel 2 Questions & Answers] bleets:
This is actually fun, you can clearly see the difference in power usage when wifi is on and off, sharp decline for the first hour when wifi is on, very little drop when wifi is off, another sharp decline when wifi is on, very little drop when wifi is off...this is a fun game
[Google Pixel 2 Questions & Answers] armordillo:
[MENTION=4350973]bleets[/MENTION], I've used ADB to get shell access and have watched 'logcat' for a good while (45 min). I'm still not seeing anything I can say I'm 100% confident is our issue. I see the 2 Errors popping up frequently:

1)

08-18 13:07:16.585 2587 17089 E WakeLock: CMWakeLock was already released!
08-18 13:07:16.585 2587 17089 E WakeLock: java.lang.RuntimeException: WakeLock under-locked CMWakeLock
08-18 13:07:16.585 2587 17089 E WakeLock:	at android.os.PowerManager$WakeLock.release(PowerManager.java:1563)
08-18 13:07:16.585 2587 17089 E WakeLock:	at android.os.PowerManager$WakeLock.release(PowerManager.java:1525)
08-18 13:07:16.585 2587 17089 E WakeLock:	at amwg.a(:com.google.android.gms@12874041@12.8.74 (100400-204998136):4)
08-18 13:07:16.585 2587 17089 E WakeLock:	at amwg.c(:com.google.android.gms@12874041@12.8.74 (100400-204998136):3)
08-18 13:07:16.585 2587 17089 E WakeLock:	at amwg.b(:com.google.android.gms@12874041@12.8.74 (100400-204998136):9)
08-18 13:07:16.585 2587 17089 E WakeLock:	at dot.a(:com.google.android.gms@12874041@12.8.74 (100400-204998136):10)
08-18 13:07:16.585 2587 17089 E WakeLock:	at dot.handleMessage(:com.google.android.gms@12874041@12.8.74 (100400-204998136):4)
08-18 13:07:16.585 2587 17089 E WakeLock:	at pig.run(:com.google.android.gms@12874041@12.8.74 (100400-204998136):6)
08-18 13:07:16.585 2587 17089 E WakeLock:	at pis.run(:com.google.android.gms@12874041@12.8.74 (100400-204998136):28)
08-18 13:07:16.585 2587 17089 E WakeLock:	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
08-18 13:07:16.585 2587 17089 E WakeLock:	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
08-18 13:07:16.585 2587 17089 E WakeLock:	at pom.run(Unknown Source:7)
08-18 13:07:16.585 2587 17089 E WakeLock:	at java.lang.Thread.run(Thread.java:764)

2)

08-18 13:07:16.124 1753 1753 E QtiImsExtUtils: getConfigForPhoneId phoneId is invalid
08-18 13:07:16.124 1753 1753 E QtiImsExtUtils: isCarrierConfigEnabled bundle is null

I watched 'top' for a while after that and kept seeing the process 'android.hardware.wifi@1.0-service' by '

wifi

' user. It was one of the top-offending processes using the most CPU usage. While it only uses .5% of a single thread (out of 800% total CPU -- 8 threads), it seems to be popping up a lot. I was looking around and saw a report [1] stating:

"When an app performs Wi-Fi scans in the background, it wakes up the CPU, causing rate of battery drain. When too many scans occur, the device’s battery life may be noticeably shortened."

That was last updated on August 9, 2018... I've got nothing more so far.

[1] https://developer.android.com/topic/performance/vitals/bg-wifi
[Google Pixel 2 Questions & Answers] bleets:
Quick question...what make/model is your wifi router/access point? Because I've connected to a different network and it's dropped 0% in the last hour...
[Google Pixel 2 Questions & Answers] armordillo:
[MENTION=4350973]bleets[/MENTION], It's a Netgear Nighthawk X4S R7800 with the latest firmware (V1.0.2.52). I connect my Pixel 2 via the 2.4G connection so I can travel further with it (to the mailbox or mow the lawn). However, my Router is in my office and when I was working from home this week, my phone sat a few inches from the router and this still drained fast. When I go to sleep, my master bedroom is the furthest from the router and I still get full Wi-Fi connection and it drains fast.

I've charged the phone to 100%, reset the 'batterystats', took it off the charger and have turned on Wi-Fi. I've let it sit almost 2 hours. I'm going to check Battery Historian [1] here in a little bit to see if it gives me anything useful.... Don't follow that guide exactly if you choose to do the same. The Docker image they have no longer exists, it's "gcr.io/android-battery-historian/stable:3.0" .... and the URL they provide says, 'http://localhost/<port>' instead of 'http://localhost:<port>' ...

Anyhow, I'll provide an update if I can make use of the data.

[1] https://developer.android.com/studio/profile/battery-historian
[Google Pixel 2 Questions & Answers] armordillo:
Alright, I took one 'bugreport' just after fully charging and resetting battery stats. I Just took one now. Here's the two file's dates/times:

File 1: bugreport-walleye-PPR1.180610.009-2018-08-18-14-08-57.zip

File 2: bugreport-walleye-PPR1.180610.009-2018-08-18-15-53-21.zip

... Keep in mind that both these were taken with both Wi-Fi + Data turned on. During this time, the phone remained untouched over the course of the 1 hour and 45 minutes. The phone drained ~6%.

View attachment 4575411

View attachment 4575412

View attachment 4575413

View attachment 4575414
[Google Pixel 2 Questions & Answers] bleets:
I've been doing functional testing...

My router WiFi on: Battery drains fast 5-6% an hour, WiFi off 0-1% an hour.

Connect to a TP-Link router: Battery drains normally ~1% an hour.

Connect back to my router: Battery drains normally still.

So right that's weird.

Delete the TP-Link from saved, turn WiFi off and then on again...back to draining fast again. Ok...

Check again the various drains: Connect to TP-Link, normal drain. Connect back to my router, normal drain, back to TP-Link again, normal drain. Delete my router from saved, turn wifi off and let it re-connect to the TP-Link again...normal drain.

So yes the issue seems to be router specific. I even connected to my router via a guest network with a visible SSID rather than hidden just in case it was that but it was still the same with very fast drain.
[Google Pixel 2 Questions & Answers] armordillo:
I don't know if the router is the correct line of thinking only because I just came from Oreo 8.1 (June security release) and I didn't have this battery drain but now I do on Pie. You didn't mention the make/model of your router used when you see battery drain...

Either way, on my router, I tried disabling just Beamforming and nothing changed. Then I tried disabling just MU-MIMO and nothing changed. Then I disabled both Beamforming and MU-MIMO and nothing changed. I've since changed it back the enabling Beamforming and MU-MIMO...

I'm stuck at the moment but I'm probably just going to charge my phone to 100%, leave on Wi-Fi and then try another 'bugreport' in the morning to see if that "UNACCOUNTED" battery drain of 4.X+% an hour will be explained better.
[Google Pixel 2 Questions & Answers] armordillo:
Okay, so I let the phone sit untouched with Wi-Fi and Data on for 10 hours and 36 minutes (9:28pm-8:04am). During this time, the chart shows 261 KB/hr of Wi-Fi data usage and the graph shows GREAT connection for Wi-Fi. However, looking at the graph, I see that the Wi-Fi radio turns on/off constantly throughout the night. I zoomed in on the graph and it's about every 30 seconds that the Wi-Fi radio turns off then quickly back on. Through the night, it went from 100% battery to 55% battery with 37.48% of the battery loss being 'UNACCOUNTED' for. Appending screenshots.

View attachment 4575848

View attachment 4575849

View attachment 4575850

View attachment 4575851
[Google Pixel 2 Questions & Answers] bleets:
I've been trying lots of things today, changing a lot of WiFi settings on the router, disabling 2.4ghz and forcing 5ghz, disabling 5hz and forcing 2.4ghz, booting into safe mode...and nothing works. Until I connect to the TP-Link router and then it stops draining.
[Google Pixel 2 Questions & Answers] VadimTk:
Totally a shot in the dark, but can you try to play with DTIM settings ?

https://en.wikipedia.org/wiki/Delivery_traffic_indication_message
[Google Pixel 2 Questions & Answers] armordillo:
I actually thought about that. Myself and [MENTION=4350973]bleets[/MENTION] have a PM message going back and forth. While my primary router is a Netgear Nighthawk R7800 w/ latest stock firmware, I have a standby router (Netgear WNDR4500v2 with latest DD-WRT Firmware) setup as a wireless access point...

When I connect to the 2.4ghz and 5ghz connection on the WNDR4500v2, I don't get the same battery drain. DTIM interval on that device is 1.... Unfortunately on the stock firmware for the R7800, there isn't a DTIM switch available but I assume it's 1 by default...

I have tweaked the preamble, cts/rts threshold and many settings on the WNDR to match the available ones on the R7800... The main difference is b/g/n (2.4ghz) and a/n (5ghz) on WNDR while R7800 is b/g/n (2.4ghz) and a/n/ac (5ghz) ... Other than that, I don't see many visible differences with the signals that cause such power drain.
[Google Pixel 2 Questions & Answers] bleets:
Howdy.

I've spent the last couple of days testing my battery drain issue and I've zeroed in on what it is.

It isn't actually router specific.

I've tested numerous old factory images of the Pixel 2 going back to the December 2017 8.1 release which I used when I first got the phone, and several old router firmwares...all exhibited the battery drain issue while the TP-Link didn't...not so!

On a whim one of the times I tested my own router, I left DHCP enabled. I usually turn it off and configure all my devices with a static IP.

So I connected via DHCP and...I didn't get the battery drain issue. I tested repeatedly but using DHCP I didn't get the issue.

Then I connected to the TP-Link router - which previously didn't have the Pixel 2 battery drain issue connected to it - via static IP on an address that isn't in the DHCP pool...and I could replicate the battery drain issue.

So yeah, my drain issue isn't router specific and isn't android version specific (on the pixel 2 at least, I need to do testing on my nexus 5) but it happens when setting the phone up with static IP rather than DHCP!

This is really annoying since I just don't use DHCP for various reasons. And it's just plain odd.
[Google Pixel 2 Questions & Answers] ddrager:
Is it possible it is the battery of the phone and not the network?
[Google Pixel 2 Questions & Answers] bleets:
I've had it connected to a DHCP WiFi network for 5 hours at the moment and it's only just dropped from 73% to 72%...so no.
[Google Pixel 2 Questions & Answers] armordillo:
Hello [MENTION=4603845]ddrager[/MENTION],

It's definitely not a battery issue. I've been at my work office for the last 2.5 hours and I'm connected to my work's Wi-Fi network via my Pixel 2 and it hasn't even dropped 1% in battery.

As suggested by [MENTION=4350973]bleets[/MENTION], I toyed with my primary router's settings before coming to work. I disabled DHCP being handled by my primary router, enabled DHCP server on my Pihole DNS server and 'forgot' my Wi-Fi connection and re-connected using DHCP instead of setting the IP statically on my phone. After doing so, my phone didn't drop a single % in power after 1.5 hours (when I was at my house)...

Oddly, I can't tell at this stage exactly what the issue is but we're narrowing it down to something related to the Wi-Fi connection on the Pixel 2. I can test more later but I'm at work but hopefully more people see this who've been having issues with quick battery drain and can help with further troubleshooting.
[Google Pixel 2 Questions & Answers] NickJHP:
My experience is exactly the same as regards battery drain with static IP vs DHCP. With static IP on my home WiFi (the WAPs are a pair of Ubiquiti Unifi UAP-AC-Pro at opposite ends of the house, and the phone connects to them using 802.11ac), the battery goes from 100% charge to completely flat in about 17 hours with zero use of the phone and screen completely off. I changed the phone from static IP to using DHCP this morning after charging to 100%, and six hours later I still have 97% battery with no use of the phone.
[Google Pixel 2 Questions & Answers] armordillo:
[MENTION=7847382]NickJHP[/MENTION], will you go to this bug report which bleets filed and add a star to it so we can get more eyes on the issue:

https://issuetracker.google.com/issues/112927337

... Anyone else affected by this would probably benefit all of us by going to the bug and starring it.
[Google Pixel 2 Questions & Answers] JacentyEsz:
How to check static or DHCP?
[Google Pixel 2 Questions & Answers] bleets:
If you have to ask then you're definitely using DHCP :)
[Google Pixel 2 Questions & Answers] JacentyEsz:
OK, thanks :). I am asking, because after i updated my Pixel 2 to Android 9.0 my battery is worse than with Oreo. With Oreo i had SoT about 5,5-6h with LTE and 1 hour more with WiFi. After update to Pie with LTE i had 3h SoT and 4h SoT with LTE. I did full reset. It is a little bit better than it was (4h with LTE, 5h with WiFi), but still not so god as with Oreo. Today i decided to turn off AOD.
[Google Pixel 2 Questions & Answers] woohoo83:
Hi all. I found my battery drain culprit. I have a wireless charging adapter on my Pixel 2 and since the 9.0 update, there must have been a change in the power management because it drains at around 5% per hour and does not allow the phone to deep sleep. I don't know how many people are using wireless charging, but that will be one issue for battery drain. Hope this helps!
[Google Pixel 2 Questions & Answers] Ssmag:
My P2 is doing the same thing it was at 100% charge when I went to bed when I woke it was at 84%. Normally it would only use 1 or 2% overnight.
[Google Pixel 2 Questions & Answers] jfdebo779:
My battery life is much better.
[Google Pixel 2 Questions & Answers] raidflex:
Why not just use DHCP reservations instead of static IPs? Personally I find this much less maintenance.
[Google Pixel 2 Questions & Answers] NickJHP:
I use static IP because my standard way of getting files to/from the phone is to run an ftp server on the phone and use ftp client on the PC. With static IP the ftp server is always at a known address.
[Google Pixel 2 Questions & Answers] WibblyW:
... as it would also be if you used DHCP reservations. So DHCP always assigns the same IP address and you can dodge any issue with the phone's implementation of static IP :)
[Google Pixel 2 Questions & Answers] 3dd1:
Do you have any apps installed on that and use it only in pitch blackness? Only watch films stored on the phone so WiFi and mobile data are disabled? That would be the only way at a guess that I'd get any way near that. My last full charge was 11 hours a go and I'm at 55% with 2 hours screen on time.

My phone also seems to have a non linear battery life with it lasting much better in the first 50% then the last 50%
[Google Pixel 2 Questions & Answers] fictus1:
Horrible battery life with Adaptive Battery

Plagued by horrible battery for the last few weeks on stock Pixel,which coincided with a job change. Initially thought the location and heavier use during the commute was the cause to the point that I purchased a new battery today from ubreakifixit. Well that did not solve the problem, which told me it was related to Android Pie.

The only thing specifically new I could think of that was turned on was Adaptive Battery, turning this off showed an immediate improvement. Before it was off I lost 15 charge in about thirty minutes without any use of my phone and no open apps. Turning it off my battery remained at the same percent, in the same location, with the same conditions for another hour.;

I use WiFi at home and work, both with DHCP, so that issue must be different, unless those users are using Adaptive Battery. I hope this helps someon else.
[Google Pixel 2 Questions & Answers] JacentyEsz:
My battery life with Pie is the same worst that with Oreo but when i turned off AB two weeks ago is was dramatic. I turned it on again.

Sent from Google Pixel 2
[Google Pixel 2 Questions & Answers] pastapie:
Worst battery. I have factory reset switched all suggested things off. Still the worst battery.
[Google Pixel 2 Questions & Answers] 3dd1:
In the first picture above where it gives screen on time, yours tells you time since last full charge, mine doesn't but an estimated time a charge will last, did you change a setting to get it to display that?
[Google Pixel 2 Questions & Answers] Colday96:
I don't know what you people have but my battery life has always been excellent.
[Google Pixel 2 Questions & Answers] pastapie:
Anybody else having this great battery life? I definitely am not. My OST is almost 5 hours now. I'm about a month since last factory reset. Running stock with everything suggested on this forum switched off.
[Google Pixel 2 Questions & Answers] PuffDaddy_d:
I don't see the problem. You had the screen on for over 5 hours and still had over an hour of battery life remaining. That puts you at 6+ hours of SOT which is great for a battery this small. 4 hours is closer to the average.
[Google Pixel 2 Questions & Answers] pastapie:
I was getting 7 to 8 hours SOT on preview. Big difference. Shutting off WiFi helps a little.
[Google Pixel 2 Questions & Answers] JacentyEsz:
There is a lot of differrnces in the same Pixel 2? When i shut off my wifi my SoT is about 3,5-4h but with wifi on 1-1,5h more. I'm after reset for over a month and still my SoT is worst on android 9. I turned off ambient display, use black wallpaper, nothing helps.

Sent from Google Pixel 2
[Google Pixel 2 Questions & Answers] _Vegas:
Using OG pixel, sot is fine, but huge idle drain, only way is turn wifi and data off when I go to bed.
[Google Pixel 2 Questions & Answers] hanifh:
Battery life is utter garbage since 9.0. I factory reset the phone and set it up from fresh. Avg SOT after 8 days is 3.45 hrs and I charge this piece of **** twice a day. Time to sell this junk off.

Shame on you Google and here's a fat middle finger for you.

And before anyone asks me to monitor app drain etc etc, I'm a veteran/advanced smartphone user since the days of the first Google phone and have tried and monitored all there is to try.
[Google Pixel 2 Questions & Answers] 3dd1:
Mine was similar on both, 5ish hours SoT over 17 hours which I was pretty happy with until a week or so a go, now I am lucky to get 3. Done a factory reset to no avail, looks like Google Play Services is the culprit used 31% battery for 16 min usage. Can't see in Pie how to uninstall updates.
[Google Pixel 2 Questions & Answers] pastapie:
I was getting really crappy signal which put nail in the coffin and got a replacement pixel 2 from warranty. Should I just stay on Oreo?
[Google Pixel 2 Questions & Answers] Rotten Ross:
Currently sat on 6hr30 screen on time over 1 day 21hrs.
[Google Pixel 2 Questions & Answers] truelies1:
Upgraded to pie 9.0,battery dropped 70%overnight. What caused this wifi problem?

Connected with Dhcp as default.
[Google Pixel 2 Questions & Answers] Jerber:
It's really sad an annoying problem that thing about battery drain, I tried almost everything, ambient display off, auto brightness off, location history off, backups off, wi-fi scanning off, Bluetooth off, battery optimicer off, double tap to wake off, dark colors. 3G only, GPS off... and the list continue, to the point I don't feel my smartphone like a smartphone, I don't remember honestly having an Android phone that just work fine without an extra configuration, and this become worse when I started to use an iPhone as second device... al those things that I have off on my Pixel are already on in my iPhone and the battery last all day long.

Battery Save mode doesnt make a big difference, and there is always a delay in notifications, seems that is on purpose to save even more battery, but no, my Pixel last almost 2-3 hours on SOT meanwhile I get easy 5 hours of SOT on my iPhone.

its really sad because I really like this device, the flexibility of the system, the freedom, the camera!, the camera is just amazing, but a few pictures are just enough to drain he battery as hell, meanwhile with the iphone a few pictures just take 1-2% of battery...

Right now my iPhone is on 78% of battery with 1:30hs SOT meanwhile my Pixel is 54% with 1:30 SOT and of course with a lot of things off like a previus said.
[Google Pixel 2 Questions & Answers] JacentyEsz:
Doesn't sounds good. Did You try hard reset?

Sent from Google Pixel 2
[Google Pixel 2 Questions & Answers] Xsabre:
I always like to wait when upgrading from major releases. Figured it was safe so did a complete wipe and installation of Pie (Was on Oreo before). I root and use very few apps and modules. Before I could go 24 hours without a recharge and still be at 20-30%. After the upgrade I am lucky if I get 15 hours (5%-10%) without charging [SOT 2 hrs].

Wish I'd created a complete backup to rollback. Going to let this ride for a week and see if it improves. Otherwise will rollback. I have disabled Adaptive Battery (as suggested) and see if that help. I am open to additional suggestions. Thanks

---------- Post added at 09:08 AM ---------- Previous post was at 08:37 AM ----------

Looks like this is more wide spread...

https://bgr.com/2018/11/02/android-pie-battery-life-issue-google-fix-workarounds/
[Google Pixel 2 Questions & Answers] armordillo:
[MENTION=3521776]Xsabre[/MENTION], do you have a static IP configured as well instead of DHCP in your WiFi settings? If so, set it to DHCP. Otherwise disregard.
[Google Pixel 2 Questions & Answers] Xsabre:
Standard DHCP setup but appreciate the help.
[Google Pixel 2 Questions & Answers] Xsabre:
Here is posting on the Pixel google forums following the issue.
[Google Pixel 2 Questions & Answers] 3dd1:
I'm finding a lot of variance, though mainly not great I've a couple of days with in excess of 5 hours SoT 24 hours since last charge with 20% left, which is perfect for me, though most days it's less than 4 hours about 12 hours since last charge.

I find often the biggest user of the battery is Google play services, on occasion accounting for over 20% if not almost 30%.
[Google Pixel 2 Questions & Answers] 3dd1:
Though at its worst I am lucky to get 3 hours