Some time ago with Android 11 SYSTEM_ALERT_WINDOW draw-over-applications touch behaviour was limited with a number of exceptions.
- Interactions within your app.
- Accessibility windows
- Input method editor (IME) windows
- Assistant windows
- Completely transparent windows. The alpha property is 0.0 for the window.
- Sufficiently translucent system alert windows. (0.8)
If I set my view opacity to be <0.8 it passes-through touches as expected - except for SurfaceView. Because my application uses a full-screen surface view drawn over other apps (overlay), the limitation basically blocks any pass-through touches.
Is this a technical limitation or is there a workaround for this new Untrusted touch events are blocked policy when SurfaceView is used?
Yes, this is a technical limitation. SurfaceView is a view that provides direct access to the underlying Surface object, which allows it to render its content without going through the normal view hierarchy. This makes it possible for SurfaceView to draw its content on top of other apps, but it also means that SurfaceView cannot receive touch events from other apps.
There is no workaround for this limitation. The only way to get touch events from other apps on a SurfaceView is to use a different view that does not have this limitation, such as a LinearLayout or a FrameLayout.
If you need to use SurfaceView, you can work around the limitation by using a different view to receive touch events. For example, you could create a LinearLayout or a FrameLayout that contains the SurfaceView, and then use the LinearLayout or FrameLayout to receive touch events.