Loading drm/drmserver/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,9 @@ drmserver_cc_binary { "libselinux", "libstagefright_foundation", ], whole_static_libs: [ "libc++fs", ], cflags: [ "-Wall", Loading Loading @@ -124,6 +127,7 @@ cc_fuzz { ], static_libs: [ "libc++fs", "libmediautils", "liblog", "libdrmframeworkcommon", Loading drm/drmserver/DrmManager.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #include "ReadWriteUtils.h" #include <algorithm> #include <filesystem> #define DECRYPT_FILE_ERROR (-1) Loading Loading @@ -114,7 +115,7 @@ void DrmManager::recordEngineMetrics( std::unique_ptr<DrmSupportInfo> info(engine.getSupportInfo(0)); uid_t callingUid = IPCThreadState::self()->getCallingUid(); std::string plugInId(plugInId8.getPathLeaf().getBasePath().c_str()); std::string plugInId = std::filesystem::path(plugInId8.c_str()).stem(); ALOGV("%d calling %s %s", callingUid, plugInId.c_str(), func); Mutex::Autolock _l(mMetricsLock); Loading Loading @@ -316,8 +317,8 @@ bool DrmManager::canHandle(int uniqueId, const String8& path, const String8& mim IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId); result = rDrmEngine.canHandle(uniqueId, path); } else { String8 extension = path.getPathExtension(); if (String8("") != extension) { const auto extension = std::filesystem::path(path.c_str()).extension(); if (!extension.empty()) { result = canHandle(uniqueId, path); } } Loading Loading @@ -745,7 +746,7 @@ String8 DrmManager::getSupportedPlugInId(const String8& mimeType) { String8 DrmManager::getSupportedPlugInIdFromPath(int uniqueId, const String8& path) { String8 plugInId(""); const String8 fileSuffix = path.getPathExtension(); const String8 fileSuffix(std::filesystem::path(path.c_str()).extension().c_str()); for (size_t index = 0; index < mSupportInfoToPlugInIdMap.size(); index++) { const DrmSupportInfo& drmSupportInfo = mSupportInfoToPlugInIdMap.keyAt(index); Loading drm/drmserver/PlugInManager.h +4 −3 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ #include <utils/Vector.h> #include <utils/KeyedVector.h> #include <filesystem> namespace android { const char* const PLUGIN_MANAGER_CREATE = "create"; Loading Loading @@ -227,10 +229,9 @@ private: * True if the input name denotes plug-in */ bool isPlugIn(const struct dirent* pEntry) const { String8 sName(pEntry->d_name); String8 extension(sName.getPathExtension()); const auto extension = std::filesystem::path(pEntry->d_name).extension(); // Note that the plug-in extension must exactly match case return extension == String8(PLUGIN_EXTENSION); return extension.string() == PLUGIN_EXTENSION; } /** Loading drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,10 @@ cc_library_shared { "libfwdlock-decoder", ], whole_static_libs: [ "libc++fs", ], local_include_dirs: ["include"], relative_install_path: "drm", Loading drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ #include "FwdLockGlue.h" #include "MimeTypeUtil.h" #include <filesystem> #undef LOG_TAG #define LOG_TAG "FwdLockEngine" Loading Loading @@ -227,7 +229,7 @@ DrmSupportInfo* FwdLockEngine::onGetSupportInfo(int /* uniqueId */) { bool FwdLockEngine::onCanHandle(int /* uniqueId */, const String8& path) { bool result = false; String8 extString = path.getPathExtension(); String8 extString(std::filesystem::path(path.c_str()).extension().c_str()); return IsFileSuffixSupported(extString); } Loading Loading
drm/drmserver/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,9 @@ drmserver_cc_binary { "libselinux", "libstagefright_foundation", ], whole_static_libs: [ "libc++fs", ], cflags: [ "-Wall", Loading Loading @@ -124,6 +127,7 @@ cc_fuzz { ], static_libs: [ "libc++fs", "libmediautils", "liblog", "libdrmframeworkcommon", Loading
drm/drmserver/DrmManager.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #include "ReadWriteUtils.h" #include <algorithm> #include <filesystem> #define DECRYPT_FILE_ERROR (-1) Loading Loading @@ -114,7 +115,7 @@ void DrmManager::recordEngineMetrics( std::unique_ptr<DrmSupportInfo> info(engine.getSupportInfo(0)); uid_t callingUid = IPCThreadState::self()->getCallingUid(); std::string plugInId(plugInId8.getPathLeaf().getBasePath().c_str()); std::string plugInId = std::filesystem::path(plugInId8.c_str()).stem(); ALOGV("%d calling %s %s", callingUid, plugInId.c_str(), func); Mutex::Autolock _l(mMetricsLock); Loading Loading @@ -316,8 +317,8 @@ bool DrmManager::canHandle(int uniqueId, const String8& path, const String8& mim IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId); result = rDrmEngine.canHandle(uniqueId, path); } else { String8 extension = path.getPathExtension(); if (String8("") != extension) { const auto extension = std::filesystem::path(path.c_str()).extension(); if (!extension.empty()) { result = canHandle(uniqueId, path); } } Loading Loading @@ -745,7 +746,7 @@ String8 DrmManager::getSupportedPlugInId(const String8& mimeType) { String8 DrmManager::getSupportedPlugInIdFromPath(int uniqueId, const String8& path) { String8 plugInId(""); const String8 fileSuffix = path.getPathExtension(); const String8 fileSuffix(std::filesystem::path(path.c_str()).extension().c_str()); for (size_t index = 0; index < mSupportInfoToPlugInIdMap.size(); index++) { const DrmSupportInfo& drmSupportInfo = mSupportInfoToPlugInIdMap.keyAt(index); Loading
drm/drmserver/PlugInManager.h +4 −3 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ #include <utils/Vector.h> #include <utils/KeyedVector.h> #include <filesystem> namespace android { const char* const PLUGIN_MANAGER_CREATE = "create"; Loading Loading @@ -227,10 +229,9 @@ private: * True if the input name denotes plug-in */ bool isPlugIn(const struct dirent* pEntry) const { String8 sName(pEntry->d_name); String8 extension(sName.getPathExtension()); const auto extension = std::filesystem::path(pEntry->d_name).extension(); // Note that the plug-in extension must exactly match case return extension == String8(PLUGIN_EXTENSION); return extension.string() == PLUGIN_EXTENSION; } /** Loading
drm/libdrmframework/plugins/forward-lock/FwdLockEngine/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,10 @@ cc_library_shared { "libfwdlock-decoder", ], whole_static_libs: [ "libc++fs", ], local_include_dirs: ["include"], relative_install_path: "drm", Loading
drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ #include "FwdLockGlue.h" #include "MimeTypeUtil.h" #include <filesystem> #undef LOG_TAG #define LOG_TAG "FwdLockEngine" Loading Loading @@ -227,7 +229,7 @@ DrmSupportInfo* FwdLockEngine::onGetSupportInfo(int /* uniqueId */) { bool FwdLockEngine::onCanHandle(int /* uniqueId */, const String8& path) { bool result = false; String8 extString = path.getPathExtension(); String8 extString(std::filesystem::path(path.c_str()).extension().c_str()); return IsFileSuffixSupported(extString); } Loading