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

Commit 02ad1b86 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11896415 from 7a008809 to 24Q3-release

Change-Id: I2d393107a513a02010f06ebe4627cf757d75b735
parents d49fc73d 7a008809
Loading
Loading
Loading
Loading
+2 −38
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_SEARCH_I
import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.quickstep.RecentsAnimationDeviceState.QUICKSTEP_TOUCH_SLOP_RATIO_TWO_BUTTON;

import android.content.Context;
import android.content.res.Resources;
@@ -33,7 +32,6 @@ import android.graphics.Canvas;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
import android.view.DisplayCutout;
import android.view.InputDevice;
import android.view.LayoutInflater;
@@ -68,7 +66,6 @@ import com.android.launcher3.util.Themes;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.IconButtonView;
import com.android.quickstep.DeviceConfigWrapper;
import com.android.quickstep.RecentsAnimationDeviceState;
import com.android.quickstep.util.AssistStateManager;

import java.util.function.Predicate;
@@ -78,8 +75,6 @@ import java.util.function.Predicate;
 */
public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconParent, Insettable,
        DeviceProfile.OnDeviceProfileChangeListener {
    private static final String TAG = "TaskbarView";

    private static final Rect sTmpRect = new Rect();

    private final int[] mTempOutLocation = new int[2];
@@ -89,10 +84,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
    private final int mItemPadding;
    private final int mFolderLeaveBehindColor;
    private final boolean mIsRtl;
    private final boolean mIsTransientTaskbar;

    private final TaskbarActivityContext mActivityContext;
    private final RecentsAnimationDeviceState mDeviceState;

    // Initialized in init.
    private TaskbarViewCallbacks mControllerCallbacks;
@@ -107,8 +100,6 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
    private Runnable mAllAppsTouchRunnable;
    private long mAllAppsButtonTouchDelayMs;
    private boolean mAllAppsTouchTriggered;
    private MotionEvent mCurrentDownEvent;
    private float mTouchSlopSquared;

    // Only non-null when device supports having an All Apps button.
    private @Nullable IconButtonView mTaskbarDivider;
@@ -138,7 +129,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        mActivityContext = ActivityContext.lookupContext(context);
        mIconLayoutBounds = mActivityContext.getTransientTaskbarBounds();
        Resources resources = getResources();
        mIsTransientTaskbar = DisplayController.isTransientTaskbar(mActivityContext)
        boolean isTransientTaskbar = DisplayController.isTransientTaskbar(mActivityContext)
                && !mActivityContext.isPhoneMode();
        mIsRtl = Utilities.isRtl(resources);
        mTransientTaskbarMinWidth = resources.getDimension(R.dimen.transient_taskbar_min_width);
@@ -172,7 +163,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        mAllAppsButton = (IconButtonView) LayoutInflater.from(context)
                .inflate(R.layout.taskbar_all_apps_button, this, false);
        mAllAppsButton.setIconDrawable(resources.getDrawable(
                getAllAppsButton(mIsTransientTaskbar)));
                getAllAppsButton(isTransientTaskbar)));
        mAllAppsButton.setPadding(mItemPadding, mItemPadding, mItemPadding, mItemPadding);
        mAllAppsButton.setForegroundTint(
                mActivityContext.getColor(R.color.all_apps_button_color));
@@ -191,10 +182,6 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar

        // Default long press (touch) delay = 400ms
        mAllAppsButtonTouchDelayMs = ViewConfiguration.getLongPressTimeout();
        // Default touch slop
        mDeviceState = new RecentsAnimationDeviceState(mContext);
        mTouchSlopSquared = mDeviceState.getSquaredTouchSlop(
                QUICKSTEP_TOUCH_SLOP_RATIO_TWO_BUTTON, 1);
    }

    @DrawableRes
@@ -299,12 +286,6 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
                    && assistStateManager.getLPNHDurationMillis().isPresent()) {
                mAllAppsButtonTouchDelayMs = assistStateManager.getLPNHDurationMillis().get();
            }
            if (DeviceConfigWrapper.get().getCustomLpaaThresholds()
                    && assistStateManager.getLPNHCustomSlopMultiplier().isPresent()) {
                mTouchSlopSquared = mDeviceState.getSquaredTouchSlop(
                        QUICKSTEP_TOUCH_SLOP_RATIO_TWO_BUTTON,
                        assistStateManager.getLPNHCustomSlopMultiplier().get());
            }
        }
        if (mTaskbarDivider != null && !mActivityContext.isThreeButtonNav()) {
            mTaskbarDivider.setOnLongClickListener(
@@ -727,27 +708,10 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
    private boolean onAllAppsButtonTouch(View view, MotionEvent ev) {
        switch (ev.getAction()) {
            case MotionEvent.ACTION_DOWN:
                if (mCurrentDownEvent != null) {
                    mCurrentDownEvent.recycle();
                }
                mCurrentDownEvent = MotionEvent.obtain(ev);
                mAllAppsTouchTriggered = false;
                MAIN_EXECUTOR.getHandler().postDelayed(
                        mAllAppsTouchRunnable, mAllAppsButtonTouchDelayMs);
                break;
            case MotionEvent.ACTION_MOVE:
                if (!MAIN_EXECUTOR.getHandler().hasCallbacks(mAllAppsTouchRunnable)
                        || mIsTransientTaskbar) {
                    break;
                }
                float dx = ev.getX() - mCurrentDownEvent.getX();
                float dy = ev.getY() - mCurrentDownEvent.getY();
                double distanceSquared = (dx * dx) + (dy * dy);
                if (distanceSquared > mTouchSlopSquared) {
                    Log.d(TAG, "Touch slop out");
                    cancelAllAppsButtonTouch();
                }
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL:
                cancelAllAppsButtonTouch();
+1 −3
Original line number Diff line number Diff line
@@ -542,18 +542,16 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer
        if (mDesktopVisibilityController != null) {
            mDesktopVisibilityController.unregisterSystemUiListener();
        }
        mDesktopVisibilityController = null;

        if (mSplitSelectStateController != null) {
            removeBackAnimationCallback(mSplitSelectStateController.getSplitBackHandler());
            mSplitSelectStateController.onDestroy();
        }
        mSplitSelectStateController = null;

        super.onDestroy();
        mHotseatPredictionController.destroy();
        mSplitWithKeyboardShortcutController.onDestroy();
        if (mViewCapture != null) mViewCapture.close();
        removeBackAnimationCallback(mSplitSelectStateController.getSplitBackHandler());
    }

    @Override
+1 −11
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener, E
    static final String SUPPORT_ONE_HANDED_MODE = "ro.support_one_handed_mode";

    // TODO: Move to quickstep contract
    public static final float QUICKSTEP_TOUCH_SLOP_RATIO_TWO_BUTTON = 3f;
    private static final float QUICKSTEP_TOUCH_SLOP_RATIO_TWO_BUTTON = 3f;
    private static final float QUICKSTEP_TOUCH_SLOP_RATIO_GESTURAL = 1.414f;

    private final Context mContext;
@@ -610,16 +610,6 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener, E
        return touchSlop * touchSlop;
    }

    /**
     * Returns the squared touch slop using the given base slop multiplier {@code slopMultiplier}
     * and custom slop multiplier {@code customSlopMultiplier}.
     */
    public float getSquaredTouchSlop(float slopMultiplier, float customSlopMultiplier) {
        float systemTouchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop();
        float touchSlop = customSlopMultiplier * slopMultiplier * systemTouchSlop;
        return touchSlop * touchSlop;
    }

    public String getSystemUiStateString() {
        return  QuickStepContract.getSystemUiStateString(mSystemUiStateFlags);
    }
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@
    <string name="uninstall_drop_target_label" msgid="4722034217958379417">"Deïnstalleer"</string>
    <string name="app_info_drop_target_label" msgid="692894985365717661">"Appinligting"</string>
    <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"Installeer privaat"</string>
    <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"Deïnstalleer app"</string>
    <string name="install_drop_target_label" msgid="2539096853673231757">"Installeer"</string>
    <string name="dismiss_prediction_label" msgid="3357562989568808658">"Moenie voorstel nie"</string>
    <string name="pin_prediction" msgid="4196423321649756498">"Vasspeldvoorspelling"</string>
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@
    <string name="uninstall_drop_target_label" msgid="4722034217958379417">"አራግፍ"</string>
    <string name="app_info_drop_target_label" msgid="692894985365717661">"የመተግበሪያ መረጃ"</string>
    <string name="install_private_system_shortcut_label" msgid="1616889277073184841">"በግል ይጫኑ"</string>
    <string name="uninstall_private_system_shortcut_label" msgid="8423460530441627982">"መተግበሪያን አራግፍ"</string>
    <string name="install_drop_target_label" msgid="2539096853673231757">"ጫን"</string>
    <string name="dismiss_prediction_label" msgid="3357562989568808658">"መተግበሪያውን አይጠቁሙ"</string>
    <string name="pin_prediction" msgid="4196423321649756498">"የፒን ግምት"</string>
Loading