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

Commit d78dad16 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 am: f941a192

am: 2665d8b4

Change-Id: I29a3afb1b1dfed01e2d9e3ca3e616104e8b09747
parents 09689a68 2665d8b4
Loading
Loading
Loading
Loading
+16 −1
Original line number Original line Diff line number Diff line
@@ -460,6 +460,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_NOTIFICATION = 999;  // Id to update and cancel CS restricted
    public static final int CS_REJECT_CAUSE_NOTIFICATION = 111; // Id to update and cancel MM
    public static final int CS_REJECT_CAUSE_NOTIFICATION = 111; // Id to update and cancel MM
                                                                // rejection cause
                                                                // rejection cause

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

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


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


            case EVENT_GET_CELL_INFO_LIST: {
            case EVENT_GET_CELL_INFO_LIST: {
@@ -1129,6 +1138,7 @@ public class ServiceStateTracker extends Handler {
                // Reset the mPreviousSubId so we treat a SIM power bounce
                // Reset the mPreviousSubId so we treat a SIM power bounce
                // as a first boot.  See b/19194287
                // as a first boot.  See b/19194287
                mOnSubscriptionsChangedListener.mPreviousSubId.set(-1);
                mOnSubscriptionsChangedListener.mPreviousSubId.set(-1);
                mIsSimReady = true;
                pollState();
                pollState();
                // Signal strength polling stops when radio is off
                // Signal strength polling stops when radio is off
                queueNextSignalStrengthPoll();
                queueNextSignalStrengthPoll();
@@ -2235,7 +2245,12 @@ public class ServiceStateTracker extends Handler {
            if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE
            if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE
                    || combinedRegState == ServiceState.STATE_EMERGENCY_ONLY) {
                    || combinedRegState == ServiceState.STATE_EMERGENCY_ONLY) {
                showPlmn = true;
                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
                    // No service but emergency call allowed
                    plmn = Resources.getSystem().
                    plmn = Resources.getSystem().
                            getText(com.android.internal.R.string.emergency_calls_only).toString();
                            getText(com.android.internal.R.string.emergency_calls_only).toString();