Fix Onyx Boox black screen on wake by not using SurfaceView #579
+1
−1
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.
On some Onyx Boox devices (confirmed on Palma 2), the SurfaceView surface is not recreated after the rapid RESUME/PAUSE/STOP activity cycling that the Boox system performs on wake. This leaves
android.app.windowpermanently nil, causing a black screen. The app is still running and responding to touch; it just can't render becauseANativeWindow_lockhas no window to lock.The SurfaceView with
setZOrderOnTop(true)andPixelFormat.TRANSPARENTwas introduced for NGL4/Tolino devices. The Onyx Qualcomm EPD API (View.refreshScreen) does not require a SurfaceView; whenneedsViewis false,einkUpdate()already falls back to the DecorView content view. SettingneedsView()=falsemakes Onyx devices use NativeActivity's default DecorView surface, which follows the standard activity lifecycle and correctly survives the Boox wake sequence.This fixes koreader/koreader#12445.
Diagnostics that led to this fix
Lifecycle event logging on the Boox Palma 2 revealed that after sleep/wake,
INIT_WINDOWnever fires when using a SurfaceView:With
needsView()=false(DecorView surface),INIT_WINDOWfires correctly:Test on Boox Palma 2
See koreader/koreader#12445 (comment) for the reproduction steps.
This change is