Merge "Add a feature flag for new version of Network and internet settings page"
This commit is contained in:
committed by
Android (Google) Code Review
commit
87e4b48cb7
@@ -27,4 +27,5 @@ public class FeatureFlags {
|
||||
public static final String MOBILE_NETWORK_V2 = "settings_mobile_network_v2";
|
||||
public static final String DATA_USAGE_V2 = "settings_data_usage_v2";
|
||||
public static final String WIFI_MAC_RANDOMIZATION = "settings_wifi_mac_randomization";
|
||||
public static final String NETWORK_INTERNET_V2 = "settings_network_and_internet_v2";
|
||||
}
|
||||
|
@@ -59,8 +59,7 @@ public class FeatureFlagsPreferenceController extends BasePreferenceController
|
||||
}
|
||||
mGroup.removeAll();
|
||||
final Context prefContext = mGroup.getContext();
|
||||
for (String feature : featureMap.keySet()) {
|
||||
mGroup.addPreference(new FeatureFlagPreference(prefContext, feature));
|
||||
}
|
||||
featureMap.keySet().stream().sorted().forEach(feature ->
|
||||
mGroup.addPreference(new FeatureFlagPreference(prefContext, feature)));
|
||||
}
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ import static com.android.settings.network.MobilePlanPreferenceController
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.util.FeatureFlagUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
@@ -28,6 +29,7 @@ import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.network.MobilePlanPreferenceController.MobilePlanPreferenceHost;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
@@ -59,7 +61,11 @@ public class NetworkDashboardFragment extends DashboardFragment implements
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.network_and_internet;
|
||||
if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
return R.xml.network_and_internet_v2;
|
||||
} else {
|
||||
return R.xml.network_and_internet;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user