Cleaning up enable_dismiss_prediction_undo flag
Test: Presubmit
Bug: 423987554
Flag: EXEMPT cleanup
Change-Id: Ieb77a5be397c8a516f6b3b8ee48ee449d71a4807
diff --git a/aconfig/launcher.aconfig b/aconfig/launcher.aconfig
index 5940a42..18af40d 100644
--- a/aconfig/launcher.aconfig
+++ b/aconfig/launcher.aconfig
@@ -300,13 +300,6 @@
}
flag {
- name: "enable_dismiss_prediction_undo"
- namespace: "launcher"
- description: "Show an 'Undo' snackbar when users dismiss a predicted hotseat item"
- bug: "270394476"
-}
-
-flag {
name: "enable_all_apps_button_in_hotseat"
namespace: "launcher"
description: "Enables displaying the all apps button in the hotseat."
diff --git a/src/com/android/launcher3/popup/PopupDataSource.kt b/src/com/android/launcher3/popup/PopupDataSource.kt
index b527d76..247599c 100644
--- a/src/com/android/launcher3/popup/PopupDataSource.kt
+++ b/src/com/android/launcher3/popup/PopupDataSource.kt
@@ -207,20 +207,18 @@
.logger()
.withItemInfo(itemInfo)
.log(LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_DONT_SUGGEST_APP_TAP)
- if (Flags.enableDismissPredictionUndo()) {
- Snackbar.show(
- activityContext,
- view.context.getString(R.string.item_removed),
- R.string.undo,
- {},
- {
- activityContext.statsLogManager
- .logger()
- .withItemInfo(itemInfo)
- .log(LauncherEvent.LAUNCHER_DISMISS_PREDICTION_UNDO)
- },
- )
- }
+ Snackbar.show(
+ activityContext,
+ view.context.getString(R.string.item_removed),
+ R.string.undo,
+ {},
+ {
+ activityContext.statsLogManager
+ .logger()
+ .withItemInfo(itemInfo)
+ .log(LauncherEvent.LAUNCHER_DISMISS_PREDICTION_UNDO)
+ },
+ )
}
// Popup data the "don't suggest app" shortcut.
diff --git a/src/com/android/launcher3/popup/SystemShortcut.java b/src/com/android/launcher3/popup/SystemShortcut.java
index 52248c4..349481d 100644
--- a/src/com/android/launcher3/popup/SystemShortcut.java
+++ b/src/com/android/launcher3/popup/SystemShortcut.java
@@ -394,14 +394,12 @@
mTarget.getStatsLogManager().logger()
.withItemInfo(mItemInfo)
.log(LAUNCHER_SYSTEM_SHORTCUT_DONT_SUGGEST_APP_TAP);
- if (Flags.enableDismissPredictionUndo()) {
- Snackbar.show(mTarget,
- view.getContext().getString(R.string.item_removed), R.string.undo,
- () -> { }, () ->
- mTarget.getStatsLogManager().logger()
- .withItemInfo(mItemInfo)
- .log(LAUNCHER_DISMISS_PREDICTION_UNDO));
- }
+ Snackbar.show(mTarget,
+ view.getContext().getString(R.string.item_removed), R.string.undo,
+ () -> { }, () ->
+ mTarget.getStatsLogManager().logger()
+ .withItemInfo(mItemInfo)
+ .log(LAUNCHER_DISMISS_PREDICTION_UNDO));
}
}
diff --git a/tests/src/com/android/launcher3/popup/SystemShortcutTest.java b/tests/src/com/android/launcher3/popup/SystemShortcutTest.java
index 094c661..41e55b9 100644
--- a/tests/src/com/android/launcher3/popup/SystemShortcutTest.java
+++ b/tests/src/com/android/launcher3/popup/SystemShortcutTest.java
@@ -20,7 +20,6 @@
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.launcher3.AbstractFloatingView.TYPE_SNACKBAR;
-import static com.android.launcher3.Flags.FLAG_ENABLE_DISMISS_PREDICTION_UNDO;
import static com.android.launcher3.Flags.FLAG_ENABLE_PRIVATE_SPACE;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APPS;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION;
@@ -187,25 +186,6 @@
}
@Test
- @DisableFlags(FLAG_ENABLE_DISMISS_PREDICTION_UNDO)
- public void testDontSuggestAppForPredictedItem() {
- mAppInfo = new AppInfo();
- mAppInfo.componentName = new ComponentName(mTestContext, getClass());
- mAppInfo.container = CONTAINER_HOTSEAT_PREDICTION;
- assertTrue(mAppInfo.isPredictedItem());
- SystemShortcut systemShortcut = SystemShortcut.DONT_SUGGEST_APP
- .getShortcut(mTestContext, mAppInfo, mView);
- assertNotNull(systemShortcut);
-
- TestUtil.runOnExecutorSync(MAIN_EXECUTOR, () -> systemShortcut.onClick(mView));
- InstrumentationRegistry.getInstrumentation().waitForIdleSync();
-
- verify(mStatsLogger).log(eq(LAUNCHER_SYSTEM_SHORTCUT_DONT_SUGGEST_APP_TAP));
- assertFalse(AbstractFloatingView.hasOpenView(mTestContext, TYPE_SNACKBAR));
- }
-
- @Test
- @EnableFlags(FLAG_ENABLE_DISMISS_PREDICTION_UNDO)
public void testDontSuggestAppForPredictedItemWithUndo() {
mAppInfo = new AppInfo();
mAppInfo.componentName = new ComponentName(mTestContext, getClass());