From 0de4d31569444d3d4b819bbf3e783ee9f0f17c9d Mon Sep 17 00:00:00 2001 From: sqian Date: Fri, 6 Apr 2018 20:50:58 -0700 Subject: [PATCH] Radio Sap 1.2 default implementation Checked points: - service is on - vts can run on it - provided a dummy implementation that a VTS test can pass it - applied with recent update in radio 1.2 hal - format repaired - pass on a 1.0 VTS test, a 1.1 VTS test, and a 1.2 VTS test Bug: 74114758 Test: run vts Change-Id: I8a052e3cedb41db9028552ab88f1e26492718497 --- radio/1.2/default/Android.bp | 39 + radio/1.2/default/Radio.cpp | 911 ++++++++++++++++++ radio/1.2/default/Radio.h | 291 ++++++ radio/1.2/default/Sap.cpp | 79 ++ radio/1.2/default/Sap.h | 61 ++ ...ndroid.hardware.radio@1.2-radio-service.rc | 4 + .../android.hardware.radio@1.2-sap-service.rc | 4 + radio/1.2/default/radio-service.cpp | 41 + radio/1.2/default/sap-service.cpp | 41 + 9 files changed, 1471 insertions(+) create mode 100644 radio/1.2/default/Android.bp create mode 100644 radio/1.2/default/Radio.cpp create mode 100644 radio/1.2/default/Radio.h create mode 100644 radio/1.2/default/Sap.cpp create mode 100644 radio/1.2/default/Sap.h create mode 100644 radio/1.2/default/android.hardware.radio@1.2-radio-service.rc create mode 100644 radio/1.2/default/android.hardware.radio@1.2-sap-service.rc create mode 100644 radio/1.2/default/radio-service.cpp create mode 100644 radio/1.2/default/sap-service.cpp diff --git a/radio/1.2/default/Android.bp b/radio/1.2/default/Android.bp new file mode 100644 index 0000000000..f8ff4c7a8c --- /dev/null +++ b/radio/1.2/default/Android.bp @@ -0,0 +1,39 @@ +cc_binary { + name: "android.hardware.radio@1.2-radio-service", + init_rc: ["android.hardware.radio@1.2-radio-service.rc"], + relative_install_path: "hw", + vendor: true, + srcs: [ + "Radio.cpp", + "radio-service.cpp", + ], + shared_libs: [ + "libhidlbase", + "libhidltransport", + "liblog", + "libutils", + "android.hardware.radio@1.2", + "android.hardware.radio@1.0", + "android.hardware.radio@1.1", + ], +} + +cc_binary { + name: "android.hardware.radio@1.2-sap-service", + init_rc: ["android.hardware.radio@1.2-sap-service.rc"], + relative_install_path: "hw", + vendor: true, + srcs: [ + "Sap.cpp", + "sap-service.cpp", + ], + shared_libs: [ + "libhidlbase", + "libhidltransport", + "liblog", + "libutils", + "android.hardware.radio@1.2", + "android.hardware.radio@1.0", + "android.hardware.radio@1.1", + ], +} diff --git a/radio/1.2/default/Radio.cpp b/radio/1.2/default/Radio.cpp new file mode 100644 index 0000000000..73512e4c23 --- /dev/null +++ b/radio/1.2/default/Radio.cpp @@ -0,0 +1,911 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.1 (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.1 + * + * 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 "Radio.h" + +namespace android { +namespace hardware { +namespace radio { +namespace V1_2 { +namespace implementation { + +// Methods from ::android::hardware::radio::V1_0::IRadio follow. +Return Radio::setResponseFunctions( + const sp<::android::hardware::radio::V1_0::IRadioResponse>& radioResponse, + const sp<::android::hardware::radio::V1_0::IRadioIndication>& radioIndication) { + mRadioResponse = radioResponse; + mRadioIndication = radioIndication; + mRadioResponseV1_1 = ::android::hardware::radio::V1_1::IRadioResponse::castFrom(mRadioResponse) + .withDefault(nullptr); + mRadioIndicationV1_1 = + ::android::hardware::radio::V1_1::IRadioIndication::castFrom(mRadioIndication) + .withDefault(nullptr); + if (mRadioResponseV1_1 == nullptr || mRadioIndicationV1_1 == nullptr) { + mRadioResponseV1_1 = nullptr; + mRadioIndicationV1_1 = nullptr; + } + mRadioResponseV1_2 = ::android::hardware::radio::V1_2::IRadioResponse::castFrom(mRadioResponse) + .withDefault(nullptr); + mRadioIndicationV1_2 = + ::android::hardware::radio::V1_2::IRadioIndication::castFrom(mRadioIndication) + .withDefault(nullptr); + if (mRadioResponseV1_2 == nullptr || mRadioIndicationV1_2 == nullptr) { + mRadioResponseV1_2 = nullptr; + mRadioIndicationV1_2 = nullptr; + } + return Void(); +} + +Return Radio::getIccCardStatus(int32_t serial) { + /** + * IRadio-defined request is called from the client and talk to the radio to get + * IRadioResponse-defined response or/and IRadioIndication-defined indication back to the + * client. This dummy implementation omits and replaces the design and implementation of vendor + * codes that needs to handle the receipt of the request and the return of the response from the + * radio; this just directly returns a dummy response back to the client. + */ + + ALOGD("Radio Request: getIccCardStatus is entering"); + + if (mRadioResponse != nullptr || mRadioResponseV1_1 != nullptr || + mRadioResponseV1_2 != nullptr) { + // Dummy RadioResponseInfo as part of response to return in 1.0, 1.1 and 1.2 + ::android::hardware::radio::V1_0::RadioResponseInfo info; + info.serial = serial; + info.type = ::android::hardware::radio::V1_0::RadioResponseType::SOLICITED; + info.error = ::android::hardware::radio::V1_0::RadioError::NONE; + /** + * In IRadio and IRadioResponse 1.2, getIccCardStatus can trigger radio to return + * getIccCardStatusResponse_1_2. In their 1.0 and 1.1, getIccCardStatus can trigger radio to + * return getIccCardStatusResponse. + */ + if (mRadioResponseV1_2 != nullptr) { + // Dummy CardStatus as part of getIccCardStatusResponse_1_2 response to return + ::android::hardware::radio::V1_2::CardStatus card_status; + card_status.base.cardState = ::android::hardware::radio::V1_0::CardState::ABSENT; + card_status.base.gsmUmtsSubscriptionAppIndex = 0; + card_status.base.cdmaSubscriptionAppIndex = 0; + mRadioResponseV1_2->getIccCardStatusResponse_1_2(info, card_status); + ALOGD("Radio Response: getIccCardStatusResponse_1_2 is sent"); + } else if (mRadioResponseV1_1 != nullptr) { + // Dummy CardStatus as part of getIccCardStatusResponse response to return + ::android::hardware::radio::V1_0::CardStatus card_status_V1_0; + card_status_V1_0.cardState = ::android::hardware::radio::V1_0::CardState::ABSENT; + card_status_V1_0.gsmUmtsSubscriptionAppIndex = 0; + card_status_V1_0.cdmaSubscriptionAppIndex = 0; + mRadioResponseV1_1->getIccCardStatusResponse(info, card_status_V1_0); + ALOGD("Radio Response: getIccCardStatusResponse is sent"); + } else { + // Dummy CardStatus as part of getIccCardStatusResponse response to return + ::android::hardware::radio::V1_0::CardStatus card_status_V1_0; + card_status_V1_0.cardState = ::android::hardware::radio::V1_0::CardState::ABSENT; + card_status_V1_0.gsmUmtsSubscriptionAppIndex = 0; + card_status_V1_0.cdmaSubscriptionAppIndex = 0; + mRadioResponse->getIccCardStatusResponse(info, card_status_V1_0); + ALOGD("Radio Response: getIccCardStatusResponse is sent"); + } + } else { + ALOGD("mRadioResponse, mRadioResponseV1_1, and mRadioResponseV1_2 are NULL"); + } + return Void(); +} + +Return Radio::supplyIccPinForApp(int32_t /* serial */, const hidl_string& /* pin */, + const hidl_string& /* aid */) { + // TODO implement + return Void(); +} + +Return Radio::supplyIccPukForApp(int32_t /* serial */, const hidl_string& /* puk */, + const hidl_string& /* pin */, const hidl_string& /* aid */) { + // TODO implement + return Void(); +} + +Return Radio::supplyIccPin2ForApp(int32_t /* serial */, const hidl_string& /* pin2 */, + const hidl_string& /* aid */) { + // TODO implement + return Void(); +} + +Return Radio::supplyIccPuk2ForApp(int32_t /* serial */, const hidl_string& /* puk2 */, + const hidl_string& /* pin2 */, + const hidl_string& /* aid */) { + // TODO implement + return Void(); +} + +Return Radio::changeIccPinForApp(int32_t /* serial */, const hidl_string& /* oldPin */, + const hidl_string& /* newPin */, + const hidl_string& /* aid */) { + // TODO implement + return Void(); +} + +Return Radio::changeIccPin2ForApp(int32_t /* serial */, const hidl_string& /* oldPin2 */, + const hidl_string& /* newPin2 */, + const hidl_string& /* aid */) { + // TODO implement + return Void(); +} + +Return Radio::supplyNetworkDepersonalization(int32_t /* serial */, + const hidl_string& /* netPin */) { + // TODO implement + return Void(); +} + +Return Radio::getCurrentCalls(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::dial(int32_t /* serial */, + const ::android::hardware::radio::V1_0::Dial& /* dialInfo */) { + // TODO implement + return Void(); +} + +Return Radio::getImsiForApp(int32_t /* serial */, const hidl_string& /* aid */) { + // TODO implement + return Void(); +} + +Return Radio::hangup(int32_t /* serial */, int32_t /* gsmIndex */) { + // TODO implement + return Void(); +} + +Return Radio::hangupWaitingOrBackground(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::hangupForegroundResumeBackground(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::switchWaitingOrHoldingAndActive(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::conference(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::rejectCall(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getLastCallFailCause(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getSignalStrength(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getVoiceRegistrationState(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getDataRegistrationState(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getOperator(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setRadioPower(int32_t /* serial */, bool /* on */) { + // TODO implement + return Void(); +} + +Return Radio::sendDtmf(int32_t /* serial */, const hidl_string& /* s */) { + // TODO implement + return Void(); +} + +Return Radio::sendSms(int32_t /* serial */, + const ::android::hardware::radio::V1_0::GsmSmsMessage& /* message */) { + // TODO implement + return Void(); +} + +Return Radio::sendSMSExpectMore( + int32_t /* serial */, const ::android::hardware::radio::V1_0::GsmSmsMessage& /* message */) { + // TODO implement + return Void(); +} + +Return Radio::setupDataCall( + int32_t /* serial */, ::android::hardware::radio::V1_0::RadioTechnology /* radioTechnology */, + const ::android::hardware::radio::V1_0::DataProfileInfo& /* dataProfileInfo */, + bool /* modemCognitive */, bool /* roamingAllowed */, bool /* isRoaming */) { + // TODO implement + return Void(); +} + +Return Radio::iccIOForApp(int32_t /* serial */, + const ::android::hardware::radio::V1_0::IccIo& /* iccIo */) { + // TODO implement + return Void(); +} + +Return Radio::sendUssd(int32_t /* serial */, const hidl_string& /* ussd */) { + // TODO implement + return Void(); +} + +Return Radio::cancelPendingUssd(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getClir(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setClir(int32_t /* serial */, int32_t /* status */) { + // TODO implement + return Void(); +} + +Return Radio::getCallForwardStatus( + int32_t /* serial */, const ::android::hardware::radio::V1_0::CallForwardInfo& /* callInfo */) { + // TODO implement + return Void(); +} + +Return Radio::setCallForward( + int32_t /* serial */, const ::android::hardware::radio::V1_0::CallForwardInfo& /* callInfo */) { + // TODO implement + return Void(); +} + +Return Radio::getCallWaiting(int32_t /* serial */, int32_t /* serviceClass */) { + // TODO implement + return Void(); +} + +Return Radio::setCallWaiting(int32_t /* serial */, bool /* enable */, + int32_t /* serviceClass */) { + // TODO implement + return Void(); +} + +Return Radio::acknowledgeLastIncomingGsmSms( + int32_t /* serial */, bool /* success */, + ::android::hardware::radio::V1_0::SmsAcknowledgeFailCause /* cause */) { + // TODO implement + return Void(); +} + +Return Radio::acceptCall(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::deactivateDataCall(int32_t /* serial */, int32_t /* cid */, + bool /* reasonRadioShutDown */) { + // TODO implement + return Void(); +} + +Return Radio::getFacilityLockForApp(int32_t /* serial */, const hidl_string& /* facility */, + const hidl_string& /* password */, + int32_t /* serviceClass */, + const hidl_string& /* appId */) { + // TODO implement + return Void(); +} + +Return Radio::setFacilityLockForApp(int32_t /* serial */, const hidl_string& /* facility */, + bool /* lockState */, const hidl_string& /* password */, + int32_t /* serviceClass */, + const hidl_string& /* appId */) { + // TODO implement + return Void(); +} + +Return Radio::setBarringPassword(int32_t /* serial */, const hidl_string& /* facility */, + const hidl_string& /* oldPassword */, + const hidl_string& /* newPassword */) { + // TODO implement + return Void(); +} + +Return Radio::getNetworkSelectionMode(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setNetworkSelectionModeAutomatic(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setNetworkSelectionModeManual(int32_t /* serial */, + const hidl_string& /* operatorNumeric */) { + // TODO implement + return Void(); +} + +Return Radio::getAvailableNetworks(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::startDtmf(int32_t /* serial */, const hidl_string& /* s */) { + // TODO implement + return Void(); +} + +Return Radio::stopDtmf(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getBasebandVersion(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::separateConnection(int32_t /* serial */, int32_t /* gsmIndex */) { + // TODO implement + return Void(); +} + +Return Radio::setMute(int32_t /* serial */, bool /* enable */) { + // TODO implement + return Void(); +} + +Return Radio::getMute(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getClip(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getDataCallList(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setSuppServiceNotifications(int32_t /* serial */, bool /* enable */) { + // TODO implement + return Void(); +} + +Return Radio::writeSmsToSim( + int32_t /* serial */, + const ::android::hardware::radio::V1_0::SmsWriteArgs& /* smsWriteArgs */) { + // TODO implement + return Void(); +} + +Return Radio::deleteSmsOnSim(int32_t /* serial */, int32_t /* index */) { + // TODO implement + return Void(); +} + +Return Radio::setBandMode(int32_t /* serial */, + ::android::hardware::radio::V1_0::RadioBandMode /* mode */) { + // TODO implement + return Void(); +} + +Return Radio::getAvailableBandModes(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::sendEnvelope(int32_t /* serial */, const hidl_string& /* command */) { + // TODO implement + return Void(); +} + +Return Radio::sendTerminalResponseToSim(int32_t /* serial */, + const hidl_string& /* commandResponse */) { + // TODO implement + return Void(); +} + +Return Radio::handleStkCallSetupRequestFromSim(int32_t /* serial */, bool /* accept */) { + // TODO implement + return Void(); +} + +Return Radio::explicitCallTransfer(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setPreferredNetworkType( + int32_t /* serial */, ::android::hardware::radio::V1_0::PreferredNetworkType /* nwType */) { + // TODO implement + return Void(); +} + +Return Radio::getPreferredNetworkType(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getNeighboringCids(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setLocationUpdates(int32_t /* serial */, bool /* enable */) { + // TODO implement + return Void(); +} + +Return Radio::setCdmaSubscriptionSource( + int32_t /* serial */, ::android::hardware::radio::V1_0::CdmaSubscriptionSource /* cdmaSub */) { + // TODO implement + return Void(); +} + +Return Radio::setCdmaRoamingPreference( + int32_t /* serial */, ::android::hardware::radio::V1_0::CdmaRoamingType /* type */) { + // TODO implement + return Void(); +} + +Return Radio::getCdmaRoamingPreference(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setTTYMode(int32_t /* serial */, + ::android::hardware::radio::V1_0::TtyMode /* mode */) { + // TODO implement + return Void(); +} + +Return Radio::getTTYMode(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setPreferredVoicePrivacy(int32_t /* serial */, bool /* enable */) { + // TODO implement + return Void(); +} + +Return Radio::getPreferredVoicePrivacy(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::sendCDMAFeatureCode(int32_t /* serial */, + const hidl_string& /* featureCode */) { + // TODO implement + return Void(); +} + +Return Radio::sendBurstDtmf(int32_t /* serial */, const hidl_string& /* dtmf*/, + int32_t /*on*/, int32_t /*off */) { + // TODO implement + return Void(); +} + +Return Radio::sendCdmaSms(int32_t /* serial */, + const ::android::hardware::radio::V1_0::CdmaSmsMessage& /* sms */) { + // TODO implement + return Void(); +} + +Return Radio::acknowledgeLastIncomingCdmaSms( + int32_t /* serial */, const ::android::hardware::radio::V1_0::CdmaSmsAck& /* smsAck */) { + // TODO implement + return Void(); +} + +Return Radio::getGsmBroadcastConfig(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setGsmBroadcastConfig( + int32_t /* serial */, + const hidl_vec<::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo>& /* configInfo */) { + // TODO implement + return Void(); +} + +Return Radio::setGsmBroadcastActivation(int32_t /* serial */, bool /* activate */) { + // TODO implement + return Void(); +} + +Return Radio::getCdmaBroadcastConfig(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setCdmaBroadcastConfig( + int32_t /* serial */, + const hidl_vec< + ::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo>& /* configInfo */) { + // TODO implement + return Void(); +} + +Return Radio::setCdmaBroadcastActivation(int32_t /* serial */, bool /* activate */) { + // TODO implement + return Void(); +} + +Return Radio::getCDMASubscription(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::writeSmsToRuim( + int32_t /* serial */, const ::android::hardware::radio::V1_0::CdmaSmsWriteArgs& /* cdmaSms */) { + // TODO implement + return Void(); +} + +Return Radio::deleteSmsOnRuim(int32_t /* serial */, int32_t /* index */) { + // TODO implement + return Void(); +} + +Return Radio::getDeviceIdentity(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::exitEmergencyCallbackMode(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getSmscAddress(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setSmscAddress(int32_t /* serial */, const hidl_string& /* smsc */) { + // TODO implement + return Void(); +} + +Return Radio::reportSmsMemoryStatus(int32_t /* serial */, bool /* available */) { + // TODO implement + return Void(); +} + +Return Radio::reportStkServiceIsRunning(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getCdmaSubscriptionSource(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::requestIsimAuthentication(int32_t /* serial */, + const hidl_string& /* challenge */) { + // TODO implement + return Void(); +} + +Return Radio::acknowledgeIncomingGsmSmsWithPdu(int32_t /* serial */, bool /* success */, + const hidl_string& /* ackPdu */) { + // TODO implement + return Void(); +} + +Return Radio::sendEnvelopeWithStatus(int32_t /* serial */, + const hidl_string& /* contents */) { + // TODO implement + return Void(); +} + +Return Radio::getVoiceRadioTechnology(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getCellInfoList(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setCellInfoListRate(int32_t /* serial */, int32_t /*rate */) { + // TODO implement + return Void(); +} + +Return Radio::setInitialAttachApn( + int32_t /* serial */, + const ::android::hardware::radio::V1_0::DataProfileInfo& /* dataProfileInfo */, + bool /* modemCognitive */, bool /* isRoaming */) { + // TODO implement + return Void(); +} + +Return Radio::getImsRegistrationState(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::sendImsSms( + int32_t /* serial */, const ::android::hardware::radio::V1_0::ImsSmsMessage& /* message */) { + // TODO implement + return Void(); +} + +Return Radio::iccTransmitApduBasicChannel( + int32_t /* serial */, const ::android::hardware::radio::V1_0::SimApdu& /* message */) { + // TODO implement + return Void(); +} + +Return Radio::iccOpenLogicalChannel(int32_t /* serial */, const hidl_string& /* aid*/, + int32_t /*p2 */) { + // TODO implement + return Void(); +} + +Return Radio::iccCloseLogicalChannel(int32_t /* serial */, int32_t /* channelId */) { + // TODO implement + return Void(); +} + +Return Radio::iccTransmitApduLogicalChannel( + int32_t /* serial */, const ::android::hardware::radio::V1_0::SimApdu& /* message */) { + // TODO implement + return Void(); +} + +Return Radio::nvReadItem(int32_t /* serial */, + ::android::hardware::radio::V1_0::NvItem /* itemId */) { + // TODO implement + return Void(); +} + +Return Radio::nvWriteItem(int32_t /* serial */, + const ::android::hardware::radio::V1_0::NvWriteItem& /* item */) { + // TODO implement + return Void(); +} + +Return Radio::nvWriteCdmaPrl(int32_t /* serial */, const hidl_vec& /* prl */) { + // TODO implement + return Void(); +} + +Return Radio::nvResetConfig(int32_t /* serial */, + ::android::hardware::radio::V1_0::ResetNvType /* resetType */) { + // TODO implement + return Void(); +} + +Return Radio::setUiccSubscription( + int32_t /* serial */, const ::android::hardware::radio::V1_0::SelectUiccSub& /* uiccSub */) { + // TODO implement + return Void(); +} + +Return Radio::setDataAllowed(int32_t /* serial */, bool /* allow */) { + // TODO implement + return Void(); +} + +Return Radio::getHardwareConfig(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::requestIccSimAuthentication(int32_t /* serial */, int32_t /* authContext */, + const hidl_string& /* authData */, + const hidl_string& /* aid */) { + // TODO implement + return Void(); +} + +Return Radio::setDataProfile( + int32_t /* serial */, + const hidl_vec<::android::hardware::radio::V1_0::DataProfileInfo>& /* profiles */, + bool /* isRoaming */) { + // TODO implement + return Void(); +} + +Return Radio::requestShutdown(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getRadioCapability(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setRadioCapability( + int32_t /* serial */, const ::android::hardware::radio::V1_0::RadioCapability& /* rc */) { + // TODO implement + return Void(); +} + +Return Radio::startLceService(int32_t /* serial */, int32_t /* reportInterval */, + bool /* pullMode */) { + // TODO implement + return Void(); +} + +Return Radio::stopLceService(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::pullLceData(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::getModemActivityInfo(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::setAllowedCarriers( + int32_t /* serial */, bool /* allAllowed */, + const ::android::hardware::radio::V1_0::CarrierRestrictions& /* carriers */) { + // TODO implement + return Void(); +} + +Return Radio::getAllowedCarriers(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::sendDeviceState( + int32_t /* serial */, ::android::hardware::radio::V1_0::DeviceStateType /* deviceStateType */, + bool /* state */) { + // TODO implement + return Void(); +} + +Return Radio::setIndicationFilter(int32_t /* serial */, + hidl_bitfield /* indicationFilter */) { + // TODO implement + return Void(); +} + +Return Radio::setSimCardPower(int32_t /* serial */, bool /* powerUp */) { + // TODO implement + return Void(); +} + +Return Radio::responseAcknowledgement() { + // TODO implement + return Void(); +} + +// Methods from ::android::hardware::radio::V1_1::IRadio follow. +Return Radio::setCarrierInfoForImsiEncryption( + int32_t /* serial */, + const ::android::hardware::radio::V1_1::ImsiEncryptionInfo& /* imsiEncryptionInfo */) { + // TODO implement + return Void(); +} + +Return Radio::setSimCardPower_1_1( + int32_t /* serial */, ::android::hardware::radio::V1_1::CardPowerState /* powerUp */) { + // TODO implement + return Void(); +} + +Return Radio::startNetworkScan( + int32_t /* serial */, + const ::android::hardware::radio::V1_1::NetworkScanRequest& /* request */) { + // TODO implement + return Void(); +} + +Return Radio::stopNetworkScan(int32_t /* serial */) { + // TODO implement + return Void(); +} + +Return Radio::startKeepalive( + int32_t /* serial */, + const ::android::hardware::radio::V1_1::KeepaliveRequest& /* keepalive */) { + // TODO implement + return Void(); +} + +Return Radio::stopKeepalive(int32_t /* serial */, int32_t /* sessionHandle */) { + // TODO implement + return Void(); +} + +// Methods from ::android::hardware::radio::V1_2::IRadio follow. +Return Radio::startNetworkScan_1_2( + int32_t /* serial */, + const ::android::hardware::radio::V1_2::NetworkScanRequest& /* request */) { + // TODO implement + return Void(); +} + +Return Radio::setIndicationFilter_1_2( + int32_t /* serial */, hidl_bitfield /* indicationFilter */) { + // TODO implement + return Void(); +} + +Return Radio::setSignalStrengthReportingCriteria( + int32_t /* serial */, int32_t /*hysteresisMs*/, int32_t /*hysteresisDb */, + const hidl_vec& /* thresholdsDbm */, + ::android::hardware::radio::V1_2::AccessNetwork /* accessNetwork */) { + // TODO implement + return Void(); +} + +Return Radio::setLinkCapacityReportingCriteria( + int32_t /* serial */, int32_t /*hysteresisMs*/, int32_t /*hysteresisDlKbps*/, + int32_t /*hysteresisUlKbps */, const hidl_vec& /* thresholdsDownlinkKbps */, + const hidl_vec& /* thresholdsUplinkKbps */, + ::android::hardware::radio::V1_2::AccessNetwork /* accessNetwork */) { + // TODO implement + return Void(); +} + +Return Radio::setupDataCall_1_2( + int32_t /* serial */, ::android::hardware::radio::V1_2::AccessNetwork /* accessNetwork */, + const ::android::hardware::radio::V1_0::DataProfileInfo& /* dataProfileInfo */, + bool /* modemCognitive */, bool /* roamingAllowed */, bool /* isRoaming */, + ::android::hardware::radio::V1_2::DataRequestReason /* reason */, + const hidl_vec& /* addresses */, const hidl_vec& /* dnses */) { + // TODO implement + return Void(); +} + +Return Radio::deactivateDataCall_1_2( + int32_t /* serial */, int32_t /* cid */, + ::android::hardware::radio::V1_2::DataRequestReason /* reason */) { + // TODO implement + return Void(); +} + +} // namespace implementation +} // namespace V1_2 +} // namespace radio +} // namespace hardware +} // namespace android diff --git a/radio/1.2/default/Radio.h b/radio/1.2/default/Radio.h new file mode 100644 index 0000000000..eb8ab5e5ad --- /dev/null +++ b/radio/1.2/default/Radio.h @@ -0,0 +1,291 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.1 (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.1 + * + * 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. + */ +#ifndef ANDROID_HARDWARE_RADIO_V1_2_RADIO_H +#define ANDROID_HARDWARE_RADIO_V1_2_RADIO_H + +#include +#include +#include +#include +#include +#include + +namespace android { +namespace hardware { +namespace radio { +namespace V1_2 { +namespace implementation { + +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; + +struct Radio : public IRadio { + sp<::android::hardware::radio::V1_0::IRadioResponse> mRadioResponse; + sp<::android::hardware::radio::V1_0::IRadioIndication> mRadioIndication; + sp<::android::hardware::radio::V1_1::IRadioResponse> mRadioResponseV1_1; + sp<::android::hardware::radio::V1_1::IRadioIndication> mRadioIndicationV1_1; + sp<::android::hardware::radio::V1_2::IRadioResponse> mRadioResponseV1_2; + sp<::android::hardware::radio::V1_2::IRadioIndication> mRadioIndicationV1_2; + + // Methods from ::android::hardware::radio::V1_0::IRadio follow. + Return setResponseFunctions( + const sp<::android::hardware::radio::V1_0::IRadioResponse>& radioResponse, + const sp<::android::hardware::radio::V1_0::IRadioIndication>& radioIndication) override; + Return getIccCardStatus(int32_t serial) override; + Return supplyIccPinForApp(int32_t serial, const hidl_string& pin, + const hidl_string& aid) override; + Return supplyIccPukForApp(int32_t serial, const hidl_string& puk, const hidl_string& pin, + const hidl_string& aid) override; + Return supplyIccPin2ForApp(int32_t serial, const hidl_string& pin2, + const hidl_string& aid) override; + Return supplyIccPuk2ForApp(int32_t serial, const hidl_string& puk2, + const hidl_string& pin2, const hidl_string& aid) override; + Return changeIccPinForApp(int32_t serial, const hidl_string& oldPin, + const hidl_string& newPin, const hidl_string& aid) override; + Return changeIccPin2ForApp(int32_t serial, const hidl_string& oldPin2, + const hidl_string& newPin2, const hidl_string& aid) override; + Return supplyNetworkDepersonalization(int32_t serial, const hidl_string& netPin) override; + Return getCurrentCalls(int32_t serial) override; + Return dial(int32_t serial, + const ::android::hardware::radio::V1_0::Dial& dialInfo) override; + Return getImsiForApp(int32_t serial, const hidl_string& aid) override; + Return hangup(int32_t serial, int32_t gsmIndex) override; + Return hangupWaitingOrBackground(int32_t serial) override; + Return hangupForegroundResumeBackground(int32_t serial) override; + Return switchWaitingOrHoldingAndActive(int32_t serial) override; + Return conference(int32_t serial) override; + Return rejectCall(int32_t serial) override; + Return getLastCallFailCause(int32_t serial) override; + Return getSignalStrength(int32_t serial) override; + Return getVoiceRegistrationState(int32_t serial) override; + Return getDataRegistrationState(int32_t serial) override; + Return getOperator(int32_t serial) override; + Return setRadioPower(int32_t serial, bool on) override; + Return sendDtmf(int32_t serial, const hidl_string& s) override; + Return sendSms(int32_t serial, + const ::android::hardware::radio::V1_0::GsmSmsMessage& message) override; + Return sendSMSExpectMore( + int32_t serial, const ::android::hardware::radio::V1_0::GsmSmsMessage& message) override; + Return setupDataCall( + int32_t serial, ::android::hardware::radio::V1_0::RadioTechnology radioTechnology, + const ::android::hardware::radio::V1_0::DataProfileInfo& dataProfileInfo, + bool modemCognitive, bool roamingAllowed, bool isRoaming) override; + Return iccIOForApp(int32_t serial, + const ::android::hardware::radio::V1_0::IccIo& iccIo) override; + Return sendUssd(int32_t serial, const hidl_string& ussd) override; + Return cancelPendingUssd(int32_t serial) override; + Return getClir(int32_t serial) override; + Return setClir(int32_t serial, int32_t status) override; + Return getCallForwardStatus( + int32_t serial, const ::android::hardware::radio::V1_0::CallForwardInfo& callInfo) override; + Return setCallForward( + int32_t serial, const ::android::hardware::radio::V1_0::CallForwardInfo& callInfo) override; + Return getCallWaiting(int32_t serial, int32_t serviceClass) override; + Return setCallWaiting(int32_t serial, bool enable, int32_t serviceClass) override; + Return acknowledgeLastIncomingGsmSms( + int32_t serial, bool success, + ::android::hardware::radio::V1_0::SmsAcknowledgeFailCause cause) override; + Return acceptCall(int32_t serial) override; + Return deactivateDataCall(int32_t serial, int32_t cid, bool reasonRadioShutDown) override; + Return getFacilityLockForApp(int32_t serial, const hidl_string& facility, + const hidl_string& password, int32_t serviceClass, + const hidl_string& appId) override; + Return setFacilityLockForApp(int32_t serial, const hidl_string& facility, bool lockState, + const hidl_string& password, int32_t serviceClass, + const hidl_string& appId) override; + Return setBarringPassword(int32_t serial, const hidl_string& facility, + const hidl_string& oldPassword, + const hidl_string& newPassword) override; + Return getNetworkSelectionMode(int32_t serial) override; + Return setNetworkSelectionModeAutomatic(int32_t serial) override; + Return setNetworkSelectionModeManual(int32_t serial, + const hidl_string& operatorNumeric) override; + Return getAvailableNetworks(int32_t serial) override; + Return startDtmf(int32_t serial, const hidl_string& s) override; + Return stopDtmf(int32_t serial) override; + Return getBasebandVersion(int32_t serial) override; + Return separateConnection(int32_t serial, int32_t gsmIndex) override; + Return setMute(int32_t serial, bool enable) override; + Return getMute(int32_t serial) override; + Return getClip(int32_t serial) override; + Return getDataCallList(int32_t serial) override; + Return setSuppServiceNotifications(int32_t serial, bool enable) override; + Return writeSmsToSim( + int32_t serial, + const ::android::hardware::radio::V1_0::SmsWriteArgs& smsWriteArgs) override; + Return deleteSmsOnSim(int32_t serial, int32_t index) override; + Return setBandMode(int32_t serial, + ::android::hardware::radio::V1_0::RadioBandMode mode) override; + Return getAvailableBandModes(int32_t serial) override; + Return sendEnvelope(int32_t serial, const hidl_string& command) override; + Return sendTerminalResponseToSim(int32_t serial, + const hidl_string& commandResponse) override; + Return handleStkCallSetupRequestFromSim(int32_t serial, bool accept) override; + Return explicitCallTransfer(int32_t serial) override; + Return setPreferredNetworkType( + int32_t serial, ::android::hardware::radio::V1_0::PreferredNetworkType nwType) override; + Return getPreferredNetworkType(int32_t serial) override; + Return getNeighboringCids(int32_t serial) override; + Return setLocationUpdates(int32_t serial, bool enable) override; + Return setCdmaSubscriptionSource( + int32_t serial, ::android::hardware::radio::V1_0::CdmaSubscriptionSource cdmaSub) override; + Return setCdmaRoamingPreference( + int32_t serial, ::android::hardware::radio::V1_0::CdmaRoamingType type) override; + Return getCdmaRoamingPreference(int32_t serial) override; + Return setTTYMode(int32_t serial, + ::android::hardware::radio::V1_0::TtyMode mode) override; + Return getTTYMode(int32_t serial) override; + Return setPreferredVoicePrivacy(int32_t serial, bool enable) override; + Return getPreferredVoicePrivacy(int32_t serial) override; + Return sendCDMAFeatureCode(int32_t serial, const hidl_string& featureCode) override; + Return sendBurstDtmf(int32_t serial, const hidl_string& dtmf, int32_t on, + int32_t off) override; + Return sendCdmaSms(int32_t serial, + const ::android::hardware::radio::V1_0::CdmaSmsMessage& sms) override; + Return acknowledgeLastIncomingCdmaSms( + int32_t serial, const ::android::hardware::radio::V1_0::CdmaSmsAck& smsAck) override; + Return getGsmBroadcastConfig(int32_t serial) override; + Return setGsmBroadcastConfig( + int32_t serial, + const hidl_vec<::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo>& configInfo) + override; + Return setGsmBroadcastActivation(int32_t serial, bool activate) override; + Return getCdmaBroadcastConfig(int32_t serial) override; + Return setCdmaBroadcastConfig( + int32_t serial, + const hidl_vec<::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo>& configInfo) + override; + Return setCdmaBroadcastActivation(int32_t serial, bool activate) override; + Return getCDMASubscription(int32_t serial) override; + Return writeSmsToRuim( + int32_t serial, const ::android::hardware::radio::V1_0::CdmaSmsWriteArgs& cdmaSms) override; + Return deleteSmsOnRuim(int32_t serial, int32_t index) override; + Return getDeviceIdentity(int32_t serial) override; + Return exitEmergencyCallbackMode(int32_t serial) override; + Return getSmscAddress(int32_t serial) override; + Return setSmscAddress(int32_t serial, const hidl_string& smsc) override; + Return reportSmsMemoryStatus(int32_t serial, bool available) override; + Return reportStkServiceIsRunning(int32_t serial) override; + Return getCdmaSubscriptionSource(int32_t serial) override; + Return requestIsimAuthentication(int32_t serial, const hidl_string& challenge) override; + Return acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success, + const hidl_string& ackPdu) override; + Return sendEnvelopeWithStatus(int32_t serial, const hidl_string& contents) override; + Return getVoiceRadioTechnology(int32_t serial) override; + Return getCellInfoList(int32_t serial) override; + Return setCellInfoListRate(int32_t serial, int32_t rate) override; + Return setInitialAttachApn( + int32_t serial, const ::android::hardware::radio::V1_0::DataProfileInfo& dataProfileInfo, + bool modemCognitive, bool isRoaming) override; + Return getImsRegistrationState(int32_t serial) override; + Return sendImsSms( + int32_t serial, const ::android::hardware::radio::V1_0::ImsSmsMessage& message) override; + Return iccTransmitApduBasicChannel( + int32_t serial, const ::android::hardware::radio::V1_0::SimApdu& message) override; + Return iccOpenLogicalChannel(int32_t serial, const hidl_string& aid, int32_t p2) override; + Return iccCloseLogicalChannel(int32_t serial, int32_t channelId) override; + Return iccTransmitApduLogicalChannel( + int32_t serial, const ::android::hardware::radio::V1_0::SimApdu& message) override; + Return nvReadItem(int32_t serial, + ::android::hardware::radio::V1_0::NvItem itemId) override; + Return nvWriteItem(int32_t serial, + const ::android::hardware::radio::V1_0::NvWriteItem& item) override; + Return nvWriteCdmaPrl(int32_t serial, const hidl_vec& prl) override; + Return nvResetConfig(int32_t serial, + ::android::hardware::radio::V1_0::ResetNvType resetType) override; + Return setUiccSubscription( + int32_t serial, const ::android::hardware::radio::V1_0::SelectUiccSub& uiccSub) override; + Return setDataAllowed(int32_t serial, bool allow) override; + Return getHardwareConfig(int32_t serial) override; + Return requestIccSimAuthentication(int32_t serial, int32_t authContext, + const hidl_string& authData, + const hidl_string& aid) override; + Return setDataProfile( + int32_t serial, const hidl_vec<::android::hardware::radio::V1_0::DataProfileInfo>& profiles, + bool isRoaming) override; + Return requestShutdown(int32_t serial) override; + Return getRadioCapability(int32_t serial) override; + Return setRadioCapability( + int32_t serial, const ::android::hardware::radio::V1_0::RadioCapability& rc) override; + Return startLceService(int32_t serial, int32_t reportInterval, bool pullMode) override; + Return stopLceService(int32_t serial) override; + Return pullLceData(int32_t serial) override; + Return getModemActivityInfo(int32_t serial) override; + Return setAllowedCarriers( + int32_t serial, bool allAllowed, + const ::android::hardware::radio::V1_0::CarrierRestrictions& carriers) override; + Return getAllowedCarriers(int32_t serial) override; + Return sendDeviceState(int32_t serial, + ::android::hardware::radio::V1_0::DeviceStateType deviceStateType, + bool state) override; + Return setIndicationFilter(int32_t serial, + hidl_bitfield indicationFilter) override; + Return setSimCardPower(int32_t serial, bool powerUp) override; + Return responseAcknowledgement() override; + + // Methods from ::android::hardware::radio::V1_1::IRadio follow. + Return setCarrierInfoForImsiEncryption( + int32_t serial, + const ::android::hardware::radio::V1_1::ImsiEncryptionInfo& imsiEncryptionInfo) override; + Return setSimCardPower_1_1( + int32_t serial, ::android::hardware::radio::V1_1::CardPowerState powerUp) override; + Return startNetworkScan( + int32_t serial, + const ::android::hardware::radio::V1_1::NetworkScanRequest& request) override; + Return stopNetworkScan(int32_t serial) override; + Return startKeepalive( + int32_t serial, + const ::android::hardware::radio::V1_1::KeepaliveRequest& keepalive) override; + Return stopKeepalive(int32_t serial, int32_t sessionHandle) override; + + // Methods from ::android::hardware::radio::V1_2::IRadio follow. + Return startNetworkScan_1_2( + int32_t serial, + const ::android::hardware::radio::V1_2::NetworkScanRequest& request) override; + Return setIndicationFilter_1_2(int32_t serial, + hidl_bitfield indicationFilter) override; + Return setSignalStrengthReportingCriteria( + int32_t serial, int32_t hysteresisMs, int32_t hysteresisDb, + const hidl_vec& thresholdsDbm, + ::android::hardware::radio::V1_2::AccessNetwork accessNetwork) override; + Return setLinkCapacityReportingCriteria( + int32_t serial, int32_t hysteresisMs, int32_t hysteresisDlKbps, int32_t hysteresisUlKbps, + const hidl_vec& thresholdsDownlinkKbps, + const hidl_vec& thresholdsUplinkKbps, + ::android::hardware::radio::V1_2::AccessNetwork accessNetwork) override; + Return setupDataCall_1_2( + int32_t serial, ::android::hardware::radio::V1_2::AccessNetwork accessNetwork, + const ::android::hardware::radio::V1_0::DataProfileInfo& dataProfileInfo, + bool modemCognitive, bool roamingAllowed, bool isRoaming, + ::android::hardware::radio::V1_2::DataRequestReason reason, + const hidl_vec& addresses, const hidl_vec& dnses) override; + Return deactivateDataCall_1_2( + int32_t serial, int32_t cid, + ::android::hardware::radio::V1_2::DataRequestReason reason) override; +}; + +} // namespace implementation +} // namespace V1_2 +} // namespace radio +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_RADIO_V1_2_RADIO_H diff --git a/radio/1.2/default/Sap.cpp b/radio/1.2/default/Sap.cpp new file mode 100644 index 0000000000..83efd302b0 --- /dev/null +++ b/radio/1.2/default/Sap.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.1 (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.1 + * + * 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 "Sap.h" + +namespace android { +namespace hardware { +namespace radio { +namespace V1_2 { +namespace implementation { + +// Methods from ::android::hardware::radio::V1_0::ISap follow. +Return Sap::setCallback( + const sp<::android::hardware::radio::V1_0::ISapCallback>& sapCallback) { + mSapCallback = sapCallback; + return Void(); +} + +Return Sap::connectReq(int32_t /* token */, int32_t /* maxMsgSize */) { + // TODO implement + return Void(); +} + +Return Sap::disconnectReq(int32_t /* token */) { + // TODO implement + return Void(); +} + +Return Sap::apduReq(int32_t /* token */, + ::android::hardware::radio::V1_0::SapApduType /* type */, + const hidl_vec& /* command */) { + // TODO implement + return Void(); +} + +Return Sap::transferAtrReq(int32_t /* token */) { + // TODO implement + return Void(); +} + +Return Sap::powerReq(int32_t /* token */, bool /* state */) { + // TODO implement + return Void(); +} + +Return Sap::resetSimReq(int32_t /* token */) { + // TODO implement + return Void(); +} + +Return Sap::transferCardReaderStatusReq(int32_t /* token */) { + // TODO implement + return Void(); +} + +Return Sap::setTransferProtocolReq( + int32_t /* token */, + ::android::hardware::radio::V1_0::SapTransferProtocol /* transferProtocol */) { + // TODO implement + return Void(); +} + +} // namespace implementation +} // namespace V1_2 +} // namespace radio +} // namespace hardware +} // namespace android diff --git a/radio/1.2/default/Sap.h b/radio/1.2/default/Sap.h new file mode 100644 index 0000000000..033e877a7b --- /dev/null +++ b/radio/1.2/default/Sap.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.1 (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.1 + * + * 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. + */ +#ifndef ANDROID_HARDWARE_RADIO_V1_2_SAP_H +#define ANDROID_HARDWARE_RADIO_V1_2_SAP_H + +#include +#include +#include + +namespace android { +namespace hardware { +namespace radio { +namespace V1_2 { +namespace implementation { + +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; + +struct Sap : public ISap { + sp<::android::hardware::radio::V1_0::ISapCallback> mSapCallback; + // Methods from ::android::hardware::radio::V1_0::ISap follow. + Return setCallback( + const sp<::android::hardware::radio::V1_0::ISapCallback>& sapCallback) override; + Return connectReq(int32_t token, int32_t maxMsgSize) override; + Return disconnectReq(int32_t token) override; + Return apduReq(int32_t token, ::android::hardware::radio::V1_0::SapApduType type, + const hidl_vec& command) override; + Return transferAtrReq(int32_t token) override; + Return powerReq(int32_t token, bool state) override; + Return resetSimReq(int32_t token) override; + Return transferCardReaderStatusReq(int32_t token) override; + Return setTransferProtocolReq( + int32_t token, + ::android::hardware::radio::V1_0::SapTransferProtocol transferProtocol) override; +}; + +} // namespace implementation +} // namespace V1_2 +} // namespace radio +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_RADIO_V1_2_SAP_H diff --git a/radio/1.2/default/android.hardware.radio@1.2-radio-service.rc b/radio/1.2/default/android.hardware.radio@1.2-radio-service.rc new file mode 100644 index 0000000000..e126cd83b3 --- /dev/null +++ b/radio/1.2/default/android.hardware.radio@1.2-radio-service.rc @@ -0,0 +1,4 @@ +service vendor.radio-1-2 /vendor/bin/hw/android.hardware.radio@1.2-radio-service + class hal + user system + group system diff --git a/radio/1.2/default/android.hardware.radio@1.2-sap-service.rc b/radio/1.2/default/android.hardware.radio@1.2-sap-service.rc new file mode 100644 index 0000000000..845e6e58e9 --- /dev/null +++ b/radio/1.2/default/android.hardware.radio@1.2-sap-service.rc @@ -0,0 +1,4 @@ +service vendor.sap-1-2 /vendor/bin/hw/android.hardware.radio@1.2-sap-service + class hal + user system + group system diff --git a/radio/1.2/default/radio-service.cpp b/radio/1.2/default/radio-service.cpp new file mode 100644 index 0000000000..ae0d3d2938 --- /dev/null +++ b/radio/1.2/default/radio-service.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.1 (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.1 + * + * 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. + */ +#define LOG_TAG "android.hardware.radio@1.2-radio-service" + +#include +#include + +#include "Radio.h" + +using android::hardware::configureRpcThreadpool; +using android::hardware::joinRpcThreadpool; +using android::hardware::radio::V1_2::IRadio; +using android::hardware::radio::V1_2::implementation::Radio; +using android::sp; +using android::status_t; +using android::OK; + +int main() { + configureRpcThreadpool(1, true); + + sp radio = new Radio; + status_t status = radio->registerAsService(); + ALOGW_IF(status != OK, "Could not register IRadio v1.2"); + ALOGD("Default service is ready."); + + joinRpcThreadpool(); + return 1; +} \ No newline at end of file diff --git a/radio/1.2/default/sap-service.cpp b/radio/1.2/default/sap-service.cpp new file mode 100644 index 0000000000..796521d903 --- /dev/null +++ b/radio/1.2/default/sap-service.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.1 (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.1 + * + * 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. + */ +#define LOG_TAG "android.hardware.radio@1.2-sap-service" + +#include +#include + +#include "Sap.h" + +using android::hardware::configureRpcThreadpool; +using android::hardware::joinRpcThreadpool; +using android::hardware::radio::V1_2::ISap; +using android::hardware::radio::V1_2::implementation::Sap; +using android::sp; +using android::status_t; +using android::OK; + +int main() { + configureRpcThreadpool(1, true); + + sp sap = new Sap; + status_t status = sap->registerAsService(); + ALOGW_IF(status != OK, "Could not register ISap v1.2"); + ALOGD("Default service is ready."); + + joinRpcThreadpool(); + return 1; +} \ No newline at end of file