[Settings] Replace #getServiceStateForSubscriber with #getServiceState

Bug: 146821501
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=RenameMobileNetworkDialogFragmentTest
Change-Id: I8a1819b70a8d4ec56ae40f2b8b613bcd65a12b11
This commit is contained in:
zoey chen
2019-12-24 17:42:13 +08:00
parent 1a2b56bd80
commit e9c59f5fad
2 changed files with 4 additions and 2 deletions

View File

@@ -149,7 +149,8 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen
}
final TextView operatorName = view.findViewById(R.id.operator_name_value);
final ServiceState serviceState = mTelephonyManager.getServiceStateForSubscriber(mSubId);
mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubId);
final ServiceState serviceState = mTelephonyManager.getServiceState();
operatorName.setText(serviceState.getOperatorAlphaLong());
final TextView phoneTitle = view.findViewById(R.id.number_label);

View File

@@ -86,7 +86,8 @@ public class RenameMobileNetworkDialogFragmentTest {
final ServiceState serviceState = mock(ServiceState.class);
when(serviceState.getOperatorAlphaLong()).thenReturn("fake carrier name");
when(mTelephonyMgr.getServiceStateForSubscriber(mSubscriptionId)).thenReturn(serviceState);
when(mTelephonyMgr.createForSubscriptionId(anyInt())).thenReturn(mTelephonyMgr);
when(mTelephonyMgr.getServiceState()).thenReturn(serviceState);
}
@Test