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

Commit b3a95149 authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Removing some obsolete features" into tm-qpr-dev

parents de86e405 171bb044
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.FloatingHeaderRow;
import com.android.launcher3.allapps.FloatingHeaderView;
import com.android.launcher3.anim.AlphaUpdateListener;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.keyboard.FocusIndicatorHelper;
import com.android.launcher3.keyboard.FocusIndicatorHelper.SimpleFocusIndicatorHelper;
import com.android.launcher3.model.data.ItemInfo;
@@ -65,7 +64,6 @@ public class PredictionRowView<T extends Context & ActivityContext>
    private FloatingHeaderView mParent;

    private boolean mPredictionsEnabled = false;
    private @Nullable List<ItemInfo> mPendingPredictedItems;
    private OnLongClickListener mOnIconLongClickListener = ItemLongClickListener.INSTANCE_ALL_APPS;

    public PredictionRowView(@NonNull Context context) {
@@ -159,18 +157,10 @@ public class PredictionRowView<T extends Context & ActivityContext>
     * we can optimize by swapping them in place.
     */
    public void setPredictedApps(List<ItemInfo> items) {
        if (!FeatureFlags.ENABLE_APP_PREDICTIONS_WHILE_VISIBLE.get()
                && !mActivityContext.isBindingItems()
                && isShown()
                && getWindowVisibility() == View.VISIBLE) {
            mPendingPredictedItems = items;
            return;
        }
        applyPredictedApps(items);
    }

    private void applyPredictedApps(List<ItemInfo> items) {
        mPendingPredictedItems = null;
        mPredictedApps.clear();
        mPredictedApps.addAll(items.stream()
                .filter(itemInfo -> itemInfo instanceof WorkspaceItemInfo)
@@ -265,13 +255,4 @@ public class PredictionRowView<T extends Context & ActivityContext>
        return getChildAt(0);
    }


    @Override
    public void onVisibilityAggregated(boolean isVisible) {
        super.onVisibilityAggregated(isVisible);

        if (mPendingPredictedItems != null && !isVisible) {
            applyPredictedApps(mPendingPredictedItems);
        }
    }
}
+0 −27
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import com.android.launcher3.Hotseat;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.R;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.graphics.DragPreviewProvider;
@@ -279,32 +278,6 @@ public class HotseatPredictionController implements DragController.DragListener,
     * Sets or updates the predicted items
     */
    public void setPredictedItems(FixedContainerItems items) {
        boolean shouldIgnoreVisibility = FeatureFlags.ENABLE_APP_PREDICTIONS_WHILE_VISIBLE.get()
                || mLauncher.isWorkspaceLoading()
                || mPredictedItems.equals(items.items)
                || mHotseat.getShortcutsAndWidgets().getChildCount() < mHotSeatItemsCount;
        if (!shouldIgnoreVisibility
                && mHotseat.isShown()
                && mHotseat.getWindowVisibility() == View.VISIBLE) {
            mHotseat.setOnVisibilityAggregatedCallback((isVisible) -> {
                if (isVisible) {
                    return;
                }
                mHotseat.setOnVisibilityAggregatedCallback(null);

                applyPredictedItems(items);
            });
        } else {
            mHotseat.setOnVisibilityAggregatedCallback(null);

            applyPredictedItems(items);
        }
    }

    /**
     * Sets or updates the predicted items only once the hotseat becomes hidden to the user
     */
    private void applyPredictedItems(FixedContainerItems items) {
        mPredictedItems = new ArrayList(items.items);
        if (mPredictedItems.isEmpty()) {
            HotseatRestoreHelper.restoreBackup(mLauncher);
+1 −5
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.quickstep;

import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;

import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_SELECTIONS;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_FREE_FORM_TAP;

import android.app.Activity;
@@ -393,10 +392,7 @@ public interface TaskShortcutFactory {
                    taskContainer.getThumbnailView().getTaskOverlay()
                            .getModalStateSystemShortcut(
                                    taskContainer.getItemInfo(), taskContainer.getTaskView());
            if (ENABLE_OVERVIEW_SELECTIONS.get()) {
            return createSingletonShortcutList(modalStateSystemShortcut);
        }
            return null;
        }
    };
}
+0 −20
Original line number Diff line number Diff line
@@ -27,10 +27,6 @@ import android.view.ViewDebug;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import androidx.annotation.Nullable;

import java.util.function.Consumer;

/**
 * View class that represents the bottom row of the home screen.
 */
@@ -43,8 +39,6 @@ public class Hotseat extends CellLayout implements Insettable {
    private boolean mHasVerticalHotseat;
    private Workspace<?> mWorkspace;
    private boolean mSendTouchToWorkspace;
    @Nullable
    private Consumer<Boolean> mOnVisibilityAggregatedCallback;

    private final View mQsb;

@@ -150,20 +144,6 @@ public class Hotseat extends CellLayout implements Insettable {
        return false;
    }

    @Override
    public void onVisibilityAggregated(boolean isVisible) {
        super.onVisibilityAggregated(isVisible);

        if (mOnVisibilityAggregatedCallback != null) {
            mOnVisibilityAggregatedCallback.accept(isVisible);
        }
    }

    /** Sets a callback to be called onVisibilityAggregated */
    public void setOnVisibilityAggregatedCallback(@Nullable Consumer<Boolean> callback) {
        mOnVisibilityAggregatedCallback = callback;
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+0 −53
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.launcher3;
import static android.app.PendingIntent.FLAG_IMMUTABLE;
import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
import static android.content.pm.ActivityInfo.CONFIG_UI_MODE;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO;
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;

import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
@@ -86,7 +85,6 @@ import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.RectF;
@@ -117,7 +115,6 @@ import android.view.ViewTreeObserver.OnPreDrawListener;
import android.view.WindowManager.LayoutParams;
import android.view.accessibility.AccessibilityEvent;
import android.view.animation.OvershootInterpolator;
import android.widget.ImageView;
import android.widget.Toast;

import androidx.annotation.CallSuper;
@@ -151,7 +148,6 @@ import com.android.launcher3.dragndrop.LauncherDragController;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.folder.FolderGridOrganizer;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.icons.BitmapRenderer;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.keyboard.ViewGroupFocusHelper;
import com.android.launcher3.logger.LauncherAtom;
@@ -306,8 +302,6 @@ public class Launcher extends StatefulActivity<LauncherState>
    private static final int NEW_APPS_ANIMATION_INACTIVE_TIMEOUT_SECONDS = 5;
    @Thunk @VisibleForTesting public static final int NEW_APPS_ANIMATION_DELAY = 500;

    private static final int THEME_CROSS_FADE_ANIMATION_DURATION = 375;

    private static final String DISPLAY_WORKSPACE_TRACE_METHOD_NAME = "DisplayWorkspaceFirstFrame";
    private static final String DISPLAY_ALL_APPS_TRACE_METHOD_NAME = "DisplayAllApps";
    public static final int DISPLAY_WORKSPACE_TRACE_COOKIE = 0;
@@ -504,7 +498,6 @@ public class Launcher extends StatefulActivity<LauncherState>
        mAppWidgetHolder.startListening();

        setupViews();
        crossFadeWithPreviousAppearance();
        mPopupDataProvider = new PopupDataProvider(this::updateNotificationDots);

        boolean internalStateHandled = ACTIVITY_TRACKER.handleCreate(this);
@@ -1579,16 +1572,6 @@ public class Launcher extends StatefulActivity<LauncherState>
    public Object onRetainNonConfigurationInstance() {
        NonConfigInstance instance = new NonConfigInstance();
        instance.config = new Configuration(mOldConfig);

        int width = mDragLayer.getWidth();
        int height = mDragLayer.getHeight();

        if (FeatureFlags.ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE.get()
                && width > 0
                && height > 0) {
            instance.snapshot =
                    BitmapRenderer.createHardwareBitmap(width, height, mDragLayer::draw);
        }
        return instance;
    }

@@ -3285,41 +3268,6 @@ public class Launcher extends StatefulActivity<LauncherState>
        return (T) activityContext;
    }

    /**
     * Cross-fades the launcher's updated appearance with its previous appearance.
     *
     * This method is used to cross-fade UI updates on activity creation, specifically dark mode
     * updates.
     */
    private void crossFadeWithPreviousAppearance() {
        NonConfigInstance lastInstance = (NonConfigInstance) getLastNonConfigurationInstance();

        if (lastInstance == null || lastInstance.snapshot == null) {
            return;
        }

        ImageView crossFadeHelper = new ImageView(this);
        crossFadeHelper.setImageBitmap(lastInstance.snapshot);
        crossFadeHelper.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);

        InsettableFrameLayout.LayoutParams layoutParams = new InsettableFrameLayout.LayoutParams(
                InsettableFrameLayout.LayoutParams.MATCH_PARENT,
                InsettableFrameLayout.LayoutParams.MATCH_PARENT);

        layoutParams.ignoreInsets = true;

        crossFadeHelper.setLayoutParams(layoutParams);

        getRootView().addView(crossFadeHelper);

        crossFadeHelper
                .animate()
                .setDuration(THEME_CROSS_FADE_ANIMATION_DURATION)
                .alpha(0f)
                .withEndAction(() -> getRootView().removeView(crossFadeHelper))
                .start();
    }

    public boolean supportsAdaptiveIconAnimation(View clickedView) {
        return false;
    }
@@ -3351,7 +3299,6 @@ public class Launcher extends StatefulActivity<LauncherState>

    private static class NonConfigInstance {
        public Configuration config;
        public Bitmap snapshot;
    }

    @Override
Loading