Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a307620 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8068644 from 59985150 to sc-v2-release

Change-Id: I249113d64d1c254f5fcac82d786e12e8ae03e51e
parents e6b4d591 59985150
Loading
Loading
Loading
Loading
+51 −58
Original line number Diff line number Diff line
@@ -138,20 +138,9 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
    private boolean mDisableBackgroundLayer = false;

    /**
     * We use this lock in SOME cases when reading or writing SurfaceControl,
     * but use the following model so that the RenderThread can run locklessly
     * in the position up-date case.
     *
     * 1. UI Thread can read from mSurfaceControl (use in Transactions) without
     * holding the lock.
     * 2. UI Thread will hold the lock when writing to mSurfaceControl (calling release
     * or remove).
     * 3. Render thread will also hold the lock when writing to mSurfaceControl (e.g.
     * calling release from positionLost).
     * 3. RenderNode.PositionUpdateListener::positionChanged will only be called
     * when the UI thread is paused (blocked on the Render thread).
     * 4. positionChanged thus will not be required to hold the lock as the
     * UI thread is blocked, and the other writer is the RT itself.
     * We use this lock to protect access to mSurfaceControl and 
     * SurfaceViewPositionUpdateListener#mPositionChangedTransaction. Both are accessed on the UI
     * thread and the render thread.
     */
    final Object mSurfaceControlLock = new Object();
    final Rect mTmpRect = new Rect();
@@ -945,8 +934,10 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
            Transaction geometryTransaction) {
        if (mPositionListener != null) {
            mRenderNode.removePositionUpdateListener(mPositionListener);
            synchronized (mSurfaceControlLock) {
                geometryTransaction = mPositionListener.getTransaction().merge(geometryTransaction);
            }
        }
        mPositionListener = new SurfaceViewPositionUpdateListener(surfaceWidth, surfaceHeight,
                geometryTransaction);
        mRenderNode.addPositionUpdateListener(mPositionListener);
@@ -975,9 +966,9 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
            mParentSurfaceSequenceId = viewRoot.getSurfaceSequenceId();

            if (mViewVisibility) {
                mTmpTransaction.show(mSurfaceControl);
                geometryTransaction.show(mSurfaceControl);
            } else {
                mTmpTransaction.hide(mSurfaceControl);
                geometryTransaction.hide(mSurfaceControl);
            }

            if (mSurfacePackage != null) {
@@ -1467,7 +1458,6 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
                if (mSurfaceControl == null) {
                    return;
                }
            }
                if (mRTLastReportedPosition.left == left
                        && mRTLastReportedPosition.top == top
                        && mRTLastReportedPosition.right == right
@@ -1490,8 +1480,10 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
                    onSetSurfacePositionAndScaleRT(mPositionChangedTransaction, mSurfaceControl,
                            mRTLastReportedPosition.left /*positionLeft*/,
                            mRTLastReportedPosition.top /*positionTop*/,
                        mRTLastReportedPosition.width() / (float) mRtSurfaceWidth /*postScaleX*/,
                        mRTLastReportedPosition.height() / (float) mRtSurfaceHeight /*postScaleY*/);
                            mRTLastReportedPosition.width()
                                    / (float) mRtSurfaceWidth /*postScaleX*/,
                            mRTLastReportedPosition.height()
                                    / (float) mRtSurfaceHeight /*postScaleY*/);
                    if (mViewVisibility) {
                        mPositionChangedTransaction.show(mSurfaceControl);
                    }
@@ -1506,6 +1498,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
                    Log.e(TAG, "Exception from repositionChild", ex);
                }
            }
        }

        @Override
        public void applyStretch(long frameNumber, float width, float height,
@@ -1526,18 +1519,18 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
            }
            mRTLastReportedPosition.setEmpty();
            mRTLastReportedSurfaceSize.set(-1, -1);
            if (mPendingTransaction) {
                Log.w(TAG, System.identityHashCode(SurfaceView.this)
                        + "Pending transaction cleared.");
                mPositionChangedTransaction.clear();
                mPendingTransaction = false;
            }

            /**
             * positionLost can be called while UI thread is un-paused so we
             * need to hold the lock here.
             */
            synchronized (mSurfaceControlLock) {
                if (mPendingTransaction) {
                    Log.w(TAG, System.identityHashCode(SurfaceView.this)
                            + "Pending transaction cleared.");
                    mPositionChangedTransaction.clear();
                    mPendingTransaction = false;
                }
                if (mSurfaceControl == null) {
                    return;
                }
+2 −1
Original line number Diff line number Diff line
@@ -231,8 +231,9 @@ public class BubbleFlyoutView extends FrameLayout {
     * Fade animation for consecutive flyouts.
     */
    void animateUpdate(Bubble.FlyoutMessage flyoutMessage, PointF stackPos,
            boolean hideDot, Runnable onHide) {
            boolean hideDot, float[] dotCenter, Runnable onHide) {
        mOnHide = onHide;
        mDotCenter = dotCenter;
        final Runnable afterFadeOut = () -> {
            updateFlyoutMessage(flyoutMessage);
            // Wait for TextViews to layout with updated height.
+1 −0
Original line number Diff line number Diff line
@@ -2494,6 +2494,7 @@ public class BubbleStackView extends FrameLayout
            if (mFlyout.getVisibility() == View.VISIBLE) {
                mFlyout.animateUpdate(bubble.getFlyoutMessage(),
                        mStackAnimationController.getStackPosition(), !bubble.showDot(),
                        bubble.getIconView().getDotCenter(),
                        mAfterFlyoutHidden /* onHide */);
            } else {
                mFlyout.setVisibility(INVISIBLE);
+1 −0
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ public class PipDismissTargetHandler implements ViewTreeObserver.OnPreDrawListen
        });

        mMagnetizedPip = mMotionHelper.getMagnetizedPip();
        mMagnetizedPip.clearAllTargets();
        mMagneticTarget = mMagnetizedPip.addTarget(mTargetView, 0);
        updateMagneticTargetSize();

+1 −1
Original line number Diff line number Diff line
@@ -1317,7 +1317,7 @@ public class AudioSystem
            return DEVICE_OUT_BLE_SPEAKER_NAME;
        case DEVICE_OUT_DEFAULT:
        default:
            return Integer.toString(device);
            return "0x" + Integer.toHexString(device);
        }
    }

Loading