device_google_tangorpro/cast_auth/mediadrm/include/Utils.h
Liana Kazanova (xWF) 32c2f95b10 Revert "Use mediadrm from private instead of tangorpro"
Revert submission 29489024-pixel_tablet_mediadrm

Reason for revert: DroidMonitor: Potential culprit for http://b/369192150 - Verifying through ABTD before submission. 

Reverted changes: /q/submissionid:29489024-pixel_tablet_mediadrm

Change-Id: I3c1c31b871275bf2b5ceb93120918f749f828cd1
2024-09-23 21:03:33 +00:00

44 lines
1.1 KiB
C++

#ifndef UTILS_H_
#define UTILS_H_
#include <string>
#include "SessionLibrary.h"
#include <android/binder_auto_utils.h>
#include "aidl/android/hardware/drm/Status.h"
#include "CastKeyTypes.h"
namespace aidl {
namespace android {
namespace hardware {
namespace drm {
namespace castkey {
inline ::ndk::ScopedAStatus toNdkScopedAStatus(::aidl::android::hardware::drm::Status status,
const char* msg = nullptr) {
if (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);
}
}
}
inline ::ndk::ScopedAStatus toNdkScopedAStatus(castkeydrm::CdmResponseType res) {
return toNdkScopedAStatus(static_cast<::aidl::android::hardware::drm::Status>(res));
}
#define UNUSED(x) (void)(x);
} // namespace castkey
} // namespace drm
} // namespace hardware
} // namespace android
} // namespace aidl
#endif // UTILS_H_