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

Commit dc4e9dff authored by codeworkx's avatar codeworkx
Browse files

SamsungExynos4RIL: fixup radio states, notify on PIN-unlock

Change-Id: Id512e61d383ccc0df8ca1a6c398adce80d917a5d
parent 16c247df
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -556,6 +556,7 @@ public class SamsungExynos4RIL extends RIL implements CommandsInterface {
        int response = p.readInt();

        switch (response) {
            case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED: ret =  responseVoid(p); break;
            case RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS: ret = responseString(p); break;
            case RIL_UNSOL_RIL_CONNECTED: ret = responseInts(p); break;
            // SAMSUNG STATES
@@ -576,6 +577,35 @@ public class SamsungExynos4RIL extends RIL implements CommandsInterface {
        }

        switch (response) {
            case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED:
                /* has bonus radio state int */
                int state = p.readInt();
                Log.d(LOG_TAG, "Radio state: " + state);

                switch (state) {
                    case 2:
                        // RADIO_UNAVAILABLE
                        state = 1;
                        break;
                    case 3:
                        // RADIO_ON
                        state = 10;
                        break;
                    case 4:
                        // RADIO_ON
                        state = 10;
                        // When SIM is PIN-unlocked, RIL doesn't respond with RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED.
                        // We notify the system here.
                        Log.d(LOG_TAG, "SIM is PIN-unlocked now");
                        if (mIccStatusChangedRegistrants != null) {
                            mIccStatusChangedRegistrants.notifyRegistrants();
                        }
                        break;
                }
                RadioState newState = getRadioStateFromInt(state);
                Log.d(LOG_TAG, "New Radio state: " + state + " (" + newState.toString() + ")");
                switchToRadioState(newState);
                break;
            case RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS:
                if (RILJ_LOGD) unsljLogRet(response, ret);