Revert "Use aidl interface for Widevine service."
This reverts commit 96a8ccd4a1.
Reason for revert:
Could break DeviceManifest/SingleManifestTest#ManifestAidlHalsServed
Bug: 200055138
Bug: 170964303
Bug: 217241995
Change-Id: I9c42df15defec428c9ef8c62439c63d4a603fee6
This commit is contained in:
@@ -22,13 +22,13 @@ namespace wvutil {
|
||||
typedef enum {
|
||||
// This log level should only be used for |g_cutoff|, in order to silence all
|
||||
// logging. It should never be passed to |Log()| as a log level.
|
||||
CDM_LOG_SILENT = -1,
|
||||
LOG_SILENT = -1,
|
||||
|
||||
CDM_LOG_ERROR = 0,
|
||||
CDM_LOG_WARN = 1,
|
||||
CDM_LOG_INFO = 2,
|
||||
CDM_LOG_DEBUG = 3,
|
||||
CDM_LOG_VERBOSE = 4,
|
||||
LOG_ERROR = 0,
|
||||
LOG_WARN = 1,
|
||||
LOG_INFO = 2,
|
||||
LOG_DEBUG = 3,
|
||||
LOG_VERBOSE = 4,
|
||||
} LogPriority;
|
||||
|
||||
extern LogPriority g_cutoff;
|
||||
@@ -93,15 +93,15 @@ CORE_UTIL_EXPORT void Log(const char* file, const char* function, int line,
|
||||
// Log APIs
|
||||
#ifndef LOGE
|
||||
# define LOGE(...) \
|
||||
Log(__FILE__, __func__, __LINE__, wvutil::CDM_LOG_ERROR, __VA_ARGS__)
|
||||
Log(__FILE__, __func__, __LINE__, wvutil::LOG_ERROR, __VA_ARGS__)
|
||||
# define LOGW(...) \
|
||||
Log(__FILE__, __func__, __LINE__, wvutil::CDM_LOG_WARN, __VA_ARGS__)
|
||||
Log(__FILE__, __func__, __LINE__, wvutil::LOG_WARN, __VA_ARGS__)
|
||||
# define LOGI(...) \
|
||||
Log(__FILE__, __func__, __LINE__, wvutil::CDM_LOG_INFO, __VA_ARGS__)
|
||||
Log(__FILE__, __func__, __LINE__, wvutil::LOG_INFO, __VA_ARGS__)
|
||||
# define LOGD(...) \
|
||||
Log(__FILE__, __func__, __LINE__, wvutil::CDM_LOG_DEBUG, __VA_ARGS__)
|
||||
Log(__FILE__, __func__, __LINE__, wvutil::LOG_DEBUG, __VA_ARGS__)
|
||||
# define LOGV(...) \
|
||||
Log(__FILE__, __func__, __LINE__, wvutil::CDM_LOG_VERBOSE, __VA_ARGS__)
|
||||
Log(__FILE__, __func__, __LINE__, wvutil::LOG_VERBOSE, __VA_ARGS__)
|
||||
#endif
|
||||
} // namespace wvutil
|
||||
|
||||
|
||||
@@ -11,27 +11,23 @@
|
||||
* at the top of your source file) to change that behavior.
|
||||
*/
|
||||
#ifndef LOG_NDEBUG
|
||||
#ifdef NDEBUG
|
||||
#define LOG_NDEBUG 1
|
||||
#else
|
||||
#define LOG_NDEBUG 0
|
||||
#endif
|
||||
# ifdef NDEBUG
|
||||
# define LOG_NDEBUG 1
|
||||
# else
|
||||
# define LOG_NDEBUG 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define LOG_TAG "WVCdm"
|
||||
#define LOG_BUF_SIZE 5120
|
||||
|
||||
#include "log.h"
|
||||
|
||||
#ifdef IS_HIDL
|
||||
#include <hwbinder/IPCThreadState.h>
|
||||
#else // AIDL is the default
|
||||
#include <binder/IPCThreadState.h>
|
||||
#endif
|
||||
#include <utils/Log.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
#include <utils/Log.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
@@ -55,7 +51,7 @@ int64_t GetCurrentTimeMs() {
|
||||
}
|
||||
} // namespace
|
||||
|
||||
LogPriority g_cutoff = CDM_LOG_VERBOSE;
|
||||
LogPriority g_cutoff = LOG_VERBOSE;
|
||||
|
||||
LogBuffer g_logbuf;
|
||||
|
||||
@@ -76,11 +72,7 @@ void ClearLoggingUid() {
|
||||
uint32_t GetLoggingUid() { return tl_logging_uid_; }
|
||||
|
||||
uint32_t GetIpcCallingUid() {
|
||||
#ifdef IS_HIDL
|
||||
const auto self = android::hardware::IPCThreadState::selfOrNull();
|
||||
#else // AIDL is the default
|
||||
const auto self = android::IPCThreadState::selfOrNull();
|
||||
#endif
|
||||
return self ? self->getCallingUid() : UNKNOWN_UID;
|
||||
}
|
||||
|
||||
@@ -105,32 +97,32 @@ void Log(const char* file, const char* function, int line, LogPriority level,
|
||||
android_LogPriority prio = ANDROID_LOG_VERBOSE;
|
||||
|
||||
switch (level) {
|
||||
case CDM_LOG_SILENT:
|
||||
return; // It is nonsensical to pass CDM_LOG_SILENT.
|
||||
case CDM_LOG_ERROR:
|
||||
case LOG_SILENT:
|
||||
return; // It is nonsensical to pass LOG_SILENT.
|
||||
case LOG_ERROR:
|
||||
prio = ANDROID_LOG_ERROR;
|
||||
break;
|
||||
case CDM_LOG_WARN:
|
||||
case LOG_WARN:
|
||||
prio = ANDROID_LOG_WARN;
|
||||
break;
|
||||
case CDM_LOG_INFO:
|
||||
case LOG_INFO:
|
||||
prio = ANDROID_LOG_INFO;
|
||||
break;
|
||||
case CDM_LOG_DEBUG:
|
||||
case LOG_DEBUG:
|
||||
prio = ANDROID_LOG_DEBUG;
|
||||
break;
|
||||
#if LOG_NDEBUG
|
||||
case CDM_LOG_VERBOSE:
|
||||
case LOG_VERBOSE:
|
||||
return;
|
||||
#else
|
||||
case CDM_LOG_VERBOSE:
|
||||
case LOG_VERBOSE:
|
||||
prio = ANDROID_LOG_VERBOSE;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
__android_log_write(prio, LOG_TAG, buf);
|
||||
if (level <= CDM_LOG_INFO) {
|
||||
if (level <= LOG_INFO) {
|
||||
uint32_t uid = tl_logging_uid_set_ ? tl_logging_uid_ : GetIpcCallingUid();
|
||||
g_logbuf.addLog({uid, GetCurrentTimeMs(), level, buf});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user