[Mainline] Use isActiveSubscriptionId instead of isActiveSubId for mainline
Bug: 147206736 Test: make RunSettingsRoboTests ROBOTEST_FILTER=DisabledSubscriptionControllerTest make RunSettingsRoboTests ROBOTEST_FILTER=MobileNetworkSwitchControllerTest make RunSettingsRoboTests ROBOTEST_FILTER=SimSelectNotificationTest Merged-In: If740c2d7ea2c1392d5fe538091ea6e5c4575ad26 Change-Id: Idca7a76c591448a45ecc33cb392f416c70d32f91
This commit is contained in:
@@ -109,7 +109,7 @@ public class MobileNetworkSwitchControllerTest {
|
||||
|
||||
@Test
|
||||
public void displayPreference_oneEnabledSubscription_switchBarNotHidden() {
|
||||
doReturn(true).when(mSubscriptionManager).isActiveSubId(mSubId);
|
||||
doReturn(true).when(mSubscriptionManager).isActiveSubscriptionId(mSubId);
|
||||
SubscriptionUtil.setAvailableSubscriptionsForTesting(Arrays.asList(mSubscription));
|
||||
mController.displayPreference(mScreen);
|
||||
assertThat(mSwitchBar.isShowing()).isTrue();
|
||||
@@ -117,7 +117,7 @@ public class MobileNetworkSwitchControllerTest {
|
||||
|
||||
@Test
|
||||
public void displayPreference_oneDisabledSubscription_switchBarNotHidden() {
|
||||
doReturn(false).when(mSubscriptionManager).isActiveSubId(mSubId);
|
||||
doReturn(false).when(mSubscriptionManager).isActiveSubscriptionId(mSubId);
|
||||
SubscriptionUtil.setAvailableSubscriptionsForTesting(Arrays.asList(mSubscription));
|
||||
mController.displayPreference(mScreen);
|
||||
assertThat(mSwitchBar.isShowing()).isTrue();
|
||||
@@ -125,7 +125,7 @@ public class MobileNetworkSwitchControllerTest {
|
||||
|
||||
@Test
|
||||
public void displayPreference_subscriptionEnabled_switchIsOn() {
|
||||
when(mSubscriptionManager.isActiveSubId(mSubId)).thenReturn(true);
|
||||
when(mSubscriptionManager.isActiveSubscriptionId(mSubId)).thenReturn(true);
|
||||
mController.displayPreference(mScreen);
|
||||
assertThat(mSwitchBar.isShowing()).isTrue();
|
||||
assertThat(mSwitchBar.isChecked()).isTrue();
|
||||
@@ -133,7 +133,7 @@ public class MobileNetworkSwitchControllerTest {
|
||||
|
||||
@Test
|
||||
public void displayPreference_subscriptionDisabled_switchIsOff() {
|
||||
when(mSubscriptionManager.isActiveSubId(mSubId)).thenReturn(false);
|
||||
when(mSubscriptionManager.isActiveSubscriptionId(mSubId)).thenReturn(false);
|
||||
mController.displayPreference(mScreen);
|
||||
assertThat(mSwitchBar.isShowing()).isTrue();
|
||||
assertThat(mSwitchBar.isChecked()).isFalse();
|
||||
@@ -141,7 +141,7 @@ public class MobileNetworkSwitchControllerTest {
|
||||
|
||||
@Test
|
||||
public void switchChangeListener_fromEnabledToDisabled_setSubscriptionEnabledCalledCorrectly() {
|
||||
when(mSubscriptionManager.isActiveSubId(mSubId)).thenReturn(true);
|
||||
when(mSubscriptionManager.isActiveSubscriptionId(mSubId)).thenReturn(true);
|
||||
mController.displayPreference(mScreen);
|
||||
assertThat(mSwitchBar.isShowing()).isTrue();
|
||||
assertThat(mSwitchBar.isChecked()).isTrue();
|
||||
@@ -153,7 +153,7 @@ public class MobileNetworkSwitchControllerTest {
|
||||
public void switchChangeListener_fromEnabledToDisabled_setSubscriptionEnabledFailed() {
|
||||
when(mSubscriptionManager.setSubscriptionEnabled(eq(mSubId), anyBoolean()))
|
||||
.thenReturn(false);
|
||||
when(mSubscriptionManager.isActiveSubId(mSubId)).thenReturn(true);
|
||||
when(mSubscriptionManager.isActiveSubscriptionId(mSubId)).thenReturn(true);
|
||||
mController.displayPreference(mScreen);
|
||||
assertThat(mSwitchBar.isShowing()).isTrue();
|
||||
assertThat(mSwitchBar.isChecked()).isTrue();
|
||||
@@ -164,7 +164,7 @@ public class MobileNetworkSwitchControllerTest {
|
||||
|
||||
@Test
|
||||
public void switchChangeListener_fromDisabledToEnabled_setSubscriptionEnabledCalledCorrectly() {
|
||||
when(mSubscriptionManager.isActiveSubId(mSubId)).thenReturn(false);
|
||||
when(mSubscriptionManager.isActiveSubscriptionId(mSubId)).thenReturn(false);
|
||||
mController.displayPreference(mScreen);
|
||||
assertThat(mSwitchBar.isShowing()).isTrue();
|
||||
assertThat(mSwitchBar.isChecked()).isFalse();
|
||||
|
@@ -117,7 +117,7 @@ public class SimSelectNotificationTest {
|
||||
|
||||
when(mTelephonyManager.createForSubscriptionId(anyInt())).thenReturn(mTelephonyManager);
|
||||
when(mTelephonyManager.isDataEnabledForApn(TYPE_MMS)).thenReturn(false);
|
||||
when(mSubscriptionManager.isActiveSubId(mSubId)).thenReturn(true);
|
||||
when(mSubscriptionManager.isActiveSubscriptionId(mSubId)).thenReturn(true);
|
||||
when(mSubscriptionManager.getActiveSubscriptionInfo(mSubId)).thenReturn(mSubInfo);
|
||||
when(mSubInfo.getDisplayName()).thenReturn(mFakeDisplayName);
|
||||
when(mContext.getResources()).thenReturn(mResources);
|
||||
|
Reference in New Issue
Block a user