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

Commit 6a544edc authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Add mechanism to update the CloseGuard callsite of a SurfaceControl"

parents 217c896b 3462f7a7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -619,10 +619,11 @@ public class DragEvent implements Parcelable {
            }
            if (in.readInt() != 0) {
                event.mDragSurface = SurfaceControl.CREATOR.createFromParcel(in);
                event.mDragSurface.setUnreleasedWarningCallSite("DragEvent");
            }
            if (in.readInt() != 0) {
                event.mDragAndDropPermissions =
                        IDragAndDropPermissions.Stub.asInterface(in.readStrongBinder());;
                        IDragAndDropPermissions.Stub.asInterface(in.readStrongBinder());
            }
            return event;
        }
+6 −0
Original line number Diff line number Diff line
@@ -296,6 +296,9 @@ public class RemoteAnimationTarget implements Parcelable {
        taskId = in.readInt();
        mode = in.readInt();
        leash = in.readTypedObject(SurfaceControl.CREATOR);
        if (leash != null) {
            leash.setUnreleasedWarningCallSite("RemoteAnimationTarget[leash]");
        }
        isTranslucent = in.readBoolean();
        clipRect = in.readTypedObject(Rect.CREATOR);
        contentInsets = in.readTypedObject(Rect.CREATOR);
@@ -307,6 +310,9 @@ public class RemoteAnimationTarget implements Parcelable {
        windowConfiguration = in.readTypedObject(WindowConfiguration.CREATOR);
        isNotInRecents = in.readBoolean();
        startLeash = in.readTypedObject(SurfaceControl.CREATOR);
        if (startLeash != null) {
            startLeash.setUnreleasedWarningCallSite("RemoteAnimationTarget[startLeash]");
        }
        startBounds = in.readTypedObject(Rect.CREATOR);
        taskInfo = in.readTypedObject(ActivityManager.RunningTaskInfo.CREATOR);
        allowEnterPip = in.readBoolean();
+14 −0
Original line number Diff line number Diff line
@@ -1290,6 +1290,20 @@ public final class SurfaceControl implements Parcelable {
        sDebugUsageAfterRelease = debug;
    }

    /**
     * Provides more information to show about the source of this SurfaceControl if it is finalized
     * without being released. This is primarily intended for callers to update the call site after
     * receiving a SurfaceControl from another process, which would otherwise get a generic default
     * call site.
     * @hide
     */
    public void setUnreleasedWarningCallSite(@NonNull String callsite) {
        if (!isValid()) {
            return;
        }
        mCloseGuard.openWithCallSite("release", callsite);
    }

    /**
     * Checks whether two {@link SurfaceControl} objects represent the same surface.
     *
+1 −0
Original line number Diff line number Diff line
@@ -170,6 +170,7 @@ public class SurfaceControlViewHost {
        private SurfacePackage(Parcel in) {
            mSurfaceControl = new SurfaceControl();
            mSurfaceControl.readFromParcel(in);
            mSurfaceControl.setUnreleasedWarningCallSite("SurfacePackage(Parcel)");
            mAccessibilityEmbeddedConnection = IAccessibilityEmbeddedConnection.Stub.asInterface(
                    in.readStrongBinder());
            mInputToken = in.readStrongBinder();
+1 −0
Original line number Diff line number Diff line
@@ -198,6 +198,7 @@ public final class TransitionInfo implements Parcelable {
        in.readTypedList(mChanges, Change.CREATOR);
        mRootLeash = new SurfaceControl();
        mRootLeash.readFromParcel(in);
        mRootLeash.setUnreleasedWarningCallSite("TransitionInfo");
        mRootOffset.readFromParcel(in);
        mOptions = in.readTypedObject(AnimationOptions.CREATOR);
    }
Loading