maforn / TimedShutdownAndroid

An app for android that will automatically shutdown your phone after a timer without needing root access. This app uses the accessiblity permission to emulate the power off gestures.
GNU General Public License v3.0
35 stars 3 forks source link

Alarms acting as timers ? #6

Closed Cwpute closed 11 months ago

Cwpute commented 11 months ago

First of all thank you soqmuch ! this app is a godsent. i've spent so much time searching for an app to do just that, without root!

My issue is as follows: i had set up an "Alarm" to 00:20, hoping it would automatically shutdown my phone twenty minutes after midnight every day. But what it actually seems to do is… shutdown ym phone 20 seconds after the app started !! Which endelessly sfutdown the phone whenever i booted it up. Both funny and very problematic 🤡

Did i not understand how alarms worked, or may there be something messing with them? One thing i can see could have altered this is that i previously tried a 1-second-long timer just to try the functionality of that app. Maybe it somehow automatically re-schedules that timer ?

maforn commented 11 months ago

Hello again Cwpute, thank you for your appreciation. This is a big problem and I did not even know it existed, I'll look into it asap. I have no clue why it would keep shutting down, the logic is based on the alarm schedule of the system, so it's really a strange problem the one that you are having. If you want to check the file I use BootBroadcastReceiver to set up the scheduled power off on boot, using the function setSchedule provided in ScheduleFragment

maforn commented 11 months ago

I think I found the problem, in the repeating alarms it set repeatings as the day of the current week, thus the system thought that they had already passed and decided to shut down the phone. I'll fix it in the next release

maforn commented 11 months ago

I have pushed the new update with this feature, as soon as Google will publish it you'll see it as well