Remove mobile network v1
Fixes: 142920912 Test: rebuild, robolectric Change-Id: Ib365ba712af62729ca35abbc370aef087ce52a90
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2018 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.
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Toolbar
|
||||
android:id="@+id/mobile_action_bar"
|
||||
style="?android:attr/actionBarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:navigationContentDescription="@*android:string/action_bar_up_description"
|
||||
android:theme="?android:attr/actionBarTheme"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/main_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/bottom_nav"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginStart="0dp"
|
||||
android:background="?android:attr/windowBackground"
|
||||
app:itemIconTint="@color/bottom_navigation_colors"
|
||||
app:itemTextColor="@color/bottom_navigation_colors"
|
||||
app:menu="@menu/home_bottom_navigation"/>
|
||||
</LinearLayout>
|
@@ -1,169 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2008 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.
|
||||
-->
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:key="mobile_network_pref_screen"
|
||||
settings:initialExpandedChildrenCount="4">
|
||||
|
||||
<Preference
|
||||
android:key="cdma_lte_data_service_key"
|
||||
android:title="@string/cdma_lte_data_service"
|
||||
settings:controller="com.android.settings.network.telephony.DataServiceSetupPreferenceController">
|
||||
</Preference>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="mobile_data_enable"
|
||||
android:title="@string/mobile_data_settings_title"
|
||||
android:summary="@string/mobile_data_settings_summary"
|
||||
settings:controller="com.android.settings.network.telephony.MobileDataPreferenceController"/>
|
||||
|
||||
<com.android.settingslib.RestrictedSwitchPreference
|
||||
android:key="button_roaming_key"
|
||||
android:title="@string/roaming"
|
||||
android:persistent="false"
|
||||
android:summaryOn="@string/roaming_enable"
|
||||
android:summaryOff="@string/roaming_disable"
|
||||
settings:userRestriction="no_data_roaming"
|
||||
settings:controller="com.android.settings.network.telephony.RoamingPreferenceController"/>
|
||||
|
||||
<Preference
|
||||
android:key="data_usage_summary"
|
||||
android:title="@string/mobile_data_usage_title"
|
||||
settings:controller="com.android.settings.network.telephony.DataUsagePreferenceController"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="enhanced_4g_lte"
|
||||
android:title="@string/enhanced_4g_lte_mode_title"
|
||||
android:persistent="false"
|
||||
android:summary="@string/enhanced_4g_lte_mode_summary"
|
||||
settings:keywords="@string/keywords_enhance_4g_lte"
|
||||
settings:controller="com.android.settings.network.telephony.Enhanced4gLtePreferenceController"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="4g_calling"
|
||||
android:title="@string/enhanced_4g_lte_mode_title_4g_calling"
|
||||
android:persistent="false"
|
||||
android:summary="@string/enhanced_4g_lte_mode_summary_4g_calling"
|
||||
settings:keywords="@string/keywords_enhance_4g_lte"
|
||||
settings:controller="com.android.settings.network.telephony.Enhanced4gCallingPreferenceController"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="advance_call"
|
||||
android:title="@string/enhanced_4g_lte_mode_title_advanced_calling"
|
||||
android:persistent="false"
|
||||
android:summary="@string/enhanced_4g_lte_mode_summary"
|
||||
settings:keywords="@string/keywords_enhance_4g_lte"
|
||||
settings:controller="com.android.settings.network.telephony.Enhanced4gAdvancedCallingPreferenceController"/>
|
||||
|
||||
<ListPreference
|
||||
android:key="preferred_network_mode_key"
|
||||
android:title="@string/preferred_network_mode_title"
|
||||
android:summary="@string/preferred_network_mode_summary"
|
||||
android:entries="@array/preferred_network_mode_choices"
|
||||
android:entryValues="@array/preferred_network_mode_values"
|
||||
android:dialogTitle="@string/preferred_network_mode_dialogtitle"
|
||||
settings:controller="com.android.settings.network.telephony.PreferredNetworkModePreferenceController"/>
|
||||
|
||||
<ListPreference
|
||||
android:key="enabled_networks_key"
|
||||
android:title="@string/preferred_network_mode_title"
|
||||
android:summary="@string/preferred_network_mode_summary"
|
||||
android:entries="@array/enabled_networks_choices"
|
||||
android:entryValues="@array/enabled_networks_values"
|
||||
android:dialogTitle="@string/preferred_network_mode_dialogtitle"
|
||||
settings:controller="com.android.settings.network.telephony.EnabledNetworkModePreferenceController"/>
|
||||
|
||||
<Preference
|
||||
android:key="carrier_settings_euicc_key"
|
||||
android:title="@string/carrier_settings_euicc"
|
||||
settings:controller="com.android.settings.network.telephony.EuiccPreferenceController" />
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="calling_category"
|
||||
android:title="@string/call_category"
|
||||
settings:searchable="false">
|
||||
|
||||
<PreferenceScreen
|
||||
android:key="wifi_calling"
|
||||
android:title="@string/wifi_calling_settings_title"
|
||||
android:summary="@string/wifi_calling_summary"
|
||||
settings:controller="com.android.settings.network.telephony.WifiCallingPreferenceController" >
|
||||
<intent android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="com.android.settings"
|
||||
android:targetClass="com.android.settings.Settings$WifiCallingSettingsActivity">
|
||||
<extra android:name="show_drawer_menu" android:value="true" />
|
||||
</intent>
|
||||
</PreferenceScreen>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="video_calling_key"
|
||||
android:title="@string/video_calling_settings_title"
|
||||
android:persistent="true"
|
||||
settings:controller="com.android.settings.network.telephony.VideoCallingPreferenceController" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<com.android.settings.network.telephony.cdma.CdmaListPreference
|
||||
android:key="cdma_system_select_key"
|
||||
android:title="@string/cdma_system_select_title"
|
||||
android:summary="@string/cdma_system_select_summary"
|
||||
android:entries="@array/cdma_system_select_choices"
|
||||
android:entryValues="@array/cdma_system_select_values"
|
||||
android:dialogTitle="@string/cdma_system_select_dialogtitle"
|
||||
settings:controller="com.android.settings.network.telephony.cdma.CdmaSystemSelectPreferenceController"/>
|
||||
|
||||
<com.android.settings.network.telephony.cdma.CdmaListPreference
|
||||
android:key="cdma_subscription_key"
|
||||
android:title="@string/cdma_subscription_title"
|
||||
android:summary="@string/cdma_subscription_summary"
|
||||
android:entries="@array/cdma_subscription_choices"
|
||||
android:entryValues="@array/cdma_subscription_values"
|
||||
android:dialogTitle="@string/cdma_subscription_dialogtitle"
|
||||
settings:controller="com.android.settings.network.telephony.cdma.CdmaSubscriptionPreferenceController"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="network_operators_category_key"
|
||||
android:title="@string/network_operator_category"
|
||||
settings:controller="com.android.settings.widget.PreferenceCategoryController">
|
||||
|
||||
<SwitchPreference
|
||||
android:key="auto_select_key"
|
||||
android:title="@string/select_automatically"
|
||||
settings:controller="com.android.settings.network.telephony.gsm.AutoSelectPreferenceController"/>
|
||||
|
||||
<Preference
|
||||
android:key="choose_network_key"
|
||||
android:title="@string/choose_network_title"
|
||||
android:fragment="com.android.phone.NetworkSelectSetting"
|
||||
settings:controller="com.android.settings.network.telephony.gsm.OpenNetworkSelectPagePreferenceController"/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<!--We want separate APN setting from reset of settings because we want user to change it with caution-->
|
||||
<com.android.settingslib.RestrictedPreference
|
||||
android:key="telephony_apn_key"
|
||||
android:persistent="false"
|
||||
android:title="@string/mobile_network_apn_title"
|
||||
settings:allowDividerAbove="true"
|
||||
settings:controller="com.android.settings.network.telephony.ApnPreferenceController"/>
|
||||
|
||||
<Preference
|
||||
android:key="carrier_settings_key"
|
||||
android:title="@string/carrier_settings_title"
|
||||
settings:controller="com.android.settings.network.telephony.CarrierPreferenceController">
|
||||
</Preference>
|
||||
|
||||
</PreferenceScreen>
|
@@ -106,7 +106,6 @@ import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.dashboard.profileselector.ProfileFragmentBridge;
|
||||
import com.android.settings.development.featureflags.FeatureFlagPersistent;
|
||||
import com.android.settings.password.ChooseLockSettingsHelper;
|
||||
import com.android.settingslib.widget.ActionBarShadowController;
|
||||
|
||||
@@ -534,13 +533,7 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
* TODO: See bug 16533525.
|
||||
*/
|
||||
public static boolean showSimCardTile(Context context) {
|
||||
if (FeatureFlagPersistent.isEnabled(context, FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
return false;
|
||||
}
|
||||
final TelephonyManager tm =
|
||||
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
|
||||
return tm.getSimCount() > 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -23,8 +23,6 @@ public class FeatureFlags {
|
||||
public static final String AUDIO_SWITCHER_SETTINGS = "settings_audio_switcher";
|
||||
public static final String DYNAMIC_SYSTEM = "settings_dynamic_system";
|
||||
public static final String HEARING_AID_SETTINGS = "settings_bluetooth_hearing_aid";
|
||||
public static final String MOBILE_NETWORK_V2 = "settings_mobile_network_v2";
|
||||
public static final String NETWORK_INTERNET_V2 = "settings_network_and_internet_v2";
|
||||
public static final String WIFI_DETAILS_DATAUSAGE_HEADER =
|
||||
"settings_wifi_details_datausage_header";
|
||||
public static final String PERSONAL_WORK_PROFILE = "settings_work_profile";
|
||||
|
@@ -35,7 +35,6 @@ public class FeatureFlagPersistent {
|
||||
static {
|
||||
PERSISTENT_FLAGS = new HashSet<>();
|
||||
PERSISTENT_FLAGS.add(FeatureFlags.HEARING_AID_SETTINGS);
|
||||
PERSISTENT_FLAGS.add(FeatureFlags.NETWORK_INTERNET_V2);
|
||||
PERSISTENT_FLAGS.add(FeatureFlags.DYNAMIC_SYSTEM);
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,6 @@ import static android.os.UserHandle.myUserId;
|
||||
import static android.os.UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
@@ -28,13 +27,11 @@ import android.provider.Settings;
|
||||
import android.telephony.PhoneStateListener;
|
||||
import android.telephony.ServiceState;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.network.telephony.MobileNetworkActivity;
|
||||
import com.android.settings.network.telephony.MobileNetworkUtils;
|
||||
@@ -51,10 +48,6 @@ public class MobileNetworkPreferenceController extends AbstractPreferenceControl
|
||||
|
||||
@VisibleForTesting
|
||||
static final String KEY_MOBILE_NETWORK_SETTINGS = "mobile_network_settings";
|
||||
@VisibleForTesting
|
||||
static final String MOBILE_NETWORK_PACKAGE = "com.android.phone";
|
||||
@VisibleForTesting
|
||||
static final String MOBILE_NETWORK_CLASS = "com.android.phone.MobileNetworkSettings";
|
||||
|
||||
private final boolean mIsSecondaryUser;
|
||||
private final TelephonyManager mTelephonyManager;
|
||||
@@ -147,15 +140,8 @@ public class MobileNetworkPreferenceController extends AbstractPreferenceControl
|
||||
@Override
|
||||
public boolean handlePreferenceTreeClick(Preference preference) {
|
||||
if (KEY_MOBILE_NETWORK_SETTINGS.equals(preference.getKey())) {
|
||||
if (FeatureFlagUtils.isEnabled(mContext, FeatureFlags.MOBILE_NETWORK_V2)) {
|
||||
final Intent intent = new Intent(mContext, MobileNetworkActivity.class);
|
||||
mContext.startActivity(intent);
|
||||
} else {
|
||||
final Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
intent.setComponent(
|
||||
new ComponentName(MOBILE_NETWORK_PACKAGE, MOBILE_NETWORK_CLASS));
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
final Intent intent = new Intent(mContext, MobileNetworkActivity.class);
|
||||
mContext.startActivity(intent);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@@ -27,9 +27,7 @@ import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.development.featureflags.FeatureFlagPersistent;
|
||||
import com.android.settings.network.MobilePlanPreferenceController.MobilePlanPreferenceHost;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.wifi.WifiMasterSwitchPreferenceController;
|
||||
@@ -60,20 +58,14 @@ public class NetworkDashboardFragment extends DashboardFragment implements
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
if (FeatureFlagPersistent.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
return R.xml.network_and_internet_v2;
|
||||
} else {
|
||||
return R.xml.network_and_internet;
|
||||
}
|
||||
return R.xml.network_and_internet_v2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
|
||||
if (FeatureFlagPersistent.isEnabled(context, FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
use(MultiNetworkHeaderController.class).init(getSettingsLifecycle());
|
||||
}
|
||||
use(MultiNetworkHeaderController.class).init(getSettingsLifecycle());
|
||||
use(AirplaneModePreferenceController.class).setFragment(this);
|
||||
}
|
||||
|
||||
@@ -95,10 +87,6 @@ public class NetworkDashboardFragment extends DashboardFragment implements
|
||||
new MobilePlanPreferenceController(context, mobilePlanHost);
|
||||
final WifiMasterSwitchPreferenceController wifiPreferenceController =
|
||||
new WifiMasterSwitchPreferenceController(context, metricsFeatureProvider);
|
||||
MobileNetworkPreferenceController mobileNetworkPreferenceController = null;
|
||||
if (!FeatureFlagPersistent.isEnabled(context, FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
mobileNetworkPreferenceController = new MobileNetworkPreferenceController(context);
|
||||
}
|
||||
|
||||
final VpnPreferenceController vpnPreferenceController =
|
||||
new VpnPreferenceController(context);
|
||||
@@ -108,21 +96,13 @@ public class NetworkDashboardFragment extends DashboardFragment implements
|
||||
if (lifecycle != null) {
|
||||
lifecycle.addObserver(mobilePlanPreferenceController);
|
||||
lifecycle.addObserver(wifiPreferenceController);
|
||||
if (mobileNetworkPreferenceController != null) {
|
||||
lifecycle.addObserver(mobileNetworkPreferenceController);
|
||||
}
|
||||
lifecycle.addObserver(vpnPreferenceController);
|
||||
lifecycle.addObserver(privateDnsPreferenceController);
|
||||
}
|
||||
|
||||
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||
|
||||
if (FeatureFlagPersistent.isEnabled(context, FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
controllers.add(new MobileNetworkSummaryController(context, lifecycle));
|
||||
}
|
||||
if (mobileNetworkPreferenceController != null) {
|
||||
controllers.add(mobileNetworkPreferenceController);
|
||||
}
|
||||
controllers.add(new MobileNetworkSummaryController(context, lifecycle));
|
||||
controllers.add(new TetherPreferenceController(context, lifecycle));
|
||||
controllers.add(vpnPreferenceController);
|
||||
controllers.add(new ProxyPreferenceController(context));
|
||||
@@ -168,12 +148,7 @@ public class NetworkDashboardFragment extends DashboardFragment implements
|
||||
public List<SearchIndexableResource> getXmlResourcesToIndex(
|
||||
Context context, boolean enabled) {
|
||||
final SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
if (FeatureFlagPersistent.isEnabled(context,
|
||||
FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
sir.xmlResId = R.xml.network_and_internet_v2;
|
||||
} else {
|
||||
sir.xmlResId = R.xml.network_and_internet;
|
||||
}
|
||||
sir.xmlResId = R.xml.network_and_internet_v2;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
|
||||
|
@@ -22,8 +22,6 @@ import android.os.Bundle;
|
||||
import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.view.Menu;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
@@ -33,13 +31,9 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.android.internal.util.CollectionUtils;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.core.SettingsBaseActivity;
|
||||
import com.android.settings.development.featureflags.FeatureFlagPersistent;
|
||||
import com.android.settings.network.ProxySubscriptionManager;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -80,11 +74,7 @@ public class MobileNetworkActivity extends SettingsBaseActivity
|
||||
return;
|
||||
}
|
||||
|
||||
if (FeatureFlagPersistent.isEnabled(this, FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
setContentView(R.layout.mobile_network_settings_container_v2);
|
||||
} else {
|
||||
setContentView(R.layout.mobile_network_settings_container);
|
||||
}
|
||||
setContentView(R.layout.mobile_network_settings_container_v2);
|
||||
setActionBar(findViewById(R.id.mobile_action_bar));
|
||||
|
||||
mProxySubscriptionMgr = ProxySubscriptionManager.getInstance(this);
|
||||
@@ -141,10 +131,6 @@ public class MobileNetworkActivity extends SettingsBaseActivity
|
||||
if (subscription != null) {
|
||||
setTitle(subscription.getDisplayName());
|
||||
}
|
||||
|
||||
if (!FeatureFlagPersistent.isEnabled(this, FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
updateBottomNavigationView();
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -181,38 +167,6 @@ public class MobileNetworkActivity extends SettingsBaseActivity
|
||||
return subInfos.get(0);
|
||||
}
|
||||
|
||||
private void updateBottomNavigationView() {
|
||||
final BottomNavigationView navigation = findViewById(R.id.bottom_nav);
|
||||
|
||||
final List<SubscriptionInfo> subInfos = mProxySubscriptionMgr.getActiveSubscriptionsInfo();
|
||||
if (CollectionUtils.size(subInfos) <= 1) {
|
||||
navigation.setVisibility(View.GONE);
|
||||
} else {
|
||||
final Menu menu = navigation.getMenu();
|
||||
menu.clear();
|
||||
for (int i = 0, size = subInfos.size(); i < size; i++) {
|
||||
final SubscriptionInfo subscriptionInfo = subInfos.get(i);
|
||||
menu.add(0, subscriptionInfo.getSubscriptionId(), i,
|
||||
subscriptionInfo.getDisplayName())
|
||||
.setIcon(R.drawable.ic_settings_sim);
|
||||
}
|
||||
navigation.setOnNavigationItemSelectedListener(item -> {
|
||||
final int subId = item.getItemId();
|
||||
if (!isSubscriptionChanged(subId)) {
|
||||
return true;
|
||||
}
|
||||
final SubscriptionInfo subscriptionInfo = mProxySubscriptionMgr
|
||||
.getActiveSubscriptionInfo(subId);
|
||||
if (subscriptionInfo == null) {
|
||||
return true;
|
||||
}
|
||||
updateSubscriptions(subscriptionInfo);
|
||||
return true;
|
||||
});
|
||||
navigation.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void switchFragment(SubscriptionInfo subInfo) {
|
||||
final FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
|
@@ -37,11 +37,9 @@ import androidx.preference.Preference;
|
||||
|
||||
import com.android.internal.telephony.TelephonyIntents;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.dashboard.RestrictedDashboardFragment;
|
||||
import com.android.settings.datausage.BillingCyclePreferenceController;
|
||||
import com.android.settings.datausage.DataUsageSummaryPreferenceController;
|
||||
import com.android.settings.development.featureflags.FeatureFlagPersistent;
|
||||
import com.android.settings.network.telephony.cdma.CdmaSubscriptionPreferenceController;
|
||||
import com.android.settings.network.telephony.cdma.CdmaSystemSelectPreferenceController;
|
||||
import com.android.settings.network.telephony.gsm.AutoSelectPreferenceController;
|
||||
@@ -117,8 +115,7 @@ public class MobileNetworkSettings extends RestrictedDashboardFragment {
|
||||
mSubId = getArguments().getInt(Settings.EXTRA_SUB_ID,
|
||||
MobileNetworkUtils.getSearchableSubscriptionId(context));
|
||||
|
||||
if (FeatureFlagPersistent.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2) &&
|
||||
mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
if (mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
return Arrays.asList(
|
||||
new DataUsageSummaryPreferenceController(getActivity(), getSettingsLifecycle(),
|
||||
this, mSubId));
|
||||
@@ -130,19 +127,17 @@ public class MobileNetworkSettings extends RestrictedDashboardFragment {
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
|
||||
if (FeatureFlagPersistent.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
use(CallsDefaultSubscriptionController.class).init(getLifecycle());
|
||||
use(SmsDefaultSubscriptionController.class).init(getLifecycle());
|
||||
use(MobileNetworkSwitchController.class).init(getLifecycle(), mSubId);
|
||||
use(CarrierSettingsVersionPreferenceController.class).init(mSubId);
|
||||
use(BillingCyclePreferenceController.class).init(mSubId);
|
||||
use(MmsMessagePreferenceController.class).init(mSubId);
|
||||
use(DataDuringCallsPreferenceController.class).init(getLifecycle(), mSubId);
|
||||
use(DisabledSubscriptionController.class).init(getLifecycle(), mSubId);
|
||||
use(DeleteSimProfilePreferenceController.class).init(mSubId, this,
|
||||
REQUEST_CODE_DELETE_SUBSCRIPTION);
|
||||
use(DisableSimFooterPreferenceController.class).init(mSubId);
|
||||
}
|
||||
use(CallsDefaultSubscriptionController.class).init(getLifecycle());
|
||||
use(SmsDefaultSubscriptionController.class).init(getLifecycle());
|
||||
use(MobileNetworkSwitchController.class).init(getLifecycle(), mSubId);
|
||||
use(CarrierSettingsVersionPreferenceController.class).init(mSubId);
|
||||
use(BillingCyclePreferenceController.class).init(mSubId);
|
||||
use(MmsMessagePreferenceController.class).init(mSubId);
|
||||
use(DataDuringCallsPreferenceController.class).init(getLifecycle(), mSubId);
|
||||
use(DisabledSubscriptionController.class).init(getLifecycle(), mSubId);
|
||||
use(DeleteSimProfilePreferenceController.class).init(mSubId, this,
|
||||
REQUEST_CODE_DELETE_SUBSCRIPTION);
|
||||
use(DisableSimFooterPreferenceController.class).init(mSubId);
|
||||
use(MobileDataPreferenceController.class).init(getFragmentManager(), mSubId);
|
||||
use(RoamingPreferenceController.class).init(getFragmentManager(), mSubId);
|
||||
use(ApnPreferenceController.class).init(mSubId);
|
||||
@@ -151,9 +146,7 @@ public class MobileNetworkSettings extends RestrictedDashboardFragment {
|
||||
use(PreferredNetworkModePreferenceController.class).init(mSubId);
|
||||
use(EnabledNetworkModePreferenceController.class).init(getLifecycle(), mSubId);
|
||||
use(DataServiceSetupPreferenceController.class).init(mSubId);
|
||||
if (!FeatureFlagPersistent.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
use(EuiccPreferenceController.class).init(mSubId);
|
||||
}
|
||||
|
||||
final WifiCallingPreferenceController wifiCallingPreferenceController =
|
||||
use(WifiCallingPreferenceController.class).init(mSubId);
|
||||
|
||||
@@ -204,11 +197,7 @@ public class MobileNetworkSettings extends RestrictedDashboardFragment {
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
if (FeatureFlagPersistent.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
return R.xml.mobile_network_settings_v2;
|
||||
} else {
|
||||
return R.xml.mobile_network_settings;
|
||||
}
|
||||
return R.xml.mobile_network_settings_v2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -250,8 +239,7 @@ public class MobileNetworkSettings extends RestrictedDashboardFragment {
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
if (FeatureFlagPersistent.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2) &&
|
||||
mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
if (mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
final MenuItem item = menu.add(Menu.NONE, R.id.edit_sim_name, Menu.NONE,
|
||||
R.string.mobile_network_sim_name);
|
||||
item.setIcon(com.android.internal.R.drawable.ic_mode_edit);
|
||||
@@ -262,8 +250,7 @@ public class MobileNetworkSettings extends RestrictedDashboardFragment {
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem menuItem) {
|
||||
if (FeatureFlagPersistent.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2) &&
|
||||
mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
if (mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
if (menuItem.getItemId() == R.id.edit_sim_name) {
|
||||
RenameMobileNetworkDialogFragment.newInstance(mSubId).show(
|
||||
getFragmentManager(), RenameMobileNetworkDialogFragment.TAG);
|
||||
@@ -281,10 +268,7 @@ public class MobileNetworkSettings extends RestrictedDashboardFragment {
|
||||
final ArrayList<SearchIndexableResource> result = new ArrayList<>();
|
||||
|
||||
final SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = FeatureFlagPersistent.isEnabled(context,
|
||||
FeatureFlags.NETWORK_INTERNET_V2)
|
||||
? R.xml.mobile_network_settings_v2
|
||||
: R.xml.mobile_network_settings;
|
||||
sir.xmlResId = R.xml.mobile_network_settings_v2;
|
||||
result.add(sir);
|
||||
return result;
|
||||
}
|
||||
|
@@ -22,24 +22,19 @@ import static androidx.lifecycle.Lifecycle.Event.ON_RESUME;
|
||||
import android.content.Context;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.development.featureflags.FeatureFlagPersistent;
|
||||
import com.android.settings.network.SubscriptionUtil;
|
||||
import com.android.settings.network.SubscriptionsChangeListener;
|
||||
import com.android.settings.widget.SwitchBar;
|
||||
import com.android.settingslib.widget.LayoutPreference;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleObserver;
|
||||
import androidx.lifecycle.OnLifecycleEvent;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.network.SubscriptionUtil;
|
||||
import com.android.settings.network.SubscriptionsChangeListener;
|
||||
import com.android.settings.widget.SwitchBar;
|
||||
import com.android.settingslib.widget.LayoutPreference;
|
||||
|
||||
/** This controls a switch to allow enabling/disabling a mobile network */
|
||||
public class MobileNetworkSwitchController extends BasePreferenceController implements
|
||||
SubscriptionsChangeListener.SubscriptionsChangeListenerClient, LifecycleObserver {
|
||||
@@ -118,11 +113,8 @@ public class MobileNetworkSwitchController extends BasePreferenceController impl
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if (FeatureFlagPersistent.isEnabled(mContext, FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
} else {
|
||||
return CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
return AVAILABLE_UNSEARCHABLE;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -64,7 +64,6 @@ import com.android.settings.Utils;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settings.datausage.WifiDataUsageSummaryPreferenceController;
|
||||
import com.android.settings.development.featureflags.FeatureFlagPersistent;
|
||||
import com.android.settings.widget.EntityHeaderController;
|
||||
import com.android.settings.wifi.WifiDialog;
|
||||
import com.android.settings.wifi.WifiDialog.WifiDialogListener;
|
||||
@@ -892,17 +891,8 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
|
||||
mWifiManager.disableEphemeralNetwork(mWifiInfo.getSSID());
|
||||
} else if (mAccessPoint.isPasspoint() || mAccessPoint.isPasspointConfig()) {
|
||||
// Post a dialog to confirm if user really want to forget the passpoint network.
|
||||
if (FeatureFlagPersistent.isEnabled(mContext, FeatureFlags.NETWORK_INTERNET_V2)) {
|
||||
showConfirmForgetDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
mWifiManager.removePasspointConfiguration(mAccessPoint.getPasspointFqdn());
|
||||
} catch (RuntimeException e) {
|
||||
Log.e(TAG, "Failed to remove Passpoint configuration for "
|
||||
+ mAccessPoint.getPasspointFqdn());
|
||||
}
|
||||
showConfirmForgetDialog();
|
||||
return;
|
||||
} else if (mWifiConfig != null) {
|
||||
mWifiManager.forget(mWifiConfig.networkId, null /* action listener */);
|
||||
}
|
||||
|
@@ -18,12 +18,8 @@ package com.android.settings.network;
|
||||
import static androidx.lifecycle.Lifecycle.Event.ON_START;
|
||||
import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
|
||||
|
||||
import static com.android.settings.network.MobileNetworkPreferenceController.MOBILE_NETWORK_CLASS;
|
||||
import static com.android.settings.network.MobileNetworkPreferenceController.MOBILE_NETWORK_PACKAGE;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.Mockito.doNothing;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.spy;
|
||||
@@ -31,23 +27,18 @@ import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.robolectric.shadow.api.Shadow.extract;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
import android.provider.Settings.Global;
|
||||
import android.telephony.PhoneStateListener;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.testutils.shadow.ShadowConnectivityManager;
|
||||
import com.android.settings.testutils.shadow.ShadowUserManager;
|
||||
import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
|
||||
@@ -57,10 +48,8 @@ import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.Robolectric;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Config;
|
||||
@@ -186,18 +175,4 @@ public class MobileNetworkPreferenceControllerTest {
|
||||
mController.updateState(mPreference);
|
||||
assertThat(mPreference.isEnabled()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void handlePreferenceTreeClick_mobileFeatureDisabled_sendIntent() {
|
||||
mController = new MobileNetworkPreferenceController(mContext);
|
||||
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.MOBILE_NETWORK_V2, false);
|
||||
ArgumentCaptor<Intent> argument = ArgumentCaptor.forClass(Intent.class);
|
||||
doNothing().when(mContext).startActivity(argument.capture());
|
||||
|
||||
mController.handlePreferenceTreeClick(mPreference);
|
||||
|
||||
final ComponentName componentName = argument.getValue().getComponent();
|
||||
assertThat(componentName.getPackageName()).isEqualTo(MOBILE_NETWORK_PACKAGE);
|
||||
assertThat(componentName.getClassName()).isEqualTo(MOBILE_NETWORK_CLASS);
|
||||
}
|
||||
}
|
||||
|
@@ -33,19 +33,12 @@ import android.telephony.CarrierConfigManager;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.view.Menu;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.test.core.app.ActivityScenario;
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import com.android.internal.telephony.TelephonyIntents;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.development.featureflags.FeatureFlagPersistent;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -124,25 +117,9 @@ public class MobileNetworkActivityTest {
|
||||
|
||||
private ActivityScenario<MobileNetworkActivity> createTargetActivity(Intent activityIntent,
|
||||
boolean isInternetV2) {
|
||||
FeatureFlagPersistent.setEnabled(mContext, FeatureFlags.NETWORK_INTERNET_V2, isInternetV2);
|
||||
return ActivityScenario.launch(activityIntent);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateBottomNavigationView_oneSubscription_shouldBeGone() {
|
||||
mSubscriptionManager.setActiveSubscriptionInfos(mSubscriptionInfo1);
|
||||
|
||||
mMobileNetworkActivity = createTargetActivity(mTestIntent, false);
|
||||
|
||||
mMobileNetworkActivity.moveToState(State.STARTED);
|
||||
|
||||
mMobileNetworkActivity.onActivity(activity -> {
|
||||
final BottomNavigationView bottomNavigationView =
|
||||
activity.findViewById(R.id.bottom_nav);
|
||||
assertThat(bottomNavigationView.getVisibility()).isEqualTo(View.GONE);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateBottomNavigationViewV2_oneSubscription_shouldNotCrash() {
|
||||
mSubscriptionManager.setActiveSubscriptionInfos(mSubscriptionInfo1);
|
||||
@@ -152,22 +129,6 @@ public class MobileNetworkActivityTest {
|
||||
mMobileNetworkActivity.moveToState(State.STARTED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateBottomNavigationView_twoSubscription_updateMenu() {
|
||||
mSubscriptionManager.setActiveSubscriptionInfos(mSubscriptionInfo1, mSubscriptionInfo2);
|
||||
|
||||
mMobileNetworkActivity = createTargetActivity(mTestIntent, false);
|
||||
|
||||
mMobileNetworkActivity.moveToState(State.STARTED);
|
||||
|
||||
mMobileNetworkActivity.onActivity(activity -> {
|
||||
final BottomNavigationView bottomNavigationView =
|
||||
activity.findViewById(R.id.bottom_nav);
|
||||
final Menu menu = bottomNavigationView.getMenu();
|
||||
assertThat(menu.size()).isEqualTo(2);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateBottomNavigationViewV2_twoSubscription_shouldNotCrash() {
|
||||
mSubscriptionManager.setActiveSubscriptionInfos(mSubscriptionInfo1, mSubscriptionInfo2);
|
||||
@@ -189,14 +150,6 @@ public class MobileNetworkActivityTest {
|
||||
mMobileNetworkActivity.onActivity(activity -> {
|
||||
final MockMobileNetworkActivity mockActivity = (MockMobileNetworkActivity) activity;
|
||||
assertThat(mockActivity.mSubscriptionInFragment).isEqualTo(mSubscriptionInfo1);
|
||||
|
||||
final BottomNavigationView bottomNavigationView =
|
||||
mockActivity.findViewById(R.id.bottom_nav);
|
||||
bottomNavigationView.setSelectedItemId(CURRENT_SUB_ID);
|
||||
assertThat(mockActivity.mSubscriptionInFragment).isEqualTo(mSubscriptionInfo2);
|
||||
|
||||
bottomNavigationView.setSelectedItemId(PREV_SUB_ID);
|
||||
assertThat(mockActivity.mSubscriptionInFragment).isEqualTo(mSubscriptionInfo1);
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -36,9 +36,7 @@ import android.telephony.TelephonyManager;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.datausage.DataUsageSummaryPreferenceController;
|
||||
import com.android.settings.development.featureflags.FeatureFlagPersistent;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
|
||||
import com.android.settings.widget.EntityHeaderController;
|
||||
@@ -92,32 +90,13 @@ public class MobileNetworkSettingsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onAttach_noV2Flag_noCrash() {
|
||||
FeatureFlagPersistent.setEnabled(mContext, FeatureFlags.NETWORK_INTERNET_V2, false);
|
||||
public void onAttach_noCrash() {
|
||||
mFragment.onAttach(mContext);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onAttach_v2Flag_noCrash() {
|
||||
FeatureFlagPersistent.setEnabled(mContext, FeatureFlags.NETWORK_INTERNET_V2, true);
|
||||
mFragment.onAttach(mContext);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createPreferenceControllers_noV2Flag_noDataUsageSummaryController() {
|
||||
FeatureFlagPersistent.setEnabled(mContext, FeatureFlags.NETWORK_INTERNET_V2, false);
|
||||
final List<AbstractPreferenceController> controllers =
|
||||
mFragment.createPreferenceControllers(mContext);
|
||||
assertThat(controllers.stream().filter(
|
||||
c -> c.getClass().equals(DataUsageSummaryPreferenceController.class))
|
||||
.count())
|
||||
.isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createPreferenceControllers_v2Flag_createsDataUsageSummaryController() {
|
||||
FeatureFlagPersistent.setEnabled(mContext, FeatureFlags.NETWORK_INTERNET_V2, true);
|
||||
|
||||
public void createPreferenceControllers_createsDataUsageSummaryController() {
|
||||
final List<AbstractPreferenceController> controllers =
|
||||
mFragment.createPreferenceControllers(mContext);
|
||||
assertThat(controllers.stream().filter(
|
||||
|
@@ -69,8 +69,6 @@ import androidx.preference.PreferenceScreen;
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.development.featureflags.FeatureFlagPersistent;
|
||||
import com.android.settings.testutils.shadow.ShadowDevicePolicyManager;
|
||||
import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
|
||||
import com.android.settings.widget.EntityHeaderController;
|
||||
@@ -1131,24 +1129,7 @@ public class WifiDetailPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void forgetNetwork_v1_Passpoint() {
|
||||
setUpForConnectedNetwork();
|
||||
FeatureFlagPersistent.setEnabled(mContext, FeatureFlags.NETWORK_INTERNET_V2, false);
|
||||
|
||||
mockWifiConfig.networkId = 5;
|
||||
when(mockAccessPoint.isPasspoint()).thenReturn(true);
|
||||
when(mockAccessPoint.getPasspointFqdn()).thenReturn(FQDN);
|
||||
|
||||
mController.displayPreference(mockScreen);
|
||||
mForgetClickListener.getValue().onClick(null);
|
||||
|
||||
verify(mockWifiManager).removePasspointConfiguration(FQDN);
|
||||
verify(mockMetricsFeatureProvider)
|
||||
.action(mockActivity, MetricsProto.MetricsEvent.ACTION_WIFI_FORGET);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void forgetNetwork_PasspointV2_shouldShowDialog() {
|
||||
public void forgetNetwork_shouldShowDialog() {
|
||||
setUpForConnectedNetwork();
|
||||
final WifiDetailPreferenceController spyController = spy(mController);
|
||||
|
||||
@@ -1156,7 +1137,6 @@ public class WifiDetailPreferenceControllerTest {
|
||||
when(mockAccessPoint.isPasspoint()).thenReturn(true);
|
||||
when(mockAccessPoint.getPasspointFqdn()).thenReturn(FQDN);
|
||||
spyController.displayPreference(mockScreen);
|
||||
FeatureFlagPersistent.setEnabled(mContext, FeatureFlags.NETWORK_INTERNET_V2, true);
|
||||
|
||||
mForgetClickListener.getValue().onClick(null);
|
||||
|
||||
|
Reference in New Issue
Block a user