LibreShift / red-moon

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

Update to Android 12 #315

Closed AdamNiederer closed 2 years ago

AdamNiederer commented 2 years ago

1) Pulls in KPreferences and removes jcenter 2) Add FLAG_IMMUTABLE and exported to everything 3) Requests SCHEDULE_EXACT_ALARM permissions on Android 12 4) Prevent a crash when scheduling the overlay, caused by some new requirements of foreground services in Android 12

This fixes all of the build errors and crashes related to the new API level - I've tested it on Android 12 and Android 7.

smichel17 commented 2 years ago

Thank you! I'll take a look at this and try to get a release out this weekend

smichel17 commented 2 years ago

I tested this in an emulator, and unfortunately it did not fix https://github.com/LibreShift/red-moon/issues/309; the overlay still absorbs taps when in any app besides Red Moon itself. I suppose you didn't mention that issue here, so maybe this was just a general update, not a fix for that?

smichel17 commented 2 years ago

Well, it fixes the build anyway, so I'm going to merge, and if you intended this to fix #309, you can send a follow-up PR.

AdamNiederer commented 2 years ago

Sorry, totally forgot to follow up on these reviews; thanks for helping it over the finish line. #309 will most likely need an accessibility overlay, although I've had issues getting it to work as outlined in that issue.

AdamNiederer commented 2 years ago

I will probably be forced to buy a new phone soon (thanks Sprint!), so this PR was getting most of the grunt work out of the way in preparation for figuring out #309; hopefully having my eyes seared at night will be sufficient motivation.

smichel17 commented 2 years ago

Ha— I'm still running 7.0 (thanks Samsung+AT&T!) so I've been a little lacking on the motivation front lately. Also I've started putting my phone away at night entirely, so it's not as big of an issue for me any more.