LibreShift / red-moon

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

Crashes on device restart #306

Open shuvashish76 opened 3 years ago

shuvashish76 commented 3 years ago

To Reproduce Just restart the device & Red Moon crashes with pop up message that "Red Moon stopped". Not just one time crash, it crashes on every device restart.

Crash logs

FATAL EXCEPTION: main
Process: com.jmstudios.redmoon, PID: 5132
java.lang.RuntimeException: Unable to start receiver com.jmstudios.redmoon.BootReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.jmstudios.redmoon/.filter.FilterService (has extras) }: app is in background uid UidRecord{2dec40d u0a158 RCVR idle change:uncached procs:1 seq(0,0,0)}
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3197)
    at android.app.ActivityThread.-wrap17(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1675)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6518)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.jmstudios.redmoon/.filter.FilterService (has extras) }: app is in background uid UidRecord{2dec40d u0a158 RCVR idle change:uncached procs:1 seq(0,0,0)}
    at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1521)
    at android.app.ContextImpl.startService(ContextImpl.java:1477)
    at android.content.ContextWrapper.startService(ContextWrapper.java:650)
    at com.jmstudios.redmoon.filter.Command.send(Command.kt:71)
    at com.jmstudios.redmoon.filter.Command$Companion.toggle(Command.kt:94)
    at com.jmstudios.redmoon.BootReceiver.onReceive(SystemBroadcastReceivers.kt:53)
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3190)
    ... 8 more

Device info:

smichel17 commented 3 years ago

This is fixed in the code and will be in the next release.

shuvashish76 commented 2 years ago

144 commits since v3.5.0, any updates regarding new release?

smichel17 commented 2 years ago

I can do a new release any time, it takes around 2 minutes. Well, I guess plus 10-30 minutes to write the changelog.

The reason I haven't is that I merged #287 without adressing all the follow-up points, and I don't want to release a version that can leave the app in a broken state.

smichel17 commented 2 years ago

...though, I suppose perhaps this is better than the current state, where the app does not work at all on some devices. I think I'll do a release this weekend and just note in the changelog that root mode is an unstable feature.