Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39ebb7c9 authored by changbetty's avatar changbetty
Browse files

Remove feature flag for provider model in wifi settings

Bug: 206338507
Test: manual test
Change-Id: I1ec83c94f801b489bcc716a6d78cbe7beab9638f
parent 2d529a4f
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -89,9 +89,10 @@ import java.util.Optional;
/**
 * UI for Wi-Fi settings screen
 *
 * TODO(b/167474581): This file will be deprecated at Android S, please merge your WifiSettings
 * @deprecated This file will be deprecated at Android S, please merge your WifiSettings
 * in change in {@link NetworkProviderSettings}.
 */
@Deprecated
@SearchIndexable
public class WifiSettings extends RestrictedSettingsFragment
        implements Indexable, WifiPickerTracker.WifiPickerTrackerCallback,
@@ -99,6 +100,10 @@ public class WifiSettings extends RestrictedSettingsFragment

    private static final String TAG = "WifiSettings";

    // Set the Provider Model is always enabled
    @VisibleForTesting
    static Boolean IS_ENABLED_PROVIDER_MODEL = true;

    // IDs of context menu
    static final int MENU_ID_CONNECT = Menu.FIRST + 1;
    @VisibleForTesting
@@ -232,7 +237,7 @@ public class WifiSettings extends RestrictedSettingsFragment
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        if (Utils.isProviderModelEnabled(getContext())) {
        if (IS_ENABLED_PROVIDER_MODEL) {
            final Intent intent = new Intent("android.settings.NETWORK_PROVIDER_SETTINGS");
            // Add FLAG_ACTIVITY_NEW_TASK and FLAG_ACTIVITY_CLEAR_TASK to avoid multiple
            // instances issue. (e.g. b/191956700)
@@ -1070,7 +1075,7 @@ public class WifiSettings extends RestrictedSettingsFragment
            new BaseSearchIndexProvider(R.xml.wifi_settings) {
                @Override
                protected boolean isPageSearchEnabled(Context context) {
                    return !Utils.isProviderModelEnabled(context);
                    return !IS_ENABLED_PROVIDER_MODEL;
                }

                @Override
+3 −9
Original line number Diff line number Diff line
@@ -271,15 +271,9 @@ public class WifiSlice implements CustomSliceable {
    public Intent getIntent() {
        final String screenTitle = mContext.getText(R.string.wifi_settings).toString();
        final Uri contentUri = new Uri.Builder().appendPath(KEY_WIFI).build();
        final String className;
        final String key;
        if (Utils.isProviderModelEnabled(mContext)) {
            className = NetworkProviderSettings.class.getName();
            key = WifiSwitchPreferenceController.KEY;
        } else {
            className = WifiSettings.class.getName();
            key = KEY_WIFI;
        }
        final String className = NetworkProviderSettings.class.getName();
        final String key = WifiSwitchPreferenceController.KEY;

        final Intent intent = SliceBuilderUtils.buildSearchResultPageIntent(mContext, className,
                key, screenTitle, SettingsEnums.DIALOG_WIFI_AP_EDIT, this)
                .setClassName(mContext.getPackageName(), SubSettings.class.getName())
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ public class WifiSettingsTest {
        mWifiSettings.mConfigureWifiSettingsPreference = new Preference(mContext);
        mWifiSettings.mWifiPickerTracker = mMockWifiPickerTracker;
        mWifiSettings.mWifiManager = mWifiManager;
        FeatureFlagUtils.setEnabled(mContext, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL, false);
        mWifiSettings.IS_ENABLED_PROVIDER_MODEL = false;
    }

    @Test