tobykurien / BatteryFu

BatteryFu (pronounced Battery-Foo, like in Kung-Fu) is an Android app that extends battery life (and lowers data usage) by changing always-on mobile/wifi data to periodic sync (meaning it disables your mobile data and/or Wifi, then checks your accounts every X minutes).
GNU General Public License v2.0
68 stars 17 forks source link

Fix work in Android 6+ #48

Closed ioctl-user closed 2 years ago

ioctl-user commented 4 years ago

However, for now "Always online" and "Always offline" modes are not working. Mobile data state changed with screen off/on. Was it working before?

The problem is GeneralReceiver does not check ModeSelect status before changing mode on screen event, and I do not know how to make good fix.

ioctl-user commented 4 years ago

Could you explain why sleep_once was removed?

Hmm. I thought it was obsolete function acting like just sleep. Wasn't it?

Also see lots of changes in MainFunctions. A lot of the code was for edge cases and handling conflicting settings, so I am nervous about the changes, it's very hard to test all cases. Could you describe what the issues were and how you fixed them?

I have noticed, that on my Android 10 device BatteryFu doesn't wakes to change mobile data state as expected. As I understand this https://developer.android.com/reference/android/app/AlarmManager#setRepeating(int,%20long,%20long,%20android.app.PendingIntent) , in modern systems that function is not working in full doze, so I changed it to this one https://developer.android.com/reference/android/app/AlarmManager#setExactAndAllowWhileIdle(int,%20long,%20android.app.PendingIntent) . However, it does not have interval argument, so, I have to rearm it again and again, not once. To use this function I have to update SDK. When SDK was updated old notification have not been compiled, so I had to use v4.app.NotificationCompat module and it function. Also I have disabled // go to sleep now, because it turn of mobile data when app starting, if (Settings.SLEEP_PERIOD < 1000 * 60 * 15) { because it doesn't allow set little timeouts, if (Settings.DEBUG_NIGHT_MODE) { because it seems like obsolete debug.

tobykurien commented 4 years ago

Thanks for the response and the pull request. I'll need a bit of time to test and verify. I can't remember what sleep_once was for.

ioctl-user commented 4 years ago

Sure.

Don't you remember, were "Always online" and "Always offline" modes working before?

tobykurien commented 4 years ago

Yes those were working.

On June 13, 2020 8:36:28 PM GMT+02:00, ioctl-user notifications@github.com wrote:

Sure.

Don't you remember, were "Always online" and "Always offline" modes working before?

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/tobykurien/BatteryFu/pull/48#issuecomment-643661207

-- tobykurien.com | @tobykurien

ioctl-user commented 4 years ago

I think I understand what happened. So, I need much more time to fix this.