-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android 12 ~ Red Moon doesn't allow proper screen interaction on homescreen. #309
Comments
Seeing same behavior on Android 12. Did see this warning in the log: and this note about bouncy castle and Android 12. Not sure if it applies or not: https://developer.android.com/about/versions/12/behavior-changes-all#bouncy-castle |
In general, there's many issues on modern Android that are not addressed, because my phone is still running 7.0. This particular issue looks like it's related to this section: Look for the log message, It seems like the only way around this would be to mark the app as an accessibility overlay. Honestly this is probably a better fit than I'd welcome a PR adapting Red Moon to be an accessibility service. This might also enable us to drop other workarounds, make it less likely that Red Moon will be killed due to running out of memory, etc. |
The accessibility overlay thing would probably also fix the issues with the lock screen and notification bar not being filtered. Is this easy to implement? If so, I might give it a go when I have some time, as I'm new to developing anything for Android. |
Yes, I think this would also fix #312, #253, and probably a couple other issues floating around with the For ease of implementation—
|
Okay, seeing as you're interested and have given me some pointers, I will see if I can find some time soonish to have a look at least and report back. |
Anyone working on this bug??? I am looking to start with this any tips will be very much helpful. |
I'm not sure what else you'd like to know besides the information I already shared. A good place to start would be researching what's needed for Red Moon to mark itself as an accessibility service. |
This comment was marked as off-topic.
This comment was marked as off-topic.
My Samsung s10se just got an update to Android 12. Now not any touch input is recognised on the screen area wich red moon overdraws. Luckily this is not the status and notification bar, so I'm able to turn redmoon of again ... I think this is related to the issues mentioned here. I hope you guys find a fix quickly. At the moment red moon is unusable for me. Im sorry but I cannot code to help. |
I found a solution to this for Android 12 users: Using adb, type the following command: This is documented here: If you need to setup ADB (Android Debug Bridge), here's a guide: |
I have a minimal PoC for this that enables the overlay as soon as the Accessibility Service is enabled, but I have no idea how to add the overlay view outside of the "privileged" context you get when enabling it. This passes all touches through, and draws over the notification shade, status/nav bars, and homescreen. class OverlayAccessibilityService : AccessibilityService() {
override fun onInterrupt() {}
override fun onAccessibilityEvent(event: AccessibilityEvent?) {}
override fun onServiceConnected() {
val layout = (getSystemService(LAYOUT_INFLATER_SERVICE) as LayoutInflater).inflate(R.layout.overlay_layout, null)
val lp = WindowManager.LayoutParams().apply {
type = WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY
format = PixelFormat.TRANSLUCENT
flags = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE.or(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
}
(getSystemService(WINDOW_SERVICE) as WindowManager).addView(layout, lp)
}
} <service
android:name=".OverlayAccessibilityService"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
android:label="@string/overlay_accessibility_service_label"
android:exported="true">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>
</service> The overlay layout can be literally any fullscreen layout with a translucent background. I've tried making |
I'm not sure I understand what the problem is with that patch actually? Presumably the overlay doesn't need to be edited outside of the privileged context? |
That patch will enable the filter when you enable the accessibility service in your phone's settings, so to turn it off you'd have to go back into your settings and turn off the accessibility service. No timing it or turning it off/on from the app's activity or notification. |
Ah, I see. |
I believe I've figured it out: We can add a transparent overlay upon enabling the AccessibilityService, and then manipulate its color/transparency by sending events over an EventBus to the AccessibilityService as needed. Only thing left is to get it working with the app monitor and notification, and make the UX not terrible. Partially completed code can be tracked here https://github.com/AdamNiederer/red-moon/tree/accessibility-overlay |
Awesome :) |
Red Moon Version: v3.5.0
Android version: 12
Device Pixel: Both 3 & 4 on Graphene OS & a Pixel 3 on a standard Android OS
Expected behavior: App functions normally. At set time, Red Moon starts and provides red screen settings based upon my choosing. I am able to interact with apps that are overdrawn, ex. scrolling, touch buttons and typing.
Actual behavior: With the rollout of Android 12, App turns on at set time as expected EXCEPT I cannot touch anywhere on home screen to pull up drawer, click on apps to open or swipe to other screens. I can swipe down and interact with turning off the Red Moon overdrawing other apps function.
Steps to reproduce: Upgrade to Android 12. Turn on Red Moon. Allow app to overdraw other apps. Try to interact with homescreen.
This happens on all 3 of my phones.
The text was updated successfully, but these errors were encountered: