Skip to content

Commit 013ccb7

Browse files
Edwin WongAndroid (Google) Code Review
authored andcommitted
Merge "Modified loadPlugIns to load from /vendor and /system; skip libraries that are already loaded. BUG: 5284436"
2 parents b35914b + aab6fe2 commit 013ccb7

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

drm/drmserver/DrmManager.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,27 @@ void DrmManager::removeUniqueId(int uniqueId) {
9898
}
9999

100100
status_t DrmManager::loadPlugIns() {
101+
102+
String8 vendorPluginDirPath("/vendor/lib/drm");
103+
loadPlugIns(vendorPluginDirPath);
104+
101105
String8 pluginDirPath("/system/lib/drm");
102-
return loadPlugIns(pluginDirPath);
106+
loadPlugIns(pluginDirPath);
107+
return DRM_NO_ERROR;
108+
103109
}
104110

105111
status_t DrmManager::loadPlugIns(const String8& plugInDirPath) {
106-
if (mSupportInfoToPlugInIdMap.isEmpty()) {
107-
mPlugInManager.loadPlugIns(plugInDirPath);
108-
Vector<String8> plugInPathList = mPlugInManager.getPlugInIdList();
109-
for (unsigned int i = 0; i < plugInPathList.size(); ++i) {
110-
String8 plugInPath = plugInPathList[i];
111-
DrmSupportInfo* info = mPlugInManager.getPlugIn(plugInPath).getSupportInfo(0);
112-
if (NULL != info) {
112+
mPlugInManager.loadPlugIns(plugInDirPath);
113+
Vector<String8> plugInPathList = mPlugInManager.getPlugInIdList();
114+
for (unsigned int i = 0; i < plugInPathList.size(); ++i) {
115+
String8 plugInPath = plugInPathList[i];
116+
DrmSupportInfo* info = mPlugInManager.getPlugIn(plugInPath).getSupportInfo(0);
117+
if (NULL != info) {
118+
if (mSupportInfoToPlugInIdMap.indexOfKey(*info) < 0) {
113119
mSupportInfoToPlugInIdMap.add(*info, plugInPath);
114-
delete info;
115120
}
121+
delete info;
116122
}
117123
}
118124
return DRM_NO_ERROR;

0 commit comments

Comments
 (0)