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

Commit a2ab0269 authored by Hunsuk Choi's avatar Hunsuk Choi
Browse files

Update IRadioNetwork for Emergency Call domain selection HAL API changes.

Bug: 243344927
Test: build and flash
Change-Id: Iea7f8c5e8e30befd16637728a0a610c01e2140d3
parent 0192d596
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ java_library {
        "android.hardware.radio.data-V1-java",
        "android.hardware.radio.messaging-V1-java",
        "android.hardware.radio.modem-V1-java",
        "android.hardware.radio.network-V1-java",
        "android.hardware.radio.network-V2-java",
        "android.hardware.radio.sim-V1-java",
        "android.hardware.radio.voice-V1-java",
        "voip-common",
+23 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ public abstract class BaseCommands implements CommandsInterface {
    protected RegistrantList mBarringInfoChangedRegistrants = new RegistrantList();
    protected RegistrantList mSimPhonebookChangedRegistrants = new RegistrantList();
    protected RegistrantList mSimPhonebookRecordsReceivedRegistrants = new RegistrantList();
    protected RegistrantList mEmergencyNetworkScanRegistrants = new RegistrantList();

    @UnsupportedAppUsage
    protected Registrant mGsmSmsRegistrant;
@@ -1132,4 +1133,26 @@ public abstract class BaseCommands implements CommandsInterface {
    @Override
    public void updateSimPhonebookRecord(SimPhonebookRecord phonebookRecord, Message result) {
    }

    /**
     * Register for Emergency network scan result.
     *
     * @param h Handler for notification message.
     * @param what User-defined message code.
     * @param obj User object.
     */
    @Override
    public void registerForEmergencyNetworkScan(Handler h, int what, Object obj) {
        mEmergencyNetworkScanRegistrants.add(h, what, obj);
    }

    /**
     * Unregister for Emergency network scan result.
     *
     * @param h Handler to be removed from the registrant list.
     */
    @Override
    public void unregisterForEmergencyNetworkScan(Handler h) {
        mEmergencyNetworkScanRegistrants.remove(h);
    }
}
+16 −0
Original line number Diff line number Diff line
@@ -2761,4 +2761,20 @@ public interface CommandsInterface {
     * @param result Callback message containing the usage setting (or a failure status).
     */
    default void getUsageSetting(Message result) {}

    /**
     * Register for Emergency network scan result.
     *
     * @param h Handler for notification message.
     * @param what User-defined message code.
     * @param obj User object.
     */
    default void registerForEmergencyNetworkScan(Handler h, int what, Object obj) {}

    /**
     * Unregister for Emergency network scan result.
     *
     * @param h Handler to be removed from the registrant list.
     */
    default void unregisterForEmergencyNetworkScan(Handler h) {}
}
+18 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.telephony.TelephonyManager.UNKNOWN_CARRIER_ID;

import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_PRL_CHANGED;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CELL_INFO_LIST;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_EMERGENCY_NETWORK_SCAN_RESULT;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_LCEDATA_RECV;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_NETWORK_SCAN_RESULT;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_NITZ_TIME_RECEIVED;
@@ -380,6 +381,23 @@ public class NetworkIndication extends IRadioNetworkIndication.Stub {
                new AsyncResult(null, response, null));
    }

    /**
     * Emergency Scan Results.
     * @param indicationType Type of radio indication
     * @param result the result of the Emergency Network Scan
     */
    public void emergencyNetworkScanResult(int indicationType,
            android.hardware.radio.network.EmergencyRegResult result) {
        mRil.processIndication(RIL.NETWORK_SERVICE, indicationType);

        if (mRil.isLogOrTrace()) {
            mRil.unsljLogRet(RIL_UNSOL_EMERGENCY_NETWORK_SCAN_RESULT, result);
        }

        mRil.mEmergencyNetworkScanRegistrants.notifyRegistrants(
                new AsyncResult(null, result, null));
    }

    @Override
    public String getInterfaceHash() {
        return IRadioNetworkIndication.HASH;
+37 −0
Original line number Diff line number Diff line
@@ -436,6 +436,43 @@ public class NetworkResponse extends IRadioNetworkResponse.Stub {
        RadioResponse.responseInts(RIL.NETWORK_SERVICE, mRil, responseInfo, usageSetting);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     * @param regState the current registration state of the modem.
     */
    public void setEmergencyModeResponse(RadioResponseInfo responseInfo,
            android.hardware.radio.network.EmergencyRegResult regState) {
        RILRequest rr = mRil.processResponse(RIL.NETWORK_SERVICE, responseInfo);

        if (rr != null) {
            if (responseInfo.error == RadioError.NONE) {
                RadioResponse.sendMessageResponse(rr.mResult, regState);
            }
            mRil.processResponseDone(rr, responseInfo, regState);
        }
    }

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

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

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

    @Override
    public String getInterfaceHash() {
        return IRadioNetworkResponse.HASH;
Loading