Loading drm/libmediadrm/DrmUtils.cpp +10 −5 Original line number Diff line number Diff line Loading @@ -363,18 +363,23 @@ char logPriorityToChar(::V1_4::LogPriority priority) { } } // namespace std::string GetExceptionMessage(status_t err, const char* msg, std::string GetExceptionMessage(const DrmStatus &err, const char* defaultMsg, const Vector<::V1_4::LogMessage>& logs) { std::string ruler("=============================="); std::string header("Beginning of DRM Plugin Log"); std::string footer("End of DRM Plugin Log"); std::string msg(err.getErrorMessage()); String8 msg8; if (msg) { msg8 += msg; if (!msg.empty()) { msg8 += msg.c_str(); msg8 += ": "; } else if (defaultMsg) { msg8 += defaultMsg; msg8 += ": "; } auto errStr = StrCryptoError(err); msg8 += errStr.c_str(); msg8 += StrCryptoError(err).c_str(); msg8 += String8::format("\ncdm err: %d, oem err: %d, ctx: %d", err.getCdmErr(), err.getOemErr(), err.getContext()); msg8 += String8::format("\n%s %s %s", ruler.c_str(), header.c_str(), ruler.c_str()); for (auto log : logs) { Loading drm/libmediadrm/interface/mediadrm/DrmUtils.h +3 −3 Original line number Diff line number Diff line Loading @@ -283,14 +283,14 @@ status_t GetLogMessages(const sp<U> &obj, Vector<::V1_4::LogMessage> &logs) { return OK; } std::string GetExceptionMessage(status_t err, const char *msg, std::string GetExceptionMessage(const DrmStatus & err, const char *defaultMsg, const Vector<::V1_4::LogMessage> &logs); template<typename T> std::string GetExceptionMessage(status_t err, const char *msg, const sp<T> &iface) { std::string GetExceptionMessage(const DrmStatus &err, const char *defaultMsg, const sp<T> &iface) { Vector<::V1_4::LogMessage> logs; iface->getLogMessages(logs); return GetExceptionMessage(err, msg, logs); return GetExceptionMessage(err, defaultMsg, logs); } } // namespace DrmUtils Loading Loading
drm/libmediadrm/DrmUtils.cpp +10 −5 Original line number Diff line number Diff line Loading @@ -363,18 +363,23 @@ char logPriorityToChar(::V1_4::LogPriority priority) { } } // namespace std::string GetExceptionMessage(status_t err, const char* msg, std::string GetExceptionMessage(const DrmStatus &err, const char* defaultMsg, const Vector<::V1_4::LogMessage>& logs) { std::string ruler("=============================="); std::string header("Beginning of DRM Plugin Log"); std::string footer("End of DRM Plugin Log"); std::string msg(err.getErrorMessage()); String8 msg8; if (msg) { msg8 += msg; if (!msg.empty()) { msg8 += msg.c_str(); msg8 += ": "; } else if (defaultMsg) { msg8 += defaultMsg; msg8 += ": "; } auto errStr = StrCryptoError(err); msg8 += errStr.c_str(); msg8 += StrCryptoError(err).c_str(); msg8 += String8::format("\ncdm err: %d, oem err: %d, ctx: %d", err.getCdmErr(), err.getOemErr(), err.getContext()); msg8 += String8::format("\n%s %s %s", ruler.c_str(), header.c_str(), ruler.c_str()); for (auto log : logs) { Loading
drm/libmediadrm/interface/mediadrm/DrmUtils.h +3 −3 Original line number Diff line number Diff line Loading @@ -283,14 +283,14 @@ status_t GetLogMessages(const sp<U> &obj, Vector<::V1_4::LogMessage> &logs) { return OK; } std::string GetExceptionMessage(status_t err, const char *msg, std::string GetExceptionMessage(const DrmStatus & err, const char *defaultMsg, const Vector<::V1_4::LogMessage> &logs); template<typename T> std::string GetExceptionMessage(status_t err, const char *msg, const sp<T> &iface) { std::string GetExceptionMessage(const DrmStatus &err, const char *defaultMsg, const sp<T> &iface) { Vector<::V1_4::LogMessage> logs; iface->getLogMessages(logs); return GetExceptionMessage(err, msg, logs); return GetExceptionMessage(err, defaultMsg, logs); } } // namespace DrmUtils Loading