@Override
  protected void processUnsolicited(Parcel p) {
    Object ret;
    int dataPosition = p.dataPosition(); // save off position within the Parcel
    int response = p.readInt();

    switch (response) {
      case RIL_UNSOL_RIL_CONNECTED: // Fix for NV/RUIM setting on CDMA SIM devices
        // skip getcdmascriptionsource as if qualcomm handles it in the ril binary
        ret = responseInts(p);
        setRadioPower(false, null);
        setPreferredNetworkType(mPreferredNetworkType, null);
        int cdmaSubscription =
            Settings.Global.getInt(
                mContext.getContentResolver(), Settings.Global.CDMA_SUBSCRIPTION_MODE, -1);
        if (cdmaSubscription != -1) {
          setCdmaSubscriptionSource(mCdmaSubscription, null);
        }
        setCellInfoListRate(Integer.MAX_VALUE, null);
        notifyRegistrantsRilConnectionChanged(((int[]) ret)[0]);
        break;
      case RIL_UNSOL_NITZ_TIME_RECEIVED:
        handleNitzTimeReceived(p);
        break;
        // SAMSUNG STATES
      case SamsungExynos4RIL.RIL_UNSOL_AM:
        ret = responseString(p);
        String amString = (String) ret;
        Rlog.d(RILJ_LOG_TAG, "Executing AM: " + amString);

        try {
          Runtime.getRuntime().exec("am " + amString);
        } catch (IOException e) {
          e.printStackTrace();
          Rlog.e(RILJ_LOG_TAG, "am " + amString + " could not be executed.");
        }
        break;
      case SamsungExynos4RIL.RIL_UNSOL_RESPONSE_HANDOVER:
        ret = responseVoid(p);
        break;
      case 1036:
        ret = responseVoid(p);
        break;
      case SamsungExynos4RIL.RIL_UNSOL_WB_AMR_STATE:
        ret = responseInts(p);
        setWbAmr(((int[]) ret)[0]);
        break;
      default:
        // Rewind the Parcel
        p.setDataPosition(dataPosition);

        // Forward responses that we are not overriding to the super class
        super.processUnsolicited(p);
        return;
    }
  }
  @Override
  protected void processUnsolicited(Parcel p) {
    Object ret;
    int dataPosition = p.dataPosition();
    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
      case RIL_UNSOL_AM:
        ret = responseString(p);
        break;
      case RIL_UNSOL_DUN_PIN_CONTROL_SIGNAL:
        ret = responseVoid(p);
        break;
      case RIL_UNSOL_DATA_SUSPEND_RESUME:
        ret = responseInts(p);
        break;
      case RIL_UNSOL_STK_CALL_CONTROL_RESULT:
        ret = responseVoid(p);
        break;
      case RIL_UNSOL_TWO_MIC_STATE:
        ret = responseInts(p);
        break;
      case RIL_UNSOL_WB_AMR_STATE:
        ret = responseInts(p);
        break;

      default:
        // Rewind the Parcel
        p.setDataPosition(dataPosition);

        // Forward responses that we are not overriding to the super class
        super.processUnsolicited(p);
        return;
    }

    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);

        if (mGsmBroadcastSmsRegistrant != null) {
          mGsmBroadcastSmsRegistrant.notifyRegistrant(new AsyncResult(null, ret, null));
        }
        break;
      case RIL_UNSOL_RIL_CONNECTED:
        if (RILJ_LOGD) unsljLogRet(response, ret);

        // Initial conditions
        setRadioPower(false, null);
        sendPreferedNetworktype(mPreferredNetworkType, null);
        setCdmaSubscriptionSource(mCdmaSubscription, null);
        notifyRegistrantsRilConnectionChanged(((int[]) ret)[0]);
        break;
        // SAMSUNG STATES
      case RIL_UNSOL_AM:
        if (RILJ_LOGD) samsungUnsljLogRet(response, ret);
        String amString = (String) ret;
        Log.d(LOG_TAG, "Executing AM: " + amString);

        try {
          Runtime.getRuntime().exec("am " + amString);
        } catch (IOException e) {
          e.printStackTrace();
          Log.e(LOG_TAG, "am " + amString + " could not be executed.");
        }
        break;
      case RIL_UNSOL_DUN_PIN_CONTROL_SIGNAL:
        if (RILJ_LOGD) samsungUnsljLogRet(response, ret);
        break;
      case RIL_UNSOL_DATA_SUSPEND_RESUME:
        if (RILJ_LOGD) samsungUnsljLogRet(response, ret);
        break;
      case RIL_UNSOL_STK_CALL_CONTROL_RESULT:
        if (RILJ_LOGD) samsungUnsljLogRet(response, ret);
        break;
      case RIL_UNSOL_TWO_MIC_STATE:
        if (RILJ_LOGD) samsungUnsljLogRet(response, ret);
        break;
      case RIL_UNSOL_WB_AMR_STATE:
        if (RILJ_LOGD) samsungUnsljLogRet(response, ret);
        setWbAmr(((int[]) ret)[0]);
        break;
    }
  }