Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af8b841a authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [16055430] into sc-qpr1-d-release.

Change-Id: I11a729789a7e403d6c646dfa411d1c520fe86acc
parents 90ba7e19 d88382cf
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.graphics.Paint;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Bundle;
import android.telephony.ServiceState;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
@@ -52,7 +51,6 @@ import com.android.settingslib.DeviceInfoUtils;

import com.google.common.collect.ImmutableMap;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

@@ -180,8 +178,7 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen

        final TextView operatorName = view.findViewById(R.id.operator_name_value);
        mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubId);
        final ServiceState serviceState = mTelephonyManager.getServiceState();
        operatorName.setText(serviceState == null ? "" : serviceState.getOperatorAlphaLong());
        operatorName.setText(info.getCarrierName());

        final TextView phoneTitle = view.findViewById(R.id.number_label);
        phoneTitle.setVisibility(info.isOpportunistic() ? View.GONE : View.VISIBLE);
+1 −6
Original line number Diff line number Diff line
@@ -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());