+- Android: skip SCVH entirely on Android 11 (API 30) when `INTERNAL_SYSTEM_WINDOW` is denied (signature-level permission no normal app holds). On this AOSP release the SCVH path through `WindowManagerService.addWindow` enforces this permission and `host.setView` throws `SecurityException` AFTER `ViewRootImpl.setView` has already called `requestLayout()` — queuing a `TraversalRunnable` that fires the same vsync (TRAVERSAL phase, before any deferred work) on a token that was never registered with the WWM, throwing the "never added" variant of `Invalid window token` from `Looper.loop`. The deferred release can't help in this case (the runnable fires in the same vsync's traversal phase, before our queued Handler message); the only safe path is to never call `setView` on these devices. Scoped to API 30 only — Android 12+ dropped the permission check for SCVH's `addToDisplay` path, so SCVH and the SurfaceFlinger-direct alpha toggle continue to work unmodified on every modern device.
0 commit comments