Create a feature flag for Search v2.

Also moved all other flags in a common file so we can track them more
easily.

Bug: 68825426
Bug: 64938328
Test: rerun robotests
Change-Id: I3fc805054cb960bedd965b1b907be759df50b95d
This commit is contained in:
Fan Zhang
2017-11-09 14:07:23 -08:00
parent 2260321fd8
commit ff4da23a65
13 changed files with 140 additions and 60 deletions

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.core;
/**
* This class keeps track of all feature flags in Settings.
*/
public class FeatureFlags {
public static final String DEVICE_INFO_V2 = "device_info_v2";
public static final String DEV_OPTION_V1 = "dev_option_v1";
public static final String SEARCH_V2 = "settings_search_v2";
public static final String SUGGESTIONS_V2 = "new_settings_suggestion";
public static final String USE_PREFERENCE_SCREEN_TITLE = "settings_use_preference_screen_title";
}

View File

@@ -18,7 +18,6 @@ package com.android.settings.core;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.VisibleForTesting;
import android.support.annotation.XmlRes;
import android.support.v7.preference.PreferenceScreen;
import android.text.TextUtils;
@@ -39,9 +38,8 @@ public abstract class InstrumentedPreferenceFragment extends ObservablePreferenc
implements Instrumentable {
private static final String TAG = "InstrumentedPrefFrag";
@VisibleForTesting
static final String FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE =
"settings_use_preference_screen_title";
protected MetricsFeatureProvider mMetricsFeatureProvider;
// metrics placeholder value. Only use this for development.
@@ -85,7 +83,7 @@ public abstract class InstrumentedPreferenceFragment extends ObservablePreferenc
}
public static boolean usePreferenceScreenTitle() {
return FeatureFlagUtils.isEnabled(FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE) || true;
return FeatureFlagUtils.isEnabled(FeatureFlags.USE_PREFERENCE_SCREEN_TITLE) || true;
}
protected final Context getPrefContext() {