Merge "Added Telephony DSDA Support to the HAL." into main

This commit is contained in:
Grant Menke
2023-12-15 22:15:35 +00:00
committed by Android (Google) Code Review
14 changed files with 123 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -39,4 +39,6 @@ parcelable PhoneCapability {
byte maxActiveInternetData;
boolean isInternetLingeringSupported;
byte[] logicalModemIds;
byte maxActiveVoice = UNKNOWN /* -1 */;
const byte UNKNOWN = (-1) /* -1 */;
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -22,3 +22,8 @@ ndk::ScopedAStatus RadioConfigIndication::simSlotsStatusChanged(
RadioIndicationType /*type*/, const std::vector<SimSlotStatus>& /*slotStatus*/) {
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioConfigIndication::onSimultaneousCallingSupportChanged(
const std::vector<int32_t>& /*enabledLogicalSlots*/) {
return ndk::ScopedAStatus::ok();
}

View File

@@ -40,6 +40,13 @@ ndk::ScopedAStatus RadioConfigResponse::getPhoneCapabilityResponse(
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioConfigResponse::getSimultaneousCallingSupportResponse(
const RadioResponseInfo& info, const std::vector<int32_t>& /* enabledLogicalSlots */) {
rspInfo = info;
parent_config.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse(
const RadioResponseInfo& info) {
rspInfo = info;

View File

@@ -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.
*/

View File

@@ -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<int32_t>& 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<SimSlotStatus>& slotStatus) override;
virtual ndk::ScopedAStatus onSimultaneousCallingSupportChanged(
const std::vector<int32_t>& /*enabledLogicalSlots*/) override;
};
// The main test class for Radio AIDL Config.