r/AndroidQuestions • • 19d ago

Gmail is draining the battery - Xiaomi 15

As the title says, I tried to clear the Gmail cache and restart the phone but it didn't change anything. Gmail drained like 15% battery over night and keeps draining during the day.

4 Upvotes

8 comments sorted by

3

u/DictoKey_Dev 19d ago

Go to Settings > Apps > Gmail > App battery usage and disable Allow background usage. That's the main fix for Gmail draining in the background. If it still drains, search 'sync' in Settings and turn off sync for accounts you don't need on the phone.

2

u/andrewia 19d ago

Third party email apps can connect to gmail, so you can switch from their app.  

-2

u/akkjn58 19d ago

Stop using it and deGoogle.

If you're too brainwashed, too much an addict, how about you adjust how often it syncs (if they even allow that).

2

u/PhillL_1 19d ago

If it is a Gmail account on the Gmail app then it doesn't sync on a timer as it uses Firebase messaging, so new emails are pushed to the phone when they arrive and there is no polling. Also email notifications are given a low priority and will be delayed if the phone is in Doze mode.

To the OP, have you connected the Gmail app to other providers, for example getting email from Outlook or iCloud?

2

u/mustabak120 19d ago

doze mode on Xiaomi? i would suggest to disable it for a time and see if it stops draining. if yes, maybe some other china services are maybe active. if not, follow tips here to limit continues connection/sync

1

u/akkjn58 17d ago

a Gmail account on the Gmail app... doesn't sync on a timer as it uses Firebase messaging, so new emails are pushed to the phone when they arrive...

So they don't allow it. Lemme guess: that's "a feature, not a bug." #degoogle

1

u/PhillL_1 16d ago

For Gmail accounts polling isn't used because the most efficient way to deliver email is using the already established Firebase messaging connection. One connection is used by the phone that covers everything and every app that needs to deliver some message. For example WhatsApp lets your phone know a message has been received by asking Google to use the Firebase messaging connection to ping the phone, saving WhatsApp from polling or using its own system of messaging.

Firebase messaging is extremely frugal on power as it uses long lived TCP connections. Push is always preferred over polling if you are developing some app or service.

https://firebase.google.com/docs/cloud-messaging

0

u/akkjn58 14d ago

'Pushing'/'Pushers.' Appropriate.

It may be preferred if you're developing an app as I suppose it saves a step for testing, not so if you're using one as it doesn't allow anyone any downtime, which is of course what Google and Big Tech wants, and it would seem per this post that it may be not so great on power consumption.