The Network name is not same as statusbar at SIM Edit page

Using subscriptionInfo to get the network name.

Bug: 203035698
Bug: 201591202
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=RenameMobileNetworkDialogFragmentTest (PASS)

Change-Id: I84848a2801172b46f7cc3ff39d88ad57e34514a4
(cherry picked from commit 050b6d5224)
This commit is contained in:
SongFerngWang
2021-10-14 18:54:52 +08:00
committed by Android Build Coastguard Worker
parent 435c3385f6
commit b172582c14
2 changed files with 2 additions and 10 deletions

View File

@@ -31,7 +31,6 @@ import static org.mockito.Mockito.when;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.telephony.ServiceState;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
@@ -73,8 +72,6 @@ public class RenameMobileNetworkDialogFragmentTest {
@Mock
private TelephonyManager mTelephonyMgr;
@Mock
private ServiceState mServiceState;
@Mock
private SubscriptionManager mSubscriptionMgr;
@Mock
private SubscriptionInfo mSubscriptionInfo;
@@ -95,11 +92,9 @@ public class RenameMobileNetworkDialogFragmentTest {
stm.setTelephonyManagerForSubscriptionId(mSubscriptionId, mTelephonyMgr);
when(mTelephonyMgr.createForSubscriptionId(anyInt())).thenReturn(mTelephonyMgr);
when(mTelephonyMgr.getServiceState()).thenReturn(mServiceState);
when(mServiceState.getOperatorAlphaLong()).thenReturn("fake carrier name");
when(mSubscriptionInfo.getSubscriptionId()).thenReturn(mSubscriptionId);
when(mSubscriptionInfo.getDisplayName()).thenReturn("test");
when(mSubscriptionInfo.getCarrierName()).thenReturn("fake carrier name");
when(mSubscriptionMgr.setDisplayName(any(), anyInt(), anyInt())).thenReturn(0);
mActivity = spy(Robolectric.buildActivity(FragmentActivity.class).setup().get());