Slice of Provider Model: add slice structure

Implement a slice which can show/update carrier networks.
Before and after: go/b173971144screenshot

Bug: 173971144
Test: atest NetworkProviderWorkerTest  (PASS)
atest ProviderModelSliceTest  (PASS)

Change-Id: I3f0dab364c88723ef3185a2ff040b1fbd1b099f4
This commit is contained in:
SongFerngWang
2020-11-17 17:07:19 +08:00
parent a97b4faa67
commit 8cad0197bd
8 changed files with 1062 additions and 6 deletions

View File

@@ -16,6 +16,8 @@
package com.android.settings.panel;
import static com.android.settings.network.NetworkProviderSettings.ACTION_NETWORK_PROVIDER_SETTINGS;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
@@ -51,17 +53,19 @@ public class InternetConnectivityPanel implements PanelContent {
@Override
public CharSequence getTitle() {
return mContext.getText(R.string.internet_connectivity_panel_title);
return mContext.getText(Utils.isProviderModelEnabled(mContext)
? R.string.provider_internet_settings : R.string.internet_connectivity_panel_title);
}
@Override
public List<Uri> getSlices() {
final List<Uri> uris = new ArrayList<>();
uris.add(CustomSliceRegistry.WIFI_SLICE_URI);
uris.add(CustomSliceRegistry.MOBILE_DATA_SLICE_URI);
if (Utils.isProviderModelEnabled(mContext)) {
uris.add(CustomSliceRegistry.PROVIDER_MODEL_SLICE_URI);
uris.add(CustomSliceRegistry.AIRPLANE_SAFE_NETWORKS_SLICE_URI);
} else {
uris.add(CustomSliceRegistry.WIFI_SLICE_URI);
uris.add(CustomSliceRegistry.MOBILE_DATA_SLICE_URI);
uris.add(AirplaneModePreferenceController.SLICE_URI);
}
return uris;
@@ -69,7 +73,8 @@ public class InternetConnectivityPanel implements PanelContent {
@Override
public Intent getSeeMoreIntent() {
return new Intent(Settings.ACTION_WIRELESS_SETTINGS)
return new Intent(Utils.isProviderModelEnabled(mContext)
? ACTION_NETWORK_PROVIDER_SETTINGS : Settings.ACTION_WIRELESS_SETTINGS)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}