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

Commit f941a192 authored by Jordan Liu's avatar Jordan Liu Committed by android-build-merger
Browse files

Merge "Display "No service" on status bar when SIM unready"

am: 182b81be

Change-Id: Ia5c74607a680e177d7e839f93331244afba19fc4
parents 2230c5f8 182b81be
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -452,6 +452,10 @@ public class ServiceStateTracker extends Handler {
    public static final int CS_NOTIFICATION = 999;  // Id to update and cancel CS restricted
    public static final int CS_REJECT_CAUSE_NOTIFICATION = 111; // Id to update and cancel MM
                                                                // rejection cause

    /** To identify whether EVENT_SIM_READY is received or not */
    private boolean mIsSimReady = false;

    private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
@@ -1064,6 +1068,11 @@ public class ServiceStateTracker extends Handler {

            case EVENT_ICC_CHANGED:
                onUpdateIccAvailability();
                if (mUiccApplcation != null
                        && mUiccApplcation.getState() != AppState.APPSTATE_READY) {
                    mIsSimReady = false;
                    updateSpnDisplay();
                }
                break;

            case EVENT_GET_CELL_INFO_LIST: {
@@ -1121,6 +1130,7 @@ public class ServiceStateTracker extends Handler {
                // Reset the mPreviousSubId so we treat a SIM power bounce
                // as a first boot.  See b/19194287
                mOnSubscriptionsChangedListener.mPreviousSubId.set(-1);
                mIsSimReady = true;
                pollState();
                // Signal strength polling stops when radio is off
                queueNextSignalStrengthPoll();
@@ -2222,7 +2232,12 @@ public class ServiceStateTracker extends Handler {
            if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE
                    || combinedRegState == ServiceState.STATE_EMERGENCY_ONLY) {
                showPlmn = true;
                if (mEmergencyOnly) {

                // Force display no service
                final boolean forceDisplayNoService = mPhone.getContext().getResources().getBoolean(
                        com.android.internal.R.bool.config_display_no_service_when_sim_unready)
                                && !mIsSimReady;
                if (mEmergencyOnly && !forceDisplayNoService) {
                    // No service but emergency call allowed
                    plmn = Resources.getSystem().
                            getText(com.android.internal.R.string.emergency_calls_only).toString();