Revert "[Settings] configuration for hidding SIM settings UI"
Revert submission 2299468-settings_without_siminfo Reason for revert: Fix build breakage Reverted Changes: I3d6ecec14:[Settings] configuration for hidding SIM settings ... I8f0c1d53c:[Settings] configuration for hidding SIM remove UI... I1b88f0f70:[Settings] configuration for hidding SIM notificat... Ibe22c3ba3:[Settings] configuration for hidding SIM provider ... Id5ea14ca8:[Settings] configuration for hidding SIM related U... I70be07dbc:[Settings] configuration for hidding SIM lock UI Log of breakage: https://android-build.googleplex.com/builds/submitted/9318826/full-eng/latest/view/logs/build_error.log Bug: 260055628 Merged-In: If1df99a79e51125d03f534cdfc9408b01c61024f Change-Id: I646d664b83d3db12cca81f53f7f5cd82a38e34d0
This commit is contained in:
@@ -60,10 +60,6 @@ public class MobileNetworkListFragment extends DashboardFragment {
|
||||
@Override
|
||||
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
||||
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||
if (!SubscriptionUtil.isSimHardwareVisible(getContext())) {
|
||||
finish();
|
||||
return controllers;
|
||||
}
|
||||
|
||||
NetworkProviderSimsCategoryController simCategoryPrefCtrl =
|
||||
new NetworkProviderSimsCategoryController(context, KEY_PREFERENCE_CATEGORY_SIM,
|
||||
@@ -92,8 +88,7 @@ public class MobileNetworkListFragment extends DashboardFragment {
|
||||
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
return SubscriptionUtil.isSimHardwareVisible(context) &&
|
||||
context.getSystemService(UserManager.class).isAdminUser();
|
||||
return context.getSystemService(UserManager.class).isAdminUser();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -120,10 +120,6 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings {
|
||||
|
||||
@Override
|
||||
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
||||
if (!SubscriptionUtil.isSimHardwareVisible(context)) {
|
||||
finish();
|
||||
return Arrays.asList();
|
||||
}
|
||||
if (getArguments() == null) {
|
||||
Intent intent = getIntent();
|
||||
if (intent != null) {
|
||||
@@ -402,8 +398,7 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings {
|
||||
/** suppress full page if user is not admin */
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
return SubscriptionUtil.isSimHardwareVisible(context) &&
|
||||
context.getSystemService(UserManager.class).isAdminUser();
|
||||
return context.getSystemService(UserManager.class).isAdminUser();
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -261,9 +261,6 @@ public class MobileNetworkUtils {
|
||||
* the user has enabled development mode.
|
||||
*/
|
||||
public static boolean showEuiccSettings(Context context) {
|
||||
if (!SubscriptionUtil.isSimHardwareVisible(context)) {
|
||||
return false;
|
||||
}
|
||||
long timeForAccess = SystemClock.elapsedRealtime();
|
||||
try {
|
||||
Boolean isShow = ((Future<Boolean>) ThreadUtils.postOnBackgroundThread(() -> {
|
||||
@@ -1013,10 +1010,6 @@ public class MobileNetworkUtils {
|
||||
}
|
||||
|
||||
public static void launchMobileNetworkSettings(Context context, SubscriptionInfo info) {
|
||||
if (!SubscriptionUtil.isSimHardwareVisible(context)) {
|
||||
Log.e(TAG, "launchMobileNetworkSettings fail, device without such UI.");
|
||||
return;
|
||||
}
|
||||
final int subId = info.getSubscriptionId();
|
||||
if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
Log.d(TAG, "launchMobileNetworkSettings fail, subId is invalid.");
|
||||
|
@@ -21,10 +21,8 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.UserManager;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -40,8 +38,6 @@ public class MobileNetworkListFragmentTest {
|
||||
@Mock
|
||||
private Context mContext;
|
||||
@Mock
|
||||
private Resources mResources;
|
||||
@Mock
|
||||
private UserManager mUserManager;
|
||||
|
||||
private MobileNetworkListFragment mFragment;
|
||||
@@ -59,9 +55,6 @@ public class MobileNetworkListFragmentTest {
|
||||
final BaseSearchIndexProvider provider =
|
||||
(BaseSearchIndexProvider) mFragment.SEARCH_INDEX_DATA_PROVIDER;
|
||||
|
||||
when(mContext.getResources()).thenReturn(mResources);
|
||||
when(mResources.getBoolean(R.bool.config_show_sim_info)).thenReturn(true);
|
||||
|
||||
final Object obj = ReflectionHelpers.callInstanceMethod(provider, "isPageSearchEnabled",
|
||||
ReflectionHelpers.ClassParameter.from(Context.class, mContext));
|
||||
final boolean isEnabled = (Boolean) obj;
|
||||
@@ -76,9 +69,6 @@ public class MobileNetworkListFragmentTest {
|
||||
final BaseSearchIndexProvider provider =
|
||||
(BaseSearchIndexProvider) mFragment.SEARCH_INDEX_DATA_PROVIDER;
|
||||
|
||||
when(mContext.getResources()).thenReturn(mResources);
|
||||
when(mResources.getBoolean(R.bool.config_show_sim_info)).thenReturn(true);
|
||||
|
||||
final Object obj = ReflectionHelpers.callInstanceMethod(provider, "isPageSearchEnabled",
|
||||
ReflectionHelpers.ClassParameter.from(Context.class, mContext));
|
||||
final boolean isEnabled = (Boolean) obj;
|
||||
|
@@ -29,7 +29,6 @@ import static org.mockito.Mockito.when;
|
||||
import android.app.Activity;
|
||||
import android.app.usage.NetworkStatsManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.net.NetworkPolicyManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserManager;
|
||||
@@ -38,7 +37,6 @@ import android.telephony.TelephonyManager;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.datausage.DataUsageSummaryPreferenceController;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
|
||||
@@ -70,18 +68,12 @@ public class MobileNetworkSettingsTest {
|
||||
private FragmentActivity mActivity;
|
||||
|
||||
private Context mContext;
|
||||
private Resources mResources;
|
||||
private MobileNetworkSettings mFragment;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mContext = spy(RuntimeEnvironment.application);
|
||||
|
||||
mResources = spy(mContext.getResources());
|
||||
when(mContext.getResources()).thenReturn(mResources);
|
||||
when(mResources.getBoolean(R.bool.config_show_sim_info)).thenReturn(true);
|
||||
|
||||
when(mActivity.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
|
||||
when(mTelephonyManager.createForSubscriptionId(anyInt())).thenReturn(mTelephonyManager);
|
||||
when(mContext.getSystemService(NetworkStatsManager.class)).thenReturn(mNetworkStatsManager);
|
||||
|
Reference in New Issue
Block a user