diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl index 0f5e7e4f77..bc1c29236f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl @@ -51,4 +51,5 @@ interface IRadioConfig { oneway void setPreferredDataModem(in int serial, in byte modemId); oneway void setResponseFunctions(in android.hardware.radio.config.IRadioConfigResponse radioConfigResponse, in android.hardware.radio.config.IRadioConfigIndication radioConfigIndication); oneway void setSimSlotsMapping(in int serial, in android.hardware.radio.config.SlotPortMapping[] slotMap); + oneway void getSimultaneousCallingSupport(in int serial); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl index 9189f9062f..f786373785 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl @@ -36,4 +36,5 @@ package android.hardware.radio.config; @VintfStability interface IRadioConfigIndication { oneway void simSlotsStatusChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.config.SimSlotStatus[] slotStatus); + oneway void onSimultaneousCallingSupportChanged(in int[] enabledLogicalSlots); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl index 348aa348bf..6ff7bd0b1b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl @@ -42,4 +42,5 @@ interface IRadioConfigResponse { oneway void setNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info); oneway void setPreferredDataModemResponse(in android.hardware.radio.RadioResponseInfo info); oneway void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void getSimultaneousCallingSupportResponse(in android.hardware.radio.RadioResponseInfo info, in int[] enabledLogicalSlots); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl index 3648866a13..2c66abda59 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl @@ -39,4 +39,6 @@ parcelable PhoneCapability { byte maxActiveInternetData; boolean isInternetLingeringSupported; byte[] logicalModemIds; + byte maxActiveVoice = UNKNOWN /* -1 */; + const byte UNKNOWN = (-1) /* -1 */; } diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl index 9058d9d050..8f4dff4bf6 100644 --- a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl +++ b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl @@ -191,4 +191,20 @@ oneway interface IRadioConfig { * This is available when android.hardware.telephony.subscription is defined. */ void setSimSlotsMapping(in int serial, in SlotPortMapping[] slotMap); + + /** + * Get the set of logical slots where simultaneous cellular calling is currently possible. This + * does not include simultaneous calling availability over other non-cellular transports, such + * as IWLAN. + * + * Get the set of slots that currently support simultaneous cellular calling. When a new + * cellular call is placed/received, if another slot is active and handing a call, both the + * active slot and proposed slot must be in this list in order to support simultaneous cellular + * calling for both of those slots. + * + * @param serial Serial number of request + * + * This is available when android.hardware.telephony is defined. + */ + void getSimultaneousCallingSupport(in int serial); } diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl index ed2366bbad..9eacb8e653 100644 --- a/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl +++ b/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl @@ -37,4 +37,15 @@ oneway interface IRadioConfigIndication { */ void simSlotsStatusChanged( in android.hardware.radio.RadioIndicationType type, in SimSlotStatus[] slotStatus); + + /** + * The logical slots supporting simultaneous cellular calling has changed. + * + * @param enabledLogicalSlots The slots that have simultaneous cellular calling enabled. If + * there is a call active on logical slot X, then a simultaneous cellular call is only possible + * on logical slot Y if BOTH slot X and slot Y are in enabledLogicalSlots. If simultaneous + * cellular calling is not currently supported, the expected value of enabledLogicalSLots is an + * empty int array. Sending only one radio slot is not acceptable in any case. + */ + void onSimultaneousCallingSupportChanged(in int[] enabledLogicalSlots); } diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl index df93e3c336..33b0ff0688 100644 --- a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl +++ b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl @@ -129,4 +129,27 @@ oneway interface IRadioConfigResponse { * RadioError:INVALID_ARGUMENTS */ void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info); + + /** + * Response to the asynchronous + * {@link IRadioConfig#getSimultaneousCallingSupport} request. + * + * @param info Response info struct containing response type, serial no. and error + * @param enabledLogicalSlots The slots that have simultaneous cellular calling enabled. If + * there is a call active on logical slot X, then a simultaneous cellular call is only possible + * on logical slot Y if BOTH slot X and slot Y are in enabledLogicalSlots. If simultaneous + * cellular calling is not currently supported, the expected value of enabledLogicalSLots is an + * empty int array. Sending only one radio slot is not acceptable in any case. + * + * Valid errors returned: + * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + * + * @see IRadioConfig#getSimultaneousCallingSupport for more information. + */ + void getSimultaneousCallingSupportResponse( + in android.hardware.radio.RadioResponseInfo info, in int[] enabledLogicalSlots); } diff --git a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl index 35d6b5d86d..7936eb6cd7 100644 --- a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl +++ b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl @@ -25,6 +25,7 @@ package android.hardware.radio.config; @VintfStability @JavaDerive(toString=true) parcelable PhoneCapability { + const byte UNKNOWN = -1; /** * maxActiveData defines how many logical modems can have * PS attached simultaneously. For example, for L+L modem it @@ -47,4 +48,10 @@ parcelable PhoneCapability { * List of logical modem IDs. */ byte[] logicalModemIds; + /** + * maxActiveVoice defines how many logical modems can have + * cellular voice calls simultaneously. For example, for cellular DSDA + * with simultaneous calling support, it should be 2. + */ + byte maxActiveVoice = UNKNOWN; } diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp index b45041811d..837c62656a 100644 --- a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp +++ b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp @@ -62,6 +62,13 @@ ScopedAStatus RadioConfig::getPhoneCapability(int32_t serial) { return ok(); } +ScopedAStatus RadioConfig::getSimultaneousCallingSupport(int32_t serial) { + LOG_CALL << serial; + LOG(ERROR) << " getSimultaneousCallingSupport is unsupported by HIDL HALs"; + respond()->getSimultaneousCallingSupportResponse(notSupported(serial), {}); + return ok(); +} + ScopedAStatus RadioConfig::getSimSlotsStatus(int32_t serial) { LOG_CALL << serial; mHal1_1->getSimSlotsStatus(serial); diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h index 89ddea0d49..17d59858a4 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h @@ -42,6 +42,7 @@ class RadioConfig : public aidl::android::hardware::radio::config::BnRadioConfig ::ndk::ScopedAStatus getHalDeviceCapabilities(int32_t serial) override; ::ndk::ScopedAStatus getNumOfLiveModems(int32_t serial) override; ::ndk::ScopedAStatus getPhoneCapability(int32_t serial) override; + ::ndk::ScopedAStatus getSimultaneousCallingSupport(int32_t serial) override; ::ndk::ScopedAStatus getSimSlotsStatus(int32_t serial) override; ::ndk::ScopedAStatus setNumOfLiveModems(int32_t serial, int8_t numOfLiveModems) override; ::ndk::ScopedAStatus setPreferredDataModem(int32_t serial, int8_t modemId) override; diff --git a/radio/aidl/vts/radio_config_indication.cpp b/radio/aidl/vts/radio_config_indication.cpp index a84c20b4b7..c7076632f2 100644 --- a/radio/aidl/vts/radio_config_indication.cpp +++ b/radio/aidl/vts/radio_config_indication.cpp @@ -22,3 +22,8 @@ ndk::ScopedAStatus RadioConfigIndication::simSlotsStatusChanged( RadioIndicationType /*type*/, const std::vector& /*slotStatus*/) { return ndk::ScopedAStatus::ok(); } + +ndk::ScopedAStatus RadioConfigIndication::onSimultaneousCallingSupportChanged( + const std::vector& /*enabledLogicalSlots*/) { + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_config_response.cpp b/radio/aidl/vts/radio_config_response.cpp index 7384f87adc..dccbd0e9c5 100644 --- a/radio/aidl/vts/radio_config_response.cpp +++ b/radio/aidl/vts/radio_config_response.cpp @@ -40,6 +40,13 @@ ndk::ScopedAStatus RadioConfigResponse::getPhoneCapabilityResponse( return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus RadioConfigResponse::getSimultaneousCallingSupportResponse( + const RadioResponseInfo& info, const std::vector& /* enabledLogicalSlots */) { + rspInfo = info; + parent_config.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse( const RadioResponseInfo& info) { rspInfo = info; diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp index d8c0142ccd..f7251367c3 100644 --- a/radio/aidl/vts/radio_config_test.cpp +++ b/radio/aidl/vts/radio_config_test.cpp @@ -121,6 +121,41 @@ TEST_P(RadioConfigTest, getPhoneCapability) { } } +/* + * Test IRadioConfig.getSimultaneousCallingSupport() for the response returned. + */ +TEST_P(RadioConfigTest, getSimultaneousCallingSupport) { + if (telephony_flags::enforce_telephony_feature_mapping()) { + if (!deviceSupportsFeature(FEATURE_TELEPHONY)) { + GTEST_SKIP() << "Skipping getSimultaneousCallingSupport " + "due to undefined FEATURE_TELEPHONY"; + } + } + + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_config->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 3) { + ALOGI("Skipped the test since" + " getSimultaneousCallingSupport is not supported on version < 3."); + GTEST_SKIP(); + } + + serial = GetRandomSerialNumber(); + ndk::ScopedAStatus res = radio_config->getSimultaneousCallingSupport(serial); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type); + EXPECT_EQ(serial, radioRsp_config->rspInfo.serial); + ALOGI("getSimultaneousCallingSupport, rspInfo.error = %s\n", + toString(radioRsp_config->rspInfo.error).c_str()); + + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_config->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR, + RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED})); +} + /* * Test IRadioConfig.setPreferredDataModem() for the response returned. */ diff --git a/radio/aidl/vts/radio_config_utils.h b/radio/aidl/vts/radio_config_utils.h index f79aedbf9e..9e809ff4ef 100644 --- a/radio/aidl/vts/radio_config_utils.h +++ b/radio/aidl/vts/radio_config_utils.h @@ -48,6 +48,9 @@ class RadioConfigResponse : public BnRadioConfigResponse { virtual ndk::ScopedAStatus getPhoneCapabilityResponse( const RadioResponseInfo& info, const PhoneCapability& phoneCapability) override; + virtual ndk::ScopedAStatus getSimultaneousCallingSupportResponse( + const RadioResponseInfo& info, const std::vector& enabledLogicalSlots) override; + virtual ndk::ScopedAStatus setPreferredDataModemResponse( const RadioResponseInfo& info) override; @@ -71,6 +74,9 @@ class RadioConfigIndication : public BnRadioConfigIndication { virtual ndk::ScopedAStatus simSlotsStatusChanged( RadioIndicationType type, const std::vector& slotStatus) override; + + virtual ndk::ScopedAStatus onSimultaneousCallingSupportChanged( + const std::vector& /*enabledLogicalSlots*/) override; }; // The main test class for Radio AIDL Config.