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

Commit f2978c7f authored by Pengquan Meng's avatar Pengquan Meng Committed by android-build-merger
Browse files

Merge "Add CellInfoV1_4 RadioIndication"

am: 692f69e7

Change-Id: Icd5195efb02479e50c1f24308b059f113087c017
parents 9097ca5c 692f69e7
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -5485,6 +5485,22 @@ public class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

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

        for (android.hardware.radio.V1_4.CellInfo record : records) {
            response.add(CellInfo.create(record));
        }
        return response;
    }

    /**
     * @return The {@link IwlanOperationMode IWLAN operation mode}
     */
+13 −1
Original line number Diff line number Diff line
@@ -736,6 +736,18 @@ public class RadioIndication extends IRadioIndication.Stub {
        mRil.mRilCellInfoListRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
    }

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

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

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

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

    /** Incremental network scan results */
    public void networkScanResult(int indicationType,
                                  android.hardware.radio.V1_1.NetworkScanResult result) {
+24 −0
Original line number Diff line number Diff line
@@ -1068,6 +1068,16 @@ public class RadioResponse extends IRadioResponse.Stub {
        responseCellInfoList_1_2(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_4(
            RadioResponseInfo responseInfo,
            ArrayList<android.hardware.radio.V1_4.CellInfo> cellInfo) {
        responseCellInfoList_1_4(responseInfo, cellInfo);
    }

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

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

        if (rr != null) {
            ArrayList<CellInfo> ret = RIL.convertHalCellInfoList_1_4(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);