fix(android): cover never appears on Samsung One UI + v0.1.7 - #4
Merged
Merged
Conversation
…n on host walk)
Reported on Samsung Galaxy A05 (SM-A057F) running Android 14 with One UI:
pressing Home left the Recents thumbnail showing the underlying React Native
UI instead of the configured privacy cover. Logcat from the affected device:
Cover : ensureCoverOnTopmost: reparent (topmost=FreezableFrameLayout)
^^^^^^^^^^^^^^^^^^^^
Cover : attachCover: addView failed:
android.view.WindowManager$BadTokenException:
Unable to add window -- token android.view.ViewRootImpl$W@d70be2d
is not valid; is your activity running?
The host-window walk (`CoverWindowAttachment.topmostHostViewFor`) excluded
`coverView` (the cover Window's root — `SurfaceView` on the SCVH path,
`FrameLayout` on legacy) but not `coverContent` (the SCVH-hosted
`FreezableFrameLayout`). On Samsung One UI's customised WindowManager the
SCVH-hosted content appears in `WindowManagerGlobal.mViews` even though it
lives inside the SCVH's own `ViewRootImpl`. The walk found our own content
view as the "topmost host", `addCover` tried to attach the cover as a
sub-window of itself, and `addView` rejected the token. The cover never
reached the Recents thumbnail.
Fix: pass `exclude2 = coverContent` at all three `topmostHostViewFor`
callsites in `HybridCover.kt`. `CoverWindowAttachment` already supported
the parameter (the blur source picker uses it for the same reason on the
SCVH path).
Verified on Samsung Galaxy A05 (Android 14, One UI):
Cover : ensureCoverOnTopmost: reparent (topmost=DecorView)
Cover : attachCover: preferredRefreshRate=90.0
Cover : broadcast: reason=homekey isEnabled=true isVisible=false sc=false
Cover : broadcast: fast scvh=false refl=false dt=1ms
Cover : performUserLeaveMount
Cover : setCoverVisibility: visible=true animated=false scvh=false
Recents thumbnail shows the #5F8AFA splash background with the icon, exactly
the iOS App Switcher parity the library was designed to deliver.
|
Update Samsung A05 |
ibrahimkanna736-pixel
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v0.1.7. Single targeted fix on top of v0.1.6 for a Samsung One UI regression discovered after the v0.1.6 rollout.
On Samsung Galaxy A05 (SM-A057F, Android 14, One UI), pressing Home left the Recents thumbnail showing the underlying React Native UI instead of the configured privacy cover. Logcat from the device:
The host-window walk (
CoverWindowAttachment.topmostHostViewFor) excludedcoverView(the cover Window's root —SurfaceViewon the SCVH path) but notcoverContent(the SCVH-hostedFreezableFrameLayout). On Samsung One UI's customised WindowManager the SCVH-hosted content appears inWindowManagerGlobal.mViewsdespite living inside the SCVH's ownViewRootImpl. The walk identified our own content view as the topmost host,addCovertried to attach the cover as a sub-window of itself, andWindowManager.addViewrejected the token. The cover never reached the Recents thumbnail.Fix
Pass
exclude2 = coverContentat all threetopmostHostViewForcallsites inHybridCover.kt.CoverWindowAttachmentalready supported the parameter (the blur source picker uses it for the same reason on the SCVH path).Verified on Samsung Galaxy A05 (Android 14, One UI)
Recents thumbnail shows the
#5F8AFAsplash background with the icon — exactly the iOS App Switcher parity the library was designed to deliver. Tested in a downstream consumer app (NEAR Mobile,com.peersyst.nearmobilewallet).Test plan
:react-native-cover:compileDebugKotlinclean (only pre-existingdefaultDisplaydeprecation warnings).Files changed
android/src/main/java/com/margelo/nitro/cover/HybridCover.kt— three callsites updated, one-paragraph explanatory comment.package.json—0.1.6→0.1.7.CHANGELOG.md— new0.1.7 - 2026-06-01entry.