Update tuner default AIDL HAL.
*) Use tuner AIDL HAL return values.
*) Replace mTunerService with mTuner to avoid confusing.
*) Merge other HIDL HAL changes.
*) ag/15371813, ag/15371814 and ag/15371815.
Bug: 191825295
Test: make and run VtsHalTvTunerTargetTest
Change-Id: Ibbf94c4fc36c3bda94a7e0f3e0697c83ac414d0e
diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp
index dc0bd5e..8335ffa 100644
--- a/tv/tuner/aidl/default/Tuner.cpp
+++ b/tv/tuner/aidl/default/Tuner.cpp
@@ -17,12 +17,14 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "android.hardware.tv.tuner-service.example-Tuner"
-#include "Tuner.h"
+#include <aidl/android/hardware/tv/tuner/Result.h>
#include <utils/Log.h>
+
#include "Demux.h"
#include "Descrambler.h"
#include "Frontend.h"
#include "Lnb.h"
+#include "Tuner.h"
namespace aidl {
namespace android {
@@ -198,7 +200,8 @@
if (in_frontendId >= mFrontendSize || in_frontendId < 0) {
ALOGW("[ WARN ] Frontend with id %d isn't available", in_frontendId);
*_aidl_return = nullptr;
- return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION);
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_ARGUMENT));
}
*_aidl_return = mFrontends[in_frontendId];
@@ -241,7 +244,8 @@
ALOGV("%s", __FUNCTION__);
if (in_frontendId >= mFrontendSize) {
- return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION);
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_ARGUMENT));
}
// assign randomly selected values for testing.
@@ -276,7 +280,8 @@
if (in_lnbId >= mLnbs.size()) {
*_aidl_return = nullptr;
- return ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION);
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_ARGUMENT));
}
*_aidl_return = mLnbs[in_lnbId];