android / android/media-samples
Failed to start presentation mode.
- Dominant language
- Kotlin
- Stars
- 1.4k
- Forks
- 781
- PR merge metrics
- No merged PRs in 30d
Description
The app works usually for the very first time. It fails easily with the following steps:
1) run the app successfully for the first time, presentation display on the second display, HDMI TV;
2) from Android system bar, select square to see all app in memory, then click "CLEAR ALL" to kill all;
3) run the app again, presentation fails. TV mirrors the LCD screen of android.
4) Press square button on system bar again, then click the app again. It can recover.
The log shows massive errors repeatedly for 180 times per second.
On Android API 25. It doesn't happen every time but often enough.
07-09 22:54:49.013 1414 1533 E WindowManager: Unhandled exception in Window Manager
07-09 22:54:49.013 1414 1533 E WindowManager: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.DisplayInfo com.android.server.wm.DisplayContent.getDisplayInfo()' on a null object reference
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.wm.Task.getDisplayInfo(Task.java:766)
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.wm.DimLayer.getBoundsForFullscreen(DimLayer.java:209)
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.wm.DimLayer.setBoundsForFullscreen(DimLayer.java:221)
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.wm.DimLayerController.updateDimLayer(DimLayerController.java:60)
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.wm.WindowSurfacePlacer.performLayoutLockedInner(WindowSurfacePlacer.java:1003)
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.wm.WindowSurfacePlacer.applySurfaceChangesTransaction(WindowSurfacePlacer.java:656)
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementInner(WindowSurfacePlacer.java:321)
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:236)
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:184)
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.wm.WindowManagerService$H.handleMessage(WindowManagerService.java:8393)
07-09 22:54:49.013 1414 1533 E WindowManager: at android.os.Handler.dispatchMessage(Handler.java:102)
07-09 22:54:49.013 1414 1533 E WindowManager: at android.os.Looper.loop(Looper.java:154)
07-09 22:54:49.013 1414 1533 E WindowManager: at android.os.HandlerThread.run(HandlerThread.java:61)
07-09 22:54:49.013 1414 1533 E WindowManager: at com.android.server.ServiceThread.run(ServiceThread.java:46)
07-09 22:54:49.016 1414 1533 E WindowManager: Unhandled exception in Window Manager
Contributor guide
Research direction
Reproduce on Android API 25 using the HDMI second-display steps, including clearing all apps, and capture the repeated WindowManager errors. Start by tracing the presentation-mode entry point and the display lifecycle around app restart; done means presentation starts on the TV instead of mirroring the Android display and the logged exception loop no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100