mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Implement RadioSim for AIDL-HIDL Telephony HAL translator
Bug: 203699028 Test: Boot and grep logcat against radiocompat Change-Id: I82d27049858e578522b83811a787b259e67d00a4
This commit is contained in:
@@ -38,6 +38,7 @@ cc_library {
|
||||
"android.hardware.radio.config@1.2",
|
||||
"android.hardware.radio.config@1.3",
|
||||
"android.hardware.radio.messaging-V1-ndk",
|
||||
"android.hardware.radio.sim-V1-ndk",
|
||||
"android.hardware.radio@1.0",
|
||||
"android.hardware.radio@1.1",
|
||||
"android.hardware.radio@1.2",
|
||||
@@ -63,6 +64,10 @@ cc_library {
|
||||
"messaging/RadioMessaging.cpp",
|
||||
"messaging/RadioResponse-messaging.cpp",
|
||||
"messaging/structs.cpp",
|
||||
"sim/RadioIndication-sim.cpp",
|
||||
"sim/RadioResponse-sim.cpp",
|
||||
"sim/RadioSim.cpp",
|
||||
"sim/structs.cpp",
|
||||
],
|
||||
export_include_dirs: ["include"],
|
||||
}
|
||||
|
||||
@@ -54,38 +54,15 @@ Return<void> RadioIndication::suppSvcNotify(V1_0::RadioIndicationType type,
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::stkSessionEnd(V1_0::RadioIndicationType type) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::stkProactiveCommand(V1_0::RadioIndicationType type,
|
||||
const hidl_string& cmd) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::stkEventNotify(V1_0::RadioIndicationType type,
|
||||
const hidl_string& cmd) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::stkCallSetup(V1_0::RadioIndicationType type, int64_t timeout) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::simRefresh(V1_0::RadioIndicationType type,
|
||||
const V1_0::SimRefreshResult& refreshResult) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::callRing(V1_0::RadioIndicationType type, bool isGsm,
|
||||
const V1_0::CdmaSignalInfoRecord& record) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::simStatusChanged(V1_0::RadioIndicationType type) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::restrictedStateChanged(V1_0::RadioIndicationType type,
|
||||
V1_0::PhoneRestrictedState state) {
|
||||
return {};
|
||||
@@ -118,11 +95,6 @@ Return<void> RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::cdmaSubscriptionSourceChanged(
|
||||
V1_0::RadioIndicationType type, V1_0::CdmaSubscriptionSource cdmaSource) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::cdmaPrlChanged(V1_0::RadioIndicationType type, int32_t version) {
|
||||
return {};
|
||||
}
|
||||
@@ -149,11 +121,6 @@ Return<void> RadioIndication::imsNetworkStateChanged(V1_0::RadioIndicationType t
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::subscriptionStatusChanged(V1_0::RadioIndicationType type,
|
||||
bool activate) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::srvccStateNotify(V1_0::RadioIndicationType type,
|
||||
V1_0::SrvccState state) {
|
||||
return {};
|
||||
@@ -194,10 +161,6 @@ Return<void> RadioIndication::modemReset(V1_0::RadioIndicationType type,
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::carrierInfoForImsiEncryption(V1_0::RadioIndicationType info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::networkScanResult(V1_0::RadioIndicationType type,
|
||||
const V1_1::NetworkScanResult& result) {
|
||||
return {};
|
||||
@@ -263,11 +226,6 @@ Return<void> RadioIndication::currentSignalStrength_1_4(
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::uiccApplicationsEnablementChanged(V1_0::RadioIndicationType type,
|
||||
bool enabled) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::registrationFailed( //
|
||||
V1_0::RadioIndicationType type, const V1_5::CellIdentity& cellIdentity,
|
||||
const hidl_string& chosenPlmn, hidl_bitfield<V1_5::Domain> domain, int32_t causeCode,
|
||||
@@ -331,14 +289,4 @@ Return<void> RadioIndication::currentPhysicalChannelConfigs_1_6(
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::simPhonebookChanged(V1_0::RadioIndicationType type) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::simPhonebookRecordsReceived(
|
||||
V1_0::RadioIndicationType type, V1_6::PbReceivedStatus status,
|
||||
const hidl_vec<V1_6::PhonebookRecordInfo>& records) {
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
|
||||
@@ -27,42 +27,9 @@ namespace android::hardware::radio::compat {
|
||||
|
||||
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
|
||||
if (mMessagingCb) mMessagingCb->acknowledgeRequest(serial);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getIccCardStatusResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::CardStatus& cardStatus) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplyIccPinForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplyIccPukForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplyIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplyIccPuk2ForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::changeIccPinForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::changeIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
if (mSimCb) mSimCb->acknowledgeRequest(serial);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -80,11 +47,6 @@ Return<void> RadioResponse::dialResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getIMSIForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_string& imsi) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::hangupConnectionResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
@@ -150,11 +112,6 @@ Return<void> RadioResponse::setupDataCallResponse(const V1_0::RadioResponseInfo&
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccIOForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::IccIoResult& iccIo) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getClirResponse(const V1_0::RadioResponseInfo& info, int32_t n,
|
||||
int32_t m) {
|
||||
return {};
|
||||
@@ -190,16 +147,6 @@ Return<void> RadioResponse::deactivateDataCallResponse(const V1_0::RadioResponse
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t response) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t retry) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setBarringPasswordResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
@@ -273,15 +220,6 @@ Return<void> RadioResponse::getAvailableBandModesResponse(
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendEnvelopeResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_string& commandResponse) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendTerminalResponseToSimResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::handleStkCallSetupRequestFromSimResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
@@ -309,10 +247,6 @@ Return<void> RadioResponse::setLocationUpdatesResponse(const V1_0::RadioResponse
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
@@ -348,12 +282,6 @@ Return<void> RadioResponse::sendBurstDtmfResponse(const V1_0::RadioResponseInfo&
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCDMASubscriptionResponse(
|
||||
const V1_0::RadioResponseInfo& info, const hidl_string& mdn, const hidl_string& hSid,
|
||||
const hidl_string& hNid, const hidl_string& min, const hidl_string& prl) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getDeviceIdentityResponse( //
|
||||
const V1_0::RadioResponseInfo& info, const hidl_string& imei, const hidl_string& imeisv,
|
||||
const hidl_string& esn, const hidl_string& meid) {
|
||||
@@ -364,25 +292,6 @@ Return<void> RadioResponse::exitEmergencyCallbackModeResponse(const V1_0::RadioR
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::reportStkServiceIsRunningResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info,
|
||||
V1_0::CdmaSubscriptionSource source) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::requestIsimAuthenticationResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_string& response) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendEnvelopeWithStatusResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::IccIoResult& iccIo) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getVoiceRadioTechnologyResponse(const V1_0::RadioResponseInfo& info,
|
||||
V1_0::RadioTechnology rat) {
|
||||
return {};
|
||||
@@ -406,25 +315,6 @@ Return<void> RadioResponse::getImsRegistrationStateResponse( //
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccTransmitApduBasicChannelResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::IccIoResult& result) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccOpenLogicalChannelResponse( //
|
||||
const V1_0::RadioResponseInfo& info, int32_t chanId, const hidl_vec<int8_t>& selectResp) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccCloseLogicalChannelResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccTransmitApduLogicalChannelResponse(
|
||||
const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& result) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::nvReadItemResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_string& result) {
|
||||
return {};
|
||||
@@ -442,10 +332,6 @@ Return<void> RadioResponse::nvResetConfigResponse(const V1_0::RadioResponseInfo&
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setUiccSubscriptionResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setDataAllowedResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
@@ -455,11 +341,6 @@ Return<void> RadioResponse::getHardwareConfigResponse(
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::requestIccSimAuthenticationResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::IccIoResult& result) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setDataProfileResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
@@ -498,16 +379,6 @@ Return<void> RadioResponse::getModemActivityInfoResponse(
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setAllowedCarriersResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t numAllowed) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getAllowedCarriersResponse( //
|
||||
const V1_0::RadioResponseInfo& info, bool allAllowed, const V1_0::CarrierRestrictions& cr) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendDeviceStateResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
@@ -516,19 +387,6 @@ Return<void> RadioResponse::setIndicationFilterResponse(const V1_0::RadioRespons
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSimCardPowerResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCarrierInfoForImsiEncryptionResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSimCardPowerResponse_1_1(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::startNetworkScanResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
@@ -551,11 +409,6 @@ Return<void> RadioResponse::getCellInfoListResponse_1_2(const V1_0::RadioRespons
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getIccCardStatusResponse_1_2(const V1_0::RadioResponseInfo& info,
|
||||
const V1_2::CardStatus& cardStatus) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSignalStrengthReportingCriteriaResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
@@ -618,11 +471,6 @@ Return<void> RadioResponse::getDataRegistrationStateResponse_1_4(
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getIccCardStatusResponse_1_4(const V1_0::RadioResponseInfo& info,
|
||||
const V1_4::CardStatus& cardStatus) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getPreferredNetworkTypeBitmapResponse(
|
||||
const V1_0::RadioResponseInfo& info,
|
||||
hidl_bitfield<V1_4::RadioAccessFamily> networkTypeBitmap) {
|
||||
@@ -645,16 +493,6 @@ Return<void> RadioResponse::setupDataCallResponse_1_4(const V1_0::RadioResponseI
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setAllowedCarriersResponse_1_4(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getAllowedCarriersResponse_1_4(
|
||||
const V1_0::RadioResponseInfo& info, const V1_4::CarrierRestrictionsWithPriority& carriers,
|
||||
V1_4::SimLockMultiSimPolicy multiSimPolicy) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getSignalStrengthResponse_1_4(
|
||||
const V1_0::RadioResponseInfo& info, const V1_4::SignalStrength& signalStrength) {
|
||||
return {};
|
||||
@@ -670,15 +508,6 @@ Return<void> RadioResponse::setLinkCapacityReportingCriteriaResponse_1_5(
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::enableUiccApplicationsResponse(const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::areUiccApplicationsEnabledResponse(const V1_0::RadioResponseInfo& info,
|
||||
bool enabled) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSystemSelectionChannelsResponse_1_5(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
return {};
|
||||
@@ -741,17 +570,6 @@ Return<void> RadioResponse::setNetworkSelectionModeManualResponse_1_5(
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplySimDepersonalizationResponse(const V1_0::RadioResponseInfo& info,
|
||||
V1_5::PersoSubstate persoType,
|
||||
int32_t remainingRetries) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getIccCardStatusResponse_1_5(const V1_0::RadioResponseInfo& info,
|
||||
const V1_5::CardStatus& cardStatus) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
@@ -767,10 +585,6 @@ Return<void> RadioResponse::getDataCallListResponse_1_6(
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSimCardPowerResponse_1_6(const V1_6::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setNrDualConnectivityStateResponse(
|
||||
const V1_6::RadioResponseInfo& info) {
|
||||
return {};
|
||||
@@ -849,18 +663,4 @@ Return<void> RadioResponse::getSlicingConfigResponse(const V1_6::RadioResponseIn
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getSimPhonebookCapacityResponse(
|
||||
const V1_6::RadioResponseInfo& info, const V1_6::PhonebookCapacity& capacity) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::updateSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info,
|
||||
int32_t updatedRecordIndex) {
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
|
||||
@@ -28,6 +28,18 @@ V1_6::RadioResponseInfo notSupported(int32_t serial) {
|
||||
};
|
||||
}
|
||||
|
||||
std::string toAidl(const hidl_string& str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
hidl_string toHidl(const std::string& str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
uint8_t toAidl(int8_t v) {
|
||||
return v;
|
||||
}
|
||||
|
||||
aidl::RadioIndicationType toAidl(V1_0::RadioIndicationType type) {
|
||||
return aidl::RadioIndicationType(type);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,10 @@ namespace android::hardware::radio::compat {
|
||||
|
||||
V1_6::RadioResponseInfo notSupported(int32_t serial);
|
||||
|
||||
std::string toAidl(const hidl_string& str);
|
||||
hidl_string toHidl(const std::string& str);
|
||||
uint8_t toAidl(int8_t v);
|
||||
|
||||
aidl::android::hardware::radio::RadioIndicationType toAidl(V1_0::RadioIndicationType type);
|
||||
aidl::android::hardware::radio::RadioResponseType toAidl(V1_0::RadioResponseType type);
|
||||
aidl::android::hardware::radio::RadioError toAidl(V1_0::RadioError type);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <aidl/android/hardware/radio/messaging/IRadioMessagingIndication.h>
|
||||
#include <aidl/android/hardware/radio/sim/IRadioSimIndication.h>
|
||||
#include <android/hardware/radio/1.6/IRadioIndication.h>
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
@@ -23,6 +24,7 @@ namespace android::hardware::radio::compat {
|
||||
class RadioIndication : public V1_6::IRadioIndication {
|
||||
std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication>
|
||||
mMessagingCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> mSimCb;
|
||||
|
||||
// IRadioIndication @ 1.0
|
||||
Return<void> radioStateChanged(V1_0::RadioIndicationType type,
|
||||
@@ -174,6 +176,8 @@ class RadioIndication : public V1_6::IRadioIndication {
|
||||
void setResponseFunction(
|
||||
std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication>
|
||||
radioMessagingIndication);
|
||||
void setResponseFunction(
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb);
|
||||
};
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <aidl/android/hardware/radio/messaging/IRadioMessagingResponse.h>
|
||||
#include <aidl/android/hardware/radio/sim/IRadioSimResponse.h>
|
||||
#include <android/hardware/radio/1.6/IRadioResponse.h>
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
@@ -23,6 +24,7 @@ namespace android::hardware::radio::compat {
|
||||
class RadioResponse : public V1_6::IRadioResponse {
|
||||
std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse>
|
||||
mMessagingCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> mSimCb;
|
||||
|
||||
// IRadioResponse @ 1.0
|
||||
Return<void> getIccCardStatusResponse(const V1_0::RadioResponseInfo& info,
|
||||
@@ -402,6 +404,8 @@ class RadioResponse : public V1_6::IRadioResponse {
|
||||
void setResponseFunction(
|
||||
std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse>
|
||||
radioMessagingResponse);
|
||||
void setResponseFunction(
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb);
|
||||
};
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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 "RadioCompatBase.h"
|
||||
|
||||
#include <aidl/android/hardware/radio/sim/BnRadioSim.h>
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
class RadioSim : public RadioCompatBase, public aidl::android::hardware::radio::sim::BnRadioSim {
|
||||
::ndk::ScopedAStatus areUiccApplicationsEnabled(int32_t serial) override;
|
||||
::ndk::ScopedAStatus changeIccPin2ForApp(int32_t serial, const std::string& oldPin2,
|
||||
const std::string& newPin2,
|
||||
const std::string& aid) override;
|
||||
::ndk::ScopedAStatus changeIccPinForApp(int32_t serial, const std::string& oldPin,
|
||||
const std::string& newPin,
|
||||
const std::string& aid) override;
|
||||
::ndk::ScopedAStatus enableUiccApplications(int32_t serial, bool enable) override;
|
||||
::ndk::ScopedAStatus getAllowedCarriers(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getCdmaSubscription(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getCdmaSubscriptionSource(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getFacilityLockForApp(int32_t serial, const std::string& facility,
|
||||
const std::string& password, int32_t serviceClass,
|
||||
const std::string& appId) override;
|
||||
::ndk::ScopedAStatus getIccCardStatus(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getImsiForApp(int32_t serial, const std::string& aid) override;
|
||||
::ndk::ScopedAStatus getSimPhonebookCapacity(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getSimPhonebookRecords(int32_t serial) override;
|
||||
::ndk::ScopedAStatus iccCloseLogicalChannel(int32_t serial, int32_t channelId) override;
|
||||
::ndk::ScopedAStatus iccIoForApp(
|
||||
int32_t serial, const ::aidl::android::hardware::radio::sim::IccIo& iccIo) override;
|
||||
::ndk::ScopedAStatus iccOpenLogicalChannel(int32_t serial, const std::string& aid,
|
||||
int32_t p2) override;
|
||||
::ndk::ScopedAStatus iccTransmitApduBasicChannel(
|
||||
int32_t serial, const ::aidl::android::hardware::radio::sim::SimApdu& message) override;
|
||||
::ndk::ScopedAStatus iccTransmitApduLogicalChannel(
|
||||
int32_t serial, const ::aidl::android::hardware::radio::sim::SimApdu& message) override;
|
||||
::ndk::ScopedAStatus reportStkServiceIsRunning(int32_t serial) override;
|
||||
::ndk::ScopedAStatus requestIccSimAuthentication(int32_t serial, int32_t authContext,
|
||||
const std::string& authData,
|
||||
const std::string& aid) override;
|
||||
::ndk::ScopedAStatus responseAcknowledgement() override;
|
||||
::ndk::ScopedAStatus sendEnvelope(int32_t serial, const std::string& command) override;
|
||||
::ndk::ScopedAStatus sendEnvelopeWithStatus(int32_t serial,
|
||||
const std::string& contents) override;
|
||||
::ndk::ScopedAStatus sendTerminalResponseToSim(int32_t serial,
|
||||
const std::string& commandResponse) override;
|
||||
::ndk::ScopedAStatus setAllowedCarriers(
|
||||
int32_t serial,
|
||||
const ::aidl::android::hardware::radio::sim::CarrierRestrictions& carriers,
|
||||
::aidl::android::hardware::radio::sim::SimLockMultiSimPolicy multiSimPolicy) override;
|
||||
::ndk::ScopedAStatus setCarrierInfoForImsiEncryption(
|
||||
int32_t serial,
|
||||
const ::aidl::android::hardware::radio::sim::ImsiEncryptionInfo& imsiEncryptionInfo)
|
||||
override;
|
||||
::ndk::ScopedAStatus setCdmaSubscriptionSource(
|
||||
int32_t serial,
|
||||
::aidl::android::hardware::radio::sim::CdmaSubscriptionSource cdmaSub) override;
|
||||
::ndk::ScopedAStatus setFacilityLockForApp( //
|
||||
int32_t serial, const std::string& facility, bool lockState, const std::string& passwd,
|
||||
int32_t serviceClass, const std::string& appId) override;
|
||||
::ndk::ScopedAStatus setResponseFunctions(
|
||||
const std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse>&
|
||||
radioSimResponse,
|
||||
const std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication>&
|
||||
radioSimIndication) override;
|
||||
::ndk::ScopedAStatus setSimCardPower(
|
||||
int32_t serial, ::aidl::android::hardware::radio::sim::CardPowerState powerUp) override;
|
||||
::ndk::ScopedAStatus setUiccSubscription(
|
||||
int32_t serial,
|
||||
const ::aidl::android::hardware::radio::sim::SelectUiccSub& uiccSub) override;
|
||||
::ndk::ScopedAStatus supplyIccPin2ForApp(int32_t serial, const std::string& pin2,
|
||||
const std::string& aid) override;
|
||||
::ndk::ScopedAStatus supplyIccPinForApp(int32_t serial, const std::string& pin,
|
||||
const std::string& aid) override;
|
||||
::ndk::ScopedAStatus supplyIccPuk2ForApp(int32_t serial, const std::string& puk2,
|
||||
const std::string& pin2,
|
||||
const std::string& aid) override;
|
||||
::ndk::ScopedAStatus supplyIccPukForApp(int32_t serial, const std::string& puk,
|
||||
const std::string& pin,
|
||||
const std::string& aid) override;
|
||||
::ndk::ScopedAStatus supplySimDepersonalization(
|
||||
int32_t serial, ::aidl::android::hardware::radio::sim::PersoSubstate persoType,
|
||||
const std::string& controlKey) override;
|
||||
::ndk::ScopedAStatus updateSimPhonebookRecords(
|
||||
int32_t serial,
|
||||
const ::aidl::android::hardware::radio::sim::PhonebookRecordInfo& recordInfo) override;
|
||||
|
||||
public:
|
||||
using RadioCompatBase::RadioCompatBase;
|
||||
};
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
121
radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp
Normal file
121
radio/aidl/compat/libradiocompat/sim/RadioIndication-sim.cpp
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* 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>
|
||||
|
||||
#include "commonStructs.h"
|
||||
#include "debug.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "collections.h"
|
||||
|
||||
#define RADIO_MODULE "SimIndication"
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
namespace aidl = ::aidl::android::hardware::radio::sim;
|
||||
|
||||
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioSimIndication> simCb) {
|
||||
CHECK(simCb);
|
||||
mSimCb = simCb;
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::carrierInfoForImsiEncryption(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->carrierInfoForImsiEncryption(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::cdmaSubscriptionSourceChanged(
|
||||
V1_0::RadioIndicationType type, V1_0::CdmaSubscriptionSource cdmaSource) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->cdmaSubscriptionSourceChanged(toAidl(type), aidl::CdmaSubscriptionSource(cdmaSource));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::simPhonebookChanged(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->simPhonebookChanged(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::simPhonebookRecordsReceived(
|
||||
V1_0::RadioIndicationType type, V1_6::PbReceivedStatus status,
|
||||
const hidl_vec<V1_6::PhonebookRecordInfo>& rec) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->simPhonebookRecordsReceived(toAidl(type), aidl::PbReceivedStatus(status), toAidl(rec));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::simRefresh(V1_0::RadioIndicationType type,
|
||||
const V1_0::SimRefreshResult& refreshResult) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->simRefresh(toAidl(type), toAidl(refreshResult));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::simStatusChanged(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->simStatusChanged(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::stkEventNotify(V1_0::RadioIndicationType type,
|
||||
const hidl_string& cmd) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->stkEventNotify(toAidl(type), cmd);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::stkProactiveCommand(V1_0::RadioIndicationType type,
|
||||
const hidl_string& cmd) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->stkProactiveCommand(toAidl(type), cmd);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::stkSessionEnd(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->stkSessionEnd(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::subscriptionStatusChanged(V1_0::RadioIndicationType type,
|
||||
bool activate) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->subscriptionStatusChanged(toAidl(type), activate);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::uiccApplicationsEnablementChanged(V1_0::RadioIndicationType type,
|
||||
bool enabled) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->uiccApplicationsEnablementChanged(toAidl(type), enabled);
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
366
radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp
Normal file
366
radio/aidl/compat/libradiocompat/sim/RadioResponse-sim.cpp
Normal file
@@ -0,0 +1,366 @@
|
||||
/*
|
||||
* 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/RadioResponse.h>
|
||||
|
||||
#include "commonStructs.h"
|
||||
#include "debug.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "collections.h"
|
||||
|
||||
#define RADIO_MODULE "SimResponse"
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
namespace aidl = ::aidl::android::hardware::radio::sim;
|
||||
|
||||
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioSimResponse> simCb) {
|
||||
CHECK(simCb);
|
||||
mSimCb = simCb;
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::areUiccApplicationsEnabledResponse(const V1_0::RadioResponseInfo& info,
|
||||
bool enabled) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->areUiccApplicationsEnabledResponse(toAidl(info), enabled);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::changeIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->changeIccPin2ForAppResponse(toAidl(info), remainingRetries);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::changeIccPinForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->changeIccPinForAppResponse(toAidl(info), remainingRetries);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::enableUiccApplicationsResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->enableUiccApplicationsResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getAllowedCarriersResponse( //
|
||||
const V1_0::RadioResponseInfo& info, bool allAllowed, const V1_0::CarrierRestrictions& cr) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
aidl::CarrierRestrictions aidlCr = toAidl(cr);
|
||||
if (allAllowed) aidlCr = {};
|
||||
mSimCb->getAllowedCarriersResponse(toAidl(info), aidlCr, {});
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getAllowedCarriersResponse_1_4(
|
||||
const V1_0::RadioResponseInfo& info, const V1_4::CarrierRestrictionsWithPriority& carriers,
|
||||
V1_4::SimLockMultiSimPolicy multiSimPolicy) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getAllowedCarriersResponse(toAidl(info), toAidl(carriers),
|
||||
aidl::SimLockMultiSimPolicy(multiSimPolicy));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCDMASubscriptionResponse(
|
||||
const V1_0::RadioResponseInfo& info, const hidl_string& mdn, const hidl_string& hSid,
|
||||
const hidl_string& hNid, const hidl_string& min, const hidl_string& prl) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getCdmaSubscriptionResponse(toAidl(info), mdn, hSid, hNid, min, prl);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info,
|
||||
V1_0::CdmaSubscriptionSource s) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getCdmaSubscriptionSourceResponse(toAidl(info), aidl::CdmaSubscriptionSource(s));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t response) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getFacilityLockForAppResponse(toAidl(info), response);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getIccCardStatusResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::CardStatus& cardStatus) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getIccCardStatusResponse_1_2(const V1_0::RadioResponseInfo& info,
|
||||
const V1_2::CardStatus& cardStatus) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getIccCardStatusResponse_1_4(const V1_0::RadioResponseInfo& info,
|
||||
const V1_4::CardStatus& cardStatus) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getIccCardStatusResponse_1_5(const V1_0::RadioResponseInfo& info,
|
||||
const V1_5::CardStatus& cardStatus) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getIccCardStatusResponse(toAidl(info), toAidl(cardStatus));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getIMSIForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_string& imsi) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getImsiForAppResponse(toAidl(info), imsi);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getSimPhonebookCapacityResponse(
|
||||
const V1_6::RadioResponseInfo& info, const V1_6::PhonebookCapacity& capacity) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getSimPhonebookCapacityResponse(toAidl(info), toAidl(capacity));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->getSimPhonebookRecordsResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccCloseLogicalChannelResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->iccCloseLogicalChannelResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccIOForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::IccIoResult& iccIo) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->iccIoForAppResponse(toAidl(info), toAidl(iccIo));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccOpenLogicalChannelResponse( //
|
||||
const V1_0::RadioResponseInfo& info, int32_t chanId, const hidl_vec<int8_t>& selectResp) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->iccOpenLogicalChannelResponse(toAidl(info), chanId, toAidl(selectResp));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccTransmitApduBasicChannelResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::IccIoResult& result) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->iccTransmitApduBasicChannelResponse(toAidl(info), toAidl(result));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccTransmitApduLogicalChannelResponse(
|
||||
const V1_0::RadioResponseInfo& info, const V1_0::IccIoResult& result) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->iccTransmitApduLogicalChannelResponse(toAidl(info), toAidl(result));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::reportStkServiceIsRunningResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->reportStkServiceIsRunningResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::requestIccSimAuthenticationResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::IccIoResult& result) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->requestIccSimAuthenticationResponse(toAidl(info), toAidl(result));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::requestIsimAuthenticationResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_string&) {
|
||||
LOG_CALL << info.serial;
|
||||
LOG(ERROR) << "requestIsimAuthenticationResponse is not supposed to be called";
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendEnvelopeResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_string& commandResponse) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->sendEnvelopeResponse(toAidl(info), commandResponse);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendEnvelopeWithStatusResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::IccIoResult& iccIo) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->sendEnvelopeWithStatusResponse(toAidl(info), toAidl(iccIo));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendTerminalResponseToSimResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->sendTerminalResponseToSimResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setAllowedCarriersResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t numAllowed) {
|
||||
LOG_CALL << info.serial << ' ' << numAllowed;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setAllowedCarriersResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setAllowedCarriersResponse_1_4(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setAllowedCarriersResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCarrierInfoForImsiEncryptionResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setCarrierInfoForImsiEncryptionResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setCdmaSubscriptionSourceResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setFacilityLockForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t retry) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setFacilityLockForAppResponse(toAidl(info), retry);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSimCardPowerResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setSimCardPowerResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSimCardPowerResponse_1_1(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setSimCardPowerResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSimCardPowerResponse_1_6(const V1_6::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setSimCardPowerResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setUiccSubscriptionResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setUiccSubscriptionResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplyIccPin2ForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->supplyIccPin2ForAppResponse(toAidl(info), remainingRetries);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplyIccPinForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->supplyIccPinForAppResponse(toAidl(info), remainingRetries);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplyIccPuk2ForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->supplyIccPuk2ForAppResponse(toAidl(info), remainingRetries);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplyIccPukForAppResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t remainingRetries) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->supplyIccPukForAppResponse(toAidl(info), remainingRetries);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplySimDepersonalizationResponse(const V1_0::RadioResponseInfo& info,
|
||||
V1_5::PersoSubstate persoType,
|
||||
int32_t rRet) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->supplySimDepersonalizationResponse(toAidl(info), aidl::PersoSubstate(persoType), rRet);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::updateSimPhonebookRecordsResponse(const V1_6::RadioResponseInfo& info,
|
||||
int32_t updatedRecordIndex) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->updateSimPhonebookRecordsResponse(toAidl(info), updatedRecordIndex);
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
295
radio/aidl/compat/libradiocompat/sim/RadioSim.cpp
Normal file
295
radio/aidl/compat/libradiocompat/sim/RadioSim.cpp
Normal file
@@ -0,0 +1,295 @@
|
||||
/*
|
||||
* 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/RadioSim.h>
|
||||
|
||||
#include "commonStructs.h"
|
||||
#include "debug.h"
|
||||
#include "structs.h"
|
||||
|
||||
#include "collections.h"
|
||||
|
||||
#define RADIO_MODULE "Sim"
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
using ::ndk::ScopedAStatus;
|
||||
namespace aidl = ::aidl::android::hardware::radio::sim;
|
||||
constexpr auto ok = &ScopedAStatus::ok;
|
||||
|
||||
ScopedAStatus RadioSim::areUiccApplicationsEnabled(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->areUiccApplicationsEnabled(serial);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::changeIccPin2ForApp(int32_t serial, const std::string& oldPin2,
|
||||
const std::string& newPin2, const std::string& aid) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->changeIccPin2ForApp(serial, oldPin2, newPin2, aid);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::changeIccPinForApp(int32_t serial, const std::string& oldPin,
|
||||
const std::string& newPin, const std::string& aid) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->changeIccPinForApp(serial, oldPin, newPin, aid);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::enableUiccApplications(int32_t serial, bool enable) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->enableUiccApplications(serial, enable);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::getAllowedCarriers(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getAllowedCarriers(serial);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::getCdmaSubscription(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getCDMASubscription(serial);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::getCdmaSubscriptionSource(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getCdmaSubscriptionSource(serial);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::getFacilityLockForApp( //
|
||||
int32_t serial, const std::string& facility, const std::string& password,
|
||||
int32_t serviceClass, const std::string& appId) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getFacilityLockForApp(serial, facility, password, serviceClass, appId);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::getIccCardStatus(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getIccCardStatus(serial);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::getImsiForApp(int32_t serial, const std::string& aid) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getImsiForApp(serial, aid);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::getSimPhonebookCapacity(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getSimPhonebookCapacity(serial);
|
||||
} else {
|
||||
respond().getSimPhonebookCapacityResponse(notSupported(serial), {});
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::getSimPhonebookRecords(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getSimPhonebookRecords(serial);
|
||||
} else {
|
||||
respond().getSimPhonebookRecordsResponse(notSupported(serial));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::iccCloseLogicalChannel(int32_t serial, int32_t channelId) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->iccCloseLogicalChannel(serial, channelId);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::iccIoForApp(int32_t serial, const aidl::IccIo& iccIo) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->iccIOForApp(serial, toHidl(iccIo));
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::iccOpenLogicalChannel(int32_t serial, const std::string& aid, int32_t p2) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->iccOpenLogicalChannel(serial, aid, p2);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::iccTransmitApduBasicChannel(int32_t serial, const aidl::SimApdu& message) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->iccTransmitApduBasicChannel(serial, toHidl(message));
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::iccTransmitApduLogicalChannel(int32_t serial,
|
||||
const aidl::SimApdu& message) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->iccTransmitApduLogicalChannel(serial, toHidl(message));
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::reportStkServiceIsRunning(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->reportStkServiceIsRunning(serial);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::requestIccSimAuthentication( //
|
||||
int32_t serial, int32_t authContext, const std::string& authData, const std::string& aid) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->requestIccSimAuthentication(serial, authContext, authData, aid);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::responseAcknowledgement() {
|
||||
LOG_CALL;
|
||||
mHal1_5->responseAcknowledgement();
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::sendEnvelope(int32_t serial, const std::string& command) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->sendEnvelope(serial, command);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::sendEnvelopeWithStatus(int32_t serial, const std::string& contents) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->sendEnvelopeWithStatus(serial, contents);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::sendTerminalResponseToSim(int32_t serial,
|
||||
const std::string& commandResponse) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->sendTerminalResponseToSim(serial, commandResponse);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::setAllowedCarriers( //
|
||||
int32_t serial, const aidl::CarrierRestrictions& carriers, aidl::SimLockMultiSimPolicy mp) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->setAllowedCarriers_1_4(serial, toHidl(carriers), V1_4::SimLockMultiSimPolicy(mp));
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::setCarrierInfoForImsiEncryption(
|
||||
int32_t serial, const aidl::ImsiEncryptionInfo& imsiEncryptionInfo) {
|
||||
LOG_CALL << serial;
|
||||
if (mHal1_6) {
|
||||
mHal1_6->setCarrierInfoForImsiEncryption_1_6(serial, toHidl_1_6(imsiEncryptionInfo));
|
||||
} else {
|
||||
mHal1_5->setCarrierInfoForImsiEncryption(serial, toHidl(imsiEncryptionInfo));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::setCdmaSubscriptionSource(int32_t serial,
|
||||
aidl::CdmaSubscriptionSource cdmaSub) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->setCdmaSubscriptionSource(serial, V1_0::CdmaSubscriptionSource(cdmaSub));
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::setFacilityLockForApp( //
|
||||
int32_t serial, const std::string& facility, bool lockState, const std::string& password,
|
||||
int32_t serviceClass, const std::string& appId) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->setFacilityLockForApp(serial, facility, lockState, password, serviceClass, appId);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::setResponseFunctions(
|
||||
const std::shared_ptr<aidl::IRadioSimResponse>& simResponse,
|
||||
const std::shared_ptr<aidl::IRadioSimIndication>& simIndication) {
|
||||
LOG_CALL << simResponse << ' ' << simIndication;
|
||||
|
||||
CHECK(simResponse);
|
||||
CHECK(simIndication);
|
||||
|
||||
mRadioResponse->setResponseFunction(simResponse);
|
||||
mRadioIndication->setResponseFunction(simIndication);
|
||||
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::setSimCardPower(int32_t serial, aidl::CardPowerState powerUp) {
|
||||
LOG_CALL << serial;
|
||||
if (mHal1_6) {
|
||||
mHal1_6->setSimCardPower_1_6(serial, V1_1::CardPowerState(powerUp));
|
||||
} else {
|
||||
mHal1_5->setSimCardPower_1_1(serial, V1_1::CardPowerState(powerUp));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::setUiccSubscription(int32_t serial, const aidl::SelectUiccSub& uiccSub) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->setUiccSubscription(serial, toHidl(uiccSub));
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::supplyIccPin2ForApp(int32_t serial, const std::string& pin2,
|
||||
const std::string& aid) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->supplyIccPin2ForApp(serial, pin2, aid);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::supplyIccPinForApp(int32_t serial, const std::string& pin,
|
||||
const std::string& aid) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->supplyIccPinForApp(serial, pin, aid);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::supplyIccPuk2ForApp(int32_t serial, const std::string& puk2,
|
||||
const std::string& pin2, const std::string& aid) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->supplyIccPuk2ForApp(serial, puk2, pin2, aid);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::supplyIccPukForApp(int32_t serial, const std::string& puk,
|
||||
const std::string& pin, const std::string& aid) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->supplyIccPukForApp(serial, puk, pin, aid);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::supplySimDepersonalization(int32_t serial, aidl::PersoSubstate pss,
|
||||
const std::string& controlKey) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->supplySimDepersonalization(serial, V1_5::PersoSubstate(pss), controlKey);
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::updateSimPhonebookRecords(int32_t serial,
|
||||
const aidl::PhonebookRecordInfo& recordInfo) {
|
||||
LOG_CALL << serial;
|
||||
if (mHal1_6) {
|
||||
mHal1_6->updateSimPhonebookRecords(serial, toHidl(recordInfo));
|
||||
} else {
|
||||
respond().updateSimPhonebookRecordsResponse(notSupported(serial), 0);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
221
radio/aidl/compat/libradiocompat/sim/structs.cpp
Normal file
221
radio/aidl/compat/libradiocompat/sim/structs.cpp
Normal file
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
* 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 "structs.h"
|
||||
|
||||
#include "commonStructs.h"
|
||||
|
||||
#include "collections.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
namespace aidl = ::aidl::android::hardware::radio::sim;
|
||||
|
||||
V1_0::IccIo toHidl(const aidl::IccIo& icc) {
|
||||
return {
|
||||
.command = icc.command,
|
||||
.fileId = icc.fileId,
|
||||
.path = icc.path,
|
||||
.p1 = icc.p1,
|
||||
.p2 = icc.p2,
|
||||
.p3 = icc.p3,
|
||||
.data = icc.data,
|
||||
.pin2 = icc.pin2,
|
||||
.aid = icc.aid,
|
||||
};
|
||||
}
|
||||
|
||||
V1_0::SimApdu toHidl(const aidl::SimApdu& apdu) {
|
||||
return {
|
||||
.sessionId = apdu.sessionId,
|
||||
.cla = apdu.cla,
|
||||
.instruction = apdu.instruction,
|
||||
.p1 = apdu.p1,
|
||||
.p2 = apdu.p2,
|
||||
.p3 = apdu.p3,
|
||||
.data = apdu.data,
|
||||
};
|
||||
}
|
||||
|
||||
aidl::Carrier toAidl(const V1_0::Carrier& carrier) {
|
||||
return {
|
||||
.mcc = carrier.mcc,
|
||||
.mnc = carrier.mnc,
|
||||
.matchType = static_cast<int32_t>(carrier.matchType),
|
||||
.matchData = carrier.matchData,
|
||||
};
|
||||
}
|
||||
|
||||
V1_0::Carrier toHidl(const aidl::Carrier& carrier) {
|
||||
return {
|
||||
.mcc = carrier.mcc,
|
||||
.mnc = carrier.mnc,
|
||||
.matchType = V1_0::CarrierMatchType{carrier.matchType},
|
||||
.matchData = carrier.matchData,
|
||||
};
|
||||
}
|
||||
|
||||
aidl::CarrierRestrictions toAidl(const V1_0::CarrierRestrictions& cr) {
|
||||
return {
|
||||
.allowedCarriers = toAidl(cr.allowedCarriers),
|
||||
.excludedCarriers = toAidl(cr.excludedCarriers),
|
||||
.allowedCarriersPrioritized = true,
|
||||
};
|
||||
}
|
||||
|
||||
aidl::CarrierRestrictions toAidl(const V1_4::CarrierRestrictionsWithPriority& cr) {
|
||||
return {
|
||||
.allowedCarriers = toAidl(cr.allowedCarriers),
|
||||
.excludedCarriers = toAidl(cr.excludedCarriers),
|
||||
.allowedCarriersPrioritized = cr.allowedCarriersPrioritized,
|
||||
};
|
||||
}
|
||||
|
||||
V1_4::CarrierRestrictionsWithPriority toHidl(const aidl::CarrierRestrictions& cr) {
|
||||
return {
|
||||
.allowedCarriers = toHidl(cr.allowedCarriers),
|
||||
.excludedCarriers = toHidl(cr.excludedCarriers),
|
||||
.allowedCarriersPrioritized = cr.allowedCarriersPrioritized,
|
||||
};
|
||||
}
|
||||
|
||||
V1_1::ImsiEncryptionInfo toHidl(const aidl::ImsiEncryptionInfo& info) {
|
||||
return {
|
||||
.mcc = info.mcc,
|
||||
.mnc = info.mnc,
|
||||
.carrierKey = info.carrierKey,
|
||||
.keyIdentifier = info.keyIdentifier,
|
||||
.expirationTime = info.expirationTime,
|
||||
};
|
||||
}
|
||||
|
||||
V1_6::ImsiEncryptionInfo toHidl_1_6(const aidl::ImsiEncryptionInfo& info) {
|
||||
return {
|
||||
.base = toHidl(info),
|
||||
.keyType = V1_6::PublicKeyType{info.keyType},
|
||||
};
|
||||
}
|
||||
|
||||
V1_0::SelectUiccSub toHidl(const aidl::SelectUiccSub& sub) {
|
||||
return {
|
||||
.slot = sub.slot,
|
||||
.appIndex = sub.appIndex,
|
||||
.subType = {},
|
||||
.actStatus = {},
|
||||
};
|
||||
}
|
||||
|
||||
aidl::PhonebookRecordInfo toAidl(const V1_6::PhonebookRecordInfo& info) {
|
||||
return {
|
||||
.recordId = static_cast<int32_t>(info.recordId),
|
||||
.name = info.name,
|
||||
.number = info.number,
|
||||
.emails = toAidl(info.emails),
|
||||
.additionalNumbers = toAidl(info.additionalNumbers),
|
||||
};
|
||||
}
|
||||
|
||||
V1_6::PhonebookRecordInfo toHidl(const aidl::PhonebookRecordInfo& info) {
|
||||
return {
|
||||
.recordId = static_cast<uint32_t>(info.recordId),
|
||||
.name = info.name,
|
||||
.number = info.number,
|
||||
.emails = toHidl(info.emails),
|
||||
.additionalNumbers = toHidl(info.additionalNumbers),
|
||||
};
|
||||
}
|
||||
|
||||
aidl::SimRefreshResult toAidl(const V1_0::SimRefreshResult& res) {
|
||||
return {
|
||||
.type = static_cast<int32_t>(res.type),
|
||||
.efId = res.efId,
|
||||
.aid = res.aid,
|
||||
};
|
||||
}
|
||||
|
||||
aidl::CardStatus toAidl(const V1_0::CardStatus& status) {
|
||||
return toAidl(V1_2::CardStatus{status, 0, "", ""});
|
||||
}
|
||||
|
||||
aidl::CardStatus toAidl(const V1_2::CardStatus& status) {
|
||||
return toAidl(V1_4::CardStatus{status, ""});
|
||||
}
|
||||
|
||||
aidl::CardStatus toAidl(const V1_4::CardStatus& status) {
|
||||
auto aidlStatus = toAidl(V1_5::CardStatus{status, {}});
|
||||
aidlStatus.applications = toAidl(status.base.base.applications);
|
||||
return aidlStatus;
|
||||
}
|
||||
|
||||
aidl::CardStatus toAidl(const V1_5::CardStatus& status) {
|
||||
return {
|
||||
.cardState = static_cast<int32_t>(status.base.base.base.cardState),
|
||||
.universalPinState = aidl::PinState(status.base.base.base.universalPinState),
|
||||
.gsmUmtsSubscriptionAppIndex = status.base.base.base.gsmUmtsSubscriptionAppIndex,
|
||||
.cdmaSubscriptionAppIndex = status.base.base.base.cdmaSubscriptionAppIndex,
|
||||
.imsSubscriptionAppIndex = status.base.base.base.imsSubscriptionAppIndex,
|
||||
.applications = toAidl(status.applications),
|
||||
.atr = status.base.base.atr,
|
||||
.iccid = status.base.base.iccid,
|
||||
.eid = status.base.eid,
|
||||
// TODO(b/203699028): we don't know portId here (but we can get it from RadioConfig)
|
||||
.slotMap = {static_cast<int32_t>(status.base.base.physicalSlotId), 0},
|
||||
};
|
||||
}
|
||||
|
||||
aidl::AppStatus toAidl(const V1_0::AppStatus& status) {
|
||||
return toAidl({status, V1_5::PersoSubstate(status.persoSubstate)});
|
||||
}
|
||||
|
||||
aidl::AppStatus toAidl(const V1_5::AppStatus& status) {
|
||||
return {
|
||||
.appType = static_cast<int32_t>(status.base.appType),
|
||||
.appState = static_cast<int32_t>(status.base.appState),
|
||||
.persoSubstate = aidl::PersoSubstate(status.persoSubstate),
|
||||
.aidPtr = status.base.aidPtr,
|
||||
.appLabelPtr = status.base.appLabelPtr,
|
||||
.pin1Replaced = (status.base.pin1Replaced != 0),
|
||||
.pin1 = aidl::PinState(status.base.pin1),
|
||||
.pin2 = aidl::PinState(status.base.pin2),
|
||||
};
|
||||
}
|
||||
|
||||
aidl::PhonebookCapacity toAidl(const V1_6::PhonebookCapacity& c) {
|
||||
return {
|
||||
.maxAdnRecords = c.maxAdnRecords,
|
||||
.usedAdnRecords = c.usedAdnRecords,
|
||||
.maxEmailRecords = c.maxEmailRecords,
|
||||
.usedEmailRecords = c.usedEmailRecords,
|
||||
.maxAdditionalNumberRecords = c.maxAdditionalNumberRecords,
|
||||
.usedAdditionalNumberRecords = c.usedAdditionalNumberRecords,
|
||||
.maxNameLen = c.maxNameLen,
|
||||
.maxNumberLen = c.maxNumberLen,
|
||||
.maxEmailLen = c.maxEmailLen,
|
||||
.maxAdditionalNumberLen = c.maxAdditionalNumberLen,
|
||||
};
|
||||
}
|
||||
|
||||
aidl::IccIoResult toAidl(const V1_0::IccIoResult& iir) {
|
||||
return {
|
||||
.sw1 = iir.sw1,
|
||||
.sw2 = iir.sw2,
|
||||
.simResponse = iir.simResponse,
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
75
radio/aidl/compat/libradiocompat/sim/structs.h
Normal file
75
radio/aidl/compat/libradiocompat/sim/structs.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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/sim/AppStatus.h>
|
||||
#include <aidl/android/hardware/radio/sim/CardStatus.h>
|
||||
#include <aidl/android/hardware/radio/sim/Carrier.h>
|
||||
#include <aidl/android/hardware/radio/sim/CarrierRestrictions.h>
|
||||
#include <aidl/android/hardware/radio/sim/IccIo.h>
|
||||
#include <aidl/android/hardware/radio/sim/IccIoResult.h>
|
||||
#include <aidl/android/hardware/radio/sim/ImsiEncryptionInfo.h>
|
||||
#include <aidl/android/hardware/radio/sim/PhonebookCapacity.h>
|
||||
#include <aidl/android/hardware/radio/sim/PhonebookRecordInfo.h>
|
||||
#include <aidl/android/hardware/radio/sim/SelectUiccSub.h>
|
||||
#include <aidl/android/hardware/radio/sim/SimApdu.h>
|
||||
#include <aidl/android/hardware/radio/sim/SimRefreshResult.h>
|
||||
#include <android/hardware/radio/1.6/types.h>
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
V1_0::IccIo toHidl(const ::aidl::android::hardware::radio::sim::IccIo& icc);
|
||||
|
||||
V1_0::SimApdu toHidl(const ::aidl::android::hardware::radio::sim::SimApdu& apdu);
|
||||
|
||||
::aidl::android::hardware::radio::sim::Carrier toAidl(const V1_0::Carrier& carrier);
|
||||
V1_0::Carrier toHidl(const ::aidl::android::hardware::radio::sim::Carrier& carrier);
|
||||
|
||||
::aidl::android::hardware::radio::sim::CarrierRestrictions //
|
||||
toAidl(const V1_0::CarrierRestrictions& cr);
|
||||
::aidl::android::hardware::radio::sim::CarrierRestrictions //
|
||||
toAidl(const V1_4::CarrierRestrictionsWithPriority& cr);
|
||||
V1_4::CarrierRestrictionsWithPriority //
|
||||
toHidl(const ::aidl::android::hardware::radio::sim::CarrierRestrictions& cr);
|
||||
|
||||
V1_1::ImsiEncryptionInfo //
|
||||
toHidl(const ::aidl::android::hardware::radio::sim::ImsiEncryptionInfo& info);
|
||||
V1_6::ImsiEncryptionInfo //
|
||||
toHidl_1_6(const ::aidl::android::hardware::radio::sim::ImsiEncryptionInfo& info);
|
||||
|
||||
V1_0::SelectUiccSub toHidl(const ::aidl::android::hardware::radio::sim::SelectUiccSub& sub);
|
||||
|
||||
::aidl::android::hardware::radio::sim::PhonebookRecordInfo //
|
||||
toAidl(const V1_6::PhonebookRecordInfo& info);
|
||||
V1_6::PhonebookRecordInfo //
|
||||
toHidl(const ::aidl::android::hardware::radio::sim::PhonebookRecordInfo& info);
|
||||
|
||||
::aidl::android::hardware::radio::sim::SimRefreshResult //
|
||||
toAidl(const V1_0::SimRefreshResult& res);
|
||||
|
||||
::aidl::android::hardware::radio::sim::CardStatus toAidl(const V1_0::CardStatus& status);
|
||||
::aidl::android::hardware::radio::sim::CardStatus toAidl(const V1_2::CardStatus& status);
|
||||
::aidl::android::hardware::radio::sim::CardStatus toAidl(const V1_4::CardStatus& status);
|
||||
::aidl::android::hardware::radio::sim::CardStatus toAidl(const V1_5::CardStatus& status);
|
||||
|
||||
::aidl::android::hardware::radio::sim::AppStatus toAidl(const V1_0::AppStatus& status);
|
||||
::aidl::android::hardware::radio::sim::AppStatus toAidl(const V1_5::AppStatus& status);
|
||||
|
||||
::aidl::android::hardware::radio::sim::PhonebookCapacity toAidl(const V1_6::PhonebookCapacity& c);
|
||||
|
||||
::aidl::android::hardware::radio::sim::IccIoResult toAidl(const V1_0::IccIoResult& iir);
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
@@ -40,6 +40,7 @@ cc_binary {
|
||||
"android.hardware.radio.config@1.2",
|
||||
"android.hardware.radio.config@1.3",
|
||||
"android.hardware.radio.messaging-V1-ndk",
|
||||
"android.hardware.radio.sim-V1-ndk",
|
||||
"android.hardware.radio@1.0",
|
||||
"android.hardware.radio@1.1",
|
||||
"android.hardware.radio@1.2",
|
||||
|
||||
@@ -13,5 +13,9 @@
|
||||
<name>android.hardware.radio.messaging</name>
|
||||
<fqname>IRadioMessaging/slot1</fqname>
|
||||
</hal>
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.radio.sim</name>
|
||||
<fqname>IRadioSim/slot1</fqname>
|
||||
</hal>
|
||||
-->
|
||||
</manifest>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <libradiocompat/RadioIndication.h>
|
||||
#include <libradiocompat/RadioMessaging.h>
|
||||
#include <libradiocompat/RadioResponse.h>
|
||||
#include <libradiocompat/RadioSim.h>
|
||||
|
||||
namespace android::hardware::radio::service {
|
||||
|
||||
@@ -57,6 +58,7 @@ static void publishRadio(std::string slot) {
|
||||
radioHidl->setResponseFunctions(responseCb, indicationCb).assertOk();
|
||||
|
||||
publishRadioHal<compat::RadioMessaging>(radioHidl, responseCb, indicationCb, slot);
|
||||
publishRadioHal<compat::RadioSim>(radioHidl, responseCb, indicationCb, slot);
|
||||
}
|
||||
|
||||
static void publishRadioConfig() {
|
||||
|
||||
Reference in New Issue
Block a user