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

Commit 15199cd3 authored by Xin Li's avatar Xin Li
Browse files

Merge 24Q3 (ab/AP3A.240905.001) to aosp-main-future

Bug: 347831320
Merged-In: I0898d202b9dd4742c0c7d2c0d6b340c748e8acf7
Change-Id: I9b2cede0bdd9bb9a06ee825be7de3df030f51065
parents 3bf8291b bf4a7385
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.view.View
import android.view.ViewGroup
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
import android.view.animation.Interpolator
import android.window.OnBackInvokedDispatcher
import androidx.core.view.updateLayoutParams
import com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE
import com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE
@@ -66,11 +67,14 @@ constructor(
    /** Container where the tooltip's body should be inflated. */
    lateinit var content: ViewGroup
        private set

    private lateinit var arrow: View

    /** Callback invoked when the tooltip is being closed. */
    var onCloseCallback: () -> Unit = {}
    private var openCloseAnimator: AnimatorSet? = null
    /** Used to set whether users can tap outside the current tooltip window to dismiss it */
    var allowTouchDismissal = true

    /** Animates the tooltip into view. */
    fun show() {
@@ -134,14 +138,25 @@ constructor(
    override fun isOfType(type: Int): Boolean = type and TYPE_TASKBAR_EDUCATION_DIALOG != 0

    override fun onControllerInterceptTouchEvent(ev: MotionEvent?): Boolean {
        if (ev?.action == ACTION_DOWN && !activityContext.dragLayer.isEventOverView(this, ev)) {
        if (
            ev?.action == ACTION_DOWN &&
                !activityContext.dragLayer.isEventOverView(this, ev) &&
                allowTouchDismissal
        ) {
            close(true)
        }
        return false
    }

    override fun onAttachedToWindow() {
        super.onAttachedToWindow()
        findOnBackInvokedDispatcher()
            ?.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT, this)
    }

    override fun onDetachedFromWindow() {
        super.onDetachedFromWindow()
        findOnBackInvokedDispatcher()?.unregisterOnBackInvokedCallback(this)
        Settings.Secure.putInt(mContext.contentResolver, LAUNCHER_TASKBAR_EDUCATION_SHOWING, 0)
    }

+9 −1
Original line number Diff line number Diff line
@@ -86,10 +86,13 @@ open class TaskbarEduTooltipController(context: Context) :
                !activityContext.isPhoneMode &&
                !activityContext.isTinyTaskbar
        }

    private val isOpen: Boolean
        get() = tooltip?.isOpen ?: false

    val isBeforeTooltipFeaturesStep: Boolean
        get() = isTooltipEnabled && tooltipStep <= TOOLTIP_STEP_FEATURES

    private lateinit var controllers: TaskbarControllers

    // Keep track of whether the user has seen the Search Edu
@@ -152,6 +155,7 @@ open class TaskbarEduTooltipController(context: Context) :
        tooltipStep = TOOLTIP_STEP_NONE
        inflateTooltip(R.layout.taskbar_edu_features)
        tooltip?.run {
            allowTouchDismissal = false
            val splitscreenAnim = requireViewById<LottieAnimationView>(R.id.splitscreen_animation)
            val suggestionsAnim = requireViewById<LottieAnimationView>(R.id.suggestions_animation)
            val pinningAnim = requireViewById<LottieAnimationView>(R.id.pinning_animation)
@@ -216,6 +220,7 @@ open class TaskbarEduTooltipController(context: Context) :
        inflateTooltip(R.layout.taskbar_edu_pinning)

        tooltip?.run {
            allowTouchDismissal = true
            requireViewById<LottieAnimationView>(R.id.standalone_pinning_animation)
                .supportLightTheme()

@@ -260,6 +265,7 @@ open class TaskbarEduTooltipController(context: Context) :
        userHasSeenSearchEdu = true
        inflateTooltip(R.layout.taskbar_edu_search)
        tooltip?.run {
            allowTouchDismissal = true
            requireViewById<LottieAnimationView>(R.id.search_edu_animation).supportLightTheme()
            val eduSubtitle: TextView = requireViewById(R.id.search_edu_text)
            showDisclosureText(eduSubtitle)
@@ -332,7 +338,9 @@ open class TaskbarEduTooltipController(context: Context) :
    }

    /** Closes the current [tooltip]. */
    fun hide() = tooltip?.close(true)
    fun hide() {
        tooltip?.close(true)
    }

    /** Initializes [tooltip] with content from [contentResId]. */
    private fun inflateTooltip(@LayoutRes contentResId: Int) {
+11 −3
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import androidx.annotation.Nullable;
import androidx.annotation.UiThread;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Flags;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.LauncherInitListener;
@@ -213,10 +212,10 @@ public final class LauncherActivityInterface extends
        if (launcher.isStarted() && (isInLiveTileMode() || launcher.hasBeenResumed())) {
            return launcher;
        }
        if (Flags.useActivityOverlay()
                && SystemUiProxy.INSTANCE.get(launcher).getHomeVisibilityState().isHomeVisible()) {
        if (isInMinusOne()) {
            return launcher;
        }

        return null;
    }

@@ -293,6 +292,15 @@ public final class LauncherActivityInterface extends
                && TopTaskTracker.INSTANCE.get(launcher).getCachedTopTask(false).isHomeTask();
    }

    private boolean isInMinusOne() {
        QuickstepLauncher launcher = getCreatedContainer();

        return launcher != null
                && launcher.getStateManager().getState() == NORMAL
                && !launcher.isStarted()
                && TopTaskTracker.INSTANCE.get(launcher).getCachedTopTask(false).isHomeTask();
    }

    @Override
    public void onLaunchTaskFailed() {
        QuickstepLauncher launcher = getCreatedContainer();
+7 −6
Original line number Diff line number Diff line
@@ -132,6 +132,13 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> implem
     * Init drag layer and overview panel views.
     */
    protected void setupViews() {
        SystemUiProxy systemUiProxy = SystemUiProxy.INSTANCE.get(this);
        // SplitSelectStateController needs to be created before setContentView()
        mSplitSelectStateController =
                new SplitSelectStateController(this, mHandler, getStateManager(),
                        null /* depthController */, getStatsLogManager(),
                        systemUiProxy, RecentsModel.INSTANCE.get(this),
                        null /*activityBackCallback*/);
        inflateRootView(R.layout.fallback_recents_activity);
        setContentView(getRootView());
        mDragLayer = findViewById(R.id.drag_layer);
@@ -139,12 +146,6 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> implem
        mFallbackRecentsView = findViewById(R.id.overview_panel);
        mActionsView = findViewById(R.id.overview_actions_view);
        getRootView().getSysUiScrim().getSysUIProgress().updateValue(0);
        SystemUiProxy systemUiProxy = SystemUiProxy.INSTANCE.get(this);
        mSplitSelectStateController =
                new SplitSelectStateController(this, mHandler, getStateManager(),
                        null /* depthController */, getStatsLogManager(),
                        systemUiProxy, RecentsModel.INSTANCE.get(this),
                        null /*activityBackCallback*/);
        mDragLayer.recreateControllers();
        if (enableDesktopWindowingMode()) {
            mDesktopRecentsTransitionController = new DesktopRecentsTransitionController(
+12 −6
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.quickstep;

import static com.android.app.animation.Interpolators.ACCELERATE_1_5;
import static com.android.app.animation.Interpolators.LINEAR;
import static com.android.launcher3.Flags.enableAdditionalHomeAnimations;
import static com.android.launcher3.PagedView.INVALID_PAGE;

import android.animation.Animator;
@@ -449,7 +450,7 @@ public abstract class SwipeUpAnimationLogic implements
            float alpha = mAnimationFactory.getWindowAlpha(progress);

            mHomeAnim.setPlayFraction(progress);
            if (mTargetTaskView == null) {
            if (!enableAdditionalHomeAnimations() || mTargetTaskView == null) {
                mHomeToWindowPositionMap.mapRect(mWindowCurrentRect, currentRect);
                mMatrix.setRectToRect(mCropRectF, mWindowCurrentRect, ScaleToFit.FILL);
                mLocalTransformParams
@@ -464,10 +465,15 @@ public abstract class SwipeUpAnimationLogic implements

            mLocalTransformParams.applySurfaceParams(
                    mLocalTransformParams.createSurfaceParams(this));

            mAnimationFactory.update(
                    currentRect, progress, mMatrix.mapRadius(cornerRadius), (int) (alpha * 255));
                    currentRect,
                    progress,
                    mMatrix.mapRadius(cornerRadius),
                    !enableAdditionalHomeAnimations() || mTargetTaskView == null
                            ? 0 : (int) (alpha * 255));

            if (mTargetTaskView == null) {
            if (!enableAdditionalHomeAnimations() || mTargetTaskView == null) {
                return;
            }
            if (mAnimationFactory.isAnimatingIntoIcon() && mAnimationFactory.isAnimationReady()) {
@@ -506,7 +512,7 @@ public abstract class SwipeUpAnimationLogic implements
        public void onAnimationStart(Animator animation) {
            setUp();
            mHomeAnim.dispatchOnStart();
            if (mTargetTaskView == null) {
            if (!enableAdditionalHomeAnimations() || mTargetTaskView == null) {
                return;
            }
            Rect thumbnailBounds = new Rect();
@@ -521,7 +527,7 @@ public abstract class SwipeUpAnimationLogic implements
        }

        private void setUp() {
            if (mTargetTaskView == null) {
            if (!enableAdditionalHomeAnimations() || mTargetTaskView == null) {
                return;
            }
            RecentsView recentsView = mTargetTaskView.getRecentsView();
@@ -542,7 +548,7 @@ public abstract class SwipeUpAnimationLogic implements
        }

        private void cleanUp() {
            if (mTargetTaskView == null) {
            if (!enableAdditionalHomeAnimations() || mTargetTaskView == null) {
                return;
            }
            RecentsView recentsView = mTargetTaskView.getRecentsView();
Loading