[Settings] Replace getSimCount() API

Change design of monitor change in Settings.Global.MOBILE_DATA and
Settings.Global.DATA_ROAMING in order to avoid from accessing
getSimCount().

Bug: 144251589
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=RoamingPreferenceControllerTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=VideoCallingPreferenceControllerTest

Change-Id: I965a0c07c7c9ef5897b33809bae6a7921977db18
This commit is contained in:
Bonian Chen
2019-11-11 15:05:06 +08:00
parent be658e94f7
commit 31367d7a72
6 changed files with 142 additions and 110 deletions

View File

@@ -80,7 +80,7 @@ public class RoamingPreferenceControllerTest {
doReturn(mFragmentTransaction).when(mFragmentManager).beginTransaction();
mPreference = spy(new RestrictedSwitchPreference(mContext));
mController = new RoamingPreferenceController(mContext, "roaming");
mController = spy(new RoamingPreferenceController(mContext, "roaming"));
mController.init(mFragmentManager, SUB_ID);
mPreference.setKey(mController.getPreferenceKey());
}
@@ -118,7 +118,7 @@ public class RoamingPreferenceControllerTest {
@Test
public void handlePreferenceTreeClick_needDialog_showDialog() {
mController.mNeedDialog = true;
doReturn(true).when(mController).isDialogNeeded();
mController.handlePreferenceTreeClick(mPreference);

View File

@@ -83,6 +83,8 @@ public class VideoCallingPreferenceControllerTest {
doReturn(true).when(mImsManager).isVtProvisionedOnDevice();
doReturn(ImsFeature.STATE_READY).when(mImsManager).getImsServiceState();
doReturn(true).when(mTelephonyManager).isDataEnabled();
mController.mCallState = TelephonyManager.CALL_STATE_IDLE;
}
@Test