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

Commit 6988247a authored by Sarah Chin's avatar Sarah Chin Committed by Gerrit Code Review
Browse files

Merge "RIL changes for IRadio APIs"

parents 6c5a843f db998a52
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.internal.telephony;

import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_ON_USSD;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_CDMA_NEW_SMS;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS;
@@ -143,25 +142,6 @@ public class MessagingIndication extends IRadioMessagingIndication.Stub {
        }
    }

    /**
     * Indicates when a new USSD message is received. The USSD session is assumed to persist if the
     * type code is REQUEST, otherwise the current session (if any) is assumed to have terminated.
     * @param indicationType Type of radio indication
     * @param ussdModeType USSD type code
     * @param msg Message string in UTF-8, if applicable
     */
    public void onUssd(int indicationType, int ussdModeType, String msg) {
        mRil.processIndication(RIL.MESSAGING_SERVICE, indicationType);

        if (RIL.RILJ_LOGD) mRil.unsljLogMore(RIL_UNSOL_ON_USSD, "" + ussdModeType);

        // TODO: Clean this up with a parcelable class for better self-documentation
        String[] resp = new String[]{"" + ussdModeType, msg};
        if (mRil.mUSSDRegistrant != null) {
            mRil.mUSSDRegistrant.notifyRegistrant(new AsyncResult(null, resp, null));
        }
    }

    /**
     * Indicates that SMS storage on the SIM is full. Sent when the network attempts to deliver a
     * new SMS message. Messages cannot be saved on the SIM until space is freed. In particular,
+0 −14
Original line number Diff line number Diff line
@@ -79,13 +79,6 @@ public class MessagingResponse extends IRadioMessagingResponse.Stub {
        RadioResponse.responseVoid(RIL.MESSAGING_SERVICE, mRil, responseInfo);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void cancelPendingUssdResponse(RadioResponseInfo responseInfo) {
        RadioResponse.responseVoid(RIL.MESSAGING_SERVICE, mRil, responseInfo);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
@@ -230,13 +223,6 @@ public class MessagingResponse extends IRadioMessagingResponse.Stub {
        responseSms(responseInfo, sms);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void sendUssdResponse(RadioResponseInfo responseInfo) {
        RadioResponse.responseVoid(RIL.MESSAGING_SERVICE, mRil, responseInfo);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
+0 −30
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.internal.telephony;

import android.content.Context;
import android.hardware.radio.RadioError;
import android.hardware.radio.RadioResponseInfo;
import android.hardware.radio.network.IRadioNetworkResponse;
@@ -24,11 +23,8 @@ import android.os.AsyncResult;
import android.telephony.BarringInfo;
import android.telephony.CellInfo;
import android.telephony.LinkCapacityEstimate;
import android.telephony.NeighboringCellInfo;
import android.telephony.RadioAccessSpecifier;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;

import java.util.ArrayList;
import java.util.List;
@@ -170,32 +166,6 @@ public class NetworkResponse extends IRadioNetworkResponse.Stub {
                        ? PhoneConstants.PHONE_TYPE_GSM : PhoneConstants.PHONE_TYPE_CDMA);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     * @param cells Vector of neighboring radio cell information
     */
    public void getNeighboringCidsResponse(RadioResponseInfo responseInfo,
            android.hardware.radio.network.NeighboringCell[] cells) {
        RILRequest rr = mRil.processResponse(RIL.NETWORK_SERVICE, responseInfo);

        if (rr != null) {
            ArrayList<NeighboringCellInfo> ret = new ArrayList<>();
            int[] subId = SubscriptionManager.getSubId(mRil.mPhoneId);
            int radioType = ((TelephonyManager) mRil.mContext.getSystemService(
                    Context.TELEPHONY_SERVICE)).getDataNetworkType(subId[0]);

            if (radioType != TelephonyManager.NETWORK_TYPE_UNKNOWN) {
                for (android.hardware.radio.network.NeighboringCell cell : cells) {
                    ret.add(new NeighboringCellInfo(cell.rssi, cell.cid, radioType));
                }
            }
            if (responseInfo.error == RadioError.NONE) {
                RadioResponse.sendMessageResponse(rr.mResult, ret);
            }
            mRil.processResponseDone(rr, responseInfo, ret);
        }
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     * @param selection false for automatic selection, true for manual selection
+10 −10
Original line number Diff line number Diff line
@@ -2035,9 +2035,9 @@ public class RIL extends BaseCommands implements CommandsInterface {

    @Override
    public void sendUSSD(String ussd, Message result) {
        RadioMessagingProxy messagingProxy =
                getRadioServiceProxy(RadioMessagingProxy.class, result);
        if (!messagingProxy.isEmpty()) {
        RadioVoiceProxy voiceProxy =
                getRadioServiceProxy(RadioVoiceProxy.class, result);
        if (!voiceProxy.isEmpty()) {
            RILRequest rr = obtainRequest(RIL_REQUEST_SEND_USSD, result, mRILDefaultWorkSource);

            if (RILJ_LOGD) {
@@ -2048,18 +2048,18 @@ public class RIL extends BaseCommands implements CommandsInterface {
            }

            try {
                messagingProxy.sendUssd(rr.mSerial, RILUtils.convertNullToEmptyString(ussd));
                voiceProxy.sendUssd(rr.mSerial, RILUtils.convertNullToEmptyString(ussd));
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(MESSAGING_SERVICE, "sendUSSD", e);
                handleRadioProxyExceptionForRR(VOICE_SERVICE, "sendUssd", e);
            }
        }
    }

    @Override
    public void cancelPendingUssd(Message result) {
        RadioMessagingProxy messagingProxy =
                getRadioServiceProxy(RadioMessagingProxy.class, result);
        if (!messagingProxy.isEmpty()) {
        RadioVoiceProxy voiceProxy =
                getRadioServiceProxy(RadioVoiceProxy.class, result);
        if (!voiceProxy.isEmpty()) {
            RILRequest rr = obtainRequest(RIL_REQUEST_CANCEL_USSD, result, mRILDefaultWorkSource);

            if (RILJ_LOGD) {
@@ -2067,9 +2067,9 @@ public class RIL extends BaseCommands implements CommandsInterface {
            }

            try {
                messagingProxy.cancelPendingUssd(rr.mSerial);
                voiceProxy.cancelPendingUssd(rr.mSerial);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(MESSAGING_SERVICE, "cancelPendingUssd", e);
                handleRadioProxyExceptionForRR(VOICE_SERVICE, "cancelPendingUssd", e);
            }
        }
    }
+0 −29
Original line number Diff line number Diff line
@@ -131,20 +131,6 @@ public class RadioMessagingProxy extends RadioServiceProxy {
        }
    }

    /**
     * Call IRadioMessaging#cancelPendingUssd
     * @param serial Serial number of request
     * @throws RemoteException
     */
    public void cancelPendingUssd(int serial) throws RemoteException {
        if (isEmpty()) return;
        if (isAidl()) {
            mMessagingProxy.cancelPendingUssd(serial);
        } else {
            mRadioProxy.cancelPendingUssd(serial);
        }
    }

    /**
     * Call IRadioMessaging#deleteSmsOnRuim
     * @param serial Serial number of request
@@ -373,21 +359,6 @@ public class RadioMessagingProxy extends RadioServiceProxy {
        }
    }

    /**
     * Call IRadioMessaging#sendUssd
     * @param serial Serial number of request
     * @param ussd String containing the USSD request in UTF-8 format
     * @throws RemoteException
     */
    public void sendUssd(int serial, String ussd) throws RemoteException {
        if (isEmpty()) return;
        if (isAidl()) {
            mMessagingProxy.sendUssd(serial, ussd);
        } else {
            mRadioProxy.sendUssd(serial, ussd);
        }
    }

    /**
     * Call IRadioMessaging#setCdmaBroadcastActivation
     * @param serial Serial number of request
Loading