private void updateRelativeZ(Transaction t) {
final ViewRootImpl viewRoot = getViewRootImpl();
if (viewRoot == null) {
// We were just detached.
return;
}
final SurfaceControl viewRootControl = viewRoot.getSurfaceControl();
t.setRelativeLayer(mBackgroundControl, viewRootControl, Integer.MIN_VALUE);
t.setRelativeLayer(mSurfaceControl, viewRootControl, mSubLayer);
}
设置相对层级,默认情况下 mSubLayer
是 -2,所以 SurfaceView layer 是窗口层级之下。