From 197c9094837ceef95e9588bd0c8e130b6c46ed9d Mon Sep 17 00:00:00 2001 From: Cyrus Boadway Date: Tue, 4 May 2021 12:00:08 +0000 Subject: [PATCH] Change flag type to control Quickstep widget app launch Previously we'd relied on a SystemProperties to control which InteractionHandler was used by Quickstep for widget app launches. This switches to a more conventional FeatureFlag. Bug: 169042867 Test: manual Change-Id: I7abf815c6e204daf996ac0a81b1a354c4e3d5cda --- .../android/launcher3/uioverrides/QuickstepLauncher.java | 7 ++----- src/com/android/launcher3/config/FeatureFlags.java | 4 ++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index f09d9e087e..d07cc35ecc 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -26,6 +26,7 @@ import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK; import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent; +import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_WIDGET_APP_START; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP; import static com.android.launcher3.testing.TestProtocol.HINT_STATE_ORDINAL; import static com.android.launcher3.testing.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL; @@ -36,7 +37,6 @@ import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SY import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; -import android.os.SystemProperties; import android.view.HapticFeedbackConstants; import android.view.View; @@ -90,9 +90,6 @@ import java.util.stream.Stream; public class QuickstepLauncher extends BaseQuickstepLauncher { - private static final boolean ENABLE_APP_WIDGET_LAUNCH_ANIMATION = - SystemProperties.getBoolean("persist.debug.quickstep_app_widget_launch", false); - public static final boolean GO_LOW_RAM_RECENTS_ENABLED = false; /** * Reusable command for applying the shelf height on the background thread. @@ -327,7 +324,7 @@ public class QuickstepLauncher extends BaseQuickstepLauncher { protected LauncherAppWidgetHost createAppWidgetHost() { LauncherAppWidgetHost appWidgetHost = super.createAppWidgetHost(); - if (ENABLE_APP_WIDGET_LAUNCH_ANIMATION) { + if (ENABLE_QUICKSTEP_WIDGET_APP_START.get()) { appWidgetHost.setInteractionHandler(new QuickstepInteractionHandler(this)); } return appWidgetHost; diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 7d5ed60019..1981a9c361 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -87,6 +87,10 @@ public final class FeatureFlags { public static final BooleanFlag ENABLE_QUICKSTEP_LIVE_TILE = getDebugFlag( "ENABLE_QUICKSTEP_LIVE_TILE", true, "Enable live tile in Quickstep overview"); + public static final BooleanFlag ENABLE_QUICKSTEP_WIDGET_APP_START = getDebugFlag( + "ENABLE_QUICKSTEP_WIDGET_APP_START", false, + "Enable Quickstep animation when launching activities from an app widget"); + // Keep as DeviceFlag to allow remote disable in emergency. public static final BooleanFlag ENABLE_SUGGESTED_ACTIONS_OVERVIEW = new DeviceFlag( "ENABLE_SUGGESTED_ACTIONS_OVERVIEW", true, "Show chip hints on the overview screen");