diff --git a/cas/1.0/default/FactoryLoader.h b/cas/1.0/default/FactoryLoader.h index b69a1b04b3..3d49d9e911 100644 --- a/cas/1.0/default/FactoryLoader.h +++ b/cas/1.0/default/FactoryLoader.h @@ -17,6 +17,7 @@ #ifndef ANDROID_HARDWARE_CAS_V1_0_FACTORY_LOADER_H_ #define ANDROID_HARDWARE_CAS_V1_0_FACTORY_LOADER_H_ +#include #include #include #include "SharedLibrary.h" @@ -108,7 +109,7 @@ bool FactoryLoader::findFactoryForScheme( struct dirent* pEntry; while ((pEntry = readdir(pDir))) { String8 pluginPath = dirPath + "/" + pEntry->d_name; - if (pluginPath.getPathExtension() == ".so") { + if (base::EndsWith(pluginPath.c_str(), ".so")) { if (loadFactoryForSchemeFromPath( pluginPath, CA_system_id, library, factory)) { mCASystemIdToLibraryPathMap.add(CA_system_id, pluginPath); @@ -150,7 +151,7 @@ bool FactoryLoader::enumeratePlugins( struct dirent* pEntry; while ((pEntry = readdir(pDir))) { String8 pluginPath = dirPath + "/" + pEntry->d_name; - if (pluginPath.getPathExtension() == ".so") { + if (base::EndsWith(pluginPath.c_str(), ".so")) { queryPluginsFromPath(pluginPath, results); } } diff --git a/cas/1.1/default/FactoryLoader.h b/cas/1.1/default/FactoryLoader.h index 07dc77263e..a575df6aaa 100644 --- a/cas/1.1/default/FactoryLoader.h +++ b/cas/1.1/default/FactoryLoader.h @@ -17,6 +17,7 @@ #ifndef ANDROID_HARDWARE_CAS_V1_1_FACTORY_LOADER_H_ #define ANDROID_HARDWARE_CAS_V1_1_FACTORY_LOADER_H_ +#include #include #include #include @@ -100,7 +101,7 @@ bool FactoryLoader::findFactoryForScheme(int32_t CA_system_id, spd_name; - if (pluginPath.getPathExtension() == ".so") { + if (base::EndsWith(pluginPath.c_str(), ".so")) { if (loadFactoryForSchemeFromPath(pluginPath, CA_system_id, library, factory)) { mCASystemIdToLibraryPathMap.add(CA_system_id, pluginPath); closedir(pDir); @@ -139,7 +140,7 @@ bool FactoryLoader::enumeratePlugins(vector* results struct dirent* pEntry; while ((pEntry = readdir(pDir))) { String8 pluginPath = dirPath + "/" + pEntry->d_name; - if (pluginPath.getPathExtension() == ".so") { + if (base::EndsWith(pluginPath.c_str(), ".so")) { queryPluginsFromPath(pluginPath, results); } } diff --git a/cas/1.2/default/FactoryLoader.h b/cas/1.2/default/FactoryLoader.h index d04e64c1a0..0b05bfcae1 100644 --- a/cas/1.2/default/FactoryLoader.h +++ b/cas/1.2/default/FactoryLoader.h @@ -17,6 +17,7 @@ #ifndef ANDROID_HARDWARE_CAS_V1_1_FACTORY_LOADER_H_ #define ANDROID_HARDWARE_CAS_V1_1_FACTORY_LOADER_H_ +#include #include #include #include @@ -100,7 +101,7 @@ bool FactoryLoader::findFactoryForScheme(int32_t CA_system_id, spd_name; - if (pluginPath.getPathExtension() == ".so") { + if (base::EndsWith(pluginPath.c_str(), ".so")) { if (loadFactoryForSchemeFromPath(pluginPath, CA_system_id, library, factory)) { mCASystemIdToLibraryPathMap.add(CA_system_id, pluginPath); closedir(pDir); @@ -139,7 +140,7 @@ bool FactoryLoader::enumeratePlugins(vector* results struct dirent* pEntry; while ((pEntry = readdir(pDir))) { String8 pluginPath = dirPath + "/" + pEntry->d_name; - if (pluginPath.getPathExtension() == ".so") { + if (base::EndsWith(pluginPath.c_str(), ".so")) { queryPluginsFromPath(pluginPath, results); } }