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

Commit 295b3e92 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

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

Merge cherrypicks of ['googleplex-android-review.googlesource.com/27886457', 'googleplex-android-review.googlesource.com/27873775', 'googleplex-android-review.googlesource.com/27873355', 'googleplex-android-review.googlesource.com/27954786', 'googleplex-android-review.googlesource.com/28014307'] into 24Q3-release.

Change-Id: Id71fd1069c3a07783709e192cb81570f24494e31
parents 1809be44 604c84d1
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -232,7 +232,17 @@ public class IntentFactory {
                            oemComponentName,
                            PackageManager.ComponentInfoFlags.of(
                                    PackageManager.MATCH_SYSTEM_ONLY));
                    if (info.enabled && info.exported) {
                    boolean oemComponentEnabled = info.enabled;
                    int runtimeComponentEnabledState = context.getPackageManager()
                          .getComponentEnabledSetting(oemComponentName);
                    if (runtimeComponentEnabledState == PackageManager
                          .COMPONENT_ENABLED_STATE_ENABLED) {
                          oemComponentEnabled = true;
                    } else if (runtimeComponentEnabledState == PackageManager
                          .COMPONENT_ENABLED_STATE_DISABLED) {
                        oemComponentEnabled = false;
                    }
                    if (oemComponentEnabled && info.exported) {
                        intentResultBuilder.setOemUiUsageStatus(IntentCreationResult
                                .OemUiUsageStatus.SUCCESS);
                        Slog.i(TAG,
+3 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.os.Handler;
import android.os.UserManager;
import android.view.Choreographer;
import android.view.IWindowManager;
import android.view.SurfaceControl;
import android.view.WindowManager;

import com.android.internal.jank.InteractionJankMonitor;
@@ -400,7 +401,8 @@ public abstract class WMShellModule {
            Optional<RecentTasksController> recentTasksController,
            HomeTransitionObserver homeTransitionObserver) {
        return new RecentsTransitionHandler(shellInit, transitions,
                recentTasksController.orElse(null), homeTransitionObserver);
                recentTasksController.orElse(null), homeTransitionObserver,
                SurfaceControl.Transaction::new);
    }

    //
+20 −2
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import com.android.wm.shell.transition.Transitions;

import java.util.ArrayList;
import java.util.function.Consumer;
import java.util.function.Supplier;

/**
 * Handles the Recents (overview) animation. Only one of these can run at a time. A recents
@@ -84,6 +85,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler {

    private final Transitions mTransitions;
    private final ShellExecutor mExecutor;
    private final Supplier<SurfaceControl.Transaction> mTransactionSupplier;
    @Nullable
    private final RecentTasksController mRecentTasksController;
    private IApplicationThread mAnimApp = null;
@@ -101,11 +103,13 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler {

    public RecentsTransitionHandler(ShellInit shellInit, Transitions transitions,
            @Nullable RecentTasksController recentTasksController,
            HomeTransitionObserver homeTransitionObserver) {
            HomeTransitionObserver homeTransitionObserver,
            Supplier<SurfaceControl.Transaction> transactionSupplier) {
        mTransitions = transitions;
        mExecutor = transitions.getMainExecutor();
        mRecentTasksController = recentTasksController;
        mHomeTransitionObserver = homeTransitionObserver;
        mTransactionSupplier = transactionSupplier;
        if (!Transitions.ENABLE_SHELL_TRANSITIONS) return;
        if (recentTasksController == null) return;
        shellInit.addInitCallback(() -> {
@@ -1056,7 +1060,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler {
            final Transitions.TransitionFinishCallback finishCB = mFinishCB;
            mFinishCB = null;

            final SurfaceControl.Transaction t = mFinishTransaction;
            SurfaceControl.Transaction t = mFinishTransaction;
            final WindowContainerTransaction wct = new WindowContainerTransaction();

            if (mKeyguardLocked && mRecentsTask != null) {
@@ -1106,6 +1110,16 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler {
                    }
                }
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION, "  normal finish");
                if (toHome && !mOpeningTasks.isEmpty()) {
                    // Attempting to start a task after swipe to home, don't show it,
                    // move recents to top
                    ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION,
                            "  attempting to start a task after swipe to home");
                    t = mTransactionSupplier.get();
                    wct.reorder(mRecentsTask, true /*onTop*/);
                    mClosingTasks.addAll(mOpeningTasks);
                    mOpeningTasks.clear();
                }
                // The general case: committing to recents, going home, or switching tasks.
                for (int i = 0; i < mOpeningTasks.size(); ++i) {
                    t.show(mOpeningTasks.get(i).mTaskSurface);
@@ -1174,6 +1188,10 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler {
                    mPipTransaction = null;
                }
            }
            if (t != mFinishTransaction) {
                // apply after merges because these changes are accounting for finishWCT changes.
                mTransitions.setAfterMergeFinishTransaction(mTransition, t);
            }
            cleanUp();
            finishCB.onTransitionFinished(wct.isEmpty() ? null : wct);
            if (runnerFinishCb != null) {
+37 −0
Original line number Diff line number Diff line
@@ -238,6 +238,13 @@ public class Transitions implements RemoteCallable<Transitions>,
        /** Ordered list of transitions which have been merged into this one. */
        private ArrayList<ActiveTransition> mMerged;

        /**
         * @deprecated DO NOT USE THIS unless absolutely necessary. It will be removed once
         * everything migrates off finishWCT.
         */
        @java.lang.Deprecated
        SurfaceControl.Transaction mAfterMergeFinishT;

        ActiveTransition(IBinder token) {
            mToken = token;
        }
@@ -1018,6 +1025,20 @@ public class Transitions implements RemoteCallable<Transitions>,
        return null;
    }

    /** @deprecated */
    @java.lang.Deprecated
    public void setAfterMergeFinishTransaction(IBinder transition,
            SurfaceControl.Transaction afterMergeFinishT) {
        final ActiveTransition at = mKnownTransitions.get(transition);
        if (at == null) return;
        if (at.mAfterMergeFinishT != null) {
            Log.e(TAG, "Setting after-merge-t >1 time on transition: " + at.mInfo.getDebugId());
            at.mAfterMergeFinishT.merge(afterMergeFinishT);
            return;
        }
        at.mAfterMergeFinishT = afterMergeFinishT;
    }

    /** Aborts a transition. This will still queue it up to maintain order. */
    private void onAbort(ActiveTransition transition) {
        final Track track = mTracks.get(transition.getTrack());
@@ -1078,6 +1099,7 @@ public class Transitions implements RemoteCallable<Transitions>,
        }
        // Merge all associated transactions together
        SurfaceControl.Transaction fullFinish = active.mFinishT;
        SurfaceControl.Transaction afterMergeFinish = active.mAfterMergeFinishT;
        if (active.mMerged != null) {
            for (int iM = 0; iM < active.mMerged.size(); ++iM) {
                final ActiveTransition toMerge = active.mMerged.get(iM);
@@ -1097,6 +1119,21 @@ public class Transitions implements RemoteCallable<Transitions>,
                        fullFinish.merge(toMerge.mFinishT);
                    }
                }
                if (toMerge.mAfterMergeFinishT != null) {
                    if (afterMergeFinish == null) {
                        afterMergeFinish = toMerge.mAfterMergeFinishT;
                    } else {
                        afterMergeFinish.merge(toMerge.mAfterMergeFinishT);
                    }
                    toMerge.mAfterMergeFinishT = null;
                }
            }
        }
        if (afterMergeFinish != null) {
            if (fullFinish == null) {
                fullFinish = afterMergeFinish;
            } else {
                fullFinish.merge(afterMergeFinish);
            }
        }
        if (fullFinish != null) {
+2 −1
Original line number Diff line number Diff line
@@ -1192,7 +1192,8 @@ public class ShellTransitionTests extends ShellTestCase {
                        mMainHandler, mAnimExecutor, mock(HomeTransitionObserver.class));
        final RecentsTransitionHandler recentsHandler =
                new RecentsTransitionHandler(shellInit, transitions,
                        mock(RecentTasksController.class), mock(HomeTransitionObserver.class));
                        mock(RecentTasksController.class), mock(HomeTransitionObserver.class),
                        () -> mock(SurfaceControl.Transaction.class));
        transitions.replaceDefaultHandlerForTest(mDefaultHandler);
        shellInit.init();

Loading