Merge "Disable Mobile settings in one condition." into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
421ca22a58
@@ -137,6 +137,8 @@ public class MobileNetworkSummaryController extends AbstractPreferenceController
|
||||
startAddSimFlow();
|
||||
return true;
|
||||
});
|
||||
} else {
|
||||
mPreference.setEnabled(false);
|
||||
}
|
||||
} else {
|
||||
// We have one or more existing subscriptions, so we want the plus button if eSIM is
|
||||
|
@@ -282,6 +282,18 @@ public class MobileNetworkSummaryControllerTest {
|
||||
assertThat(captor.getValue()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onResume_noSubscriptionEsimDisabled_isDisabled() {
|
||||
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 0);
|
||||
SubscriptionUtil.setAvailableSubscriptionsForTesting(null);
|
||||
when(mEuiccManager.isEnabled()).thenReturn(false);
|
||||
mController.displayPreference(mPreferenceScreen);
|
||||
|
||||
mController.onResume();
|
||||
|
||||
assertThat(mPreference.isEnabled()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onAirplaneModeChanged_oneSubscriptionAirplaneModeGetsTurnedOn_isDisabled() {
|
||||
final SubscriptionInfo sub1 = mock(SubscriptionInfo.class);
|
||||
|
Reference in New Issue
Block a user