/* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include "commonStructs.h" #include "debug.h" #include "structs.h" #include "collections.h" #define RADIO_MODULE "DataResponse" namespace android::hardware::radio::compat { namespace aidl = ::aidl::android::hardware::radio::data; void RadioResponse::setResponseFunction(std::shared_ptr dataCb) { mDataCb = dataCb; } std::shared_ptr RadioResponse::dataCb() { return mDataCb.get(); } Return RadioResponse::allocatePduSessionIdResponse(const V1_6::RadioResponseInfo& info, int32_t id) { LOG_CALL << info.serial; dataCb()->allocatePduSessionIdResponse(toAidl(info), id); return {}; } Return RadioResponse::cancelHandoverResponse(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->cancelHandoverResponse(toAidl(info)); return {}; } Return RadioResponse::deactivateDataCallResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->deactivateDataCallResponse(toAidl(info)); return {}; } Return RadioResponse::getDataCallListResponse(const V1_0::RadioResponseInfo& info, const hidl_vec&) { LOG_CALL << info.serial; LOG(ERROR) << "IRadio HAL 1.0 not supported"; return {}; } Return RadioResponse::getDataCallListResponse_1_4( const V1_0::RadioResponseInfo& info, const hidl_vec&) { LOG_CALL << info.serial; LOG(ERROR) << "IRadio HAL 1.4 not supported"; return {}; } Return RadioResponse::getDataCallListResponse_1_5( const V1_0::RadioResponseInfo& info, const hidl_vec& dcResponse) { LOG_CALL << info.serial; dataCb()->getDataCallListResponse(toAidl(info), toAidl(dcResponse)); return {}; } Return RadioResponse::getDataCallListResponse_1_6( const V1_6::RadioResponseInfo& info, const hidl_vec& dcResponse) { LOG_CALL << info.serial; dataCb()->getDataCallListResponse(toAidl(info), toAidl(dcResponse)); return {}; } Return RadioResponse::getSlicingConfigResponse(const V1_6::RadioResponseInfo& info, const V1_6::SlicingConfig& slicingConfig) { LOG_CALL << info.serial; dataCb()->getSlicingConfigResponse(toAidl(info), toAidl(slicingConfig)); return {}; } Return RadioResponse::releasePduSessionIdResponse(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->releasePduSessionIdResponse(toAidl(info)); return {}; } Return RadioResponse::setDataAllowedResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->setDataAllowedResponse(toAidl(info)); return {}; } Return RadioResponse::setDataProfileResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->setDataProfileResponse(toAidl(info)); return {}; } Return RadioResponse::setDataProfileResponse_1_5(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->setDataProfileResponse(toAidl(info)); return {}; } Return RadioResponse::setDataThrottlingResponse(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->setDataThrottlingResponse(toAidl(info)); return {}; } Return RadioResponse::setInitialAttachApnResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->setInitialAttachApnResponse(toAidl(info)); return {}; } Return RadioResponse::setInitialAttachApnResponse_1_5(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->setInitialAttachApnResponse(toAidl(info)); return {}; } Return RadioResponse::setupDataCallResponse(const V1_0::RadioResponseInfo& info, const V1_0::SetupDataCallResult&) { LOG_CALL << info.serial; LOG(ERROR) << "IRadio HAL 1.0 not supported"; return {}; } Return RadioResponse::setupDataCallResponse_1_4(const V1_0::RadioResponseInfo& info, const V1_4::SetupDataCallResult&) { LOG_CALL << info.serial; LOG(ERROR) << "IRadio HAL 1.0 not supported"; return {}; } Return RadioResponse::setupDataCallResponse_1_5(const V1_0::RadioResponseInfo& info, const V1_5::SetupDataCallResult& dcResponse) { LOG_CALL << info.serial; dataCb()->setupDataCallResponse(toAidl(info), toAidl(dcResponse)); return {}; } Return RadioResponse::setupDataCallResponse_1_6(const V1_6::RadioResponseInfo& info, const V1_6::SetupDataCallResult& dcResponse) { LOG_CALL << info.serial; dataCb()->setupDataCallResponse(toAidl(info), toAidl(dcResponse)); return {}; } Return RadioResponse::startHandoverResponse(const V1_6::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->startHandoverResponse(toAidl(info)); return {}; } Return RadioResponse::startKeepaliveResponse(const V1_0::RadioResponseInfo& info, const V1_1::KeepaliveStatus& status) { LOG_CALL << info.serial; dataCb()->startKeepaliveResponse(toAidl(info), toAidl(status)); return {}; } Return RadioResponse::stopKeepaliveResponse(const V1_0::RadioResponseInfo& info) { LOG_CALL << info.serial; dataCb()->stopKeepaliveResponse(toAidl(info)); return {}; } } // namespace android::hardware::radio::compat