diff options
author | Sarah Chin <sarahchin@google.com> | 2021-12-16 21:31:57 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-12-16 21:31:57 +0000 |
commit | 0595b36095f79f20f45fa46258b014f78cc5a032 (patch) | |
tree | 741bcdb92575648dfcbf2b832170bbc46f209ba1 | |
parent | 5f5568d4fc34e3f7b455e2f1d353a99ef69ddabd (diff) | |
parent | ba427352e25d97a9eb65817b43837c05b1dbf704 (diff) |
Merge "Add TrafficDescriptor to DataProfileInfo"
19 files changed, 151 insertions, 32 deletions
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl index 9df687c258..334261965c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl @@ -53,6 +53,7 @@ parcelable DataProfileInfo { boolean preferred; boolean persistent; boolean alwaysOn; + @nullable android.hardware.radio.data.TrafficDescriptor trafficDescriptor; const int ID_DEFAULT = 0; const int ID_TETHERED = 1; const int ID_IMS = 2; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl index a648675280..dc6092a066 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl @@ -46,7 +46,7 @@ interface IRadioData { oneway void setDataThrottling(in int serial, in android.hardware.radio.data.DataThrottlingAction dataThrottlingAction, in long completionDurationMillis); oneway void setInitialAttachApn(in int serial, in android.hardware.radio.data.DataProfileInfo dataProfileInfo); oneway void setResponseFunctions(in android.hardware.radio.data.IRadioDataResponse radioDataResponse, in android.hardware.radio.data.IRadioDataIndication radioDataIndication); - oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.data.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.data.DataRequestReason reason, in android.hardware.radio.data.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.data.SliceInfo sliceInfo, in @nullable android.hardware.radio.data.TrafficDescriptor trafficDescriptor, in boolean matchAllRuleAllowed); + oneway void setupDataCall(in int serial, in android.hardware.radio.AccessNetwork accessNetwork, in android.hardware.radio.data.DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in android.hardware.radio.data.DataRequestReason reason, in android.hardware.radio.data.LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable android.hardware.radio.data.SliceInfo sliceInfo, in boolean matchAllRuleAllowed); oneway void startHandover(in int serial, in int callId); oneway void startKeepalive(in int serial, in android.hardware.radio.data.KeepaliveRequest keepalive); oneway void stopKeepalive(in int serial, in int sessionHandle); diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl index e496c7be4e..b0cc1eb189 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl @@ -37,5 +37,5 @@ interface IRadioDataIndication { oneway void dataCallListChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.SetupDataCallResult[] dcList); oneway void keepaliveStatus(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.KeepaliveStatus status); oneway void pcoData(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.PcoDataInfo pco); - oneway void unthrottleApn(in android.hardware.radio.RadioIndicationType type, in String apn); + oneway void unthrottleApn(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.DataProfileInfo dataProfileInfo); } diff --git a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl index a14963fe60..0f061191fd 100644 --- a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl +++ b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.RadioAccessFamily; import android.hardware.radio.data.ApnAuthType; import android.hardware.radio.data.ApnTypes; import android.hardware.radio.data.PdpProtocolType; +import android.hardware.radio.data.TrafficDescriptor; @VintfStability parcelable DataProfileInfo { @@ -122,4 +123,12 @@ parcelable DataProfileInfo { * See 3GPP TS 23.501 section 5.6.13 for the details. */ boolean alwaysOn; + /** + * TrafficDescriptor for which data connection needs to be established. + * It is used for URSP traffic matching as described in TS 24.526 Section 4.2.2. + * It includes an optional DNN which, if present, must be used for traffic matching -- + * it does not specify the end point to be used for the data call. The end point is specified by + * apn; apn must be used as the end point if one is not specified through URSP rules. + */ + @nullable TrafficDescriptor trafficDescriptor; } diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl index 9f5ba4c147..54a045c35d 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl @@ -219,12 +219,6 @@ oneway interface IRadioData { * EPDG to 5G. It is valid only when accessNetwork is AccessNetwork:NGRAN. If the slice * passed from EPDG is rejected, then the data failure cause must be * DataCallFailCause:SLICE_REJECTED. - * @param trafficDescriptor TrafficDescriptor for which data connection needs to be established. - * It is used for URSP traffic matching as described in TS 24.526 Section 4.2.2. - * It includes an optional DNN which, if present, must be used for traffic matching -- - * it does not specify the end point to be used for the data call. The end point is - * specified by DataProfileInfo.apn; DataProfileInfo.apn must be used as the end point if - * one is not specified through URSP rules. * @param matchAllRuleAllowed bool to indicate if using default match-all URSP rule for this * request is allowed. If false, this request must not use the match-all URSP rule and if * a non-match-all rule is not found (or if URSP rules are not available) it should @@ -238,7 +232,6 @@ oneway interface IRadioData { in DataProfileInfo dataProfileInfo, in boolean roamingAllowed, in DataRequestReason reason, in LinkAddress[] addresses, in String[] dnses, in int pduSessionId, in @nullable SliceInfo sliceInfo, - in @nullable TrafficDescriptor trafficDescriptor, in boolean matchAllRuleAllowed); /** diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl index 8e73ee33af..1772c8859f 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.data; import android.hardware.radio.RadioIndicationType; +import android.hardware.radio.data.DataProfileInfo; import android.hardware.radio.data.KeepaliveStatus; import android.hardware.radio.data.PcoDataInfo; import android.hardware.radio.data.SetupDataCallResult; @@ -68,7 +69,7 @@ oneway interface IRadioDataIndication { * is sent, AOSP will no longer throttle calls to IRadioData.SetupDataCall for the given APN. * * @param type Type of radio indication - * @param apn Apn to unthrottle + * @param dataProfileInfo Data profile info. */ - void unthrottleApn(in RadioIndicationType type, in String apn); + void unthrottleApn(in RadioIndicationType type, in DataProfileInfo dataProfileInfo); } diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index 43d9378364..5294de4bb1 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -56,7 +56,9 @@ cc_library { "libutils", ], srcs: [ + "DriverContext.cpp", "RadioCompatBase.cpp", + "RadioIndication.cpp", "RadioResponse.cpp", "commonStructs.cpp", "config/RadioConfig.cpp", diff --git a/radio/aidl/compat/libradiocompat/DriverContext.cpp b/radio/aidl/compat/libradiocompat/DriverContext.cpp new file mode 100644 index 0000000000..a07173e6c9 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/DriverContext.cpp @@ -0,0 +1,37 @@ +/* + * 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 <libradiocompat/DriverContext.h> + +namespace android::hardware::radio::compat { + +namespace aidl = ::aidl::android::hardware::radio; + +void DriverContext::addDataProfile(const aidl::data::DataProfileInfo& profile) { + mDataProfiles[profile.apn] = profile; +} + +aidl::data::DataProfileInfo DriverContext::getDataProfile(const std::string& apn) { + const auto it = mDataProfiles.find(apn); + if (it != mDataProfiles.end()) return it->second; + + // if not found in cache, return a made up default + return { + .apn = apn, + }; +} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp index a9eac68d13..dba6c19fa2 100644 --- a/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp +++ b/radio/aidl/compat/libradiocompat/RadioCompatBase.cpp @@ -20,12 +20,13 @@ namespace android::hardware::radio::compat { -RadioCompatBase::RadioCompatBase(sp<V1_5::IRadio> hidlHal, sp<RadioResponse> radioResponse, - sp<RadioIndication> radioIndication) - : mHal1_5(hidlHal), +RadioCompatBase::RadioCompatBase(std::shared_ptr<DriverContext> context, sp<V1_5::IRadio> hidlHal, + sp<RadioResponse> radioResponse, sp<RadioIndication> radioInd) + : mContext(context), + mHal1_5(hidlHal), mHal1_6(V1_6::IRadio::castFrom(hidlHal)), mRadioResponse(radioResponse), - mRadioIndication(radioIndication) {} + mRadioIndication(radioInd) {} V1_6::IRadioResponse& RadioCompatBase::respond() { CHECK(mRadioResponse) << "This shouldn't happen (response functions are passed in constructor)"; diff --git a/radio/aidl/compat/libradiocompat/RadioIndication.cpp b/radio/aidl/compat/libradiocompat/RadioIndication.cpp new file mode 100644 index 0000000000..30ef6a0dcc --- /dev/null +++ b/radio/aidl/compat/libradiocompat/RadioIndication.cpp @@ -0,0 +1,23 @@ +/* + * 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 <libradiocompat/RadioIndication.h> + +namespace android::hardware::radio::compat { + +RadioIndication::RadioIndication(std::shared_ptr<DriverContext> context) : mContext(context) {} + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/RadioResponse.cpp b/radio/aidl/compat/libradiocompat/RadioResponse.cpp index 35b0ac1d82..e1bd4469cb 100644 --- a/radio/aidl/compat/libradiocompat/RadioResponse.cpp +++ b/radio/aidl/compat/libradiocompat/RadioResponse.cpp @@ -22,6 +22,8 @@ namespace android::hardware::radio::compat { +RadioResponse::RadioResponse(std::shared_ptr<DriverContext> context) : mContext(context) {} + Return<void> RadioResponse::acknowledgeRequest(int32_t serial) { LOG_CALL << serial; // TODO(b/203699028): send to correct requestor or confirm if spam is not a problem diff --git a/radio/aidl/compat/libradiocompat/data/RadioData.cpp b/radio/aidl/compat/libradiocompat/data/RadioData.cpp index fdb127318e..cc6f526de8 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioData.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioData.cpp @@ -139,14 +139,15 @@ ScopedAStatus RadioData::setupDataCall( // const aidl::DataProfileInfo& dataProfileInfo, bool roamingAllowed, aidl::DataRequestReason reason, const std::vector<aidl::LinkAddress>& addresses, const std::vector<std::string>& dnses, int32_t pduSessId, - const std::optional<aidl::SliceInfo>& sliceInfo, - const std::optional<aidl::TrafficDescriptor>& trDesc, bool matchAllRuleAllowed) { + const std::optional<aidl::SliceInfo>& sliceInfo, bool matchAllRuleAllowed) { if (mHal1_6) { mHal1_6->setupDataCall_1_6( // serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed, V1_2::DataRequestReason(reason), toHidl(addresses), toHidl(dnses), pduSessId, toHidl<V1_6::OptionalSliceInfo>(sliceInfo), - toHidl<V1_6::OptionalTrafficDescriptor>(trDesc), matchAllRuleAllowed); + toHidl<V1_6::OptionalTrafficDescriptor>(dataProfileInfo.trafficDescriptor), + matchAllRuleAllowed); + mContext->addDataProfile(dataProfileInfo); } else { mHal1_5->setupDataCall_1_5( // serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed, diff --git a/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp b/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp index f51d1a8d37..a680e562ab 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioIndication-data.cpp @@ -83,7 +83,7 @@ Return<void> RadioIndication::unthrottleApn(V1_0::RadioIndicationType type, const hidl_string& apn) { LOG_CALL << type; CHECK_CB(mDataCb); - mDataCb->unthrottleApn(toAidl(type), apn); + mDataCb->unthrottleApn(toAidl(type), mContext->getDataProfile(apn)); return {}; } diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/DriverContext.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/DriverContext.h new file mode 100644 index 0000000000..6833aca753 --- /dev/null +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/DriverContext.h @@ -0,0 +1,32 @@ +/* + * 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. + */ +#pragma once + +#include <aidl/android/hardware/radio/data/DataProfileInfo.h> + +#include <map> + +namespace android::hardware::radio::compat { + +class DriverContext { + std::map<std::string, ::aidl::android::hardware::radio::data::DataProfileInfo> mDataProfiles; + + public: + void addDataProfile(const ::aidl::android::hardware::radio::data::DataProfileInfo& profile); + ::aidl::android::hardware::radio::data::DataProfileInfo getDataProfile(const std::string& apn); +}; + +} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h index a412c34abc..21d7898002 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioCompatBase.h @@ -15,6 +15,7 @@ */ #pragma once +#include "DriverContext.h" #include "RadioIndication.h" #include "RadioResponse.h" @@ -24,6 +25,8 @@ namespace android::hardware::radio::compat { class RadioCompatBase { protected: + std::shared_ptr<DriverContext> mContext; + sp<V1_5::IRadio> mHal1_5; sp<V1_6::IRadio> mHal1_6; @@ -33,8 +36,8 @@ class RadioCompatBase { V1_6::IRadioResponse& respond(); public: - RadioCompatBase(sp<V1_5::IRadio> hidlHal, sp<RadioResponse> radioResponse, - sp<RadioIndication> radioIndication); + RadioCompatBase(std::shared_ptr<DriverContext> context, sp<V1_5::IRadio> hidlHal, + sp<RadioResponse> radioResponse, sp<RadioIndication> radioIndication); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h index 900a669064..ba8bb0a6ae 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h @@ -55,7 +55,6 @@ class RadioData : public RadioCompatBase, public aidl::android::hardware::radio: const std::vector<::aidl::android::hardware::radio::data::LinkAddress>& addresses, const std::vector<std::string>& dnses, int32_t pduSessionId, const std::optional<::aidl::android::hardware::radio::data::SliceInfo>& sliceInfo, - const std::optional<::aidl::android::hardware::radio::data::TrafficDescriptor>& trDescr, bool matchAllRuleAllowed) override; ::ndk::ScopedAStatus startHandover(int32_t serial, int32_t callId) override; ::ndk::ScopedAStatus startKeepalive( diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h index 20e09735e6..4d03063a41 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -15,6 +15,8 @@ */ #pragma once +#include "DriverContext.h" + #include <aidl/android/hardware/radio/data/IRadioDataIndication.h> #include <aidl/android/hardware/radio/messaging/IRadioMessagingIndication.h> #include <aidl/android/hardware/radio/modem/IRadioModemIndication.h> @@ -26,6 +28,8 @@ namespace android::hardware::radio::compat { class RadioIndication : public V1_6::IRadioIndication { + std::shared_ptr<DriverContext> mContext; + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> mDataCb; std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> mMessagingCb; @@ -181,6 +185,8 @@ class RadioIndication : public V1_6::IRadioIndication { const hidl_vec<V1_6::PhonebookRecordInfo>& records) override; public: + RadioIndication(std::shared_ptr<DriverContext> context); + void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> dataCb); void setResponseFunction( diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h index 5db963f582..344864f75e 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -15,6 +15,8 @@ */ #pragma once +#include "DriverContext.h" + #include <aidl/android/hardware/radio/data/IRadioDataResponse.h> #include <aidl/android/hardware/radio/messaging/IRadioMessagingResponse.h> #include <aidl/android/hardware/radio/modem/IRadioModemResponse.h> @@ -26,6 +28,8 @@ namespace android::hardware::radio::compat { class RadioResponse : public V1_6::IRadioResponse { + std::shared_ptr<DriverContext> mContext; + std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> mDataCb; std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> mMessagingCb; @@ -409,6 +413,8 @@ class RadioResponse : public V1_6::IRadioResponse { int32_t updatedRecordIndex) override; public: + RadioResponse(std::shared_ptr<DriverContext> context); + void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> dataCb); void setResponseFunction( diff --git a/radio/aidl/compat/service/service.cpp b/radio/aidl/compat/service/service.cpp index 2a67569452..6bcd4b0c61 100644 --- a/radio/aidl/compat/service/service.cpp +++ b/radio/aidl/compat/service/service.cpp @@ -36,7 +36,8 @@ using namespace std::string_literals; static std::vector<std::shared_ptr<ndk::ICInterface>> gPublishedHals; template <typename T> -static void publishRadioHal(sp<V1_5::IRadio> hidlHal, sp<compat::RadioResponse> responseCb, +static void publishRadioHal(std::shared_ptr<compat::DriverContext> context, + sp<V1_5::IRadio> hidlHal, sp<compat::RadioResponse> responseCb, sp<compat::RadioIndication> indicationCb, const std::string& slot) { const auto instance = T::descriptor + "/"s + slot; if (!AServiceManager_isDeclared(instance.c_str())) { @@ -45,7 +46,7 @@ static void publishRadioHal(sp<V1_5::IRadio> hidlHal, sp<compat::RadioResponse> } LOG(DEBUG) << "Publishing " << instance; - auto aidlHal = ndk::SharedRefBase::make<T>(hidlHal, responseCb, indicationCb); + auto aidlHal = ndk::SharedRefBase::make<T>(context, hidlHal, responseCb, indicationCb); gPublishedHals.push_back(aidlHal); const auto status = AServiceManager_addService(aidlHal->asBinder().get(), instance.c_str()); CHECK_EQ(status, STATUS_OK); @@ -57,16 +58,18 @@ static void publishRadio(std::string slot) { hidl_utils::linkDeathToDeath(radioHidl); - auto responseCb = sp<compat::RadioResponse>::make(); - auto indicationCb = sp<compat::RadioIndication>::make(); + auto context = std::make_shared<compat::DriverContext>(); + + auto responseCb = sp<compat::RadioResponse>::make(context); + auto indicationCb = sp<compat::RadioIndication>::make(context); radioHidl->setResponseFunctions(responseCb, indicationCb).assertOk(); - publishRadioHal<compat::RadioData>(radioHidl, responseCb, indicationCb, slot); - publishRadioHal<compat::RadioMessaging>(radioHidl, responseCb, indicationCb, slot); - publishRadioHal<compat::RadioModem>(radioHidl, responseCb, indicationCb, slot); - publishRadioHal<compat::RadioNetwork>(radioHidl, responseCb, indicationCb, slot); - publishRadioHal<compat::RadioSim>(radioHidl, responseCb, indicationCb, slot); - publishRadioHal<compat::RadioVoice>(radioHidl, responseCb, indicationCb, slot); + publishRadioHal<compat::RadioData>(context, radioHidl, responseCb, indicationCb, slot); + publishRadioHal<compat::RadioMessaging>(context, radioHidl, responseCb, indicationCb, slot); + publishRadioHal<compat::RadioModem>(context, radioHidl, responseCb, indicationCb, slot); + publishRadioHal<compat::RadioNetwork>(context, radioHidl, responseCb, indicationCb, slot); + publishRadioHal<compat::RadioSim>(context, radioHidl, responseCb, indicationCb, slot); + publishRadioHal<compat::RadioVoice>(context, radioHidl, responseCb, indicationCb, slot); } static void publishRadioConfig() { |