diff options
author | Sarah Chin <sarahchin@google.com> | 2022-01-25 14:24:43 -0800 |
---|---|---|
committer | Sarah Chin <sarahchin@google.com> | 2022-01-28 15:15:23 -0800 |
commit | 4ae4e1723f3da02b6f704ebf1bf92fc09c11dbfb (patch) | |
tree | 4f5831ed8c13b206d0ec14bb3e414440e043d518 | |
parent | 104192c28f92bda4865021eee0a01c8475a12755 (diff) |
Allow null DataProfileInfo for IA APN to clear
Test: build
Bug: 216357727
Change-Id: If003316192f579a3970ac48eaf50cb714cf757e6
Merged-In: If003316192f579a3970ac48eaf50cb714cf757e6
4 files changed, 19 insertions, 15 deletions
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 dc6092a066..7b572f1f8e 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 @@ -44,7 +44,7 @@ interface IRadioData { oneway void setDataAllowed(in int serial, in boolean allow); oneway void setDataProfile(in int serial, in android.hardware.radio.data.DataProfileInfo[] profiles); 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 setInitialAttachApn(in int serial, in @nullable 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 boolean matchAllRuleAllowed); oneway void startHandover(in int serial, in int callId); diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl index 54a045c35d..e1ba56828f 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl @@ -159,14 +159,15 @@ oneway interface IRadioData { in long completionDurationMillis); /** - * Set an APN to initial attach network. + * Set an APN to initial attach network or clear the existing initial attach APN. * * @param serial Serial number of request. - * @param dataProfileInfo data profile containing APN settings + * @param dataProfileInfo Data profile containing APN settings or null to clear the existing + * initial attach APN. * * Response function is IRadioDataResponse.setInitialAttachApnResponse() */ - void setInitialAttachApn(in int serial, in DataProfileInfo dataProfileInfo); + void setInitialAttachApn(in int serial, in @nullable DataProfileInfo dataProfileInfo); /** * Set response functions for data radio requests and indications. diff --git a/radio/aidl/compat/libradiocompat/data/RadioData.cpp b/radio/aidl/compat/libradiocompat/data/RadioData.cpp index d2f368778f..51f5543420 100644 --- a/radio/aidl/compat/libradiocompat/data/RadioData.cpp +++ b/radio/aidl/compat/libradiocompat/data/RadioData.cpp @@ -122,9 +122,10 @@ ScopedAStatus RadioData::setDataThrottling(int32_t serial, aidl::DataThrottlingA return ok(); } -ScopedAStatus RadioData::setInitialAttachApn(int32_t serial, const aidl::DataProfileInfo& info) { +ScopedAStatus RadioData::setInitialAttachApn(int32_t serial, + const std::optional<aidl::DataProfileInfo>& info) { LOG_CALL << serial; - mHal1_5->setInitialAttachApn_1_5(serial, toHidl(info)); + mHal1_5->setInitialAttachApn_1_5(serial, toHidl(info.value())); return ok(); } @@ -136,14 +137,15 @@ ScopedAStatus RadioData::setResponseFunctions( return ok(); } -ScopedAStatus RadioData::setupDataCall( // - int32_t serial, aidlCommon::AccessNetwork accessNetwork, - 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, bool matchAllRuleAllowed) { +ScopedAStatus RadioData::setupDataCall(int32_t serial, aidlCommon::AccessNetwork accessNetwork, + 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, + bool matchAllRuleAllowed) { if (mHal1_6) { - mHal1_6->setupDataCall_1_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), @@ -151,7 +153,7 @@ ScopedAStatus RadioData::setupDataCall( // matchAllRuleAllowed); mContext->addDataProfile(dataProfileInfo); } else { - mHal1_5->setupDataCall_1_5( // + mHal1_5->setupDataCall_1_5( serial, V1_5::AccessNetwork(accessNetwork), toHidl(dataProfileInfo), roamingAllowed, V1_2::DataRequestReason(reason), toHidl(addresses), toHidl(dnses)); } diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h index c617ec24ea..c2c0de3b05 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioData.h @@ -44,7 +44,8 @@ class RadioData : public RadioCompatBase, public aidl::android::hardware::radio: int64_t completionDurationMillis) override; ::ndk::ScopedAStatus setInitialAttachApn( int32_t serial, - const ::aidl::android::hardware::radio::data::DataProfileInfo& dpInfo) override; + const std::optional<::aidl::android::hardware::radio::data::DataProfileInfo>& dpInfo) + override; ::ndk::ScopedAStatus setResponseFunctions( const std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse>& radioDataResponse, |