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

Commit a72deb37 authored by Jeremy Goldman's avatar Jeremy Goldman Committed by Automerger Merge Worker
Browse files

Merge "Null check added when updating the roaming status." into sc-dev am: e6880595

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15007771

Change-Id: I6d16a6d94b2ff98d2382f0edf0a6b572fc2c8551
parents 673ee6ed e6880595
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -38,7 +38,6 @@ import android.telephony.CellBroadcastIntents;
import android.telephony.CellBroadcastService;
import android.telephony.CellBroadcastService;
import android.telephony.CellSignalStrength;
import android.telephony.CellSignalStrength;
import android.telephony.ICellBroadcastService;
import android.telephony.ICellBroadcastService;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionInfo;
@@ -245,6 +244,8 @@ public class SimStatusDialogController implements LifecycleObserver {
    private void updateSubscriptionStatus() {
    private void updateSubscriptionStatus() {
        updateNetworkProvider();
        updateNetworkProvider();


        // getServiceState() may return null when the subscription is inactive
        // or when there was an error communicating with the phone process.
        final ServiceState serviceState = mTelephonyManager.getServiceState();
        final ServiceState serviceState = mTelephonyManager.getServiceState();
        final SignalStrength signalStrength = mTelephonyManager.getSignalStrength();
        final SignalStrength signalStrength = mTelephonyManager.getSignalStrength();


@@ -577,7 +578,10 @@ public class SimStatusDialogController implements LifecycleObserver {
    }
    }


    private void updateRoamingStatus(ServiceState serviceState) {
    private void updateRoamingStatus(ServiceState serviceState) {
        if (serviceState.getRoaming()) {
        // If the serviceState is null, we assume that roaming is disabled.
        if (serviceState == null) {
            mDialog.setText(ROAMING_INFO_VALUE_ID, mRes.getString(R.string.radioInfo_unknown));
        } else if (serviceState.getRoaming()) {
            mDialog.setText(ROAMING_INFO_VALUE_ID, mRes.getString(R.string.radioInfo_roaming_in));
            mDialog.setText(ROAMING_INFO_VALUE_ID, mRes.getString(R.string.radioInfo_roaming_in));
        } else {
        } else {
            mDialog.setText(ROAMING_INFO_VALUE_ID, mRes.getString(R.string.radioInfo_roaming_not));
            mDialog.setText(ROAMING_INFO_VALUE_ID, mRes.getString(R.string.radioInfo_roaming_not));