Merge "[Settings] Replace #getServiceStateForSubscriber with #getServiceState"

This commit is contained in:
Zoey Chen
2019-12-26 13:44:58 +00:00
committed by Gerrit Code Review
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 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()); operatorName.setText(serviceState.getOperatorAlphaLong());
final TextView phoneTitle = view.findViewById(R.id.number_label); final TextView phoneTitle = view.findViewById(R.id.number_label);

View File

@@ -86,7 +86,8 @@ public class RenameMobileNetworkDialogFragmentTest {
final ServiceState serviceState = mock(ServiceState.class); final ServiceState serviceState = mock(ServiceState.class);
when(serviceState.getOperatorAlphaLong()).thenReturn("fake carrier name"); 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 @Test