red-moon
red-moon copied to clipboard
Accessibility Service Overlay MVP
I'm not going to pretend that this is the finest code I've written, but this should be daily-usable and I want to prevent as much eye-searing as possible among our Android 12 users. This should be in a reasonable state to build upon as well.
It adds a link in the settings to the accessibility services page, and will always use the accessibility service instead of a standard overlay when said service is enabled. It all goes through the existing FilterService, so it should work with all the possible ways one can toggle and set filters.
Good news:
- Covers up everything (home screen, notifications, navigation, incl. notches/cutouts) on every API level tested 7/11/12L/13 + 11 IRL device
- Appears to work with the scheduling thing
- Miraculously fixed the busted vibration motor on my phone (not kidding)
Bad news:
- Is not animated (I think this can be added though)
- Probably doesn't work with the privileged app monitor (can also probably be added later)
- Some stuff is hardcoded b/c I can't seem to get info about cutouts or screen size on the newer API levels (ScreenManager uses a bunch of deprecated stuff)
- Didn't bother to make it particularly discoverable; maybe we should add this to the welcome slideshow if we detect you're running Android 12+ at some later point
Resolves #309 Resolves #253 Resolves #252 Resolves #312 Resolves #236 (repro'd + confirmed fixed on Android 11) Probably Resolves #234 Probably Resolves #277
Maybe you could merge it now and release as beta only on Github?
I've been using this for the past year or so on my phone and it's worked well. If there's no major blocking issues then I think approving and merging this would be a net benefit.
Could you add the apk version with your changes here? Then people could install and test it. I tried to compile it myself, but Android Studio throws errors :/
I'm pretty sure the (rightfully-added) anti-scam measures on newer android versions would prevent you from actually testing the accessibility service if I gave you an APK. I did just push a change which fixes the failing APK build, though, which might fix your issue.
I managed to compile. It works perfectly, thanks a lot! This should definitely be merged.
I'm pretty sure the (rightfully-added) anti-scam measures on newer android versions would prevent you from actually testing the accessibility service if I gave you an APK.
Actually, it is still possible to use accessibility services from an APK. It will stop you from doing it the normal way, but if you know where to look, in the app details menu, in a kebab menu in the top right, you can disable this safeguard. So an APK actually would be useful. Assuming you're trustworthy ;D