Failed to start presentation mode.

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, kotlin
Domain
mobile

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.

Description

migrated googlesamples

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

Dominant language
Kotlin
Stars
1.4k
Forks
777
Avg merge
1m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from android/media-samples

All issues in android/media-samples

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.