From c0c420a3c27ed8d3478124ed944d282f0709a440 Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Wed, 29 Nov 2023 16:51:08 -0800 Subject: [PATCH] Adds ENABLE_SEARCH_HAPTIC_COMMIT feature flag. This controls whether a haptic is played when search invocation starts. The assumption is that the search app will play this haptic if the flag is disabled (default). Test: Manual Bug: 310659178 Bug: 314005577 Flag: LEGACY ENABLE_SEARCH_HAPTIC_COMMIT DISABLED Change-Id: I406c18cfaf27d004e19de26f00c997c0a03de996 --- src/com/android/launcher3/config/FeatureFlags.java | 10 +++++++--- src/com/android/launcher3/util/VibratorWrapper.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 14d1683585..329659ad4d 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -279,12 +279,16 @@ public final class FeatureFlags { "Inject fallback app corpus result when AiAi fails to return it."); public static final BooleanFlag ENABLE_LONG_PRESS_NAV_HANDLE = - getReleaseFlag(282993230, "ENABLE_LONG_PRESS_NAV_HANDLE", TEAMFOOD, + getReleaseFlag(299682306, "ENABLE_LONG_PRESS_NAV_HANDLE", TEAMFOOD, "Enables long pressing on the bottom bar nav handle to trigger events."); public static final BooleanFlag ENABLE_SEARCH_HAPTIC_HINT = - getReleaseFlag(303023676, "ENABLE_SEARCH_HAPTIC_HINT", ENABLED, - "Enables haptic hint when long pressing on the bottom bar nav handle."); + getReleaseFlag(314005131, "ENABLE_SEARCH_HAPTIC_HINT", ENABLED, + "Enables haptic hint while long pressing on the bottom bar nav handle."); + + public static final BooleanFlag ENABLE_SEARCH_HAPTIC_COMMIT = + getReleaseFlag(314005577, "ENABLE_SEARCH_HAPTIC_COMMIT", DISABLED, + "Enables haptic hint at end of long pressing on the bottom bar nav handle."); public static final IntFlag LPNH_HAPTIC_HINT_START_SCALE_PERCENT = getIntFlag(309972570, "LPNH_HAPTIC_HINT_START_SCALE_PERCENT", 0, diff --git a/src/com/android/launcher3/util/VibratorWrapper.java b/src/com/android/launcher3/util/VibratorWrapper.java index 8aaad93a6d..8b8d3f7b76 100644 --- a/src/com/android/launcher3/util/VibratorWrapper.java +++ b/src/com/android/launcher3/util/VibratorWrapper.java @@ -238,7 +238,7 @@ public class VibratorWrapper { /** Indicates that search has been invoked. */ public void vibrateForSearch() { - if (mSearchEffect != null) { + if (mSearchEffect != null && FeatureFlags.ENABLE_SEARCH_HAPTIC_COMMIT.get()) { vibrate(mSearchEffect); } }