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

Commit c416d3df authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Log cleanup and fix conversions for AIDL RIL" am: de7bc68e am: 47f77753 am: 2a965b4b

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1935071

Change-Id: Id1e05e6fb7733bc2e07927659cc06dbac13c9540
parents 36c40ce9 2a965b4b
Loading
Loading
Loading
Loading
+87 −10
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ public class CellularNetworkService extends NetworkService {
                            int domain = (message.what == GET_CS_REGISTRATION_STATE_DONE)
                                    ? NetworkRegistrationInfo.DOMAIN_CS
                                    : NetworkRegistrationInfo.DOMAIN_PS;
                            // TODO: move to RILUtils
                            NetworkRegistrationInfo netState =
                                    getRegistrationStateFromResult(ar.result, domain);

@@ -220,12 +221,13 @@ public class CellularNetworkService extends NetworkService {
            final int transportType = AccessNetworkConstants.TRANSPORT_TYPE_WWAN;
            final int domain = NetworkRegistrationInfo.DOMAIN_CS;

            if (result instanceof android.hardware.radio.V1_6.RegStateResult) {
            if (result instanceof android.hardware.radio.network.RegStateResult) {
                return getNetworkRegistrationInfoAidl(domain, transportType,
                        (android.hardware.radio.network.RegStateResult) result);
            } else if (result instanceof android.hardware.radio.V1_6.RegStateResult) {
                return getNetworkRegistrationInfo1_6(domain, transportType,
                        (android.hardware.radio.V1_6.RegStateResult) result);
            }
            // 1.5 at the top so that we can do an "early exit" from the method
            else if (result instanceof android.hardware.radio.V1_5.RegStateResult) {
            } else if (result instanceof android.hardware.radio.V1_5.RegStateResult) {
                return getNetworkRegistrationInfo(domain, transportType,
                        (android.hardware.radio.V1_5.RegStateResult) result);
            } else if (result instanceof android.hardware.radio.V1_0.VoiceRegStateResult) {
@@ -293,12 +295,13 @@ public class CellularNetworkService extends NetworkService {
                    new LteVopsSupportInfo(LteVopsSupportInfo.LTE_STATUS_NOT_AVAILABLE,
                            LteVopsSupportInfo.LTE_STATUS_NOT_AVAILABLE);

            if (result instanceof android.hardware.radio.V1_6.RegStateResult) {
            if (result instanceof android.hardware.radio.network.RegStateResult) {
                return getNetworkRegistrationInfoAidl(domain, transportType,
                        (android.hardware.radio.network.RegStateResult) result);
            } else if (result instanceof android.hardware.radio.V1_6.RegStateResult) {
                return getNetworkRegistrationInfo1_6(domain, transportType,
                        (android.hardware.radio.V1_6.RegStateResult) result);
            }
            // 1.5 at the top so that we can do an "early exit" from the method
            else if (result instanceof android.hardware.radio.V1_5.RegStateResult) {
            } else if (result instanceof android.hardware.radio.V1_5.RegStateResult) {
                return getNetworkRegistrationInfo(domain, transportType,
                        (android.hardware.radio.V1_5.RegStateResult) result);
            } else if (result instanceof android.hardware.radio.V1_0.DataRegStateResult) {
@@ -372,7 +375,6 @@ public class CellularNetworkService extends NetworkService {
            final boolean isEmergencyOnly = isEmergencyOnly(regResult.regState);
            final List<Integer> availableServices = getAvailableServices(
                    regState, domain, isEmergencyOnly);
            final int rejectCause = regResult.reasonForDenial;
            final CellIdentity cellIdentity =
                    RILUtils.convertHalCellIdentity(regResult.cellIdentity);
            final String rplmn = regResult.registeredPlmn;
@@ -444,6 +446,82 @@ public class CellularNetworkService extends NetworkService {
            }
        }

        private @NonNull NetworkRegistrationInfo getNetworkRegistrationInfoAidl(int domain,
                int transportType, android.hardware.radio.network.RegStateResult regResult) {
            // Perform common conversions that aren't domain specific
            final int regState = getRegStateFromHalRegState(regResult.regState);
            final boolean isEmergencyOnly = isEmergencyOnly(regResult.regState);
            final List<Integer> availableServices = getAvailableServices(
                    regState, domain, isEmergencyOnly);
            final CellIdentity cellIdentity =
                    RILUtils.convertHalCellIdentity(regResult.cellIdentity);
            final String rplmn = regResult.registeredPlmn;
            final int reasonForDenial = regResult.reasonForDenial;

            int networkType = ServiceState.rilRadioTechnologyToNetworkType(regResult.rat);
            if (networkType == TelephonyManager.NETWORK_TYPE_LTE_CA) {
                networkType = TelephonyManager.NETWORK_TYPE_LTE;
            }

            // Conditional parameters for specific RANs
            boolean cssSupported = false;
            int roamingIndicator = 0;
            int systemIsInPrl = 0;
            int defaultRoamingIndicator = 0;
            boolean isEndcAvailable = false;
            boolean isNrAvailable = false;
            boolean isDcNrRestricted = false;
            VopsSupportInfo vopsInfo = null;

            android.hardware.radio.network.AccessTechnologySpecificInfo info =
                    regResult.accessTechnologySpecificInfo;

            switch (info.getTag()) {
                case android.hardware.radio.network.AccessTechnologySpecificInfo.cdmaInfo:
                    cssSupported = info.getCdmaInfo().cssSupported;
                    roamingIndicator = info.getCdmaInfo().roamingIndicator;
                    systemIsInPrl = info.getCdmaInfo().systemIsInPrl;
                    defaultRoamingIndicator = info.getCdmaInfo().defaultRoamingIndicator;
                    break;
                case android.hardware.radio.network.AccessTechnologySpecificInfo.eutranInfo:
                    isDcNrRestricted = info.getEutranInfo().nrIndicators.isDcNrRestricted;
                    isNrAvailable = info.getEutranInfo().nrIndicators.isNrAvailable;
                    isEndcAvailable = info.getEutranInfo().nrIndicators.isEndcAvailable;
                    vopsInfo = convertHalLteVopsSupportInfo(
                            info.getEutranInfo().lteVopsInfo.isVopsSupported,
                            info.getEutranInfo().lteVopsInfo.isEmcBearerSupported);
                    break;
                case android.hardware.radio.network.AccessTechnologySpecificInfo.ngranNrVopsInfo:
                    vopsInfo = new NrVopsSupportInfo(info.getNgranNrVopsInfo().vopsSupported,
                            info.getNgranNrVopsInfo().emcSupported,
                            info.getNgranNrVopsInfo().emfSupported);
                    break;
                case android.hardware.radio.network.AccessTechnologySpecificInfo.geranDtmSupported:
                    cssSupported = info.getGeranDtmSupported();
                    break;
                default:
                    log("No access tech specific info passes for RegStateResult");
                    break;
            }

            // build the result based on the domain for the request
            switch (domain) {
                case NetworkRegistrationInfo.DOMAIN_CS:
                    return new NetworkRegistrationInfo(domain, transportType, regState,
                            networkType, reasonForDenial, isEmergencyOnly, availableServices,
                            cellIdentity, rplmn, cssSupported, roamingIndicator, systemIsInPrl,
                            defaultRoamingIndicator);
                default:
                    loge("Unknown domain passed to CellularNetworkService= " + domain);
                    // fall through
                case NetworkRegistrationInfo.DOMAIN_PS:
                    return new NetworkRegistrationInfo(domain, transportType, regState, networkType,
                            reasonForDenial, isEmergencyOnly, availableServices, cellIdentity,
                            rplmn, MAX_DATA_CALLS, isDcNrRestricted, isNrAvailable, isEndcAvailable,
                            vopsInfo);
            }
        }

        private @NonNull NetworkRegistrationInfo getNetworkRegistrationInfo1_6(
                int domain, int transportType,
                android.hardware.radio.V1_6.RegStateResult regResult) {
@@ -453,7 +531,6 @@ public class CellularNetworkService extends NetworkService {
            final boolean isEmergencyOnly = isEmergencyOnly(regResult.regState);
            final List<Integer> availableServices = getAvailableServices(
                    regState, domain, isEmergencyOnly);
            final int rejectCause = regResult.reasonForDenial;
            final CellIdentity cellIdentity =
                    RILUtils.convertHalCellIdentity(regResult.cellIdentity);
            final String rplmn = regResult.registeredPlmn;
+14 −14
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ public class DataResponse extends IRadioDataResponse.Stub {
     * @param id The pdu session id allocated
     */
    public void allocatePduSessionIdResponse(RadioResponseInfo responseInfo, int id) {
        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(RIL.DATA_SERVICE, responseInfo);
        if (rr != null) {
            if (responseInfo.error == RadioError.NONE) {
                RadioResponse.sendMessageResponse(rr.mResult, id);
@@ -64,14 +64,14 @@ public class DataResponse extends IRadioDataResponse.Stub {
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void cancelHandoverResponse(RadioResponseInfo responseInfo) {
        RadioResponse.responseVoid(mRil, responseInfo);
        RadioResponse.responseVoid(RIL.DATA_SERVICE, mRil, responseInfo);
    }

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

    /**
@@ -80,7 +80,7 @@ public class DataResponse extends IRadioDataResponse.Stub {
     */
    public void getDataCallListResponse(RadioResponseInfo responseInfo,
            android.hardware.radio.data.SetupDataCallResult[] dataCallResultList) {
        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(RIL.DATA_SERVICE, responseInfo);

        if (rr != null) {
            ArrayList<DataCallResponse> response =
@@ -98,7 +98,7 @@ public class DataResponse extends IRadioDataResponse.Stub {
     */
    public void getSlicingConfigResponse(RadioResponseInfo responseInfo,
                android.hardware.radio.data.SlicingConfig slicingConfig) {
        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(RIL.DATA_SERVICE, responseInfo);

        if (rr != null) {
            NetworkSlicingConfig ret = RILUtils.convertHalSlicingConfig(slicingConfig);
@@ -113,35 +113,35 @@ public class DataResponse extends IRadioDataResponse.Stub {
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void releasePduSessionIdResponse(RadioResponseInfo responseInfo) {
        RadioResponse.responseVoid(mRil, responseInfo);
        RadioResponse.responseVoid(RIL.DATA_SERVICE, mRil, responseInfo);
    }

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

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

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

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

    /**
@@ -150,7 +150,7 @@ public class DataResponse extends IRadioDataResponse.Stub {
     */
    public void setupDataCallResponse(RadioResponseInfo responseInfo,
            android.hardware.radio.data.SetupDataCallResult setupDataCallResult) {
        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(RIL.DATA_SERVICE, responseInfo);

        if (rr != null) {
            DataCallResponse response = RILUtils.convertHalDataCallResult(setupDataCallResult);
@@ -165,7 +165,7 @@ public class DataResponse extends IRadioDataResponse.Stub {
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void startHandoverResponse(RadioResponseInfo responseInfo) {
        RadioResponse.responseVoid(mRil, responseInfo);
        RadioResponse.responseVoid(RIL.DATA_SERVICE, mRil, responseInfo);
    }

    /**
@@ -175,7 +175,7 @@ public class DataResponse extends IRadioDataResponse.Stub {
    public void startKeepaliveResponse(RadioResponseInfo responseInfo,
            android.hardware.radio.data.KeepaliveStatus keepaliveStatus) {

        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(RIL.DATA_SERVICE, responseInfo);
        if (rr == null) return;

        KeepaliveStatus ret = null;
@@ -213,7 +213,7 @@ public class DataResponse extends IRadioDataResponse.Stub {
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void stopKeepaliveResponse(RadioResponseInfo responseInfo) {
        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(RIL.DATA_SERVICE, responseInfo);
        if (rr == null) return;

        try {
+19 −19
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ public class MessagingResponse extends IRadioMessagingResponse.Stub {

    private void responseSms(RadioResponseInfo responseInfo,
            android.hardware.radio.messaging.SendSmsResult sms) {
        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(RIL.MESSAGING_SERVICE, responseInfo);

        if (rr != null) {
            long messageId = RIL.getOutgoingSmsMessageId(rr.mResult);
@@ -62,42 +62,42 @@ public class MessagingResponse extends IRadioMessagingResponse.Stub {
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void acknowledgeIncomingGsmSmsWithPduResponse(RadioResponseInfo responseInfo) {
        RadioResponse.responseVoid(mRil, responseInfo);
        RadioResponse.responseVoid(RIL.MESSAGING_SERVICE, mRil, responseInfo);
    }

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

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void acknowledgeLastIncomingGsmSmsResponse(RadioResponseInfo responseInfo) {
        RadioResponse.responseVoid(mRil, responseInfo);
        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(mRil, responseInfo);
        RadioResponse.responseVoid(RIL.MESSAGING_SERVICE, mRil, responseInfo);
    }

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

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

    /**
@@ -106,7 +106,7 @@ public class MessagingResponse extends IRadioMessagingResponse.Stub {
     */
    public void getCdmaBroadcastConfigResponse(RadioResponseInfo responseInfo,
            android.hardware.radio.messaging.CdmaBroadcastSmsConfigInfo[] configs) {
        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(RIL.MESSAGING_SERVICE, responseInfo);

        if (rr != null) {
            int[] ret;
@@ -155,7 +155,7 @@ public class MessagingResponse extends IRadioMessagingResponse.Stub {
     */
    public void getGsmBroadcastConfigResponse(RadioResponseInfo responseInfo,
            android.hardware.radio.messaging.GsmBroadcastSmsConfigInfo[] configs) {
        RILRequest rr = mRil.processResponse(responseInfo);
        RILRequest rr = mRil.processResponse(RIL.MESSAGING_SERVICE, responseInfo);

        if (rr != null) {
            ArrayList<SmsBroadcastConfigInfo> ret = new ArrayList<>();
@@ -175,14 +175,14 @@ public class MessagingResponse extends IRadioMessagingResponse.Stub {
     * @param smsc Short Message Service Center address on the device
     */
    public void getSmscAddressResponse(RadioResponseInfo responseInfo, String smsc) {
        RadioResponse.responseString(mRil, responseInfo, smsc);
        RadioResponse.responseString(RIL.MESSAGING_SERVICE, mRil, responseInfo, smsc);
    }

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

    /**
@@ -234,42 +234,42 @@ public class MessagingResponse extends IRadioMessagingResponse.Stub {
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void sendUssdResponse(RadioResponseInfo responseInfo) {
        RadioResponse.responseVoid(mRil, responseInfo);
        RadioResponse.responseVoid(RIL.MESSAGING_SERVICE, mRil, responseInfo);
    }

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

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

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

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

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

    /**
@@ -277,7 +277,7 @@ public class MessagingResponse extends IRadioMessagingResponse.Stub {
     * @param index record index where the CDMA SMS message is stored
     */
    public void writeSmsToRuimResponse(RadioResponseInfo responseInfo, int index) {
        RadioResponse.responseInts(mRil, responseInfo, index);
        RadioResponse.responseInts(RIL.MESSAGING_SERVICE, mRil, responseInfo, index);
    }

    /**
@@ -285,6 +285,6 @@ public class MessagingResponse extends IRadioMessagingResponse.Stub {
     * @param index record index where the message is stored
     */
    public void writeSmsToSimResponse(RadioResponseInfo responseInfo, int index) {
        RadioResponse.responseInts(mRil, responseInfo, index);
        RadioResponse.responseInts(RIL.MESSAGING_SERVICE, mRil, responseInfo, index);
    }
}
+16 −15

File changed.

Preview size limit exceeded, changes collapsed.

+38 −37

File changed.

Preview size limit exceeded, changes collapsed.

Loading