Add widevine vendor apex

Bug: 243699259
Change-Id: Ifa5c1b621a9fc0b6d370124fad7de1334c537c65
This commit is contained in:
Kyle Zhang
2022-08-30 23:32:11 +00:00
parent 3ec4679ff2
commit b9c4bfdaf7
15 changed files with 221 additions and 9 deletions

View File

@@ -77,5 +77,4 @@ cc_library_static {
],
proprietary: true,
}

View File

@@ -42,6 +42,7 @@ using namespace wvoec3;
using video_widevine::ProvisioningResponse;
using wvcdm::kLevel3;
using wvcdm::kLevelDefault;
using namespace std;
namespace {
@@ -931,7 +932,19 @@ class Adapter {
return result;
}
if (level1_library_ == nullptr) {
level1_library_ = dlopen(library_name.c_str(), RTLD_NOW);
vector<string> library_paths = {"/vendor/", "/system/", "/odm/"};
string sub_dir;
#if __LP64__
sub_dir = "lib64/";
#else
sub_dir = "lib/";
#endif
for (auto& path : library_paths) {
level1_library_ = dlopen((path + sub_dir + library_name).c_str(), RTLD_NOW);
if (level1_library_) break;
}
if (level1_library_ == nullptr) {
LOGW("Could not load %s. Falling back to L3. %s", library_name.c_str(),
dlerror());