LibreShift / red-moon

Android screen filter app for night time phone use.
GNU General Public License v3.0
653 stars 82 forks source link

High battery usage in background #316

Open islam2hamy opened 2 years ago

islam2hamy commented 2 years ago

Hi , High battery usage in background reported by device, suggests to sleep the app.

I can see that the app auto start randomly in background , why?? Please fix. An app with battery drain is not good

Os : miui 11.0.2 Android : 7.1.2

smichel17 commented 2 years ago

The app should auto-start once per day, if you have configured it to do that. Otherwise it should not be doing anything "in the background", only when it is on. I'm not sure why it would behave any differently.

islam2hamy commented 2 years ago

Screenshot-com-jmstudios-redmoon

smichel17 commented 2 years ago

I'm really not sure why it would turn on at all then. You could try grabbing a log and see if it is still scheduling even though it should not be. There are instructions in https://github.com/LibreShift/red-moon/issues/184#issuecomment-330053370

islam2hamy commented 2 years ago

Here you are

https://mega.nz/file/gE4hgIKY#sfJWKjvWUF2nRazK37uCIyCDr2OsQEqZtCkL3bgx4HU

islam2hamy commented 2 years ago

https://mega.nz/file/8J4VyLBZ#5pJMkLBaF6WJnFpeMvGy5O32HF4aWbHBkHXDa4lPpEw

islam2hamy commented 2 years ago

More : https://mega.nz/folder/JIIzQTTC#KDpEHKQ5fsYCp27P9YPnxA

islam2hamy commented 2 years ago

I will keep this folder updated

smichel17 commented 2 years ago

app auto start randomly in background

To clarify,

  1. Do you mean that the app opens, or that the filter starts running (and coloring the screen)?
  2. Are all of these logs from when that happens, or are some of them after you manually opened the app?

If Red Moon were scheduling itself to turn on/off, you would see this message in the logs (calendar.toString() becomes a timestamp):

https://github.com/LibreShift/red-moon/blob/a9f0eed042e72f92d528c75abb5667d3a6340ccb/app/src/main/java/com/jmstudios/redmoon/receiver/ScheduleReceiver.kt#L86

I'm not seeing any of those. However, in the last two logs, I see a couple lines like this:

[05-25 20:38:50.432 1571:2711 I/ActivityManager]
Start proc 2859:com.jmstudios.redmoon/u0a172 for service com.jmstudios.redmoon/.widget.TileReceiver caller=com.android.systemui

I would expect to see that when the filter is started via the quick settings tile, that you can access at the top of the notification drawer. Maybe you've accidentally tapped it, or miui has a bug which is triggering it randomly?

islam2hamy commented 2 years ago

app auto start randomly in background

To clarify,

  1. Do you mean that the app opens, or that the filter starts running (and coloring the screen)?

the app opens (using ram)

  1. Are all of these logs from when that happens, or are some of them after you manually opened the app?

some of them after manually open the app

I would expect to see that when the filter is started via the quick settings tile, that you can access at the top of the notification drawer. Maybe you've accidentally tapped it, or miui has a bug which is triggering it randomly?

May be miui ?!

islam2hamy commented 2 years ago

New log with no manually open

https://mega.nz/file/wRBimAjJ#JfpIA791SW8JRrz8FOmQHaU_c8Bahj06BpTB7sIR4wY

islam2hamy commented 2 years ago

I will remove the app quick tile , and get the new log

islam2hamy commented 2 years ago

There is no log until now

islam2hamy commented 2 years ago

No more log

smichel17 commented 2 years ago

Is the bug fixed?

islam2hamy commented 2 years ago

Is the bug fixed?

Can you do anything about using app tile in the quick settings ?