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

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

Merge "Add response and indication for CellInfo"

parents de029072 670850c1
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -6493,6 +6493,23 @@ public class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    /**
     * Convert CellInfo defined in 1.5/types.hal to CellInfo type.
     * @param records List of CellInfo defined in 1.5/types.hal.
     * @return List of converted CellInfo object.
     */
    @VisibleForTesting
    public static ArrayList<CellInfo> convertHalCellInfoList_1_5(
            ArrayList<android.hardware.radio.V1_5.CellInfo> records) {
        ArrayList<CellInfo> response = new ArrayList<>(records.size());

        final long nanotime = SystemClock.elapsedRealtimeNanos();
        for (android.hardware.radio.V1_5.CellInfo record : records) {
            response.add(CellInfo.create(record, nanotime));
        }
        return response;
    }

    /**
     * Convert SetupDataCallResult defined in 1.0, 1.4, or 1.5 types.hal into DataCallResponse
     * @param dcResult setup data call result
+28 −0
Original line number Diff line number Diff line
@@ -758,6 +758,18 @@ public class RadioIndication extends IRadioIndication.Stub {
        mRil.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
    }

    /** Get unsolicited message for cellInfoList using HAL V1_5 */
    public void cellInfoList_1_5(int indicationType,
            ArrayList<android.hardware.radio.V1_5.CellInfo> records) {
        mRil.processIndication(indicationType);

        ArrayList<CellInfo> response = RIL.convertHalCellInfoList_1_5(records);

        if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CELL_INFO_LIST, response);

        mRil.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
    }

    /** Get unsolicited message for uicc applications enablement changes. */
    public void uiccApplicationsEnablementChanged(int indicationType, boolean enabled) {
        mRil.processIndication(indicationType);
@@ -787,6 +799,12 @@ public class RadioIndication extends IRadioIndication.Stub {
        responseNetworkScan_1_4(indicationType, result);
    }

    /** Incremental network scan results with HAL V1_5 */
    public void networkScanResult_1_5(int indicationType,
            android.hardware.radio.V1_5.NetworkScanResult result) {
        responseNetworkScan_1_5(indicationType, result);
    }

    public void imsNetworkStateChanged(int indicationType) {
        mRil.processIndication(indicationType);

@@ -1140,6 +1158,16 @@ public class RadioIndication extends IRadioIndication.Stub {
        mRil.mRilNetworkScanResultRegistrants.notifyRegistrants(new AsyncResult(null, nsr, null));
    }

    private void responseNetworkScan_1_5(int indicationType,
            android.hardware.radio.V1_5.NetworkScanResult result) {
        mRil.processIndication(indicationType);

        ArrayList<CellInfo> cellInfos = RIL.convertHalCellInfoList_1_5(result.networkInfos);
        NetworkScanResult nsr = new NetworkScanResult(result.status, result.error, cellInfos);
        if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_NETWORK_SCAN_RESULT, nsr);
        mRil.mRilNetworkScanResultRegistrants.notifyRegistrants(new AsyncResult(null, nsr, null));
    }

    private void responseDataCallListChanged(int indicationType, List<?> dcList) {
        mRil.processIndication(indicationType);

+23 −0
Original line number Diff line number Diff line
@@ -1178,6 +1178,16 @@ public class RadioResponse extends IRadioResponse.Stub {
        responseCellInfoList_1_4(responseInfo, cellInfo);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error.
     * @param cellInfo List of current cell information known to radio.
     */
    public void getCellInfoListResponse_1_5(
            RadioResponseInfo responseInfo,
            ArrayList<android.hardware.radio.V1_5.CellInfo> cellInfo) {
        responseCellInfoList_1_5(responseInfo, cellInfo);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
@@ -2310,6 +2320,19 @@ public class RadioResponse extends IRadioResponse.Stub {
        }
    }

    private void responseCellInfoList_1_5(RadioResponseInfo responseInfo,
            ArrayList<android.hardware.radio.V1_5.CellInfo> cellInfo) {
        RILRequest rr = mRil.processResponse(responseInfo);

        if (rr != null) {
            ArrayList<CellInfo> ret = RIL.convertHalCellInfoList_1_5(cellInfo);
            if (responseInfo.error == RadioError.NONE) {
                sendMessageResponse(rr.mResult, ret);
            }
            mRil.processResponseDone(rr, responseInfo, ret);
        }
    }

    private void responseActivityData(RadioResponseInfo responseInfo,
                                      ActivityStatsInfo activityInfo) {
        RILRequest rr = mRil.processResponse(responseInfo);