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

Commit 3adf6ff5 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Merging ub-launcher3-qt-qpr1-dev, build 5884665

Test: Manual

Bug:135864059 P4 [Live Tiles] Empty launcher
Bug:139137636 P2 Create memory tests for Launcher
Bug:139281702 P2 [Enterprise - Cloud DO] GSOC and Mobile Utilities launcher icons are in broken state
Bug:140837771 P1 Failing test: AddConfigWidgetTests and AddWidgetTests are failing
Bug:141024521 P2 Tapping nav bar during quick switch causes scroll animation to cancel and not resume
Bug:141184247 P1 Clear all button not present in fallback recents in 3-button mode
Change-Id: I99f4db995a2af5959d5be4182f4e47bb67c9cbc4
parents 757d62dc a0aee21f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
        anim.addListener(new AnimationSuccessListener() {
            @Override
            public void onAnimationSuccess(Animator animator) {
                mHelper.onSwipeUpToRecentsComplete(mActivity);
                if (mRecentsView != null) {
                    mRecentsView.animateUpRunningTaskIconScale();
                }
+4 −0
Original line number Diff line number Diff line
@@ -941,6 +941,10 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
        }
    }

    public boolean isTaskIconScaledDown(TaskView taskView) {
        return mRunningTaskIconScaledDown && getRunningTaskView() == taskView;
    }

    private void applyRunningTaskIconScale() {
        TaskView firstTask = getRunningTaskView();
        if (firstTask != null) {
+5 −4
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.res.Resources;
@@ -54,7 +53,6 @@ import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.logging.UserEventDispatcher;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
@@ -818,8 +816,11 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
                    / (getWidth() + currentInsetsLeft + currentInsetsRight));
        }

        // Some of the items in here are dependent on the current fullscreen params
        if (!getRecentsView().isTaskIconScaledDown(this)) {
            // Some of the items in here are dependent on the current fullscreen params, but don't
            // update them if the icon is supposed to be scaled down.
            setIconScaleAndDim(progress, true /* invert */);
        }

        thumbnail.setFullscreenParams(mCurrentFullscreenParams);
        mOutlineProvider.setFullscreenParams(mCurrentFullscreenParams);
+22 −17
Original line number Diff line number Diff line
@@ -890,23 +890,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
                mTotalMotionX = 0;
                mActivePointerId = ev.getPointerId(0);

                /*
                 * If being flinged and user touches the screen, initiate drag;
                 * otherwise don't.  mScroller.isFinished should be false when
                 * being flinged.
                 */
                final int xDist = Math.abs(mScroller.getFinalPos() - mScroller.getCurrPos());
                final boolean finishedScrolling = (mScroller.isFinished() || xDist < mTouchSlop / 3);

                if (finishedScrolling) {
                    mIsBeingDragged = false;
                    if (!mScroller.isFinished() && !mFreeScroll) {
                        setCurrentPage(getNextPage());
                        pageEndTransition();
                    }
                } else {
                    mIsBeingDragged = true;
                }
                updateIsBeingDraggedOnTouchDown();

                break;
            }
@@ -929,6 +913,25 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
        return mIsBeingDragged;
    }

    /**
     * If being flinged and user touches the screen, initiate drag; otherwise don't.
     */
    private void updateIsBeingDraggedOnTouchDown() {
        // mScroller.isFinished should be false when being flinged.
        final int xDist = Math.abs(mScroller.getFinalPos() - mScroller.getCurrPos());
        final boolean finishedScrolling = (mScroller.isFinished() || xDist < mTouchSlop / 3);

        if (finishedScrolling) {
            mIsBeingDragged = false;
            if (!mScroller.isFinished() && !mFreeScroll) {
                setCurrentPage(getNextPage());
                pageEndTransition();
            }
        } else {
            mIsBeingDragged = true;
        }
    }

    public boolean isHandlingTouch() {
        return mIsBeingDragged;
    }
@@ -1104,6 +1107,8 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou

        switch (action & MotionEvent.ACTION_MASK) {
        case MotionEvent.ACTION_DOWN:
            updateIsBeingDraggedOnTouchDown();

            /*
             * If being flinged and user touches, stop the fling. isFinished
             * will be false if being flinged.
+8 −6
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.launcher3.compat;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageInstaller.SessionInfo;
import android.os.Process;
import android.os.UserHandle;

@@ -29,6 +30,7 @@ import java.util.List;
import androidx.annotation.NonNull;

import com.android.launcher3.Utilities;
import com.android.launcher3.util.PackageUserKey;

public abstract class PackageInstallerCompat {

@@ -52,19 +54,19 @@ public abstract class PackageInstallerCompat {
        }
    }

    public static UserHandle getUserHandle(PackageInstaller.SessionInfo info) {
    public static UserHandle getUserHandle(SessionInfo info) {
        return Utilities.ATLEAST_Q ? info.getUser() : Process.myUserHandle();
    }

    /**
     * @return a map of active installs to their progress
     */
    public abstract HashMap<String, PackageInstaller.SessionInfo> updateAndGetActiveSessionCache();
    public abstract HashMap<PackageUserKey, SessionInfo> updateAndGetActiveSessionCache();

    /**
     * @return an active SessionInfo for {@param pkg} or null if none exists.
     */
    public abstract PackageInstaller.SessionInfo getActiveSessionInfo(UserHandle user, String pkg);
    public abstract SessionInfo getActiveSessionInfo(UserHandle user, String pkg);

    public abstract void onStop();

@@ -75,7 +77,7 @@ public abstract class PackageInstallerCompat {
        public final int progress;
        public final UserHandle user;

        private PackageInstallInfo(@NonNull PackageInstaller.SessionInfo info) {
        private PackageInstallInfo(@NonNull SessionInfo info) {
            this.state = STATUS_INSTALLING;
            this.packageName = info.getAppPackageName();
            this.componentName = new ComponentName(packageName, "");
@@ -91,7 +93,7 @@ public abstract class PackageInstallerCompat {
            this.user = user;
        }

        public static PackageInstallInfo fromInstallingState(PackageInstaller.SessionInfo info) {
        public static PackageInstallInfo fromInstallingState(SessionInfo info) {
            return new PackageInstallInfo(info);
        }

@@ -101,7 +103,7 @@ public abstract class PackageInstallerCompat {

    }

    public abstract List<PackageInstaller.SessionInfo> getAllVerifiedSessions();
    public abstract List<SessionInfo> getAllVerifiedSessions();

    /**
     * Returns true if a promise icon was already added to the home screen for {@param sessionId}.
Loading