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

Commit 3190c222 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10277839 from c6a789e7 to udc-release

Change-Id: I4e2fdb002b8b29646fb11f12835600ce894fdaa8
parents 5299bc05 c6a789e7
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -5459,7 +5459,7 @@ public final class ViewRootImpl implements ViewParent,
    }

    private void updateRenderHdrSdrRatio() {
        mRenderHdrSdrRatio = mDisplay.getHdrSdrRatio();
        mRenderHdrSdrRatio = Math.min(mDesiredHdrSdrRatio, mDisplay.getHdrSdrRatio());
        mUpdateHdrSdrRatioInfo = true;
    }

@@ -5487,22 +5487,14 @@ public final class ViewRootImpl implements ViewParent,
                mHdrSdrRatioChangedListener = null;
            } else {
                mHdrSdrRatioChangedListener = display -> {
                    setTargetHdrSdrRatio(display.getHdrSdrRatio());
                    updateRenderHdrSdrRatio();
                    invalidate();
                };
                mDisplay.registerHdrSdrRatioChangedListener(mExecutor, mHdrSdrRatioChangedListener);
            }
        }
    }

    /** happylint */
    public void setTargetHdrSdrRatio(float ratio) {
        if (mRenderHdrSdrRatio != ratio) {
            mRenderHdrSdrRatio = ratio;
            mUpdateHdrSdrRatioInfo = true;
            invalidate();
        }
    }

    @Override
    public void requestChildFocus(View child, View focused) {
        if (DEBUG_INPUT_RESIZE) {
+10 −0
Original line number Diff line number Diff line
@@ -549,6 +549,16 @@ public final class TransitionInfo implements Parcelable {
        }
    }

    /**
     * Updates the callsites of all the surfaces in this transition, which aids in the debugging of
     * lingering surfaces.
     */
    public void setUnreleasedWarningCallSiteForAllSurfaces(String callsite) {
        for (int i = mChanges.size() - 1; i >= 0; --i) {
            mChanges.get(i).getLeash().setUnreleasedWarningCallSite(callsite);
        }
    }

    /**
     * Makes a copy of this as if it were parcel'd and unparcel'd. This implies that surfacecontrol
     * refcounts are incremented which allows the "remote" receiver to release them without breaking
+3 −4
Original line number Diff line number Diff line
@@ -375,16 +375,15 @@ public class DisplayLayout {
                    insetsState.getDisplayFrame(),
                    WindowInsets.Type.navigationBars(),
                    false /* ignoreVisibility */);
            outInsets.set(insets.left, insets.top, insets.right, insets.bottom);
            int position = navigationBarPosition(res, displayWidth, displayHeight, displayRotation);
            int navBarSize =
                    getNavigationBarSize(res, position, displayWidth > displayHeight, uiMode);
            if (position == NAV_BAR_BOTTOM) {
                outInsets.bottom = Math.max(outInsets.bottom , navBarSize);
                outInsets.bottom = Math.max(insets.bottom , navBarSize);
            } else if (position == NAV_BAR_RIGHT) {
                outInsets.right = Math.max(outInsets.right , navBarSize);
                outInsets.right = Math.max(insets.right , navBarSize);
            } else if (position == NAV_BAR_LEFT) {
                outInsets.left = Math.max(outInsets.left , navBarSize);
                outInsets.left = Math.max(insets.left , navBarSize);
            }
        }

+8 −6
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ import com.android.wm.shell.draganddrop.DragAndDropController;
import com.android.wm.shell.freeform.FreeformComponents;
import com.android.wm.shell.fullscreen.FullscreenTaskListener;
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutoutController;
import com.android.wm.shell.keyguard.KeyguardTransitionHandler;
import com.android.wm.shell.keyguard.KeyguardTransitions;
import com.android.wm.shell.onehanded.OneHanded;
import com.android.wm.shell.onehanded.OneHandedController;
import com.android.wm.shell.pip.Pip;
@@ -77,8 +79,6 @@ import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipSurfaceTransactionHelper;
import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.pip.phone.PipTouchHandler;
import com.android.wm.shell.keyguard.KeyguardTransitionHandler;
import com.android.wm.shell.keyguard.KeyguardTransitions;
import com.android.wm.shell.recents.RecentTasks;
import com.android.wm.shell.recents.RecentTasksController;
import com.android.wm.shell.recents.RecentsTransitionHandler;
@@ -102,13 +102,13 @@ import com.android.wm.shell.unfold.UnfoldAnimationController;
import com.android.wm.shell.unfold.UnfoldTransitionHandler;
import com.android.wm.shell.windowdecor.WindowDecorViewModel;

import java.util.Optional;

import dagger.BindsOptionalOf;
import dagger.Lazy;
import dagger.Module;
import dagger.Provides;

import java.util.Optional;

/**
 * Provides basic dependencies from {@link com.android.wm.shell}, these dependencies are only
 * accessible from components within the WM subcomponent (can be explicitly exposed to the
@@ -548,13 +548,15 @@ public abstract class WMShellBaseModule {
            @ShellMainThread ShellExecutor mainExecutor,
            @ShellMainThread Handler mainHandler,
            @ShellAnimationThread ShellExecutor animExecutor,
            ShellCommandHandler shellCommandHandler) {
            ShellCommandHandler shellCommandHandler,
            RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer) {
        if (!context.getResources().getBoolean(R.bool.config_registerShellTransitionsOnInit)) {
            // TODO(b/238217847): Force override shell init if registration is disabled
            shellInit = new ShellInit(mainExecutor);
        }
        return new Transitions(context, shellInit, shellController, organizer, pool,
                displayController, mainExecutor, mainHandler, animExecutor, shellCommandHandler);
                displayController, mainExecutor, mainHandler, animExecutor, shellCommandHandler,
                rootTaskDisplayAreaOrganizer);
    }

    @WMSingleton
+32 −0
Original line number Diff line number Diff line
@@ -438,6 +438,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
     */
    public Rect startSwipePipToHome(ComponentName componentName, ActivityInfo activityInfo,
            PictureInPictureParams pictureInPictureParams) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "startSwipePipToHome: %s, state=%s", componentName, mPipTransitionState);
        mPipTransitionState.setInSwipePipToHomeTransition(true);
        sendOnPipTransitionStarted(TRANSITION_DIRECTION_TO_PIP);
        setBoundsStateForEntry(componentName, pictureInPictureParams, activityInfo);
@@ -450,6 +452,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
     */
    public void stopSwipePipToHome(int taskId, ComponentName componentName, Rect destinationBounds,
            SurfaceControl overlay) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "stopSwipePipToHome: %s, state=%s", componentName, mPipTransitionState);
        // do nothing if there is no startSwipePipToHome being called before
        if (!mPipTransitionState.getInSwipePipToHomeTransition()) {
            return;
@@ -522,6 +526,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
            return;
        }

        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "exitPip: %s, state=%s", mTaskInfo.topActivity, mPipTransitionState);
        final WindowContainerTransaction wct = new WindowContainerTransaction();
        if (isLaunchIntoPipTask()) {
            exitLaunchIntoPipTask(wct);
@@ -559,6 +565,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
            // destinationBounds calculated above will be incorrect if this is with rotation.
            wct.setBounds(mToken, null);
        } else {
            ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                    "exitPip: %s, dest=%s", mTaskInfo.topActivity, destinationBounds);
            final SurfaceControl.Transaction tx =
                    mSurfaceControlTransactionFactory.getTransaction();
            mSurfaceTransactionHelper.scale(tx, mLeash, destinationBounds,
@@ -656,9 +664,13 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
        animator.setInterpolator(Interpolators.ALPHA_OUT);
        animator.start();
        mPipTransitionState.setTransitionState(PipTransitionState.EXITING_PIP);
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "removePip: %s, state=%s", mTaskInfo.topActivity, mPipTransitionState);
    }

    private void removePipImmediately() {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "removePipImmediately: %s, state=%s", mTaskInfo.topActivity, mPipTransitionState);
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
            final WindowContainerTransaction wct = new WindowContainerTransaction();
            wct.setBounds(mToken, null);
@@ -723,6 +735,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
        }
        mPipUiEventLoggerLogger.log(uiEventEnum);

        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "onTaskAppeared: %s, state=%s", mTaskInfo.topActivity, mPipTransitionState);
        if (mPipTransitionState.getInSwipePipToHomeTransition()) {
            if (!mWaitForFixedRotation) {
                onEndOfSwipePipToHomeTransition();
@@ -774,6 +788,9 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
    }

    private void onTaskAppearedWithFixedRotation(int animationType) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "onTaskAppearedWithFixedRotation: %s, state=%s animationType=%d",
                mTaskInfo.topActivity, mPipTransitionState, animationType);
        if (animationType == ANIM_TYPE_ALPHA) {
            ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                    "%s: Defer entering PiP alpha animation, fixed rotation is ongoing", TAG);
@@ -920,6 +937,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
     */
    @Override
    public void onTaskVanished(ActivityManager.RunningTaskInfo info) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "onTaskVanished: %s, state=%s", mTaskInfo.topActivity, mPipTransitionState);
        if (mPipTransitionState.getTransitionState() == PipTransitionState.UNDEFINED) {
            return;
        }
@@ -961,6 +980,9 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
        mPipBoundsState.setOverrideMinSize(
                mPipBoundsAlgorithm.getMinimalSize(info.topActivityInfo));
        final PictureInPictureParams newParams = info.pictureInPictureParams;
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "onTaskInfoChanged: %s, state=%s oldParams=%s newParams=%s",
                mTaskInfo.topActivity, mPipTransitionState, mPictureInPictureParams, newParams);

        // mPictureInPictureParams is only null if there is no PiP
        if (newParams == null || mPictureInPictureParams == null) {
@@ -1001,6 +1023,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,

    @Override
    public void onFixedRotationStarted(int displayId, int newRotation) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "onFixedRotationStarted: %s, state=%s", mTaskInfo, mPipTransitionState);
        mNextRotation = newRotation;
        mWaitForFixedRotation = true;

@@ -1022,6 +1046,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,

    @Override
    public void onFixedRotationFinished(int displayId) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "onFixedRotationFinished: %s, state=%s", mTaskInfo, mPipTransitionState);
        if (!mWaitForFixedRotation) {
            return;
        }
@@ -1057,6 +1083,9 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,

    /** Called when exiting PIP transition is finished to do the state cleanup. */
    void onExitPipFinished(TaskInfo info) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "onExitPipFinished: %s, state=%s leash=%s",
                info.topActivity, mPipTransitionState, mLeash);
        if (mLeash == null) {
            // TODO(239461594): Remove once the double call to onExitPipFinished() is fixed
            ProtoLog.w(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
@@ -1108,6 +1137,9 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,

    /** Explicitly set the visibility of PiP window. */
    public void setPipVisibility(boolean visible) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                "setPipVisibility: %s, state=%s visible=%s",
                mTaskInfo.topActivity, mPipTransitionState, visible);
        if (!isInPip()) {
            return;
        }
Loading