mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge changes Iac870a24,I74afe105,I7db17475,I1e0cd95f
* changes: Move Radio HAL compat shim logs to radio buffer Set HAL response functions after framework sets all of theirs. Use most recent available HAL methods. Use AIDL callbacks directly.
This commit is contained in:
@@ -28,7 +28,6 @@ cc_library {
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
//"-Wold-style-cast", // TODO(b/203699028) enable after aosp/1900880 gets merged
|
||||
"-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
|
||||
],
|
||||
shared_libs: [
|
||||
@@ -56,6 +55,7 @@ cc_library {
|
||||
"libutils",
|
||||
],
|
||||
srcs: [
|
||||
"CallbackManager.cpp",
|
||||
"DriverContext.cpp",
|
||||
"RadioCompatBase.cpp",
|
||||
"RadioIndication.cpp",
|
||||
|
||||
84
radio/aidl/compat/libradiocompat/CallbackManager.cpp
Normal file
84
radio/aidl/compat/libradiocompat/CallbackManager.cpp
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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/CallbackManager.h>
|
||||
|
||||
#include <android-base/logging.h>
|
||||
|
||||
using namespace std::literals::chrono_literals;
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
/**
|
||||
* How much setter thread will wait with setting response functions after the last
|
||||
* setResponseFunctions call from the framework. Subsequent calls from the framework reset the
|
||||
* clock, so this number should be larger than the longest time between setResponseFunctions calls
|
||||
* from the framework.
|
||||
*
|
||||
* Real world measurements with Cuttlefish give <10ms delay between Modem and Data and <2ms delays
|
||||
* between all others.
|
||||
*/
|
||||
static constexpr auto kDelayedSetterDelay = 100ms;
|
||||
|
||||
CallbackManager::CallbackManager(std::shared_ptr<DriverContext> context, sp<V1_5::IRadio> hidlHal)
|
||||
: mHidlHal(hidlHal),
|
||||
mRadioResponse(sp<compat::RadioResponse>::make(context)),
|
||||
mRadioIndication(sp<compat::RadioIndication>::make(context)),
|
||||
mDelayedSetterThread(&CallbackManager::delayedSetterThread, this) {}
|
||||
|
||||
CallbackManager::~CallbackManager() {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mDelayedSetterGuard);
|
||||
mDelayedSetterDeadline = std::nullopt;
|
||||
mDestroy = true;
|
||||
mDelayedSetterCv.notify_all();
|
||||
}
|
||||
mDelayedSetterThread.join();
|
||||
}
|
||||
|
||||
RadioResponse& CallbackManager::response() const {
|
||||
return *mRadioResponse;
|
||||
}
|
||||
|
||||
void CallbackManager::setResponseFunctionsDelayed() {
|
||||
std::unique_lock<std::mutex> lock(mDelayedSetterGuard);
|
||||
mDelayedSetterDeadline = std::chrono::steady_clock::now() + kDelayedSetterDelay;
|
||||
mDelayedSetterCv.notify_all();
|
||||
}
|
||||
|
||||
void CallbackManager::delayedSetterThread() {
|
||||
while (!mDestroy) {
|
||||
std::unique_lock<std::mutex> lock(mDelayedSetterGuard);
|
||||
auto deadline = mDelayedSetterDeadline;
|
||||
|
||||
// not waiting to set response functions
|
||||
if (!deadline) {
|
||||
mDelayedSetterCv.wait(lock);
|
||||
continue;
|
||||
}
|
||||
|
||||
// waiting to set response functions, but not yet
|
||||
if (*deadline > std::chrono::steady_clock::now()) {
|
||||
mDelayedSetterCv.wait_until(lock, *deadline);
|
||||
continue;
|
||||
}
|
||||
|
||||
mHidlHal->setResponseFunctions(mRadioResponse, mRadioIndication).assertOk();
|
||||
mDelayedSetterDeadline = std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
@@ -21,16 +21,10 @@
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
RadioCompatBase::RadioCompatBase(std::shared_ptr<DriverContext> context, sp<V1_5::IRadio> hidlHal,
|
||||
sp<RadioResponse> radioResponse, sp<RadioIndication> radioInd)
|
||||
std::shared_ptr<CallbackManager> cbMgr)
|
||||
: mContext(context),
|
||||
mHal1_5(hidlHal),
|
||||
mHal1_6(V1_6::IRadio::castFrom(hidlHal)),
|
||||
mRadioResponse(radioResponse),
|
||||
mRadioIndication(radioInd) {}
|
||||
|
||||
V1_6::IRadioResponse& RadioCompatBase::respond() {
|
||||
CHECK(mRadioResponse) << "This shouldn't happen (response functions are passed in constructor)";
|
||||
return *mRadioResponse;
|
||||
}
|
||||
mCallbackManager(cbMgr) {}
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
|
||||
@@ -27,12 +27,12 @@ RadioResponse::RadioResponse(std::shared_ptr<DriverContext> context) : mContext(
|
||||
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 (mDataCb) mDataCb->acknowledgeRequest(serial);
|
||||
if (mMessagingCb) mMessagingCb->acknowledgeRequest(serial);
|
||||
if (mModemCb) mModemCb->acknowledgeRequest(serial);
|
||||
if (mNetworkCb) mNetworkCb->acknowledgeRequest(serial);
|
||||
if (mSimCb) mSimCb->acknowledgeRequest(serial);
|
||||
if (mVoiceCb) mVoiceCb->acknowledgeRequest(serial);
|
||||
if (mDataCb) mDataCb.get()->acknowledgeRequest(serial);
|
||||
if (mMessagingCb) mMessagingCb.get()->acknowledgeRequest(serial);
|
||||
if (mModemCb) mModemCb.get()->acknowledgeRequest(serial);
|
||||
if (mNetworkCb) mNetworkCb.get()->acknowledgeRequest(serial);
|
||||
if (mSimCb) mSimCb.get()->acknowledgeRequest(serial);
|
||||
if (mVoiceCb) mVoiceCb.get()->acknowledgeRequest(serial);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ namespace android::hardware::radio::compat {
|
||||
|
||||
namespace aidl = ::aidl::android::hardware::radio;
|
||||
|
||||
V1_6::RadioResponseInfo notSupported(int32_t serial) {
|
||||
aidl::RadioResponseInfo notSupported(int32_t serial) {
|
||||
return {
|
||||
.type = V1_0::RadioResponseType::SOLICITED,
|
||||
.type = aidl::RadioResponseType::SOLICITED,
|
||||
.serial = serial,
|
||||
.error = V1_6::RadioError::REQUEST_NOT_SUPPORTED,
|
||||
.error = aidl::RadioError::REQUEST_NOT_SUPPORTED,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
V1_6::RadioResponseInfo notSupported(int32_t serial);
|
||||
aidl::android::hardware::radio::RadioResponseInfo notSupported(int32_t serial);
|
||||
|
||||
std::string toAidl(const hidl_string& str);
|
||||
hidl_string toHidl(const std::string& str);
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
#include <libradiocompat/RadioConfig.h>
|
||||
|
||||
#include "RadioConfigIndication.h"
|
||||
#include "RadioConfigResponse.h"
|
||||
#include "commonStructs.h"
|
||||
#include "debug.h"
|
||||
#include "structs.h"
|
||||
@@ -31,11 +29,13 @@ namespace aidl = ::aidl::android::hardware::radio::config;
|
||||
constexpr auto ok = &ScopedAStatus::ok;
|
||||
|
||||
RadioConfig::RadioConfig(sp<config::V1_1::IRadioConfig> hidlHal)
|
||||
: mHal1_1(hidlHal), mHal1_3(config::V1_3::IRadioConfig::castFrom(hidlHal)) {}
|
||||
: mHal1_1(hidlHal),
|
||||
mHal1_3(config::V1_3::IRadioConfig::castFrom(hidlHal)),
|
||||
mRadioConfigResponse(sp<RadioConfigResponse>::make()),
|
||||
mRadioConfigIndication(sp<RadioConfigIndication>::make()) {}
|
||||
|
||||
config::V1_3::IRadioConfigResponse& RadioConfig::respond() {
|
||||
CHECK(mRadioConfigResponse) << "setResponseFunctions was not called yet";
|
||||
return *mRadioConfigResponse;
|
||||
std::shared_ptr<aidl::IRadioConfigResponse> RadioConfig::respond() {
|
||||
return mRadioConfigResponse->respond();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioConfig::getHalDeviceCapabilities(int32_t serial) {
|
||||
@@ -43,7 +43,7 @@ ScopedAStatus RadioConfig::getHalDeviceCapabilities(int32_t serial) {
|
||||
if (mHal1_3) {
|
||||
mHal1_3->getHalDeviceCapabilities(serial);
|
||||
} else {
|
||||
respond().getHalDeviceCapabilitiesResponse(notSupported(serial), false);
|
||||
respond()->getHalDeviceCapabilitiesResponse(notSupported(serial), false);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
@@ -86,9 +86,9 @@ ScopedAStatus RadioConfig::setResponseFunctions(
|
||||
CHECK(radioConfigResponse);
|
||||
CHECK(radioConfigIndication);
|
||||
|
||||
mRadioConfigResponse = sp<RadioConfigResponse>::make(radioConfigResponse);
|
||||
mRadioConfigIndication = sp<RadioConfigIndication>::make(radioConfigIndication);
|
||||
mHal1_1->setResponseFunctions(mRadioConfigResponse, mRadioConfigIndication);
|
||||
mRadioConfigResponse->setResponseFunction(radioConfigResponse);
|
||||
mRadioConfigIndication->setResponseFunction(radioConfigIndication);
|
||||
mHal1_1->setResponseFunctions(mRadioConfigResponse, mRadioConfigIndication).assertOk();
|
||||
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "RadioConfigIndication.h"
|
||||
#include <libradiocompat/RadioConfigIndication.h>
|
||||
|
||||
#include "commonStructs.h"
|
||||
#include "debug.h"
|
||||
@@ -28,20 +28,26 @@ namespace android::hardware::radio::compat {
|
||||
|
||||
namespace aidl = ::aidl::android::hardware::radio::config;
|
||||
|
||||
RadioConfigIndication::RadioConfigIndication(std::shared_ptr<aidl::IRadioConfigIndication> callback)
|
||||
: mCallback(callback) {}
|
||||
void RadioConfigIndication::setResponseFunction(
|
||||
std::shared_ptr<aidl::IRadioConfigIndication> callback) {
|
||||
mCallback = callback;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioConfigIndication> RadioConfigIndication::indicate() {
|
||||
return mCallback.get();
|
||||
}
|
||||
|
||||
Return<void> RadioConfigIndication::simSlotsStatusChanged(
|
||||
V1_0::RadioIndicationType type, const hidl_vec<config::V1_0::SimSlotStatus>& slotStatus) {
|
||||
LOG_CALL << type;
|
||||
mCallback->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
|
||||
indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioConfigIndication::simSlotsStatusChanged_1_2(
|
||||
V1_0::RadioIndicationType type, const hidl_vec<config::V1_2::SimSlotStatus>& slotStatus) {
|
||||
LOG_CALL << type;
|
||||
mCallback->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
|
||||
indicate()->simSlotsStatusChanged(toAidl(type), toAidl(slotStatus));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "RadioConfigResponse.h"
|
||||
#include <libradiocompat/RadioConfigResponse.h>
|
||||
|
||||
#include "commonStructs.h"
|
||||
#include "debug.h"
|
||||
@@ -28,14 +28,20 @@ namespace android::hardware::radio::compat {
|
||||
|
||||
namespace aidl = ::aidl::android::hardware::radio::config;
|
||||
|
||||
RadioConfigResponse::RadioConfigResponse(std::shared_ptr<aidl::IRadioConfigResponse> callback)
|
||||
: mCallback(callback) {}
|
||||
void RadioConfigResponse::setResponseFunction(
|
||||
std::shared_ptr<aidl::IRadioConfigResponse> callback) {
|
||||
mCallback = callback;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioConfigResponse> RadioConfigResponse::respond() {
|
||||
return mCallback.get();
|
||||
}
|
||||
|
||||
Return<void> RadioConfigResponse::getSimSlotsStatusResponse(
|
||||
const V1_0::RadioResponseInfo& info,
|
||||
const hidl_vec<config::V1_0::SimSlotStatus>& slotStatus) {
|
||||
LOG_CALL << info.serial;
|
||||
mCallback->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus));
|
||||
respond()->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus));
|
||||
return {};
|
||||
};
|
||||
|
||||
@@ -43,47 +49,47 @@ Return<void> RadioConfigResponse::getSimSlotsStatusResponse_1_2(
|
||||
const V1_0::RadioResponseInfo& info,
|
||||
const hidl_vec<config::V1_2::SimSlotStatus>& slotStatus) {
|
||||
LOG_CALL << info.serial;
|
||||
mCallback->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus));
|
||||
respond()->getSimSlotsStatusResponse(toAidl(info), toAidl(slotStatus));
|
||||
return {};
|
||||
};
|
||||
|
||||
Return<void> RadioConfigResponse::setSimSlotsMappingResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
mCallback->setSimSlotsMappingResponse(toAidl(info));
|
||||
respond()->setSimSlotsMappingResponse(toAidl(info));
|
||||
return {};
|
||||
};
|
||||
|
||||
Return<void> RadioConfigResponse::getPhoneCapabilityResponse(
|
||||
const V1_0::RadioResponseInfo& info, const config::V1_1::PhoneCapability& phoneCapability) {
|
||||
LOG_CALL << info.serial;
|
||||
mCallback->getPhoneCapabilityResponse(toAidl(info), toAidl(phoneCapability));
|
||||
respond()->getPhoneCapabilityResponse(toAidl(info), toAidl(phoneCapability));
|
||||
return {};
|
||||
};
|
||||
|
||||
Return<void> RadioConfigResponse::setPreferredDataModemResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
mCallback->setPreferredDataModemResponse(toAidl(info));
|
||||
respond()->setPreferredDataModemResponse(toAidl(info));
|
||||
return {};
|
||||
};
|
||||
|
||||
Return<void> RadioConfigResponse::setModemsConfigResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
mCallback->setNumOfLiveModemsResponse(toAidl(info));
|
||||
respond()->setNumOfLiveModemsResponse(toAidl(info));
|
||||
return {};
|
||||
};
|
||||
|
||||
Return<void> RadioConfigResponse::getModemsConfigResponse(
|
||||
const V1_0::RadioResponseInfo& info, const config::V1_1::ModemsConfig& modemsConfig) {
|
||||
LOG_CALL << info.serial;
|
||||
mCallback->getNumOfLiveModemsResponse(toAidl(info), modemsConfig.numOfLiveModems);
|
||||
respond()->getNumOfLiveModemsResponse(toAidl(info), modemsConfig.numOfLiveModems);
|
||||
return {};
|
||||
};
|
||||
|
||||
Return<void> RadioConfigResponse::getHalDeviceCapabilitiesResponse(
|
||||
const V1_6::RadioResponseInfo& info, bool modemReducedFeatureSet1) {
|
||||
LOG_CALL << info.serial;
|
||||
mCallback->getHalDeviceCapabilitiesResponse(toAidl(info), modemReducedFeatureSet1);
|
||||
respond()->getHalDeviceCapabilitiesResponse(toAidl(info), modemReducedFeatureSet1);
|
||||
return {};
|
||||
};
|
||||
|
||||
|
||||
@@ -31,12 +31,16 @@ namespace aidl = ::aidl::android::hardware::radio::data;
|
||||
namespace aidlCommon = ::aidl::android::hardware::radio;
|
||||
constexpr auto ok = &ScopedAStatus::ok;
|
||||
|
||||
std::shared_ptr<aidl::IRadioDataResponse> RadioData::respond() {
|
||||
return mCallbackManager->response().dataCb();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioData::allocatePduSessionId(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
if (mHal1_6) {
|
||||
mHal1_6->allocatePduSessionId(serial);
|
||||
} else {
|
||||
respond().allocatePduSessionIdResponse(notSupported(serial), 0);
|
||||
respond()->allocatePduSessionIdResponse(notSupported(serial), 0);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
@@ -46,7 +50,7 @@ ScopedAStatus RadioData::cancelHandover(int32_t serial, int32_t callId) {
|
||||
if (mHal1_6) {
|
||||
mHal1_6->cancelHandover(serial, callId);
|
||||
} else {
|
||||
respond().cancelHandoverResponse(notSupported(serial));
|
||||
respond()->cancelHandoverResponse(notSupported(serial));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
@@ -60,7 +64,11 @@ ScopedAStatus RadioData::deactivateDataCall(int32_t serial, int32_t cid,
|
||||
|
||||
ScopedAStatus RadioData::getDataCallList(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getDataCallList(serial);
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getDataCallList_1_6(serial);
|
||||
} else {
|
||||
mHal1_5->getDataCallList(serial);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -69,7 +77,7 @@ ScopedAStatus RadioData::getSlicingConfig(int32_t serial) {
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getSlicingConfig(serial);
|
||||
} else {
|
||||
respond().getSlicingConfigResponse(notSupported(serial), {});
|
||||
respond()->getSlicingConfigResponse(notSupported(serial), {});
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
@@ -79,7 +87,7 @@ ScopedAStatus RadioData::releasePduSessionId(int32_t serial, int32_t id) {
|
||||
if (mHal1_6) {
|
||||
mHal1_6->releasePduSessionId(serial, id);
|
||||
} else {
|
||||
respond().releasePduSessionIdResponse(notSupported(serial));
|
||||
respond()->releasePduSessionIdResponse(notSupported(serial));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
@@ -109,7 +117,7 @@ ScopedAStatus RadioData::setDataThrottling(int32_t serial, aidl::DataThrottlingA
|
||||
if (mHal1_6) {
|
||||
mHal1_6->setDataThrottling(serial, V1_6::DataThrottlingAction(dta), completionDurationMs);
|
||||
} else {
|
||||
respond().setDataThrottlingResponse(notSupported(serial));
|
||||
respond()->setDataThrottlingResponse(notSupported(serial));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
@@ -121,16 +129,10 @@ ScopedAStatus RadioData::setInitialAttachApn(int32_t serial, const aidl::DataPro
|
||||
}
|
||||
|
||||
ScopedAStatus RadioData::setResponseFunctions(
|
||||
const std::shared_ptr<aidl::IRadioDataResponse>& dataResponse,
|
||||
const std::shared_ptr<aidl::IRadioDataIndication>& dataIndication) {
|
||||
LOG_CALL << dataResponse << ' ' << dataIndication;
|
||||
|
||||
CHECK(dataResponse);
|
||||
CHECK(dataIndication);
|
||||
|
||||
mRadioResponse->setResponseFunction(dataResponse);
|
||||
mRadioIndication->setResponseFunction(dataIndication);
|
||||
|
||||
const std::shared_ptr<aidl::IRadioDataResponse>& response,
|
||||
const std::shared_ptr<aidl::IRadioDataIndication>& indication) {
|
||||
LOG_CALL << response << ' ' << indication;
|
||||
mCallbackManager->setResponseFunctions(response, indication);
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -161,7 +163,7 @@ ScopedAStatus RadioData::startHandover(int32_t serial, int32_t callId) {
|
||||
if (mHal1_6) {
|
||||
mHal1_6->startHandover(serial, callId);
|
||||
} else {
|
||||
respond().startHandoverResponse(notSupported(serial));
|
||||
respond()->startHandoverResponse(notSupported(serial));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -29,10 +29,13 @@ namespace android::hardware::radio::compat {
|
||||
namespace aidl = ::aidl::android::hardware::radio::data;
|
||||
|
||||
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioDataIndication> dataCb) {
|
||||
CHECK(dataCb);
|
||||
mDataCb = dataCb;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioDataIndication> RadioIndication::dataCb() {
|
||||
return mDataCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::dataCallListChanged(V1_0::RadioIndicationType type,
|
||||
const hidl_vec<V1_0::SetupDataCallResult>&) {
|
||||
LOG_CALL << type;
|
||||
@@ -50,40 +53,35 @@ Return<void> RadioIndication::dataCallListChanged_1_4(V1_0::RadioIndicationType
|
||||
Return<void> RadioIndication::dataCallListChanged_1_5(
|
||||
V1_0::RadioIndicationType type, const hidl_vec<V1_5::SetupDataCallResult>& dcList) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->dataCallListChanged(toAidl(type), toAidl(dcList));
|
||||
dataCb()->dataCallListChanged(toAidl(type), toAidl(dcList));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::dataCallListChanged_1_6(
|
||||
V1_0::RadioIndicationType type, const hidl_vec<V1_6::SetupDataCallResult>& dcList) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->dataCallListChanged(toAidl(type), toAidl(dcList));
|
||||
dataCb()->dataCallListChanged(toAidl(type), toAidl(dcList));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::keepaliveStatus(V1_0::RadioIndicationType type,
|
||||
const V1_1::KeepaliveStatus& status) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->keepaliveStatus(toAidl(type), toAidl(status));
|
||||
dataCb()->keepaliveStatus(toAidl(type), toAidl(status));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::pcoData(V1_0::RadioIndicationType type,
|
||||
const V1_0::PcoDataInfo& pco) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->pcoData(toAidl(type), toAidl(pco));
|
||||
dataCb()->pcoData(toAidl(type), toAidl(pco));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::unthrottleApn(V1_0::RadioIndicationType type,
|
||||
const hidl_string& apn) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->unthrottleApn(toAidl(type), mContext->getDataProfile(apn));
|
||||
dataCb()->unthrottleApn(toAidl(type), mContext->getDataProfile(apn));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,29 +29,29 @@ namespace android::hardware::radio::compat {
|
||||
namespace aidl = ::aidl::android::hardware::radio::data;
|
||||
|
||||
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioDataResponse> dataCb) {
|
||||
CHECK(dataCb);
|
||||
mDataCb = dataCb;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioDataResponse> RadioResponse::dataCb() {
|
||||
return mDataCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::allocatePduSessionIdResponse(const V1_6::RadioResponseInfo& info,
|
||||
int32_t id) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->allocatePduSessionIdResponse(toAidl(info), id);
|
||||
dataCb()->allocatePduSessionIdResponse(toAidl(info), id);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::cancelHandoverResponse(const V1_6::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->cancelHandoverResponse(toAidl(info));
|
||||
dataCb()->cancelHandoverResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::deactivateDataCallResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->deactivateDataCallResponse(toAidl(info));
|
||||
dataCb()->deactivateDataCallResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -73,8 +73,7 @@ Return<void> RadioResponse::getDataCallListResponse_1_5(
|
||||
const V1_0::RadioResponseInfo& info,
|
||||
const hidl_vec<V1_5::SetupDataCallResult>& dcResponse) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->getDataCallListResponse(toAidl(info), toAidl(dcResponse));
|
||||
dataCb()->getDataCallListResponse(toAidl(info), toAidl(dcResponse));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -82,65 +81,56 @@ Return<void> RadioResponse::getDataCallListResponse_1_6(
|
||||
const V1_6::RadioResponseInfo& info,
|
||||
const hidl_vec<V1_6::SetupDataCallResult>& dcResponse) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->getDataCallListResponse(toAidl(info), toAidl(dcResponse));
|
||||
dataCb()->getDataCallListResponse(toAidl(info), toAidl(dcResponse));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getSlicingConfigResponse(const V1_6::RadioResponseInfo& info,
|
||||
const V1_6::SlicingConfig& slicingConfig) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->getSlicingConfigResponse(toAidl(info), toAidl(slicingConfig));
|
||||
dataCb()->getSlicingConfigResponse(toAidl(info), toAidl(slicingConfig));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::releasePduSessionIdResponse(const V1_6::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->releasePduSessionIdResponse(toAidl(info));
|
||||
dataCb()->releasePduSessionIdResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setDataAllowedResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->setDataAllowedResponse(toAidl(info));
|
||||
dataCb()->setDataAllowedResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setDataProfileResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->setDataProfileResponse(toAidl(info));
|
||||
dataCb()->setDataProfileResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setDataProfileResponse_1_5(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->setDataProfileResponse(toAidl(info));
|
||||
dataCb()->setDataProfileResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setDataThrottlingResponse(const V1_6::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->setDataThrottlingResponse(toAidl(info));
|
||||
dataCb()->setDataThrottlingResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setInitialAttachApnResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->setInitialAttachApnResponse(toAidl(info));
|
||||
dataCb()->setInitialAttachApnResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setInitialAttachApnResponse_1_5(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->setInitialAttachApnResponse(toAidl(info));
|
||||
dataCb()->setInitialAttachApnResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -161,38 +151,33 @@ Return<void> RadioResponse::setupDataCallResponse_1_4(const V1_0::RadioResponseI
|
||||
Return<void> RadioResponse::setupDataCallResponse_1_5(const V1_0::RadioResponseInfo& info,
|
||||
const V1_5::SetupDataCallResult& dcResponse) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->setupDataCallResponse(toAidl(info), toAidl(dcResponse));
|
||||
dataCb()->setupDataCallResponse(toAidl(info), toAidl(dcResponse));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setupDataCallResponse_1_6(const V1_6::RadioResponseInfo& info,
|
||||
const V1_6::SetupDataCallResult& dcResponse) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->setupDataCallResponse(toAidl(info), toAidl(dcResponse));
|
||||
dataCb()->setupDataCallResponse(toAidl(info), toAidl(dcResponse));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::startHandoverResponse(const V1_6::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->startHandoverResponse(toAidl(info));
|
||||
dataCb()->startHandoverResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::startKeepaliveResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_1::KeepaliveStatus& status) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->startKeepaliveResponse(toAidl(info), toAidl(status));
|
||||
dataCb()->startKeepaliveResponse(toAidl(info), toAidl(status));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::stopKeepaliveResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mDataCb);
|
||||
mDataCb->stopKeepaliveResponse(toAidl(info));
|
||||
dataCb()->stopKeepaliveResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -26,12 +26,6 @@ static constexpr bool kSuperVerbose = true;
|
||||
#define LOG_CALL \
|
||||
if constexpr (debug::kSuperVerbose) LOG(VERBOSE) << (RADIO_MODULE ".") << __func__ << ' '
|
||||
|
||||
#define CHECK_CB(field) \
|
||||
if (!field) { \
|
||||
LOG(WARNING) << "Callback not set"; \
|
||||
return {}; \
|
||||
}
|
||||
|
||||
} // namespace debug
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const V1_0::RadioIndicationType& type) {
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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 "DriverContext.h"
|
||||
#include "RadioIndication.h"
|
||||
#include "RadioResponse.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/hardware/radio/1.6/IRadio.h>
|
||||
|
||||
#include <thread>
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
class CallbackManager {
|
||||
sp<V1_5::IRadio> mHidlHal;
|
||||
sp<RadioResponse> mRadioResponse;
|
||||
sp<RadioIndication> mRadioIndication;
|
||||
|
||||
std::thread mDelayedSetterThread;
|
||||
std::mutex mDelayedSetterGuard;
|
||||
std::optional<std::chrono::time_point<std::chrono::steady_clock>> mDelayedSetterDeadline
|
||||
GUARDED_BY(mDelayedSetterGuard);
|
||||
std::condition_variable mDelayedSetterCv GUARDED_BY(mDelayedSetterGuard);
|
||||
bool mDestroy GUARDED_BY(mDelayedSetterGuard) = false;
|
||||
|
||||
void setResponseFunctionsDelayed();
|
||||
void delayedSetterThread();
|
||||
|
||||
public:
|
||||
CallbackManager(std::shared_ptr<DriverContext> context, sp<V1_5::IRadio> hidlHal);
|
||||
~CallbackManager();
|
||||
|
||||
RadioResponse& response() const;
|
||||
|
||||
template <typename ResponseType, typename IndicationType>
|
||||
void setResponseFunctions(const std::shared_ptr<ResponseType>& response,
|
||||
const std::shared_ptr<IndicationType>& indication) {
|
||||
CHECK(response);
|
||||
CHECK(indication);
|
||||
|
||||
mRadioResponse->setResponseFunction(response);
|
||||
mRadioIndication->setResponseFunction(indication);
|
||||
setResponseFunctionsDelayed();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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 <android-base/logging.h>
|
||||
#include <android/binder_interface_utils.h>
|
||||
#include <utils/Mutex.h>
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
template <typename Interface, typename DefaultImplementation, bool isIndication = false>
|
||||
class GuaranteedCallback {
|
||||
mutable std::mutex mCallbackGuard;
|
||||
std::shared_ptr<Interface> mCallback GUARDED_BY(mCallbackGuard);
|
||||
|
||||
public:
|
||||
GuaranteedCallback<Interface, DefaultImplementation, isIndication>& operator=(
|
||||
const std::shared_ptr<Interface>& callback) {
|
||||
CHECK(callback);
|
||||
const std::lock_guard<std::mutex> lock(mCallbackGuard);
|
||||
mCallback = callback;
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::shared_ptr<Interface> get() {
|
||||
if (mCallback) return mCallback;
|
||||
const std::lock_guard<std::mutex> lock(mCallbackGuard);
|
||||
if (mCallback) return mCallback;
|
||||
|
||||
LOG(isIndication ? WARNING : ERROR) << "Callback is not set";
|
||||
return mCallback = ndk::SharedRefBase::make<DefaultImplementation>();
|
||||
}
|
||||
|
||||
operator bool() const { return mCallback != nullptr; }
|
||||
};
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
@@ -15,9 +15,8 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "CallbackManager.h"
|
||||
#include "DriverContext.h"
|
||||
#include "RadioIndication.h"
|
||||
#include "RadioResponse.h"
|
||||
|
||||
#include <android/hardware/radio/1.6/IRadio.h>
|
||||
|
||||
@@ -30,14 +29,11 @@ class RadioCompatBase {
|
||||
sp<V1_5::IRadio> mHal1_5;
|
||||
sp<V1_6::IRadio> mHal1_6;
|
||||
|
||||
sp<RadioResponse> mRadioResponse;
|
||||
sp<RadioIndication> mRadioIndication;
|
||||
|
||||
V1_6::IRadioResponse& respond();
|
||||
std::shared_ptr<CallbackManager> mCallbackManager;
|
||||
|
||||
public:
|
||||
RadioCompatBase(std::shared_ptr<DriverContext> context, sp<V1_5::IRadio> hidlHal,
|
||||
sp<RadioResponse> radioResponse, sp<RadioIndication> radioIndication);
|
||||
std::shared_ptr<CallbackManager> cbMgr);
|
||||
};
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "RadioConfigIndication.h"
|
||||
#include "RadioConfigResponse.h"
|
||||
|
||||
#include <aidl/android/hardware/radio/config/BnRadioConfig.h>
|
||||
#include <android/hardware/radio/config/1.2/IRadioConfigIndication.h>
|
||||
#include <android/hardware/radio/config/1.3/IRadioConfig.h>
|
||||
@@ -30,11 +33,13 @@ namespace android::hardware::radio::compat {
|
||||
* fetch source implementation and publish resulting HAL instance.
|
||||
*/
|
||||
class RadioConfig : public aidl::android::hardware::radio::config::BnRadioConfig {
|
||||
sp<config::V1_1::IRadioConfig> mHal1_1;
|
||||
sp<config::V1_3::IRadioConfig> mHal1_3;
|
||||
const sp<config::V1_1::IRadioConfig> mHal1_1;
|
||||
const sp<config::V1_3::IRadioConfig> mHal1_3;
|
||||
|
||||
sp<config::V1_3::IRadioConfigResponse> mRadioConfigResponse;
|
||||
sp<config::V1_2::IRadioConfigIndication> mRadioConfigIndication;
|
||||
const sp<RadioConfigResponse> mRadioConfigResponse;
|
||||
const sp<RadioConfigIndication> mRadioConfigIndication;
|
||||
|
||||
std::shared_ptr<::aidl::android::hardware::radio::config::IRadioConfigResponse> respond();
|
||||
|
||||
::ndk::ScopedAStatus getHalDeviceCapabilities(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getNumOfLiveModems(int32_t serial) override;
|
||||
@@ -52,8 +57,6 @@ class RadioConfig : public aidl::android::hardware::radio::config::BnRadioConfig
|
||||
const std::vector<aidl::android::hardware::radio::config::SlotPortMapping>& slotMap)
|
||||
override;
|
||||
|
||||
config::V1_3::IRadioConfigResponse& respond();
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructs AIDL IRadioConfig instance wrapping existing HIDL IRadioConfig instance.
|
||||
|
||||
@@ -15,13 +15,17 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "GuaranteedCallback.h"
|
||||
|
||||
#include <aidl/android/hardware/radio/config/IRadioConfigIndication.h>
|
||||
#include <android/hardware/radio/config/1.2/IRadioConfigIndication.h>
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
class RadioConfigIndication : public config::V1_2::IRadioConfigIndication {
|
||||
std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigIndication> mCallback;
|
||||
GuaranteedCallback<aidl::android::hardware::radio::config::IRadioConfigIndication,
|
||||
aidl::android::hardware::radio::config::IRadioConfigIndicationDefault, true>
|
||||
mCallback;
|
||||
|
||||
Return<void> simSlotsStatusChanged(
|
||||
V1_0::RadioIndicationType type,
|
||||
@@ -31,8 +35,10 @@ class RadioConfigIndication : public config::V1_2::IRadioConfigIndication {
|
||||
const hidl_vec<config::V1_2::SimSlotStatus>& slotStatus) override;
|
||||
|
||||
public:
|
||||
RadioConfigIndication(
|
||||
void setResponseFunction(
|
||||
std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigIndication> cb);
|
||||
|
||||
std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigIndication> indicate();
|
||||
};
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
@@ -15,13 +15,17 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "GuaranteedCallback.h"
|
||||
|
||||
#include <aidl/android/hardware/radio/config/IRadioConfigResponse.h>
|
||||
#include <android/hardware/radio/config/1.3/IRadioConfigResponse.h>
|
||||
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
class RadioConfigResponse : public config::V1_3::IRadioConfigResponse {
|
||||
std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigResponse> mCallback;
|
||||
GuaranteedCallback<aidl::android::hardware::radio::config::IRadioConfigResponse,
|
||||
aidl::android::hardware::radio::config::IRadioConfigResponseDefault>
|
||||
mCallback;
|
||||
|
||||
Return<void> getSimSlotsStatusResponse(
|
||||
const V1_0::RadioResponseInfo& info,
|
||||
@@ -41,8 +45,10 @@ class RadioConfigResponse : public config::V1_3::IRadioConfigResponse {
|
||||
bool modemReducedFeatureSet1) override;
|
||||
|
||||
public:
|
||||
RadioConfigResponse(
|
||||
void setResponseFunction(
|
||||
std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigResponse> callback);
|
||||
|
||||
std::shared_ptr<aidl::android::hardware::radio::config::IRadioConfigResponse> respond();
|
||||
};
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
@@ -22,6 +22,8 @@
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
class RadioData : public RadioCompatBase, public aidl::android::hardware::radio::data::BnRadioData {
|
||||
std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> respond();
|
||||
|
||||
::ndk::ScopedAStatus allocatePduSessionId(int32_t serial) override;
|
||||
::ndk::ScopedAStatus cancelHandover(int32_t serial, int32_t callId) override;
|
||||
::ndk::ScopedAStatus deactivateDataCall(
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "DriverContext.h"
|
||||
#include "GuaranteedCallback.h"
|
||||
|
||||
#include <aidl/android/hardware/radio/data/IRadioDataIndication.h>
|
||||
#include <aidl/android/hardware/radio/messaging/IRadioMessagingIndication.h>
|
||||
@@ -30,13 +31,30 @@ namespace android::hardware::radio::compat {
|
||||
class RadioIndication : public V1_6::IRadioIndication {
|
||||
std::shared_ptr<DriverContext> mContext;
|
||||
|
||||
std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> mDataCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication>
|
||||
GuaranteedCallback< //
|
||||
::aidl::android::hardware::radio::data::IRadioDataIndication,
|
||||
::aidl::android::hardware::radio::data::IRadioDataIndicationDefault, true>
|
||||
mDataCb;
|
||||
GuaranteedCallback< //
|
||||
::aidl::android::hardware::radio::messaging::IRadioMessagingIndication,
|
||||
::aidl::android::hardware::radio::messaging::IRadioMessagingIndicationDefault, true>
|
||||
mMessagingCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication> mModemCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> mNetworkCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> mSimCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> mVoiceCb;
|
||||
GuaranteedCallback< //
|
||||
::aidl::android::hardware::radio::modem::IRadioModemIndication,
|
||||
::aidl::android::hardware::radio::modem::IRadioModemIndicationDefault, true>
|
||||
mModemCb;
|
||||
GuaranteedCallback< //
|
||||
::aidl::android::hardware::radio::network::IRadioNetworkIndication,
|
||||
::aidl::android::hardware::radio::network::IRadioNetworkIndicationDefault, true>
|
||||
mNetworkCb;
|
||||
GuaranteedCallback< //
|
||||
::aidl::android::hardware::radio::sim::IRadioSimIndication,
|
||||
::aidl::android::hardware::radio::sim::IRadioSimIndicationDefault, true>
|
||||
mSimCb;
|
||||
GuaranteedCallback< //
|
||||
::aidl::android::hardware::radio::voice::IRadioVoiceIndication,
|
||||
::aidl::android::hardware::radio::voice::IRadioVoiceIndicationDefault, true>
|
||||
mVoiceCb;
|
||||
|
||||
// IRadioIndication @ 1.0
|
||||
Return<void> radioStateChanged(V1_0::RadioIndicationType type,
|
||||
@@ -200,6 +218,14 @@ class RadioIndication : public V1_6::IRadioIndication {
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb);
|
||||
void setResponseFunction(
|
||||
std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voicCb);
|
||||
|
||||
std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> dataCb();
|
||||
std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication>
|
||||
messagingCb();
|
||||
std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemIndication> modemCb();
|
||||
std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkIndication> networkCb();
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb();
|
||||
std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voiceCb();
|
||||
};
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace android::hardware::radio::compat {
|
||||
|
||||
class RadioMessaging : public RadioCompatBase,
|
||||
public aidl::android::hardware::radio::messaging::BnRadioMessaging {
|
||||
std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> respond();
|
||||
|
||||
::ndk::ScopedAStatus acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success,
|
||||
const std::string& ackPdu) override;
|
||||
::ndk::ScopedAStatus acknowledgeLastIncomingCdmaSms(
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace android::hardware::radio::compat {
|
||||
|
||||
class RadioModem : public RadioCompatBase,
|
||||
public aidl::android::hardware::radio::modem::BnRadioModem {
|
||||
std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> respond();
|
||||
|
||||
::ndk::ScopedAStatus enableModem(int32_t serial, bool on) override;
|
||||
::ndk::ScopedAStatus getBasebandVersion(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getDeviceIdentity(int32_t serial) override;
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace android::hardware::radio::compat {
|
||||
|
||||
class RadioNetwork : public RadioCompatBase,
|
||||
public aidl::android::hardware::radio::network::BnRadioNetwork {
|
||||
std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond();
|
||||
|
||||
::ndk::ScopedAStatus getAllowedNetworkTypesBitmap(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getAvailableBandModes(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getAvailableNetworks(int32_t serial) override;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "DriverContext.h"
|
||||
#include "GuaranteedCallback.h"
|
||||
|
||||
#include <aidl/android/hardware/radio/data/IRadioDataResponse.h>
|
||||
#include <aidl/android/hardware/radio/messaging/IRadioMessagingResponse.h>
|
||||
@@ -30,13 +31,24 @@ namespace android::hardware::radio::compat {
|
||||
class RadioResponse : public V1_6::IRadioResponse {
|
||||
std::shared_ptr<DriverContext> mContext;
|
||||
|
||||
std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> mDataCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse>
|
||||
GuaranteedCallback<::aidl::android::hardware::radio::data::IRadioDataResponse,
|
||||
::aidl::android::hardware::radio::data::IRadioDataResponseDefault>
|
||||
mDataCb;
|
||||
GuaranteedCallback<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse,
|
||||
::aidl::android::hardware::radio::messaging::IRadioMessagingResponseDefault>
|
||||
mMessagingCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> mModemCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> mNetworkCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> mSimCb;
|
||||
std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> mVoiceCb;
|
||||
GuaranteedCallback<::aidl::android::hardware::radio::modem::IRadioModemResponse,
|
||||
::aidl::android::hardware::radio::modem::IRadioModemResponseDefault>
|
||||
mModemCb;
|
||||
GuaranteedCallback<::aidl::android::hardware::radio::network::IRadioNetworkResponse,
|
||||
::aidl::android::hardware::radio::network::IRadioNetworkResponseDefault>
|
||||
mNetworkCb;
|
||||
GuaranteedCallback<::aidl::android::hardware::radio::sim::IRadioSimResponse,
|
||||
::aidl::android::hardware::radio::sim::IRadioSimResponseDefault>
|
||||
mSimCb;
|
||||
GuaranteedCallback<::aidl::android::hardware::radio::voice::IRadioVoiceResponse,
|
||||
::aidl::android::hardware::radio::voice::IRadioVoiceResponseDefault>
|
||||
mVoiceCb;
|
||||
|
||||
// IRadioResponse @ 1.0
|
||||
Return<void> getIccCardStatusResponse(const V1_0::RadioResponseInfo& info,
|
||||
@@ -428,6 +440,14 @@ class RadioResponse : public V1_6::IRadioResponse {
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb);
|
||||
void setResponseFunction(
|
||||
std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb);
|
||||
|
||||
std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> dataCb();
|
||||
std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse>
|
||||
messagingCb();
|
||||
std::shared_ptr<::aidl::android::hardware::radio::modem::IRadioModemResponse> modemCb();
|
||||
std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> networkCb();
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb();
|
||||
std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb();
|
||||
};
|
||||
|
||||
} // namespace android::hardware::radio::compat
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
namespace android::hardware::radio::compat {
|
||||
|
||||
class RadioSim : public RadioCompatBase, public aidl::android::hardware::radio::sim::BnRadioSim {
|
||||
std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> respond();
|
||||
|
||||
::ndk::ScopedAStatus areUiccApplicationsEnabled(int32_t serial) override;
|
||||
::ndk::ScopedAStatus changeIccPin2ForApp(int32_t serial, const std::string& oldPin2,
|
||||
const std::string& newPin2,
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace android::hardware::radio::compat {
|
||||
|
||||
class RadioVoice : public RadioCompatBase,
|
||||
public aidl::android::hardware::radio::voice::BnRadioVoice {
|
||||
std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> respond();
|
||||
|
||||
::ndk::ScopedAStatus acceptCall(int32_t serial) override;
|
||||
::ndk::ScopedAStatus conference(int32_t serial) override;
|
||||
::ndk::ScopedAStatus dial(
|
||||
|
||||
@@ -27,67 +27,62 @@ namespace android::hardware::radio::compat {
|
||||
namespace aidl = ::aidl::android::hardware::radio::messaging;
|
||||
|
||||
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioMessagingIndication> rmiCb) {
|
||||
CHECK(rmiCb);
|
||||
mMessagingCb = rmiCb;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioMessagingIndication> RadioIndication::messagingCb() {
|
||||
return mMessagingCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::cdmaNewSms(V1_0::RadioIndicationType type,
|
||||
const V1_0::CdmaSmsMessage& msg) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->cdmaNewSms(toAidl(type), toAidl(msg));
|
||||
messagingCb()->cdmaNewSms(toAidl(type), toAidl(msg));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::cdmaRuimSmsStorageFull(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->cdmaRuimSmsStorageFull(toAidl(type));
|
||||
messagingCb()->cdmaRuimSmsStorageFull(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::newBroadcastSms(V1_0::RadioIndicationType type,
|
||||
const hidl_vec<uint8_t>& data) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->newBroadcastSms(toAidl(type), data);
|
||||
messagingCb()->newBroadcastSms(toAidl(type), data);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::newSms(V1_0::RadioIndicationType type, const hidl_vec<uint8_t>& pdu) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->newSms(toAidl(type), pdu);
|
||||
messagingCb()->newSms(toAidl(type), pdu);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::newSmsOnSim(V1_0::RadioIndicationType type, int32_t recordNumber) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->newSmsOnSim(toAidl(type), recordNumber);
|
||||
messagingCb()->newSmsOnSim(toAidl(type), recordNumber);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::newSmsStatusReport(V1_0::RadioIndicationType type,
|
||||
const hidl_vec<uint8_t>& pdu) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->newSmsStatusReport(toAidl(type), pdu);
|
||||
messagingCb()->newSmsStatusReport(toAidl(type), pdu);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::onUssd(V1_0::RadioIndicationType type, V1_0::UssdModeType modeType,
|
||||
const hidl_string& msg) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg);
|
||||
messagingCb()->onUssd(toAidl(type), aidl::UssdModeType(modeType), msg);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::simSmsStorageFull(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->simSmsStorageFull(toAidl(type));
|
||||
messagingCb()->simSmsStorageFull(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@ using ::ndk::ScopedAStatus;
|
||||
namespace aidl = ::aidl::android::hardware::radio::messaging;
|
||||
constexpr auto ok = &ScopedAStatus::ok;
|
||||
|
||||
std::shared_ptr<aidl::IRadioMessagingResponse> RadioMessaging::respond() {
|
||||
return mCallbackManager->response().messagingCb();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioMessaging::acknowledgeIncomingGsmSmsWithPdu( //
|
||||
int32_t serial, bool success, const std::string& ackPdu) {
|
||||
LOG_CALL << serial << ' ' << success << ' ' << ackPdu;
|
||||
@@ -100,13 +104,21 @@ ScopedAStatus RadioMessaging::responseAcknowledgement() {
|
||||
|
||||
ScopedAStatus RadioMessaging::sendCdmaSms(int32_t serial, const aidl::CdmaSmsMessage& sms) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->sendCdmaSms(serial, toHidl(sms));
|
||||
if (mHal1_6) {
|
||||
mHal1_6->sendCdmaSms_1_6(serial, toHidl(sms));
|
||||
} else {
|
||||
mHal1_5->sendCdmaSms(serial, toHidl(sms));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioMessaging::sendCdmaSmsExpectMore(int32_t serial, const aidl::CdmaSmsMessage& m) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->sendCdmaSmsExpectMore(serial, toHidl(m));
|
||||
if (mHal1_6) {
|
||||
mHal1_6->sendCdmaSmsExpectMore_1_6(serial, toHidl(m));
|
||||
} else {
|
||||
mHal1_5->sendCdmaSmsExpectMore(serial, toHidl(m));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -118,13 +130,21 @@ ScopedAStatus RadioMessaging::sendImsSms(int32_t serial, const aidl::ImsSmsMessa
|
||||
|
||||
ScopedAStatus RadioMessaging::sendSms(int32_t serial, const aidl::GsmSmsMessage& message) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->sendSms(serial, toHidl(message));
|
||||
if (mHal1_6) {
|
||||
mHal1_6->sendSms_1_6(serial, toHidl(message));
|
||||
} else {
|
||||
mHal1_5->sendSms(serial, toHidl(message));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioMessaging::sendSmsExpectMore(int32_t serial, const aidl::GsmSmsMessage& msg) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->sendSMSExpectMore(serial, toHidl(msg));
|
||||
if (mHal1_6) {
|
||||
mHal1_6->sendSmsExpectMore_1_6(serial, toHidl(msg));
|
||||
} else {
|
||||
mHal1_5->sendSMSExpectMore(serial, toHidl(msg));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -161,16 +181,10 @@ ScopedAStatus RadioMessaging::setGsmBroadcastConfig(
|
||||
}
|
||||
|
||||
ScopedAStatus RadioMessaging::setResponseFunctions(
|
||||
const std::shared_ptr<aidl::IRadioMessagingResponse>& messagingResponse,
|
||||
const std::shared_ptr<aidl::IRadioMessagingIndication>& messagingIndication) {
|
||||
LOG_CALL << messagingResponse << ' ' << messagingIndication;
|
||||
|
||||
CHECK(messagingResponse);
|
||||
CHECK(messagingIndication);
|
||||
|
||||
mRadioResponse->setResponseFunction(messagingResponse);
|
||||
mRadioIndication->setResponseFunction(messagingIndication);
|
||||
|
||||
const std::shared_ptr<aidl::IRadioMessagingResponse>& response,
|
||||
const std::shared_ptr<aidl::IRadioMessagingIndication>& indication) {
|
||||
LOG_CALL << response << ' ' << indication;
|
||||
mCallbackManager->setResponseFunctions(response, indication);
|
||||
return ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,52 +29,49 @@ namespace android::hardware::radio::compat {
|
||||
namespace aidl = ::aidl::android::hardware::radio::messaging;
|
||||
|
||||
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioMessagingResponse> rmrCb) {
|
||||
CHECK(rmrCb);
|
||||
mMessagingCb = rmrCb;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioMessagingResponse> RadioResponse::messagingCb() {
|
||||
return mMessagingCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::acknowledgeIncomingGsmSmsWithPduResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->acknowledgeIncomingGsmSmsWithPduResponse(toAidl(info));
|
||||
messagingCb()->acknowledgeIncomingGsmSmsWithPduResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::acknowledgeLastIncomingCdmaSmsResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->acknowledgeLastIncomingCdmaSmsResponse(toAidl(info));
|
||||
messagingCb()->acknowledgeLastIncomingCdmaSmsResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::acknowledgeLastIncomingGsmSmsResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->acknowledgeLastIncomingGsmSmsResponse(toAidl(info));
|
||||
messagingCb()->acknowledgeLastIncomingGsmSmsResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::cancelPendingUssdResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->cancelPendingUssdResponse(toAidl(info));
|
||||
messagingCb()->cancelPendingUssdResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::deleteSmsOnRuimResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->deleteSmsOnRuimResponse(toAidl(info));
|
||||
messagingCb()->deleteSmsOnRuimResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::deleteSmsOnSimResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->deleteSmsOnSimResponse(toAidl(info));
|
||||
messagingCb()->deleteSmsOnSimResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -82,162 +79,141 @@ Return<void> RadioResponse::getCdmaBroadcastConfigResponse(
|
||||
const V1_0::RadioResponseInfo& info,
|
||||
const hidl_vec<V1_0::CdmaBroadcastSmsConfigInfo>& configs) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->getCdmaBroadcastConfigResponse(toAidl(info), toAidl(configs));
|
||||
messagingCb()->getCdmaBroadcastConfigResponse(toAidl(info), toAidl(configs));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getGsmBroadcastConfigResponse(
|
||||
const V1_0::RadioResponseInfo& info, const hidl_vec<V1_0::GsmBroadcastSmsConfigInfo>& cfg) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->getGsmBroadcastConfigResponse(toAidl(info), toAidl(cfg));
|
||||
messagingCb()->getGsmBroadcastConfigResponse(toAidl(info), toAidl(cfg));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getSmscAddressResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_string& smsc) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->getSmscAddressResponse(toAidl(info), smsc);
|
||||
messagingCb()->getSmscAddressResponse(toAidl(info), smsc);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::reportSmsMemoryStatusResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->reportSmsMemoryStatusResponse(toAidl(info));
|
||||
messagingCb()->reportSmsMemoryStatusResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendCdmaSmsExpectMoreResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::SendSmsResult& sms) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms));
|
||||
messagingCb()->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendCdmaSmsExpectMoreResponse_1_6(const V1_6::RadioResponseInfo& info,
|
||||
const V1_0::SendSmsResult& sms) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms));
|
||||
messagingCb()->sendCdmaSmsExpectMoreResponse(toAidl(info), toAidl(sms));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendCdmaSmsResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::SendSmsResult& sms) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->sendCdmaSmsResponse(toAidl(info), toAidl(sms));
|
||||
messagingCb()->sendCdmaSmsResponse(toAidl(info), toAidl(sms));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendCdmaSmsResponse_1_6(const V1_6::RadioResponseInfo& info,
|
||||
const V1_0::SendSmsResult& sms) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->sendCdmaSmsResponse(toAidl(info), toAidl(sms));
|
||||
messagingCb()->sendCdmaSmsResponse(toAidl(info), toAidl(sms));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendImsSmsResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::SendSmsResult& sms) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->sendImsSmsResponse(toAidl(info), toAidl(sms));
|
||||
messagingCb()->sendImsSmsResponse(toAidl(info), toAidl(sms));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendSMSExpectMoreResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::SendSmsResult& sms) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms));
|
||||
messagingCb()->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendSmsExpectMoreResponse_1_6(const V1_6::RadioResponseInfo& info,
|
||||
const V1_0::SendSmsResult& sms) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms));
|
||||
messagingCb()->sendSmsExpectMoreResponse(toAidl(info), toAidl(sms));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendSmsResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::SendSmsResult& sms) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->sendSmsResponse(toAidl(info), toAidl(sms));
|
||||
messagingCb()->sendSmsResponse(toAidl(info), toAidl(sms));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendSmsResponse_1_6(const V1_6::RadioResponseInfo& info,
|
||||
const V1_0::SendSmsResult& sms) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->sendSmsResponse(toAidl(info), toAidl(sms));
|
||||
messagingCb()->sendSmsResponse(toAidl(info), toAidl(sms));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendUssdResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->sendUssdResponse(toAidl(info));
|
||||
messagingCb()->sendUssdResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCdmaBroadcastActivationResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->setCdmaBroadcastActivationResponse(toAidl(info));
|
||||
messagingCb()->setCdmaBroadcastActivationResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCdmaBroadcastConfigResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->setCdmaBroadcastConfigResponse(toAidl(info));
|
||||
messagingCb()->setCdmaBroadcastConfigResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setGsmBroadcastActivationResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->setGsmBroadcastActivationResponse(toAidl(info));
|
||||
messagingCb()->setGsmBroadcastActivationResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setGsmBroadcastConfigResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->setGsmBroadcastConfigResponse(toAidl(info));
|
||||
messagingCb()->setGsmBroadcastConfigResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSmscAddressResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->setSmscAddressResponse(toAidl(info));
|
||||
messagingCb()->setSmscAddressResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::writeSmsToRuimResponse(const V1_0::RadioResponseInfo& info,
|
||||
uint32_t index) {
|
||||
LOG_CALL << info.serial << ' ' << index;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->writeSmsToRuimResponse(toAidl(info), index);
|
||||
messagingCb()->writeSmsToRuimResponse(toAidl(info), index);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::writeSmsToSimResponse(const V1_0::RadioResponseInfo& info,
|
||||
int32_t index) {
|
||||
LOG_CALL << info.serial << ' ' << index;
|
||||
CHECK_CB(mMessagingCb);
|
||||
mMessagingCb->writeSmsToSimResponse(toAidl(info), index);
|
||||
messagingCb()->writeSmsToSimResponse(toAidl(info), index);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,44 +29,42 @@ namespace android::hardware::radio::compat {
|
||||
namespace aidl = ::aidl::android::hardware::radio::modem;
|
||||
|
||||
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioModemIndication> modemCb) {
|
||||
CHECK(modemCb);
|
||||
mModemCb = modemCb;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioModemIndication> RadioIndication::modemCb() {
|
||||
return mModemCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::hardwareConfigChanged(V1_0::RadioIndicationType type,
|
||||
const hidl_vec<V1_0::HardwareConfig>& configs) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->hardwareConfigChanged(toAidl(type), toAidl(configs));
|
||||
modemCb()->hardwareConfigChanged(toAidl(type), toAidl(configs));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::modemReset(V1_0::RadioIndicationType type, const hidl_string& reasn) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->modemReset(toAidl(type), reasn);
|
||||
modemCb()->modemReset(toAidl(type), reasn);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::radioCapabilityIndication(V1_0::RadioIndicationType type,
|
||||
const V1_0::RadioCapability& rc) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->radioCapabilityIndication(toAidl(type), toAidl(rc));
|
||||
modemCb()->radioCapabilityIndication(toAidl(type), toAidl(rc));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::radioStateChanged(V1_0::RadioIndicationType t, V1_0::RadioState st) {
|
||||
LOG_CALL << t;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->radioStateChanged(toAidl(t), aidl::RadioState(st));
|
||||
modemCb()->radioStateChanged(toAidl(t), aidl::RadioState(st));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::rilConnected(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->rilConnected(toAidl(type));
|
||||
modemCb()->rilConnected(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@ using ::ndk::ScopedAStatus;
|
||||
namespace aidl = ::aidl::android::hardware::radio::modem;
|
||||
constexpr auto ok = &ScopedAStatus::ok;
|
||||
|
||||
std::shared_ptr<aidl::IRadioModemResponse> RadioModem::respond() {
|
||||
return mCallbackManager->response().modemCb();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioModem::enableModem(int32_t serial, bool on) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->enableModem(serial, on);
|
||||
@@ -129,16 +133,10 @@ ScopedAStatus RadioModem::setRadioPower(int32_t serial, bool powerOn, bool forEm
|
||||
}
|
||||
|
||||
ScopedAStatus RadioModem::setResponseFunctions(
|
||||
const std::shared_ptr<aidl::IRadioModemResponse>& modemResponse,
|
||||
const std::shared_ptr<aidl::IRadioModemIndication>& modemIndication) {
|
||||
LOG_CALL << modemResponse << ' ' << modemIndication;
|
||||
|
||||
CHECK(modemResponse);
|
||||
CHECK(modemIndication);
|
||||
|
||||
mRadioResponse->setResponseFunction(modemResponse);
|
||||
mRadioIndication->setResponseFunction(modemIndication);
|
||||
|
||||
const std::shared_ptr<aidl::IRadioModemResponse>& response,
|
||||
const std::shared_ptr<aidl::IRadioModemIndication>& indication) {
|
||||
LOG_CALL << response << ' ' << indication;
|
||||
mCallbackManager->setResponseFunctions(response, indication);
|
||||
return ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,22 +29,23 @@ namespace android::hardware::radio::compat {
|
||||
namespace aidl = ::aidl::android::hardware::radio::modem;
|
||||
|
||||
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioModemResponse> modemCb) {
|
||||
CHECK(modemCb);
|
||||
mModemCb = modemCb;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioModemResponse> RadioResponse::modemCb() {
|
||||
return mModemCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::enableModemResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->enableModemResponse(toAidl(info));
|
||||
modemCb()->enableModemResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getBasebandVersionResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_string& version) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->getBasebandVersionResponse(toAidl(info), version);
|
||||
modemCb()->getBasebandVersionResponse(toAidl(info), version);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -52,112 +53,97 @@ 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) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->getDeviceIdentityResponse(toAidl(info), imei, imeisv, esn, meid);
|
||||
modemCb()->getDeviceIdentityResponse(toAidl(info), imei, imeisv, esn, meid);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getHardwareConfigResponse(
|
||||
const V1_0::RadioResponseInfo& info, const hidl_vec<V1_0::HardwareConfig>& config) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->getHardwareConfigResponse(toAidl(info), toAidl(config));
|
||||
modemCb()->getHardwareConfigResponse(toAidl(info), toAidl(config));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getModemActivityInfoResponse(
|
||||
const V1_0::RadioResponseInfo& info, const V1_0::ActivityStatsInfo& activityInfo) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->getModemActivityInfoResponse(toAidl(info), toAidl(activityInfo));
|
||||
modemCb()->getModemActivityInfoResponse(toAidl(info), toAidl(activityInfo));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getModemStackStatusResponse(const V1_0::RadioResponseInfo& info,
|
||||
bool isEnabled) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->getModemStackStatusResponse(toAidl(info), isEnabled);
|
||||
modemCb()->getModemStackStatusResponse(toAidl(info), isEnabled);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getRadioCapabilityResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::RadioCapability& rc) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->getRadioCapabilityResponse(toAidl(info), toAidl(rc));
|
||||
modemCb()->getRadioCapabilityResponse(toAidl(info), toAidl(rc));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::nvReadItemResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_string& result) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->nvReadItemResponse(toAidl(info), result);
|
||||
modemCb()->nvReadItemResponse(toAidl(info), result);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::nvResetConfigResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->nvResetConfigResponse(toAidl(info));
|
||||
modemCb()->nvResetConfigResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::nvWriteCdmaPrlResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->nvWriteCdmaPrlResponse(toAidl(info));
|
||||
modemCb()->nvWriteCdmaPrlResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::nvWriteItemResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->nvWriteItemResponse(toAidl(info));
|
||||
modemCb()->nvWriteItemResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::requestShutdownResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->requestShutdownResponse(toAidl(info));
|
||||
modemCb()->requestShutdownResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendDeviceStateResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->sendDeviceStateResponse(toAidl(info));
|
||||
modemCb()->sendDeviceStateResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setRadioCapabilityResponse(const V1_0::RadioResponseInfo& info,
|
||||
const V1_0::RadioCapability& rc) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->setRadioCapabilityResponse(toAidl(info), toAidl(rc));
|
||||
modemCb()->setRadioCapabilityResponse(toAidl(info), toAidl(rc));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setRadioPowerResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->setRadioPowerResponse(toAidl(info));
|
||||
modemCb()->setRadioPowerResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setRadioPowerResponse_1_5(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->setRadioPowerResponse(toAidl(info));
|
||||
modemCb()->setRadioPowerResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setRadioPowerResponse_1_6(const V1_6::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mModemCb);
|
||||
mModemCb->setRadioPowerResponse(toAidl(info));
|
||||
modemCb()->setRadioPowerResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -30,23 +30,24 @@ using ::aidl::android::hardware::radio::RadioTechnology;
|
||||
namespace aidl = ::aidl::android::hardware::radio::network;
|
||||
|
||||
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioNetworkIndication> netCb) {
|
||||
CHECK(netCb);
|
||||
mNetworkCb = netCb;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioNetworkIndication> RadioIndication::networkCb() {
|
||||
return mNetworkCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::barringInfoChanged(V1_0::RadioIndicationType type,
|
||||
const V1_5::CellIdentity& cellIdentity,
|
||||
const hidl_vec<V1_5::BarringInfo>& barringInfos) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->barringInfoChanged(toAidl(type), toAidl(cellIdentity), toAidl(barringInfos));
|
||||
networkCb()->barringInfoChanged(toAidl(type), toAidl(cellIdentity), toAidl(barringInfos));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::cdmaPrlChanged(V1_0::RadioIndicationType type, int32_t version) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->cdmaPrlChanged(toAidl(type), version);
|
||||
networkCb()->cdmaPrlChanged(toAidl(type), version);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -74,32 +75,28 @@ Return<void> RadioIndication::cellInfoList_1_4(V1_0::RadioIndicationType type,
|
||||
Return<void> RadioIndication::cellInfoList_1_5(V1_0::RadioIndicationType type,
|
||||
const hidl_vec<V1_5::CellInfo>& records) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->cellInfoList(toAidl(type), toAidl(records));
|
||||
networkCb()->cellInfoList(toAidl(type), toAidl(records));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::cellInfoList_1_6(V1_0::RadioIndicationType type,
|
||||
const hidl_vec<V1_6::CellInfo>& records) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->cellInfoList(toAidl(type), toAidl(records));
|
||||
networkCb()->cellInfoList(toAidl(type), toAidl(records));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::currentLinkCapacityEstimate(V1_0::RadioIndicationType type,
|
||||
const V1_2::LinkCapacityEstimate& lce) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->currentLinkCapacityEstimate(toAidl(type), toAidl(lce));
|
||||
networkCb()->currentLinkCapacityEstimate(toAidl(type), toAidl(lce));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::currentLinkCapacityEstimate_1_6(
|
||||
V1_0::RadioIndicationType type, const V1_6::LinkCapacityEstimate& lce) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->currentLinkCapacityEstimate(toAidl(type), toAidl(lce));
|
||||
networkCb()->currentLinkCapacityEstimate(toAidl(type), toAidl(lce));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -113,16 +110,14 @@ Return<void> RadioIndication::currentPhysicalChannelConfigs(
|
||||
Return<void> RadioIndication::currentPhysicalChannelConfigs_1_4(
|
||||
V1_0::RadioIndicationType type, const hidl_vec<V1_4::PhysicalChannelConfig>& configs) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs));
|
||||
networkCb()->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::currentPhysicalChannelConfigs_1_6(
|
||||
V1_0::RadioIndicationType type, const hidl_vec<V1_6::PhysicalChannelConfig>& configs) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs));
|
||||
networkCb()->currentPhysicalChannelConfigs(toAidl(type), toAidl(configs));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -143,23 +138,20 @@ Return<void> RadioIndication::currentSignalStrength_1_2(V1_0::RadioIndicationTyp
|
||||
Return<void> RadioIndication::currentSignalStrength_1_4(
|
||||
V1_0::RadioIndicationType type, const V1_4::SignalStrength& signalStrength) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->currentSignalStrength(toAidl(type), toAidl(signalStrength));
|
||||
networkCb()->currentSignalStrength(toAidl(type), toAidl(signalStrength));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::currentSignalStrength_1_6(
|
||||
V1_0::RadioIndicationType type, const V1_6::SignalStrength& signalStrength) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->currentSignalStrength(toAidl(type), toAidl(signalStrength));
|
||||
networkCb()->currentSignalStrength(toAidl(type), toAidl(signalStrength));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::imsNetworkStateChanged(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->imsNetworkStateChanged(toAidl(type));
|
||||
networkCb()->imsNetworkStateChanged(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -187,31 +179,27 @@ Return<void> RadioIndication::networkScanResult_1_4(V1_0::RadioIndicationType ty
|
||||
Return<void> RadioIndication::networkScanResult_1_5(V1_0::RadioIndicationType type,
|
||||
const V1_5::NetworkScanResult& result) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->networkScanResult(toAidl(type), toAidl(result));
|
||||
networkCb()->networkScanResult(toAidl(type), toAidl(result));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::networkScanResult_1_6(V1_0::RadioIndicationType type,
|
||||
const V1_6::NetworkScanResult& result) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->networkScanResult(toAidl(type), toAidl(result));
|
||||
networkCb()->networkScanResult(toAidl(type), toAidl(result));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::networkStateChanged(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->networkStateChanged(toAidl(type));
|
||||
networkCb()->networkStateChanged(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::nitzTimeReceived(V1_0::RadioIndicationType type,
|
||||
const hidl_string& nitzTime, uint64_t receivedTime) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->nitzTimeReceived(toAidl(type), nitzTime, receivedTime, 0);
|
||||
networkCb()->nitzTimeReceived(toAidl(type), nitzTime, receivedTime, 0);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -220,33 +208,29 @@ Return<void> RadioIndication::registrationFailed( //
|
||||
const hidl_string& chosenPlmn, hidl_bitfield<V1_5::Domain> domain, int32_t causeCode,
|
||||
int32_t additionalCauseCode) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->registrationFailed(toAidl(type), toAidl(cellIdentity), chosenPlmn,
|
||||
aidl::Domain(domain), causeCode, additionalCauseCode);
|
||||
networkCb()->registrationFailed(toAidl(type), toAidl(cellIdentity), chosenPlmn,
|
||||
aidl::Domain(domain), causeCode, additionalCauseCode);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::restrictedStateChanged(V1_0::RadioIndicationType type,
|
||||
V1_0::PhoneRestrictedState state) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->restrictedStateChanged(toAidl(type), aidl::PhoneRestrictedState(state));
|
||||
networkCb()->restrictedStateChanged(toAidl(type), aidl::PhoneRestrictedState(state));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::suppSvcNotify(V1_0::RadioIndicationType type,
|
||||
const V1_0::SuppSvcNotification& suppSvc) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->suppSvcNotify(toAidl(type), toAidl(suppSvc));
|
||||
networkCb()->suppSvcNotify(toAidl(type), toAidl(suppSvc));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::voiceRadioTechChanged(V1_0::RadioIndicationType type,
|
||||
V1_0::RadioTechnology rat) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->voiceRadioTechChanged(toAidl(type), RadioTechnology(rat));
|
||||
networkCb()->voiceRadioTechChanged(toAidl(type), RadioTechnology(rat));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,10 @@ using ::ndk::ScopedAStatus;
|
||||
namespace aidl = ::aidl::android::hardware::radio::network;
|
||||
constexpr auto ok = &ScopedAStatus::ok;
|
||||
|
||||
std::shared_ptr<aidl::IRadioNetworkResponse> RadioNetwork::respond() {
|
||||
return mCallbackManager->response().networkCb();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioNetwork::getAllowedNetworkTypesBitmap(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
if (mHal1_6) {
|
||||
@@ -69,13 +73,21 @@ ScopedAStatus RadioNetwork::getCdmaRoamingPreference(int32_t serial) {
|
||||
|
||||
ScopedAStatus RadioNetwork::getCellInfoList(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getCellInfoList(serial);
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getCellInfoList_1_6(serial);
|
||||
} else {
|
||||
mHal1_5->getCellInfoList(serial);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioNetwork::getDataRegistrationState(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getDataRegistrationState(serial);
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getDataRegistrationState_1_6(serial);
|
||||
} else {
|
||||
mHal1_5->getDataRegistrationState_1_5(serial);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -99,7 +111,11 @@ ScopedAStatus RadioNetwork::getOperator(int32_t serial) {
|
||||
|
||||
ScopedAStatus RadioNetwork::getSignalStrength(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getSignalStrength(serial);
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getSignalStrength_1_6(serial);
|
||||
} else {
|
||||
mHal1_5->getSignalStrength_1_4(serial);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -108,7 +124,7 @@ ScopedAStatus RadioNetwork::getSystemSelectionChannels(int32_t serial) {
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getSystemSelectionChannels(serial);
|
||||
} else {
|
||||
respond().getSystemSelectionChannelsResponse(notSupported(serial), {});
|
||||
respond()->getSystemSelectionChannelsResponse(notSupported(serial), {});
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
@@ -121,7 +137,11 @@ ScopedAStatus RadioNetwork::getVoiceRadioTechnology(int32_t serial) {
|
||||
|
||||
ScopedAStatus RadioNetwork::getVoiceRegistrationState(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getVoiceRegistrationState(serial);
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getVoiceRegistrationState_1_6(serial);
|
||||
} else {
|
||||
mHal1_5->getVoiceRegistrationState_1_5(serial);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -130,7 +150,7 @@ ScopedAStatus RadioNetwork::isNrDualConnectivityEnabled(int32_t serial) {
|
||||
if (mHal1_6) {
|
||||
mHal1_6->isNrDualConnectivityEnabled(serial);
|
||||
} else {
|
||||
respond().isNrDualConnectivityEnabledResponse(notSupported(serial), false);
|
||||
respond()->isNrDualConnectivityEnabledResponse(notSupported(serial), false);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
@@ -179,7 +199,7 @@ ScopedAStatus RadioNetwork::setCellInfoListRate(int32_t serial, int32_t rate) {
|
||||
|
||||
ScopedAStatus RadioNetwork::setIndicationFilter(int32_t serial, aidl::IndicationFilter indFilter) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->setIndicationFilter(serial, toHidlBitfield<V1_0::IndicationFilter>(indFilter));
|
||||
mHal1_5->setIndicationFilter_1_5(serial, toHidlBitfield<V1_5::IndicationFilter>(indFilter));
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -188,9 +208,9 @@ ScopedAStatus RadioNetwork::setLinkCapacityReportingCriteria( //
|
||||
const std::vector<int32_t>& thrDownlinkKbps, const std::vector<int32_t>& thrUplinkKbps,
|
||||
AccessNetwork accessNetwork) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->setLinkCapacityReportingCriteria( //
|
||||
mHal1_5->setLinkCapacityReportingCriteria_1_5( //
|
||||
serial, hysteresisMs, hysteresisDlKbps, hysteresisUlKbps, thrDownlinkKbps,
|
||||
thrUplinkKbps, V1_2::AccessNetwork(accessNetwork));
|
||||
thrUplinkKbps, V1_5::AccessNetwork(accessNetwork));
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -219,22 +239,16 @@ ScopedAStatus RadioNetwork::setNrDualConnectivityState(int32_t serial,
|
||||
if (mHal1_6) {
|
||||
mHal1_6->setNrDualConnectivityState(serial, V1_6::NrDualConnectivityState(st));
|
||||
} else {
|
||||
respond().setNrDualConnectivityStateResponse(notSupported(serial));
|
||||
respond()->setNrDualConnectivityStateResponse(notSupported(serial));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioNetwork::setResponseFunctions(
|
||||
const std::shared_ptr<aidl::IRadioNetworkResponse>& networkResponse,
|
||||
const std::shared_ptr<aidl::IRadioNetworkIndication>& networkIndication) {
|
||||
LOG_CALL << networkResponse << ' ' << networkIndication;
|
||||
|
||||
CHECK(networkResponse);
|
||||
CHECK(networkIndication);
|
||||
|
||||
mRadioResponse->setResponseFunction(networkResponse);
|
||||
mRadioIndication->setResponseFunction(networkIndication);
|
||||
|
||||
const std::shared_ptr<aidl::IRadioNetworkResponse>& response,
|
||||
const std::shared_ptr<aidl::IRadioNetworkIndication>& indication) {
|
||||
LOG_CALL << response << ' ' << indication;
|
||||
mCallbackManager->setResponseFunctions(response, indication);
|
||||
return ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,25 +33,26 @@ using ::aidl::android::hardware::radio::RadioTechnologyFamily;
|
||||
namespace aidl = ::aidl::android::hardware::radio::network;
|
||||
|
||||
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioNetworkResponse> netCb) {
|
||||
CHECK(netCb);
|
||||
mNetworkCb = netCb;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioNetworkResponse> RadioResponse::networkCb() {
|
||||
return mNetworkCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getAllowedNetworkTypesBitmapResponse(
|
||||
const V1_6::RadioResponseInfo& info,
|
||||
hidl_bitfield<V1_4::RadioAccessFamily> networkTypeBitmap) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getAllowedNetworkTypesBitmapResponse(toAidl(info),
|
||||
RadioAccessFamily(networkTypeBitmap));
|
||||
networkCb()->getAllowedNetworkTypesBitmapResponse(toAidl(info),
|
||||
RadioAccessFamily(networkTypeBitmap));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info,
|
||||
V1_0::PreferredNetworkType nwType) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getAllowedNetworkTypesBitmapResponse( //
|
||||
networkCb()->getAllowedNetworkTypesBitmapResponse( //
|
||||
toAidl(info), RadioAccessFamily(getRafFromNetworkType(nwType)));
|
||||
return {};
|
||||
}
|
||||
@@ -66,16 +67,14 @@ Return<void> RadioResponse::getPreferredNetworkTypeBitmapResponse(
|
||||
Return<void> RadioResponse::getAvailableBandModesResponse(
|
||||
const V1_0::RadioResponseInfo& info, const hidl_vec<V1_0::RadioBandMode>& bandModes) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getAvailableBandModesResponse(toAidl(info), toAidl(bandModes));
|
||||
networkCb()->getAvailableBandModesResponse(toAidl(info), toAidl(bandModes));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getAvailableNetworksResponse(
|
||||
const V1_0::RadioResponseInfo& info, const hidl_vec<V1_0::OperatorInfo>& networkInfos) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getAvailableNetworksResponse(toAidl(info), toAidl(networkInfos));
|
||||
networkCb()->getAvailableNetworksResponse(toAidl(info), toAidl(networkInfos));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -83,16 +82,14 @@ Return<void> RadioResponse::getBarringInfoResponse(
|
||||
const V1_0::RadioResponseInfo& info, const V1_5::CellIdentity& cellIdentity,
|
||||
const hidl_vec<V1_5::BarringInfo>& barringInfos) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getBarringInfoResponse(toAidl(info), toAidl(cellIdentity), toAidl(barringInfos));
|
||||
networkCb()->getBarringInfoResponse(toAidl(info), toAidl(cellIdentity), toAidl(barringInfos));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info,
|
||||
V1_0::CdmaRoamingType type) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getCdmaRoamingPreferenceResponse(toAidl(info), aidl::CdmaRoamingType(type));
|
||||
networkCb()->getCdmaRoamingPreferenceResponse(toAidl(info), aidl::CdmaRoamingType(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -120,16 +117,14 @@ Return<void> RadioResponse::getCellInfoListResponse_1_4(const V1_0::RadioRespons
|
||||
Return<void> RadioResponse::getCellInfoListResponse_1_5(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_vec<V1_5::CellInfo>& cellInfo) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getCellInfoListResponse(toAidl(info), toAidl(cellInfo));
|
||||
networkCb()->getCellInfoListResponse(toAidl(info), toAidl(cellInfo));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCellInfoListResponse_1_6(const V1_6::RadioResponseInfo& info,
|
||||
const hidl_vec<V1_6::CellInfo>& cellInfo) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getCellInfoListResponse(toAidl(info), toAidl(cellInfo));
|
||||
networkCb()->getCellInfoListResponse(toAidl(info), toAidl(cellInfo));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -157,25 +152,22 @@ Return<void> RadioResponse::getDataRegistrationStateResponse_1_4(
|
||||
Return<void> RadioResponse::getDataRegistrationStateResponse_1_5(
|
||||
const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& dataRegResponse) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse));
|
||||
networkCb()->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getDataRegistrationStateResponse_1_6(
|
||||
const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& dataRegResponse) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse));
|
||||
networkCb()->getDataRegistrationStateResponse(toAidl(info), toAidl(dataRegResponse));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getImsRegistrationStateResponse( //
|
||||
const V1_0::RadioResponseInfo& info, bool isRegd, V1_0::RadioTechnologyFamily ratFamily) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getImsRegistrationStateResponse(toAidl(info), isRegd,
|
||||
RadioTechnologyFamily(ratFamily));
|
||||
networkCb()->getImsRegistrationStateResponse(toAidl(info), isRegd,
|
||||
RadioTechnologyFamily(ratFamily));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -189,8 +181,7 @@ Return<void> RadioResponse::getNeighboringCidsResponse(const V1_0::RadioResponse
|
||||
Return<void> RadioResponse::getNetworkSelectionModeResponse(const V1_0::RadioResponseInfo& info,
|
||||
bool manual) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getNetworkSelectionModeResponse(toAidl(info), manual);
|
||||
networkCb()->getNetworkSelectionModeResponse(toAidl(info), manual);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -198,8 +189,7 @@ Return<void> RadioResponse::getOperatorResponse( //
|
||||
const V1_0::RadioResponseInfo& info, const hidl_string& longName,
|
||||
const hidl_string& shortName, const hidl_string& numeric) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getOperatorResponse(toAidl(info), longName, shortName, numeric);
|
||||
networkCb()->getOperatorResponse(toAidl(info), longName, shortName, numeric);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -220,16 +210,14 @@ Return<void> RadioResponse::getSignalStrengthResponse_1_2(const V1_0::RadioRespo
|
||||
Return<void> RadioResponse::getSignalStrengthResponse_1_4(
|
||||
const V1_0::RadioResponseInfo& info, const V1_4::SignalStrength& signalStrength) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength));
|
||||
networkCb()->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getSignalStrengthResponse_1_6(
|
||||
const V1_6::RadioResponseInfo& info, const V1_6::SignalStrength& signalStrength) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength));
|
||||
networkCb()->getSignalStrengthResponse(toAidl(info), toAidl(signalStrength));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -237,16 +225,14 @@ Return<void> RadioResponse::getSystemSelectionChannelsResponse(
|
||||
const V1_6::RadioResponseInfo& info,
|
||||
const hidl_vec<V1_5::RadioAccessSpecifier>& specifiers) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getSystemSelectionChannelsResponse(toAidl(info), toAidl(specifiers));
|
||||
networkCb()->getSystemSelectionChannelsResponse(toAidl(info), toAidl(specifiers));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getVoiceRadioTechnologyResponse(const V1_0::RadioResponseInfo& info,
|
||||
V1_0::RadioTechnology rat) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getVoiceRadioTechnologyResponse(toAidl(info), RadioTechnology(rat));
|
||||
networkCb()->getVoiceRadioTechnologyResponse(toAidl(info), RadioTechnology(rat));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -267,24 +253,21 @@ Return<void> RadioResponse::getVoiceRegistrationStateResponse_1_2(
|
||||
Return<void> RadioResponse::getVoiceRegistrationStateResponse_1_5(
|
||||
const V1_0::RadioResponseInfo& info, const V1_5::RegStateResult& voiceRegResponse) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse));
|
||||
networkCb()->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getVoiceRegistrationStateResponse_1_6(
|
||||
const V1_6::RadioResponseInfo& info, const V1_6::RegStateResult& voiceRegResponse) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse));
|
||||
networkCb()->getVoiceRegistrationStateResponse(toAidl(info), toAidl(voiceRegResponse));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::isNrDualConnectivityEnabledResponse(const V1_6::RadioResponseInfo& info,
|
||||
bool isEnabled) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->isNrDualConnectivityEnabledResponse(toAidl(info), isEnabled);
|
||||
networkCb()->isNrDualConnectivityEnabledResponse(toAidl(info), isEnabled);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -297,15 +280,13 @@ Return<void> RadioResponse::pullLceDataResponse(const V1_0::RadioResponseInfo& i
|
||||
|
||||
Return<void> RadioResponse::setAllowedNetworkTypesBitmapResponse(const V1_6::RadioResponseInfo& i) {
|
||||
LOG_CALL << i.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setAllowedNetworkTypesBitmapResponse(toAidl(i));
|
||||
networkCb()->setAllowedNetworkTypesBitmapResponse(toAidl(i));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setPreferredNetworkTypeResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setAllowedNetworkTypesBitmapResponse(toAidl(info));
|
||||
networkCb()->setAllowedNetworkTypesBitmapResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -318,174 +299,151 @@ Return<void> RadioResponse::setPreferredNetworkTypeBitmapResponse(
|
||||
|
||||
Return<void> RadioResponse::setBandModeResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setBandModeResponse(toAidl(info));
|
||||
networkCb()->setBandModeResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setBarringPasswordResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setBarringPasswordResponse(toAidl(info));
|
||||
networkCb()->setBarringPasswordResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCdmaRoamingPreferenceResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setCdmaRoamingPreferenceResponse(toAidl(info));
|
||||
networkCb()->setCdmaRoamingPreferenceResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCellInfoListRateResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setCellInfoListRateResponse(toAidl(info));
|
||||
networkCb()->setCellInfoListRateResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setIndicationFilterResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setIndicationFilterResponse(toAidl(info));
|
||||
networkCb()->setIndicationFilterResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setIndicationFilterResponse_1_5(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setIndicationFilterResponse(toAidl(info));
|
||||
networkCb()->setIndicationFilterResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setLinkCapacityReportingCriteriaResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setLinkCapacityReportingCriteriaResponse(toAidl(info));
|
||||
networkCb()->setLinkCapacityReportingCriteriaResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setLinkCapacityReportingCriteriaResponse_1_5(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setLinkCapacityReportingCriteriaResponse(toAidl(info));
|
||||
networkCb()->setLinkCapacityReportingCriteriaResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setLocationUpdatesResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setLocationUpdatesResponse(toAidl(info));
|
||||
networkCb()->setLocationUpdatesResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setNetworkSelectionModeAutomaticResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setNetworkSelectionModeAutomaticResponse(toAidl(info));
|
||||
networkCb()->setNetworkSelectionModeAutomaticResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setNetworkSelectionModeManualResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setNetworkSelectionModeManualResponse(toAidl(info));
|
||||
networkCb()->setNetworkSelectionModeManualResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setNetworkSelectionModeManualResponse_1_5(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setNetworkSelectionModeManualResponse(toAidl(info));
|
||||
networkCb()->setNetworkSelectionModeManualResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setNrDualConnectivityStateResponse(
|
||||
const V1_6::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setNrDualConnectivityStateResponse(toAidl(info));
|
||||
networkCb()->setNrDualConnectivityStateResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSignalStrengthReportingCriteriaResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setSignalStrengthReportingCriteriaResponse(toAidl(info));
|
||||
networkCb()->setSignalStrengthReportingCriteriaResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSignalStrengthReportingCriteriaResponse_1_5(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setSignalStrengthReportingCriteriaResponse(toAidl(info));
|
||||
networkCb()->setSignalStrengthReportingCriteriaResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSuppServiceNotificationsResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setSuppServiceNotificationsResponse(toAidl(info));
|
||||
networkCb()->setSuppServiceNotificationsResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSystemSelectionChannelsResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setSystemSelectionChannelsResponse(toAidl(info));
|
||||
networkCb()->setSystemSelectionChannelsResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setSystemSelectionChannelsResponse_1_5(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->setSystemSelectionChannelsResponse(toAidl(info));
|
||||
networkCb()->setSystemSelectionChannelsResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::startNetworkScanResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->startNetworkScanResponse(toAidl(info));
|
||||
networkCb()->startNetworkScanResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::startNetworkScanResponse_1_4(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->startNetworkScanResponse(toAidl(info));
|
||||
networkCb()->startNetworkScanResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::startNetworkScanResponse_1_5(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->startNetworkScanResponse(toAidl(info));
|
||||
networkCb()->startNetworkScanResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::stopNetworkScanResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->stopNetworkScanResponse(toAidl(info));
|
||||
networkCb()->stopNetworkScanResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::supplyNetworkDepersonalizationResponse(
|
||||
const V1_0::RadioResponseInfo& info, int32_t remainingRetries) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mNetworkCb);
|
||||
mNetworkCb->supplyNetworkDepersonalizationResponse(toAidl(info), remainingRetries);
|
||||
networkCb()->supplyNetworkDepersonalizationResponse(toAidl(info), remainingRetries);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,29 +29,29 @@ 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;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioSimIndication> RadioIndication::simCb() {
|
||||
return mSimCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::carrierInfoForImsiEncryption(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->carrierInfoForImsiEncryption(toAidl(type));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->simPhonebookChanged(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -59,62 +59,54 @@ 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));
|
||||
simCb()->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));
|
||||
simCb()->simRefresh(toAidl(type), toAidl(refreshResult));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::simStatusChanged(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->simStatusChanged(toAidl(type));
|
||||
simCb()->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);
|
||||
simCb()->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);
|
||||
simCb()->stkProactiveCommand(toAidl(type), cmd);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::stkSessionEnd(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->stkSessionEnd(toAidl(type));
|
||||
simCb()->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);
|
||||
simCb()->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);
|
||||
simCb()->uiccApplicationsEnablementChanged(toAidl(type), enabled);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,48 +29,46 @@ 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;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioSimResponse> RadioResponse::simCb() {
|
||||
return mSimCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::areUiccApplicationsEnabledResponse(const V1_0::RadioResponseInfo& info,
|
||||
bool enabled) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->areUiccApplicationsEnabledResponse(toAidl(info), enabled);
|
||||
simCb()->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);
|
||||
simCb()->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);
|
||||
simCb()->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));
|
||||
simCb()->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, {});
|
||||
simCb()->getAllowedCarriersResponse(toAidl(info), aidlCr, {});
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -78,9 +76,8 @@ 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));
|
||||
simCb()->getAllowedCarriersResponse(toAidl(info), toAidl(carriers),
|
||||
aidl::SimLockMultiSimPolicy(multiSimPolicy));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -88,133 +85,116 @@ 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);
|
||||
simCb()->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));
|
||||
simCb()->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);
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->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);
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->getSimPhonebookRecordsResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::iccCloseLogicalChannelResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->iccCloseLogicalChannelResponse(toAidl(info));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->requestIccSimAuthenticationResponse(toAidl(info), toAidl(result));
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -228,121 +208,105 @@ Return<void> RadioResponse::requestIsimAuthenticationResponse(const V1_0::RadioR
|
||||
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);
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->setAllowedCarriersResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCarrierInfoForImsiEncryptionResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setCarrierInfoForImsiEncryptionResponse(toAidl(info));
|
||||
simCb()->setCarrierInfoForImsiEncryptionResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCdmaSubscriptionSourceResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setCdmaSubscriptionSourceResponse(toAidl(info));
|
||||
simCb()->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);
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->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));
|
||||
simCb()->setSimCardPowerResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setUiccSubscriptionResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->setUiccSubscriptionResponse(toAidl(info));
|
||||
simCb()->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);
|
||||
simCb()->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);
|
||||
simCb()->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);
|
||||
simCb()->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);
|
||||
simCb()->supplyIccPukForAppResponse(toAidl(info), remainingRetries);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -350,16 +314,14 @@ Return<void> RadioResponse::supplySimDepersonalizationResponse(const V1_0::Radio
|
||||
V1_5::PersoSubstate persoType,
|
||||
int32_t rRet) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mSimCb);
|
||||
mSimCb->supplySimDepersonalizationResponse(toAidl(info), aidl::PersoSubstate(persoType), rRet);
|
||||
simCb()->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);
|
||||
simCb()->updateSimPhonebookRecordsResponse(toAidl(info), updatedRecordIndex);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@ using ::ndk::ScopedAStatus;
|
||||
namespace aidl = ::aidl::android::hardware::radio::sim;
|
||||
constexpr auto ok = &ScopedAStatus::ok;
|
||||
|
||||
std::shared_ptr<aidl::IRadioSimResponse> RadioSim::respond() {
|
||||
return mCallbackManager->response().simCb();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioSim::areUiccApplicationsEnabled(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->areUiccApplicationsEnabled(serial);
|
||||
@@ -58,7 +62,7 @@ ScopedAStatus RadioSim::enableUiccApplications(int32_t serial, bool enable) {
|
||||
|
||||
ScopedAStatus RadioSim::getAllowedCarriers(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getAllowedCarriers(serial);
|
||||
mHal1_5->getAllowedCarriers_1_4(serial);
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -99,7 +103,7 @@ ScopedAStatus RadioSim::getSimPhonebookCapacity(int32_t serial) {
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getSimPhonebookCapacity(serial);
|
||||
} else {
|
||||
respond().getSimPhonebookCapacityResponse(notSupported(serial), {});
|
||||
respond()->getSimPhonebookCapacityResponse(notSupported(serial), {});
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
@@ -109,7 +113,7 @@ ScopedAStatus RadioSim::getSimPhonebookRecords(int32_t serial) {
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getSimPhonebookRecords(serial);
|
||||
} else {
|
||||
respond().getSimPhonebookRecordsResponse(notSupported(serial));
|
||||
respond()->getSimPhonebookRecordsResponse(notSupported(serial));
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
@@ -217,16 +221,10 @@ ScopedAStatus RadioSim::setFacilityLockForApp( //
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
const std::shared_ptr<aidl::IRadioSimResponse>& response,
|
||||
const std::shared_ptr<aidl::IRadioSimIndication>& indication) {
|
||||
LOG_CALL << response << ' ' << indication;
|
||||
mCallbackManager->setResponseFunctions(response, indication);
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -287,7 +285,7 @@ ScopedAStatus RadioSim::updateSimPhonebookRecords(int32_t serial,
|
||||
if (mHal1_6) {
|
||||
mHal1_6->updateSimPhonebookRecords(serial, toHidl(recordInfo));
|
||||
} else {
|
||||
respond().updateSimPhonebookRecordsResponse(notSupported(serial), 0);
|
||||
respond()->updateSimPhonebookRecordsResponse(notSupported(serial), 0);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -29,113 +29,102 @@ namespace android::hardware::radio::compat {
|
||||
namespace aidl = ::aidl::android::hardware::radio::voice;
|
||||
|
||||
void RadioIndication::setResponseFunction(std::shared_ptr<aidl::IRadioVoiceIndication> voiceCb) {
|
||||
CHECK(voiceCb);
|
||||
mVoiceCb = voiceCb;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioVoiceIndication> RadioIndication::voiceCb() {
|
||||
return mVoiceCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::callRing(V1_0::RadioIndicationType type, bool isGsm,
|
||||
const V1_0::CdmaSignalInfoRecord& record) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->callRing(toAidl(type), isGsm, toAidl(record));
|
||||
voiceCb()->callRing(toAidl(type), isGsm, toAidl(record));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::callStateChanged(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->callStateChanged(toAidl(type));
|
||||
voiceCb()->callStateChanged(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::cdmaCallWaiting(V1_0::RadioIndicationType type,
|
||||
const V1_0::CdmaCallWaiting& callWaitingRecord) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->cdmaCallWaiting(toAidl(type), toAidl(callWaitingRecord));
|
||||
voiceCb()->cdmaCallWaiting(toAidl(type), toAidl(callWaitingRecord));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::cdmaInfoRec(V1_0::RadioIndicationType type,
|
||||
const V1_0::CdmaInformationRecords& records) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->cdmaInfoRec(toAidl(type), toAidl(records.infoRec));
|
||||
voiceCb()->cdmaInfoRec(toAidl(type), toAidl(records.infoRec));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::cdmaOtaProvisionStatus(V1_0::RadioIndicationType type,
|
||||
V1_0::CdmaOtaProvisionStatus status) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->cdmaOtaProvisionStatus(toAidl(type), aidl::CdmaOtaProvisionStatus(status));
|
||||
voiceCb()->cdmaOtaProvisionStatus(toAidl(type), aidl::CdmaOtaProvisionStatus(status));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::currentEmergencyNumberList(
|
||||
V1_0::RadioIndicationType type, const hidl_vec<V1_4::EmergencyNumber>& emergencyNumbers) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->currentEmergencyNumberList(toAidl(type), toAidl(emergencyNumbers));
|
||||
voiceCb()->currentEmergencyNumberList(toAidl(type), toAidl(emergencyNumbers));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::enterEmergencyCallbackMode(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->enterEmergencyCallbackMode(toAidl(type));
|
||||
voiceCb()->enterEmergencyCallbackMode(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::exitEmergencyCallbackMode(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->exitEmergencyCallbackMode(toAidl(type));
|
||||
voiceCb()->exitEmergencyCallbackMode(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::indicateRingbackTone(V1_0::RadioIndicationType type, bool start) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->indicateRingbackTone(toAidl(type), start);
|
||||
voiceCb()->indicateRingbackTone(toAidl(type), start);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::onSupplementaryServiceIndication(V1_0::RadioIndicationType type,
|
||||
const V1_0::StkCcUnsolSsResult& ss) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->onSupplementaryServiceIndication(toAidl(type), toAidl(ss));
|
||||
voiceCb()->onSupplementaryServiceIndication(toAidl(type), toAidl(ss));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::resendIncallMute(V1_0::RadioIndicationType type) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->resendIncallMute(toAidl(type));
|
||||
voiceCb()->resendIncallMute(toAidl(type));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::srvccStateNotify(V1_0::RadioIndicationType type,
|
||||
V1_0::SrvccState state) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->srvccStateNotify(toAidl(type), aidl::SrvccState(state));
|
||||
voiceCb()->srvccStateNotify(toAidl(type), aidl::SrvccState(state));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::stkCallControlAlphaNotify(V1_0::RadioIndicationType type,
|
||||
const hidl_string& alpha) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->stkCallControlAlphaNotify(toAidl(type), alpha);
|
||||
voiceCb()->stkCallControlAlphaNotify(toAidl(type), alpha);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioIndication::stkCallSetup(V1_0::RadioIndicationType type, int64_t timeout) {
|
||||
LOG_CALL << type;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->stkCallSetup(toAidl(type), timeout);
|
||||
voiceCb()->stkCallSetup(toAidl(type), timeout);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,265 +29,233 @@ namespace android::hardware::radio::compat {
|
||||
namespace aidl = ::aidl::android::hardware::radio::voice;
|
||||
|
||||
void RadioResponse::setResponseFunction(std::shared_ptr<aidl::IRadioVoiceResponse> voiceCb) {
|
||||
CHECK(voiceCb);
|
||||
mVoiceCb = voiceCb;
|
||||
}
|
||||
|
||||
std::shared_ptr<aidl::IRadioVoiceResponse> RadioResponse::voiceCb() {
|
||||
return mVoiceCb.get();
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::acceptCallResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->acceptCallResponse(toAidl(info));
|
||||
voiceCb()->acceptCallResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::conferenceResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->conferenceResponse(toAidl(info));
|
||||
voiceCb()->conferenceResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::dialResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->dialResponse(toAidl(info));
|
||||
voiceCb()->dialResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::emergencyDialResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->emergencyDialResponse(toAidl(info));
|
||||
voiceCb()->emergencyDialResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::exitEmergencyCallbackModeResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->exitEmergencyCallbackModeResponse(toAidl(info));
|
||||
voiceCb()->exitEmergencyCallbackModeResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::explicitCallTransferResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->explicitCallTransferResponse(toAidl(info));
|
||||
voiceCb()->explicitCallTransferResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCallForwardStatusResponse(
|
||||
const V1_0::RadioResponseInfo& info, const hidl_vec<V1_0::CallForwardInfo>& callFwdInfos) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getCallForwardStatusResponse(toAidl(info), toAidl(callFwdInfos));
|
||||
voiceCb()->getCallForwardStatusResponse(toAidl(info), toAidl(callFwdInfos));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCallWaitingResponse(const V1_0::RadioResponseInfo& info, bool enable,
|
||||
int32_t serviceClass) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getCallWaitingResponse(toAidl(info), enable, serviceClass);
|
||||
voiceCb()->getCallWaitingResponse(toAidl(info), enable, serviceClass);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getClipResponse(const V1_0::RadioResponseInfo& info,
|
||||
V1_0::ClipStatus status) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getClipResponse(toAidl(info), aidl::ClipStatus(status));
|
||||
voiceCb()->getClipResponse(toAidl(info), aidl::ClipStatus(status));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getClirResponse(const V1_0::RadioResponseInfo& info, int32_t n,
|
||||
int32_t m) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getClirResponse(toAidl(info), n, m);
|
||||
voiceCb()->getClirResponse(toAidl(info), n, m);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCurrentCallsResponse(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_vec<V1_0::Call>& calls) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls));
|
||||
voiceCb()->getCurrentCallsResponse(toAidl(info), toAidl(calls));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCurrentCallsResponse_1_2(const V1_0::RadioResponseInfo& info,
|
||||
const hidl_vec<V1_2::Call>& calls) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls));
|
||||
voiceCb()->getCurrentCallsResponse(toAidl(info), toAidl(calls));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getCurrentCallsResponse_1_6(const V1_6::RadioResponseInfo& info,
|
||||
const hidl_vec<V1_6::Call>& calls) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getCurrentCallsResponse(toAidl(info), toAidl(calls));
|
||||
voiceCb()->getCurrentCallsResponse(toAidl(info), toAidl(calls));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getLastCallFailCauseResponse(
|
||||
const V1_0::RadioResponseInfo& info, const V1_0::LastCallFailCauseInfo& failCauseinfo) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getLastCallFailCauseResponse(toAidl(info), toAidl(failCauseinfo));
|
||||
voiceCb()->getLastCallFailCauseResponse(toAidl(info), toAidl(failCauseinfo));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getMuteResponse(const V1_0::RadioResponseInfo& info, bool enable) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getMuteResponse(toAidl(info), enable);
|
||||
voiceCb()->getMuteResponse(toAidl(info), enable);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info,
|
||||
bool enable) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getPreferredVoicePrivacyResponse(toAidl(info), enable);
|
||||
voiceCb()->getPreferredVoicePrivacyResponse(toAidl(info), enable);
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::getTTYModeResponse(const V1_0::RadioResponseInfo& info,
|
||||
V1_0::TtyMode mode) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->getTtyModeResponse(toAidl(info), aidl::TtyMode(mode));
|
||||
voiceCb()->getTtyModeResponse(toAidl(info), aidl::TtyMode(mode));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::handleStkCallSetupRequestFromSimResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->handleStkCallSetupRequestFromSimResponse(toAidl(info));
|
||||
voiceCb()->handleStkCallSetupRequestFromSimResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::hangupConnectionResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->hangupConnectionResponse(toAidl(info));
|
||||
voiceCb()->hangupConnectionResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::hangupForegroundResumeBackgroundResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->hangupForegroundResumeBackgroundResponse(toAidl(info));
|
||||
voiceCb()->hangupForegroundResumeBackgroundResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::hangupWaitingOrBackgroundResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->hangupWaitingOrBackgroundResponse(toAidl(info));
|
||||
voiceCb()->hangupWaitingOrBackgroundResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::rejectCallResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->rejectCallResponse(toAidl(info));
|
||||
voiceCb()->rejectCallResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendBurstDtmfResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->sendBurstDtmfResponse(toAidl(info));
|
||||
voiceCb()->sendBurstDtmfResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendCDMAFeatureCodeResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->sendCdmaFeatureCodeResponse(toAidl(info));
|
||||
voiceCb()->sendCdmaFeatureCodeResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::sendDtmfResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->sendDtmfResponse(toAidl(info));
|
||||
voiceCb()->sendDtmfResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::separateConnectionResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->separateConnectionResponse(toAidl(info));
|
||||
voiceCb()->separateConnectionResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCallForwardResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->setCallForwardResponse(toAidl(info));
|
||||
voiceCb()->setCallForwardResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setCallWaitingResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->setCallWaitingResponse(toAidl(info));
|
||||
voiceCb()->setCallWaitingResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setClirResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->setClirResponse(toAidl(info));
|
||||
voiceCb()->setClirResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setMuteResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->setMuteResponse(toAidl(info));
|
||||
voiceCb()->setMuteResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setPreferredVoicePrivacyResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->setPreferredVoicePrivacyResponse(toAidl(info));
|
||||
voiceCb()->setPreferredVoicePrivacyResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::setTTYModeResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->setTtyModeResponse(toAidl(info));
|
||||
voiceCb()->setTtyModeResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::startDtmfResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->startDtmfResponse(toAidl(info));
|
||||
voiceCb()->startDtmfResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::stopDtmfResponse(const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->stopDtmfResponse(toAidl(info));
|
||||
voiceCb()->stopDtmfResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
Return<void> RadioResponse::switchWaitingOrHoldingAndActiveResponse(
|
||||
const V1_0::RadioResponseInfo& info) {
|
||||
LOG_CALL << info.serial;
|
||||
CHECK_CB(mVoiceCb);
|
||||
mVoiceCb->switchWaitingOrHoldingAndActiveResponse(toAidl(info));
|
||||
voiceCb()->switchWaitingOrHoldingAndActiveResponse(toAidl(info));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@ using ::ndk::ScopedAStatus;
|
||||
namespace aidl = ::aidl::android::hardware::radio::voice;
|
||||
constexpr auto ok = &ScopedAStatus::ok;
|
||||
|
||||
std::shared_ptr<aidl::IRadioVoiceResponse> RadioVoice::respond() {
|
||||
return mCallbackManager->response().voiceCb();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioVoice::acceptCall(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->acceptCall(serial);
|
||||
@@ -49,13 +53,19 @@ ScopedAStatus RadioVoice::dial(int32_t serial, const aidl::Dial& dialInfo) {
|
||||
}
|
||||
|
||||
ScopedAStatus RadioVoice::emergencyDial( //
|
||||
int32_t serial, const aidl::Dial& dialInfo, aidl::EmergencyServiceCategory categories,
|
||||
int32_t serial, const aidl::Dial& info, aidl::EmergencyServiceCategory categories,
|
||||
const std::vector<std::string>& urns, aidl::EmergencyCallRouting routing,
|
||||
bool hasKnownUserIntentEmerg, bool isTesting) {
|
||||
bool knownUserIntentEmerg, bool isTesting) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->emergencyDial(serial, toHidl(dialInfo),
|
||||
toHidlBitfield<V1_4::EmergencyServiceCategory>(categories), toHidl(urns),
|
||||
V1_4::EmergencyCallRouting(routing), hasKnownUserIntentEmerg, isTesting);
|
||||
if (mHal1_6) {
|
||||
mHal1_6->emergencyDial_1_6( //
|
||||
serial, toHidl(info), toHidlBitfield<V1_4::EmergencyServiceCategory>(categories),
|
||||
toHidl(urns), V1_4::EmergencyCallRouting(routing), knownUserIntentEmerg, isTesting);
|
||||
} else {
|
||||
mHal1_5->emergencyDial( //
|
||||
serial, toHidl(info), toHidlBitfield<V1_4::EmergencyServiceCategory>(categories),
|
||||
toHidl(urns), V1_4::EmergencyCallRouting(routing), knownUserIntentEmerg, isTesting);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -98,7 +108,11 @@ ScopedAStatus RadioVoice::getClir(int32_t serial) {
|
||||
|
||||
ScopedAStatus RadioVoice::getCurrentCalls(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getCurrentCalls(serial);
|
||||
if (mHal1_6) {
|
||||
mHal1_6->getCurrentCalls_1_6(serial);
|
||||
} else {
|
||||
mHal1_5->getCurrentCalls(serial);
|
||||
}
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -152,7 +166,7 @@ ScopedAStatus RadioVoice::hangupWaitingOrBackground(int32_t serial) {
|
||||
|
||||
ScopedAStatus RadioVoice::isVoNrEnabled(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
// TODO(b/203699028): can't call isVoNrEnabledResponse with 1.6 callback
|
||||
respond()->isVoNrEnabledResponse(notSupported(serial), false);
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -224,16 +238,10 @@ ScopedAStatus RadioVoice::setPreferredVoicePrivacy(int32_t serial, bool enable)
|
||||
}
|
||||
|
||||
ScopedAStatus RadioVoice::setResponseFunctions(
|
||||
const std::shared_ptr<aidl::IRadioVoiceResponse>& voiceResponse,
|
||||
const std::shared_ptr<aidl::IRadioVoiceIndication>& voiceIndication) {
|
||||
LOG_CALL << voiceResponse << ' ' << voiceIndication;
|
||||
|
||||
CHECK(voiceResponse);
|
||||
CHECK(voiceIndication);
|
||||
|
||||
mRadioResponse->setResponseFunction(voiceResponse);
|
||||
mRadioIndication->setResponseFunction(voiceIndication);
|
||||
|
||||
const std::shared_ptr<aidl::IRadioVoiceResponse>& response,
|
||||
const std::shared_ptr<aidl::IRadioVoiceIndication>& indication) {
|
||||
LOG_CALL << response << ' ' << indication;
|
||||
mCallbackManager->setResponseFunctions(response, indication);
|
||||
return ok();
|
||||
}
|
||||
|
||||
@@ -245,7 +253,8 @@ ScopedAStatus RadioVoice::setTtyMode(int32_t serial, aidl::TtyMode mode) {
|
||||
|
||||
ndk::ScopedAStatus RadioVoice::setVoNrEnabled(int32_t serial, [[maybe_unused]] bool enable) {
|
||||
LOG_CALL << serial;
|
||||
// TODO(b/203699028): should set `persist.radio.is_vonr_enabled_` property instead
|
||||
// Note: a workaround for older HALs could also be setting persist.radio.is_vonr_enabled_
|
||||
respond()->setVoNrEnabledResponse(notSupported(serial));
|
||||
return ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,12 @@
|
||||
#include <android-base/logging.h>
|
||||
#include <android/binder_manager.h>
|
||||
#include <android/binder_process.h>
|
||||
#include <libradiocompat/CallbackManager.h>
|
||||
#include <libradiocompat/RadioConfig.h>
|
||||
#include <libradiocompat/RadioData.h>
|
||||
#include <libradiocompat/RadioIndication.h>
|
||||
#include <libradiocompat/RadioMessaging.h>
|
||||
#include <libradiocompat/RadioModem.h>
|
||||
#include <libradiocompat/RadioNetwork.h>
|
||||
#include <libradiocompat/RadioResponse.h>
|
||||
#include <libradiocompat/RadioSim.h>
|
||||
#include <libradiocompat/RadioVoice.h>
|
||||
|
||||
@@ -36,9 +35,8 @@ using namespace std::string_literals;
|
||||
static std::vector<std::shared_ptr<ndk::ICInterface>> gPublishedHals;
|
||||
|
||||
template <typename T>
|
||||
static void publishRadioHal(std::shared_ptr<compat::DriverContext> context,
|
||||
sp<V1_5::IRadio> hidlHal, sp<compat::RadioResponse> responseCb,
|
||||
sp<compat::RadioIndication> indicationCb, const std::string& slot) {
|
||||
static void publishRadioHal(std::shared_ptr<compat::DriverContext> ctx, sp<V1_5::IRadio> hidlHal,
|
||||
std::shared_ptr<compat::CallbackManager> cm, const std::string& slot) {
|
||||
const auto instance = T::descriptor + "/"s + slot;
|
||||
if (!AServiceManager_isDeclared(instance.c_str())) {
|
||||
LOG(INFO) << instance << " is not declared in VINTF (this may be intentional)";
|
||||
@@ -46,7 +44,7 @@ static void publishRadioHal(std::shared_ptr<compat::DriverContext> context,
|
||||
}
|
||||
LOG(DEBUG) << "Publishing " << instance;
|
||||
|
||||
auto aidlHal = ndk::SharedRefBase::make<T>(context, hidlHal, responseCb, indicationCb);
|
||||
auto aidlHal = ndk::SharedRefBase::make<T>(ctx, hidlHal, cm);
|
||||
gPublishedHals.push_back(aidlHal);
|
||||
const auto status = AServiceManager_addService(aidlHal->asBinder().get(), instance.c_str());
|
||||
CHECK_EQ(status, STATUS_OK);
|
||||
@@ -59,17 +57,14 @@ static void publishRadio(std::string slot) {
|
||||
hidl_utils::linkDeathToDeath(radioHidl);
|
||||
|
||||
auto context = std::make_shared<compat::DriverContext>();
|
||||
auto callbackMgr = std::make_shared<compat::CallbackManager>(context, radioHidl);
|
||||
|
||||
auto responseCb = sp<compat::RadioResponse>::make(context);
|
||||
auto indicationCb = sp<compat::RadioIndication>::make(context);
|
||||
radioHidl->setResponseFunctions(responseCb, indicationCb).assertOk();
|
||||
|
||||
publishRadioHal<compat::RadioData>(context, radioHidl, responseCb, indicationCb, slot);
|
||||
publishRadioHal<compat::RadioMessaging>(context, radioHidl, responseCb, indicationCb, slot);
|
||||
publishRadioHal<compat::RadioModem>(context, radioHidl, responseCb, indicationCb, slot);
|
||||
publishRadioHal<compat::RadioNetwork>(context, radioHidl, responseCb, indicationCb, slot);
|
||||
publishRadioHal<compat::RadioSim>(context, radioHidl, responseCb, indicationCb, slot);
|
||||
publishRadioHal<compat::RadioVoice>(context, radioHidl, responseCb, indicationCb, slot);
|
||||
publishRadioHal<compat::RadioData>(context, radioHidl, callbackMgr, slot);
|
||||
publishRadioHal<compat::RadioMessaging>(context, radioHidl, callbackMgr, slot);
|
||||
publishRadioHal<compat::RadioModem>(context, radioHidl, callbackMgr, slot);
|
||||
publishRadioHal<compat::RadioNetwork>(context, radioHidl, callbackMgr, slot);
|
||||
publishRadioHal<compat::RadioSim>(context, radioHidl, callbackMgr, slot);
|
||||
publishRadioHal<compat::RadioVoice>(context, radioHidl, callbackMgr, slot);
|
||||
}
|
||||
|
||||
static void publishRadioConfig() {
|
||||
@@ -86,6 +81,7 @@ static void publishRadioConfig() {
|
||||
}
|
||||
|
||||
static void main() {
|
||||
base::InitLogging(nullptr, base::LogdLogger(base::RADIO));
|
||||
base::SetDefaultTag("radiocompat");
|
||||
base::SetMinimumLogSeverity(base::VERBOSE);
|
||||
LOG(DEBUG) << "Radio HAL compat service starting...";
|
||||
|
||||
Reference in New Issue
Block a user