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

Commit 8006a272 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I5c2facba,I2fecbeaa,I045ddf19,I961d190d

* changes:
  Move frame validation logic for deferTransactionUntil.
  Handle surfaceInset changes with deferred transactions.
  Various pinned animation bug fixes.
  Nuke WindowState#mShownPosition. Rework mXOffset/mYOffset.
parents 2c5079c6 024378c5
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -763,20 +763,16 @@ public class SurfaceControl implements Parcelable {
    }

    public void deferTransactionUntil(IBinder handle, long frame) {
        if (frame > 0) {
        synchronized(SurfaceControl.class) {
            sGlobalTransaction.deferTransactionUntil(this, handle, frame);
        }
    }
    }

    public void deferTransactionUntil(Surface barrier, long frame) {
        if (frame > 0) {
        synchronized(SurfaceControl.class) {
            sGlobalTransaction.deferTransactionUntilSurface(this, barrier, frame);
        }
    }
    }

    public void reparentChildren(IBinder newParentHandle) {
        synchronized(SurfaceControl.class) {
@@ -1479,6 +1475,9 @@ public class SurfaceControl implements Parcelable {

        public Transaction deferTransactionUntil(SurfaceControl sc, IBinder handle,
                long frameNumber) {
            if (frameNumber < 0) {
                return this;
            }
            sc.checkNotReleased();
            nativeDeferTransactionUntil(mNativeObject, sc.mNativeObject, handle, frameNumber);
            return this;
@@ -1486,6 +1485,9 @@ public class SurfaceControl implements Parcelable {

        public Transaction deferTransactionUntilSurface(SurfaceControl sc, Surface barrierSurface,
                long frameNumber) {
            if (frameNumber < 0) {
                return this;
            }
            sc.checkNotReleased();
            nativeDeferTransactionUntilSurface(mNativeObject, sc.mNativeObject,
                    barrierSurface.mNativeObject, frameNumber);
+13 −7
Original line number Diff line number Diff line
@@ -6440,11 +6440,11 @@ public final class ViewRootImpl implements ViewParent,
            params.backup();
            mTranslator.translateWindowLayout(params);
        }

        if (params != null) {
            if (DBG) Log.d(mTag, "WindowLayout in layoutWindow:" + params);
        }

        if (params != null && mOrigWindowType != params.type) {
            if (mOrigWindowType != params.type) {
                // For compatibility with old apps, don't crash here.
                if (mTargetSdkVersion < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
                    Slog.w(mTag, "Window type can not be changed after "
@@ -6452,6 +6452,12 @@ public final class ViewRootImpl implements ViewParent,
                    params.type = mOrigWindowType;
                }
            }

            if (mSurface.isValid()) {
                params.frameNumber = mSurface.getNextFrameNumber();
            }
        }

        int relayoutResult = mWindowSession.relayout(
                mWindow, mSeq, params,
                (int) (mView.getMeasuredWidth() * appScale + 0.5f),
+13 −0
Original line number Diff line number Diff line
@@ -2370,6 +2370,13 @@ public interface WindowManager extends ViewManager {
         */
        public long hideTimeoutMilliseconds = -1;

        /**
         * A frame number in which changes requested in this layout will be rendered.
         *
         * @hide
         */
        public long frameNumber = -1;

        /**
         * The color mode requested by this window. The target display may
         * not be able to honor the request. When the color mode is not set
@@ -2543,6 +2550,7 @@ public interface WindowManager extends ViewManager {
            TextUtils.writeToParcel(accessibilityTitle, out, parcelableFlags);
            out.writeInt(mColorMode);
            out.writeLong(hideTimeoutMilliseconds);
            out.writeLong(frameNumber);
        }

        public static final Parcelable.Creator<LayoutParams> CREATOR
@@ -2599,6 +2607,7 @@ public interface WindowManager extends ViewManager {
            accessibilityTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
            mColorMode = in.readInt();
            hideTimeoutMilliseconds = in.readLong();
            frameNumber = in.readLong();
        }

        @SuppressWarnings({"PointlessBitwiseExpression"})
@@ -2799,6 +2808,10 @@ public interface WindowManager extends ViewManager {
                changes |= SURFACE_INSETS_CHANGED;
            }

            // The frame number changing is only relevant in the context of other
            // changes, and so we don't need to track it with a flag.
            frameNumber = o.frameNumber;

            if (hasManualSurfaceInsets != o.hasManualSurfaceInsets) {
                hasManualSurfaceInsets = o.hasManualSurfaceInsets;
                changes |= SURFACE_INSETS_CHANGED;
+0 −1
Original line number Diff line number Diff line
@@ -295,7 +295,6 @@ message WindowStateProto {
  optional bool animating_exit = 14;
  repeated WindowStateProto child_windows = 15;
  optional .android.graphics.RectProto surface_position = 16;
  optional .android.graphics.RectProto shown_position = 17;
  optional int32 requested_width = 18;
  optional int32 requested_height = 19;
  optional int32 view_visibility = 20;
+1 −3
Original line number Diff line number Diff line
@@ -5647,9 +5647,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        final int fl = PolicyControl.getWindowFlags(null,
                mTopFullscreenOpaqueWindowState.getAttrs());
        if (localLOGV) {
            Slog.d(TAG, "frame: " + mTopFullscreenOpaqueWindowState.getFrameLw()
                    + " shown position: "
                    + mTopFullscreenOpaqueWindowState.getShownPositionLw());
            Slog.d(TAG, "frame: " + mTopFullscreenOpaqueWindowState.getFrameLw());
            Slog.d(TAG, "attr: " + mTopFullscreenOpaqueWindowState.getAttrs()
                    + " lp.flags=0x" + Integer.toHexString(fl));
        }
Loading