Rename aidl_ include and src directories.

Test: unit tests
Test: Google TV and Netflix
Test: atest GtsMediaTestCases

Bug: 216527109
Change-Id: I3fd02c2c60da588dba3db27cea3593de25a7180f
This commit is contained in:
Edwin Wong
2022-05-24 17:37:06 +00:00
parent a7b76187ea
commit e176b20509
45 changed files with 72 additions and 72 deletions

View File

@@ -0,0 +1,55 @@
//
// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine License
// Agreement.
//
#ifndef WV_UTILS_H_
#define WV_UTILS_H_
#include <aidl/android/hardware/drm/Status.h>
#include <android/binder_auto_utils.h>
#include <string>
#include <vector>
#include "log.h"
namespace wvdrm {
inline ::aidl::android::hardware::drm::LogPriority toAidlLogPriority(
wvutil::LogPriority p) {
switch (p) {
case wvutil::LogPriority::CDM_LOG_ERROR:
return ::aidl::android::hardware::drm::LogPriority::ERROR;
case wvutil::LogPriority::CDM_LOG_WARN:
return ::aidl::android::hardware::drm::LogPriority::WARN;
case wvutil::LogPriority::CDM_LOG_INFO:
return ::aidl::android::hardware::drm::LogPriority::INFO;
case wvutil::LogPriority::CDM_LOG_DEBUG:
return ::aidl::android::hardware::drm::LogPriority::DEBUG;
case wvutil::LogPriority::CDM_LOG_VERBOSE:
return ::aidl::android::hardware::drm::LogPriority::VERBOSE;
default:
return ::aidl::android::hardware::drm::LogPriority::UNKNOWN;
}
}
inline ::ndk::ScopedAStatus toNdkScopedAStatus(
::aidl::android::hardware::drm::Status status, const char* msg = nullptr) {
if (::aidl::android::hardware::drm::Status::OK == status)
return ::ndk::ScopedAStatus::ok();
else {
auto err = static_cast<int32_t>(status);
if (msg) {
return ::ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage(err,
msg);
} else {
return ::ndk::ScopedAStatus::fromServiceSpecificError(err);
}
}
}
} // namespace wvdrm
#endif // WV_UTILS_H_