Merge "Modified loadPlugIns to load from /vendor and /system; skip libraries that are already loaded. BUG: 5284436"
This commit is contained in:
@@ -98,21 +98,27 @@ void DrmManager::removeUniqueId(int uniqueId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t DrmManager::loadPlugIns() {
|
status_t DrmManager::loadPlugIns() {
|
||||||
|
|
||||||
|
String8 vendorPluginDirPath("/vendor/lib/drm");
|
||||||
|
loadPlugIns(vendorPluginDirPath);
|
||||||
|
|
||||||
String8 pluginDirPath("/system/lib/drm");
|
String8 pluginDirPath("/system/lib/drm");
|
||||||
return loadPlugIns(pluginDirPath);
|
loadPlugIns(pluginDirPath);
|
||||||
|
return DRM_NO_ERROR;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t DrmManager::loadPlugIns(const String8& plugInDirPath) {
|
status_t DrmManager::loadPlugIns(const String8& plugInDirPath) {
|
||||||
if (mSupportInfoToPlugInIdMap.isEmpty()) {
|
mPlugInManager.loadPlugIns(plugInDirPath);
|
||||||
mPlugInManager.loadPlugIns(plugInDirPath);
|
Vector<String8> plugInPathList = mPlugInManager.getPlugInIdList();
|
||||||
Vector<String8> plugInPathList = mPlugInManager.getPlugInIdList();
|
for (unsigned int i = 0; i < plugInPathList.size(); ++i) {
|
||||||
for (unsigned int i = 0; i < plugInPathList.size(); ++i) {
|
String8 plugInPath = plugInPathList[i];
|
||||||
String8 plugInPath = plugInPathList[i];
|
DrmSupportInfo* info = mPlugInManager.getPlugIn(plugInPath).getSupportInfo(0);
|
||||||
DrmSupportInfo* info = mPlugInManager.getPlugIn(plugInPath).getSupportInfo(0);
|
if (NULL != info) {
|
||||||
if (NULL != info) {
|
if (mSupportInfoToPlugInIdMap.indexOfKey(*info) < 0) {
|
||||||
mSupportInfoToPlugInIdMap.add(*info, plugInPath);
|
mSupportInfoToPlugInIdMap.add(*info, plugInPath);
|
||||||
delete info;
|
|
||||||
}
|
}
|
||||||
|
delete info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return DRM_NO_ERROR;
|
return DRM_NO_ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user