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

Commit 3f61ba6f authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10719298 from bf8019c0 to udc-qpr1-release

Change-Id: I49016bdf2638d86ca16b1fb0b23bd98f9df3a8e9
parents a6ae475d bf8019c0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -673,8 +673,8 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
                    synchronized (mInterfaceLock) {
                        try {
                            if (mSessionProcessor != null) {
                                mSessionProcessor.onCaptureSessionStart(mRequestProcessor);
                                mInitialized = true;
                                mSessionProcessor.onCaptureSessionStart(mRequestProcessor);
                            } else {
                                Log.v(TAG, "Failed to start capture session, session " +
                                                " released before extension start!");
+8 −5
Original line number Diff line number Diff line
@@ -1167,10 +1167,9 @@ public final class Choreographer {
         */
        FrameTimeline update(
                long frameTimeNanos, DisplayEventReceiver.VsyncEventData vsyncEventData) {
            if (vsyncEventData.frameTimelinesLength == 0) {
                throw new IllegalArgumentException(
                        "Vsync event timelines length must be greater than 0");
            }
            // Even if the frame timelines length is 0, continue with allocation for API
            // FrameData.getFrameTimelines consistency. The 0 length frame timelines code path
            // should only occur when USE_VSYNC property is false.
            if (mFrameTimelines.length != vsyncEventData.frameTimelinesLength) {
                allocateFrameTimelines(vsyncEventData.frameTimelinesLength);
            }
@@ -1207,7 +1206,11 @@ public final class Choreographer {
            if (newPreferredDeadline < minimumDeadline) {
                DisplayEventReceiver.VsyncEventData latestVsyncEventData =
                        displayEventReceiver.getLatestVsyncEventData();
                if (latestVsyncEventData == null) {
                    Log.w(TAG, "Could not get latest VsyncEventData. Did SurfaceFlinger crash?");
                } else {
                    update(frameTimeNanos, latestVsyncEventData);
                }
            } else {
                update(frameTimeNanos, newPreferredIndex);
            }
+10 −4
Original line number Diff line number Diff line
@@ -158,7 +158,11 @@ public abstract class DisplayEventReceiver {
        static final int FRAME_TIMELINES_CAPACITY = 7;

        public static class FrameTimeline {
            FrameTimeline() {}
            FrameTimeline() {
                // Some reasonable values (+10 ms) for default timestamps.
                deadline = System.nanoTime() + 10_000_000;
                expectedPresentationTime = deadline + 10_000_000;
            }

            // Called from native code.
            @SuppressWarnings("unused")
@@ -179,11 +183,11 @@ public abstract class DisplayEventReceiver {
            public long vsyncId = FrameInfo.INVALID_VSYNC_ID;

            // The frame timestamp for when the frame is expected to be presented.
            public long expectedPresentationTime = Long.MAX_VALUE;
            public long expectedPresentationTime;

            // The frame deadline timestamp in {@link System#nanoTime()} timebase that it is
            // allotted for the frame to be completed.
            public long deadline = Long.MAX_VALUE;
            public long deadline;
        }

        /**
@@ -197,7 +201,9 @@ public abstract class DisplayEventReceiver {

        public int preferredFrameTimelineIndex = 0;

        public int frameTimelinesLength = 0;
        // The default FrameTimeline is a placeholder populated with invalid vsync ID and some
        // reasonable timestamps.
        public int frameTimelinesLength = 1;

        VsyncEventData() {
            frameTimelines = new FrameTimeline[FRAME_TIMELINES_CAPACITY];
+39 −13
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package android.window;

import static android.view.WindowManager.transitTypeToString;

import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.WindowConfiguration;
@@ -51,14 +49,26 @@ public final class TransitionRequestInfo implements Parcelable {
     * The reliable parts should be flags, rotation start/end (if rotating), and start/end bounds
     * (if size is changing).
     */
    private @Nullable DisplayChange mDisplayChange;
    private @Nullable TransitionRequestInfo.DisplayChange mDisplayChange;

    /** The transition flags known at the time of the request. These may not be complete. */
    private final int mFlags;

    /** constructor override */
    public TransitionRequestInfo(
            @WindowManager.TransitionType int type,
            @Nullable ActivityManager.RunningTaskInfo triggerTask,
            @Nullable RemoteTransition remoteTransition) {
        this(type, triggerTask, remoteTransition, null /* displayChange */);
        this(type, triggerTask, remoteTransition, null /* displayChange */, 0 /* flags */);
    }

    /** constructor override */
    public TransitionRequestInfo(
            @WindowManager.TransitionType int type,
            @Nullable ActivityManager.RunningTaskInfo triggerTask,
            @Nullable RemoteTransition remoteTransition,
            int flags) {
        this(type, triggerTask, remoteTransition, null /* displayChange */, flags);
    }

    /** Requested change to a display. */
@@ -236,7 +246,7 @@ public final class TransitionRequestInfo implements Parcelable {
        };

        @DataClass.Generated(
                time = 1648141181315L,
                time = 1691627678294L,
                codegenVersion = "1.0.23",
                sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java",
                inputSignatures = "private final  int mDisplayId\nprivate @android.annotation.Nullable android.graphics.Rect mStartAbsBounds\nprivate @android.annotation.Nullable android.graphics.Rect mEndAbsBounds\nprivate  int mStartRotation\nprivate  int mEndRotation\nprivate  boolean mPhysicalDisplayChanged\nclass DisplayChange extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genBuilder=false, genConstructor=false)")
@@ -279,19 +289,23 @@ public final class TransitionRequestInfo implements Parcelable {
     *   If non-null, this request was triggered by this display change. This will not be complete:
     *   The reliable parts should be flags, rotation start/end (if rotating), and start/end bounds
     *   (if size is changing).
     * @param flags
     *   The transition flags known at the time of the request. These may not be complete.
     */
    @DataClass.Generated.Member
    public TransitionRequestInfo(
            @WindowManager.TransitionType int type,
            @Nullable ActivityManager.RunningTaskInfo triggerTask,
            @Nullable RemoteTransition remoteTransition,
            @Nullable DisplayChange displayChange) {
            @Nullable TransitionRequestInfo.DisplayChange displayChange,
            int flags) {
        this.mType = type;
        com.android.internal.util.AnnotationValidations.validate(
                WindowManager.TransitionType.class, null, mType);
        this.mTriggerTask = triggerTask;
        this.mRemoteTransition = remoteTransition;
        this.mDisplayChange = displayChange;
        this.mFlags = flags;

        // onConstructed(); // You can define this method to get a callback
    }
@@ -327,10 +341,18 @@ public final class TransitionRequestInfo implements Parcelable {
     * (if size is changing).
     */
    @DataClass.Generated.Member
    public @Nullable DisplayChange getDisplayChange() {
    public @Nullable TransitionRequestInfo.DisplayChange getDisplayChange() {
        return mDisplayChange;
    }

    /**
     * The transition flags known at the time of the request. These may not be complete.
     */
    @DataClass.Generated.Member
    public int getFlags() {
        return mFlags;
    }

    /**
     * If non-null, If non-null, the task containing the activity whose lifecycle change (start or
     * finish) has caused this transition to occur.
@@ -356,7 +378,7 @@ public final class TransitionRequestInfo implements Parcelable {
     * (if size is changing).
     */
    @DataClass.Generated.Member
    public @android.annotation.NonNull TransitionRequestInfo setDisplayChange(@android.annotation.NonNull DisplayChange value) {
    public @android.annotation.NonNull TransitionRequestInfo setDisplayChange(@android.annotation.NonNull TransitionRequestInfo.DisplayChange value) {
        mDisplayChange = value;
        return this;
    }
@@ -368,10 +390,11 @@ public final class TransitionRequestInfo implements Parcelable {
        // String fieldNameToString() { ... }

        return "TransitionRequestInfo { " +
                "type = " + transitTypeToString(mType) + ", " +
                "type = " + mType + ", " +
                "triggerTask = " + mTriggerTask + ", " +
                "remoteTransition = " + mRemoteTransition + ", " +
                "displayChange = " + mDisplayChange +
                "displayChange = " + mDisplayChange + ", " +
                "flags = " + mFlags +
        " }";
    }

@@ -390,6 +413,7 @@ public final class TransitionRequestInfo implements Parcelable {
        if (mTriggerTask != null) dest.writeTypedObject(mTriggerTask, flags);
        if (mRemoteTransition != null) dest.writeTypedObject(mRemoteTransition, flags);
        if (mDisplayChange != null) dest.writeTypedObject(mDisplayChange, flags);
        dest.writeInt(mFlags);
    }

    @Override
@@ -407,7 +431,8 @@ public final class TransitionRequestInfo implements Parcelable {
        int type = in.readInt();
        ActivityManager.RunningTaskInfo triggerTask = (flg & 0x2) == 0 ? null : (ActivityManager.RunningTaskInfo) in.readTypedObject(ActivityManager.RunningTaskInfo.CREATOR);
        RemoteTransition remoteTransition = (flg & 0x4) == 0 ? null : (RemoteTransition) in.readTypedObject(RemoteTransition.CREATOR);
        DisplayChange displayChange = (flg & 0x8) == 0 ? null : (DisplayChange) in.readTypedObject(DisplayChange.CREATOR);
        TransitionRequestInfo.DisplayChange displayChange = (flg & 0x8) == 0 ? null : (TransitionRequestInfo.DisplayChange) in.readTypedObject(TransitionRequestInfo.DisplayChange.CREATOR);
        int flags = in.readInt();

        this.mType = type;
        com.android.internal.util.AnnotationValidations.validate(
@@ -415,6 +440,7 @@ public final class TransitionRequestInfo implements Parcelable {
        this.mTriggerTask = triggerTask;
        this.mRemoteTransition = remoteTransition;
        this.mDisplayChange = displayChange;
        this.mFlags = flags;

        // onConstructed(); // You can define this method to get a callback
    }
@@ -434,10 +460,10 @@ public final class TransitionRequestInfo implements Parcelable {
    };

    @DataClass.Generated(
            time = 1639445520938L,
            time = 1691627678327L,
            codegenVersion = "1.0.23",
            sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java",
            inputSignatures = "private final @android.view.WindowManager.TransitionType int mType\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mTriggerTask\nprivate @android.annotation.Nullable android.window.RemoteTransition mRemoteTransition\nprivate @android.annotation.Nullable android.window.TransitionRequestInfo.DisplayChange mDisplayChange\nclass TransitionRequestInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)")
            inputSignatures = "private final @android.view.WindowManager.TransitionType int mType\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mTriggerTask\nprivate @android.annotation.Nullable android.window.RemoteTransition mRemoteTransition\nprivate @android.annotation.Nullable android.window.TransitionRequestInfo.DisplayChange mDisplayChange\nprivate final  int mFlags\nclass TransitionRequestInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)")
    @Deprecated
    private void __metadata() {}

+22 −3
Original line number Diff line number Diff line
@@ -21,11 +21,13 @@ import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.TestApi;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.IBinder;
import android.os.InputConfig;
import android.util.ArrayMap;
import android.util.Log;
import android.util.Pair;
import android.util.SparseArray;
import android.view.InputWindowHandle;

import java.util.ArrayList;
@@ -127,13 +129,13 @@ public class WindowInfosListenerForTest {
                            "Exception thrown while waiting for listener to be called with "
                                    + "initial state");
                }
                consumer.accept(buildWindowInfos(windowHandles));
                consumer.accept(buildWindowInfos(windowHandles, displayInfos));
            }
        };
        mListeners.put(consumer, listener);
        Pair<InputWindowHandle[], WindowInfosListener.DisplayInfo[]> initialState =
                listener.register();
        consumer.accept(buildWindowInfos(initialState.first));
        consumer.accept(buildWindowInfos(initialState.first, initialState.second));
        calledWithInitialState.countDown();
    }

@@ -148,11 +150,28 @@ public class WindowInfosListenerForTest {
        listener.unregister();
    }

    private static List<WindowInfo> buildWindowInfos(InputWindowHandle[] windowHandles) {
    private static List<WindowInfo> buildWindowInfos(
            InputWindowHandle[] windowHandles, WindowInfosListener.DisplayInfo[] displayInfos) {
        var windowInfos = new ArrayList<WindowInfo>(windowHandles.length);

        var displayInfoById = new SparseArray<WindowInfosListener.DisplayInfo>(displayInfos.length);
        for (var displayInfo : displayInfos) {
            displayInfoById.put(displayInfo.mDisplayId, displayInfo);
        }

        var tmp = new RectF();
        for (var handle : windowHandles) {
            var bounds = new Rect(handle.frameLeft, handle.frameTop, handle.frameRight,
                    handle.frameBottom);

            // Transform bounds from physical display coordinates to logical display coordinates.
            var display = displayInfoById.get(handle.displayId);
            if (display != null) {
                tmp.set(bounds);
                display.mTransform.mapRect(tmp);
                tmp.round(bounds);
            }

            windowInfos.add(new WindowInfo(handle.getWindowToken(), handle.name, handle.displayId,
                    bounds, handle.inputConfig));
        }
Loading