Skip to content

Commit

Permalink
[Cleaup] Remove IsVoiceSearchEnabledCache experiment code
Browse files Browse the repository at this point in the history
Bug: 905461, 1385901
Change-Id: Ic2c994c1dc7d3ee357688cb8f1b01ce140a96e12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4190370
Reviewed-by: David Trainor <dtrainor@chromium.org>
Commit-Queue: Peilin Wang <peilinwang@google.com>
Cr-Commit-Position: refs/heads/main@{#1098188}
  • Loading branch information
Peilin Wang authored and Chromium LUCI CQ committed Jan 27, 2023
1 parent e53dc84 commit 37c1136
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 37 deletions.
Expand Up @@ -154,7 +154,6 @@ public void tearDown() {
assertNotNull(mHandler);
mHandler.removeObserver(mObserver);
VoiceRecognitionHandler.setIsRecognitionIntentPresentForTesting(null);
mHandler.setIsVoiceSearchEnabledCacheForTesting(null);
mWindowAndroid.destroy();
});
}
Expand Down
Expand Up @@ -141,7 +141,6 @@ public void tearDown() {
RecognitionTestHelper.setAudioCapturePref(true);
mHandler.removeObserver(mObserver);
VoiceRecognitionHandler.setIsRecognitionIntentPresentForTesting(null);
mHandler.setIsVoiceSearchEnabledCacheForTesting(null);
mWindowAndroid.destroy();
});
}
Expand Down
Expand Up @@ -144,7 +144,6 @@ public void tearDown() {
RecognitionTestHelper.setAudioCapturePref(true);
mHandler.removeObserver(mObserver);
VoiceRecognitionHandler.setIsRecognitionIntentPresentForTesting(null);
mHandler.setIsVoiceSearchEnabledCacheForTesting(null);
mWindowAndroid.destroy();
});
}
Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/flags/android/chrome_feature_list.cc
Expand Up @@ -232,7 +232,6 @@ const base::Feature* const kFeaturesExposedToJava[] = {
&kInfobarScrollOptimization,
&kInstanceSwitcher,
&kInstantStart,
&kIsVoiceSearchEnabledCache,
&kLensCameraAssistedSearch,
&kLensOnQuickActionSearchWidget,
&kNotificationPermissionVariant,
Expand Down Expand Up @@ -727,10 +726,6 @@ BASE_FEATURE(kInfobarScrollOptimization,

BASE_FEATURE(kInstantStart, "InstantStart", base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kIsVoiceSearchEnabledCache,
"IsVoiceSearchEnabledCache",
base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kNotificationPermissionVariant,
"NotificationPermissionVariant",
base::FEATURE_DISABLED_BY_DEFAULT);
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/flags/android/chrome_feature_list.h
Expand Up @@ -97,7 +97,6 @@ BASE_DECLARE_FEATURE(kInfobarScrollOptimization);
BASE_DECLARE_FEATURE(kImprovedA2HS);
BASE_DECLARE_FEATURE(kInstanceSwitcher);
BASE_DECLARE_FEATURE(kInstantStart);
BASE_DECLARE_FEATURE(kIsVoiceSearchEnabledCache);
BASE_DECLARE_FEATURE(kLanguagesPreference);
BASE_DECLARE_FEATURE(kLensCameraAssistedSearch);
BASE_DECLARE_FEATURE(kLensOnQuickActionSearchWidget);
Expand Down
Expand Up @@ -350,7 +350,6 @@ public static boolean getFieldTrialParamByFeatureAsBoolean(
public static final String INTEREST_FEED_V2 = "InterestFeedV2";
public static final String INTEREST_FEED_V2_AUTOPLAY = "InterestFeedV2Autoplay";
public static final String INTEREST_FEED_V2_HEARTS = "InterestFeedV2Hearts";
public static final String IS_VOICE_SEARCH_ENABLED_CACHE = "IsVoiceSearchEnabledCache";
public static final String LEAK_DETECTION_UNAUTHENTICATED = "LeakDetectionUnauthenticated";
public static final String LENS_CAMERA_ASSISTED_SEARCH = "LensCameraAssistedSearch";
public static final String LENS_ON_QUICK_ACTION_SEARCH_WIDGET = "LensOnQuickActionSearchWidget";
Expand Down
Expand Up @@ -29,7 +29,6 @@
import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.MutableFlagWithSafeDefault;
import org.chromium.chrome.browser.flags.PostNativeFlag;
import org.chromium.chrome.browser.omnibox.LocationBarDataProvider;
import org.chromium.chrome.browser.omnibox.R;
import org.chromium.chrome.browser.omnibox.suggestions.AutocompleteCoordinator;
Expand Down Expand Up @@ -144,8 +143,6 @@ public class VoiceRecognitionHandler {
private static final MutableFlagWithSafeDefault sAssistantIntentTranslateInfoFlag =
new MutableFlagWithSafeDefault(
ChromeFeatureList.ASSISTANT_INTENT_TRANSLATE_INFO, false);
private static final PostNativeFlag sCacheVoiceSearchEnabledFlag =
new PostNativeFlag(ChromeFeatureList.IS_VOICE_SEARCH_ENABLED_CACHE);

private static Boolean sIsRecognitionIntentPresentForTesting;
private final Delegate mDelegate;
Expand Down Expand Up @@ -904,10 +901,6 @@ public boolean isVoiceSearchEnabled() {
if (windowAndroid.getActivity().get() == null) return false;
if (!VoiceRecognitionUtil.isVoiceSearchPermittedByPolicy(false)) return false;

if (!sCacheVoiceSearchEnabledFlag.isEnabled()) {
return VoiceRecognitionUtil.isVoiceSearchEnabled(windowAndroid);
}

if (mIsVoiceSearchEnabledCached == null) {
mIsVoiceSearchEnabledCached = VoiceRecognitionUtil.isVoiceSearchEnabled(windowAndroid);

Expand Down Expand Up @@ -1138,11 +1131,6 @@ protected static boolean isRecognitionIntentPresent(boolean useCachedValue) {
sIsRecognitionIntentPresentForTesting = isRecognitionIntentPresent;
}

@VisibleForTesting
protected void setIsVoiceSearchEnabledCacheForTesting(Boolean value) {
mIsVoiceSearchEnabledCached = value;
}

/** Sets the start time for testing. */
void setQueryStartTimeForTesting(Long queryStartTimeMs) {
mQueryStartTimeMs = queryStartTimeMs;
Expand Down
15 changes: 0 additions & 15 deletions testing/variations/fieldtrial_testing_config.json
Expand Up @@ -6463,21 +6463,6 @@
]
}
],
"IsVoiceSearchEnabledCache": [
{
"platforms": [
"android"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"IsVoiceSearchEnabledCache"
]
}
]
}
],
"JourneysAndroidPreStable": [
{
"platforms": [
Expand Down

0 comments on commit 37c1136

Please sign in to comment.