Use feature flag to show/hide AllInOneTetherSettings

This partially reverts commit 0ccc849de7
which added a config value. Instead, we will use feature flag to switch
between the fragments.

This CL also adds a postfix to keys in all_tether_prefs to
de-duplicate with keys in tether_prefs and wifi_tether_settings.

Bug: 148182953
Change-Id: I92832c786473990065a965409072e4117a7e75a8
Fix: 148618984
Test: make RunSettingsRoboTests
Test: make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
This commit is contained in:
Zhen Zhang
2020-01-30 15:12:50 -08:00
parent 0141e6f943
commit d2a7f9ae79
11 changed files with 84 additions and 47 deletions

View File

@@ -33,13 +33,16 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.FeatureFlagUtils;
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import com.android.settings.AllInOneTetherSettings;
import com.android.settings.R;
import com.android.settings.TetherSettings;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.TetherUtil;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -110,8 +113,8 @@ public class TetherPreferenceController extends AbstractPreferenceController imp
// Grey out if provisioning is not available.
mPreference.setEnabled(!TetherSettings.isProvisioningNeededButUnavailable(mContext));
if (mContext.getResources().getBoolean(R.bool.config_show_all_in_one_tether_settings)) {
mPreference.setFragment("com.android.settings.AllInOneTetherSettings");
if (FeatureFlagUtils.isEnabled(mContext, FeatureFlags.TETHER_ALL_IN_ONE)) {
mPreference.setFragment(AllInOneTetherSettings.class.getName());
}
}
}