Android 7.0 设置图案解锁，在锁屏状态下拉视频/推送视频，显示黑屏问题分析

Android 7.0 设置图案解锁，在锁屏状态下拉视频/推送视频，显示黑屏问题分析

1. 从现象上来看，很像是界面上有一层东西挡住了视频的显示。查看Activity中布局设置，发现在onCreate中先设置了一个空壳布局作为容器，之后才设置真正的布局。修改为直接设置布局，不再套一层显示。
2. 跟踪代码，发现在设置SurfaceView的显示时，surfaceview.setZOrderMediaOverlay为false，修改为true。

surfaceview.setZOrderMediaOverlay方法：

public void setZOrderMediaOverlay(boolean isMediaOverlay) {
mWindowType = isMediaOverlay
? WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY
: WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;
}

Control whether the surface view's surface is placed on top of its window. Normally it is placed behind the window, to allow it to (for the most part) appear to composite with the views in the hierarchy. By setting this, you cause it to be placed above the window. This means that none of the contents of the window this SurfaceView is in will be visible on top of its surface.
Note that this must be set before the surface view's containing window is attached to the window manager.

Calling this overrides any previous call to setZOrderMediaOverlay(boolean).