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

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

Merge cherrypicks of ['googleplex-android-review.googlesource.com/28095144',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/28095144', 'googleplex-android-review.googlesource.com/28156918', 'googleplex-android-review.googlesource.com/28240753', 'googleplex-android-review.googlesource.com/28354266', 'googleplex-android-review.googlesource.com/28548443', 'googleplex-android-review.googlesource.com/29361823', 'googleplex-android-review.googlesource.com/29433228', 'googleplex-android-review.googlesource.com/29489824'] into 24Q3-release.

Change-Id: I2725a264602085a34a303aa31ae20e9079c0c708
parents 4253ae01 61dbf045
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -135,6 +135,14 @@ public class ClipDescription implements Parcelable {
    public static final String EXTRA_LOGGING_INSTANCE_ID =
            "android.intent.extra.LOGGING_INSTANCE_ID";

    /**
     * The id of the task containing the window that initiated the drag that should be hidden.
     * Only provided to internal drag handlers as a part of the DRAG_START event.
     * @hide
     */
    public static final String EXTRA_HIDE_DRAG_SOURCE_TASK_ID =
            "android.intent.extra.HIDE_DRAG_SOURCE_TASK_ID";

    /**
     * Indicates that a ClipData contains potentially sensitive information, such as a
     * password or credit card number.
+13 −1
Original line number Diff line number Diff line
@@ -9,3 +9,15 @@ flag {
    bug: "293636629"
    is_fixed_read_only: true
}

flag {
    name: "device_state_requester_cancel_state"
    is_exported: true
    namespace: "windowing_sdk"
    description: "Removes foreground requirement if process attempting to cancel a state request is the requester"
    bug: "354772125"
    is_fixed_read_only: true
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -5511,6 +5511,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    @FlaggedApi(FLAG_DELEGATE_UNHANDLED_DRAGS)
    public static final int DRAG_FLAG_START_INTENT_SENDER_ON_UNHANDLED_DRAG = 1 << 13;
    /**
     * Flag indicating that this drag will result in the caller activity's task to be hidden for the
     * duration of the drag, this means that the source activity will not receive drag events for
     * the current drag gesture. Only the current voice interaction service may use this flag.
     * @hide
     */
    public static final int DRAG_FLAG_HIDE_CALLING_TASK_ON_DRAG_START = 1 << 14;
    /**
     * Vertical scroll factor cached by {@link #getVerticalScrollFactor}.
     */
+51 −2
Original line number Diff line number Diff line
@@ -123,6 +123,15 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
        default void dump(@NonNull PrintWriter pw, String prefix) {};
    }

    /**
     * Limited scope callback to notify when a task is removed from the system.  This signal is
     * not synchronized with anything (or any transition), and should not be used in cases where
     * that is necessary.
     */
    public interface TaskVanishedListener {
        default void onTaskVanished(RunningTaskInfo taskInfo) {}
    }

    /**
     * Callbacks for events on a task with a locus id.
     */
@@ -167,6 +176,9 @@ public class ShellTaskOrganizer extends TaskOrganizer implements

    private final ArraySet<FocusListener> mFocusListeners = new ArraySet<>();

    // Listeners that should be notified when a task is removed
    private final ArraySet<TaskVanishedListener> mTaskVanishedListeners = new ArraySet<>();

    private final Object mLock = new Object();
    private StartingWindowController mStartingWindow;

@@ -409,7 +421,7 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
    }

    /**
     * Removes listener.
     * Removes a locus id listener.
     */
    public void removeLocusIdListener(LocusIdListener listener) {
        synchronized (mLock) {
@@ -430,7 +442,7 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
    }

    /**
     * Removes listener.
     * Removes a focus listener.
     */
    public void removeFocusListener(FocusListener listener) {
        synchronized (mLock) {
@@ -438,6 +450,24 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
        }
    }

    /**
     * Adds a listener to be notified when a task vanishes.
     */
    public void addTaskVanishedListener(TaskVanishedListener listener) {
        synchronized (mLock) {
            mTaskVanishedListeners.add(listener);
        }
    }

    /**
     * Removes a task-vanished listener.
     */
    public void removeTaskVanishedListener(TaskVanishedListener listener) {
        synchronized (mLock) {
            mTaskVanishedListeners.remove(listener);
        }
    }

    /**
     * Returns a surface which can be used to attach overlays to the home root task
     */
@@ -614,6 +644,9 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
                t.apply();
                ProtoLog.v(WM_SHELL_TASK_ORG, "Removing overlay surface");
            }
            for (TaskVanishedListener l : mTaskVanishedListeners) {
                l.onTaskVanished(taskInfo);
            }

            if (!ENABLE_SHELL_TRANSITIONS && (appearedInfo.getLeash() != null)) {
                // Preemptively clean up the leash only if shell transitions are not enabled
@@ -647,6 +680,22 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
        }
    }

    /**
     * Shows/hides the given task surface.  Not for general use as changing the task visibility may
     * conflict with other Transitions.  This is currently ONLY used to temporarily hide a task
     * while a drag is in session.
     */
    public void setTaskSurfaceVisibility(int taskId, boolean visible) {
        synchronized (mLock) {
            final TaskAppearedInfo info = mTasks.get(taskId);
            if (info != null) {
                SurfaceControl.Transaction t = new SurfaceControl.Transaction();
                t.setVisibility(info.getLeash(), visible);
                t.apply();
            }
        }
    }

    private boolean updateTaskListenerIfNeeded(RunningTaskInfo taskInfo, SurfaceControl leash,
            TaskListener oldListener, TaskListener newListener) {
        if (oldListener == newListener) return false;
+3 −2
Original line number Diff line number Diff line
@@ -642,6 +642,7 @@ public abstract class WMShellModule {
            ShellInit shellInit,
            ShellController shellController,
            ShellCommandHandler shellCommandHandler,
            ShellTaskOrganizer shellTaskOrganizer,
            DisplayController displayController,
            UiEventLogger uiEventLogger,
            IconProvider iconProvider,
@@ -649,8 +650,8 @@ public abstract class WMShellModule {
            Transitions transitions,
            @ShellMainThread ShellExecutor mainExecutor) {
        return new DragAndDropController(context, shellInit, shellController, shellCommandHandler,
                displayController, uiEventLogger, iconProvider, globalDragListener, transitions,
                mainExecutor);
                shellTaskOrganizer, displayController, uiEventLogger, iconProvider,
                globalDragListener, transitions, mainExecutor);
    }

    //
Loading