Java Code Examples for android.view.SurfaceControl#mergeToGlobalTransaction()

The following examples show how to use android.view.SurfaceControl#mergeToGlobalTransaction() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WindowSurfaceController.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
private boolean updateVisibility() {
    if (mHiddenForCrop || mHiddenForOtherReasons) {
        if (mSurfaceShown) {
            hideSurface(mTmpTransaction);
            SurfaceControl.mergeToGlobalTransaction(mTmpTransaction);
        }
        return false;
    } else {
        if (!mSurfaceShown) {
            return showSurface();
        } else {
            return true;
        }
    }
}
 
Example 2
Source File: RootWindowContainer.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
private void applySurfaceChangesTransaction(boolean recoveringMemory, int defaultDw,
        int defaultDh) {
    mHoldScreenWindow = null;
    mObscuringWindow = null;

    // TODO(multi-display): Support these features on secondary screens.
    if (mService.mWatermark != null) {
        mService.mWatermark.positionSurface(defaultDw, defaultDh);
    }
    if (mService.mStrictModeFlash != null) {
        mService.mStrictModeFlash.positionSurface(defaultDw, defaultDh);
    }
    if (mService.mCircularDisplayMask != null) {
        mService.mCircularDisplayMask.positionSurface(defaultDw, defaultDh,
                mService.getDefaultDisplayRotation());
    }
    if (mService.mEmulatorDisplayOverlay != null) {
        mService.mEmulatorDisplayOverlay.positionSurface(defaultDw, defaultDh,
                mService.getDefaultDisplayRotation());
    }

    boolean focusDisplayed = false;

    final int count = mChildren.size();
    for (int j = 0; j < count; ++j) {
        final DisplayContent dc = mChildren.get(j);
        focusDisplayed |= dc.applySurfaceChangesTransaction(recoveringMemory);
    }

    if (focusDisplayed) {
        mService.mH.sendEmptyMessage(REPORT_LOSING_FOCUS);
    }

    // Give the display manager a chance to adjust properties like display rotation if it needs
    // to.
    mService.mDisplayManagerInternal.performTraversal(mDisplayTransaction);
    SurfaceControl.mergeToGlobalTransaction(mDisplayTransaction);
}
 
Example 3
Source File: WindowContainer.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/**
 * TODO: Once we totally eliminate global transaction we will pass transaction in here
 * rather than merging to global.
 */
void prepareSurfaces() {
    SurfaceControl.mergeToGlobalTransaction(getPendingTransaction());

    // If a leash has been set when the transaction was committed, then the leash reparent has
    // been committed.
    mCommittedReparentToAnimationLeash = mSurfaceAnimator.hasLeash();
    for (int i = 0; i < mChildren.size(); i++) {
        mChildren.get(i).prepareSurfaces();
    }
}
 
Example 4
Source File: WindowStateAnimator.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
void hide(String reason) {
    hide(mTmpTransaction, reason);
    SurfaceControl.mergeToGlobalTransaction(mTmpTransaction);
}