itsdrnoob / DataMonitor

Data usage monitoring app for android.
GNU General Public License v3.0
571 stars 49 forks source link

Custom data plan doesn't refresh after expiration #227

Open buttercookie42 opened 9 months ago

buttercookie42 commented 9 months ago

Checklist

Affected app version

v2.4.0

Steps to reproduce the bug

  1. Create a custom data plan and set it to automatically refresh.
  2. Reboot your phone at least once.
  3. Wait for the data plan to expire.

Expected behavior

It refreshes for the next period.

Actual behavior

The old plan remains active.

Screenshots/Screen recordings

No response

Logs

No response

Affected Android/Custom ROM version

Android 14

Affected device model

Sony Xperia 10 V

Additional context

As far as I can tell, data plan refresh only works via alarms (i.e. there's no fallback check for an outdated data plan when opening the app) and setRefreshAlarm() only gets called when the data plan settings are updated, or else when the previous alarm fires.

However AlarmManager alarms all expire if the device is rebooted and have to be re-set after afterwards when receiving ACTION_BOOT_COMPLETED or whatever other way might be appropriate.