Merge "Removing some obsolete features" into tm-qpr-dev am: b3a95149f5

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21537730

Change-Id: Ia7fb81792677cbc3979f138dcea93a77cc44af14
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Sunny Goyal
2023-02-23 08:47:16 +00:00
committed by Automerger Merge Worker
6 changed files with 1 additions and 145 deletions

View File

@@ -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);
}
}
}

View File

@@ -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);

View File

@@ -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;
return createSingletonShortcutList(modalStateSystemShortcut);
}
};
}

View File

@@ -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);

View File

@@ -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

View File

@@ -138,17 +138,6 @@ public final class FeatureFlags {
true,
"Enable loading all apps icons in bulk.");
// Keep as DeviceFlag for remote disable in emergency.
public static final BooleanFlag ENABLE_OVERVIEW_SELECTIONS = new DeviceFlag(
"ENABLE_OVERVIEW_SELECTIONS", true, "Show Select Mode button in Overview Actions");
public static final BooleanFlag ENABLE_WIDGETS_PICKER_AIAI_SEARCH = new DeviceFlag(
"ENABLE_WIDGETS_PICKER_AIAI_SEARCH", true, "Enable AiAi search in the widgets picker");
public static final BooleanFlag ENABLE_OVERVIEW_SHARING_TO_PEOPLE = getDebugFlag(
"ENABLE_OVERVIEW_SHARING_TO_PEOPLE", true,
"Show indicators for content on Overview to share with top people. ");
public static final BooleanFlag ENABLE_DATABASE_RESTORE = getDebugFlag(
"ENABLE_DATABASE_RESTORE", false,
"Enable database restore when new restore session is created");
@@ -182,16 +171,6 @@ public final class FeatureFlags {
"ENABLE_MINIMAL_DEVICE", false,
"Allow user to toggle minimal device mode in launcher.");
// TODO: b/172467144 Remove ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE feature flag.
public static final BooleanFlag ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE = new DeviceFlag(
"ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE", false, "Enables a "
+ "crossfade animation when the system these changes.");
// TODO: b/174174514 Remove ENABLE_APP_PREDICTIONS_WHILE_VISIBLE feature flag.
public static final BooleanFlag ENABLE_APP_PREDICTIONS_WHILE_VISIBLE = new DeviceFlag(
"ENABLE_APP_PREDICTIONS_WHILE_VISIBLE", true, "Allows app "
+ "predictions to be updated while they are visible to the user.");
public static final BooleanFlag ENABLE_TASKBAR_POPUP_MENU = getDebugFlag(
"ENABLE_TASKBAR_POPUP_MENU", true, "Enables long pressing taskbar icons to show the"
+ " popup menu.");