Presentation surface of presentation service is destroyed when terminating the parent applicationSee original GitHub issue
This problem occurs when an app contains both an activity and a presentation service. When terminating the activity(app) then the presentation service’s surface is destroyed.
I’ve observed this problem in my own application but it also occurs with the demoService application. Android OS version: 7.0
Bringing the app to the background works correctly, only destroying the app triggers this behavior. The presentation service is automatically restarted after 1 sec, after which it works correctly.
Error captured with adb logcat
12-20 15:31:20.326 3713 7220 I WindowManager_SurfaceController: Destroying surface Surface(name=com.android.systemui/com.android.systemui.recents.RecentsActivity) called by com.android.server.wm.WindowStateAnimator.destroySurface:2840 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:1070 com.android.server.wm.WindowState.destroyOrSaveSurface:2561 com.android.server.wm.AppWindowToken.destroySurfaces:412 com.android.server.wm.AppWindowToken.destroySurfaces:376 com.android.server.wm.AppWindowToken.notifyAppStopped:456 com.android.server.wm.WindowManagerService.notifyAppStopped:5199
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
OK, I will take a look at this in a couple of days. In the meantime, you could try making your service be a foreground service, if it is not one already, and see if that helps. You will need this for Android 8.0+ anyway, and my guess is that this is not a problem with the library but rather a problem of the service being destroyed. But, I’ll look into it more in the coming days.
Thanks for the info!
Thanks for quickly looking into this and providing a fix for the problem!