Return apex name for PROPERTY_VENDOR

[ Merge of go/wvgerrit/c/cdm/+/170370 ]

Bug: 277620071
Test: WidevineHalTest
Change-Id: I05385358875723e20b13d3abb21a0deee9f35c29
This commit is contained in:
Robert Shih
2023-04-12 14:40:17 -07:00
parent de779e7545
commit d258acb879
2 changed files with 16 additions and 1 deletions

View File

@@ -52,7 +52,10 @@ cc_library_static {
"libutils_headers",
],
static_libs: ["libcdm_protos"],
static_libs: [
"lib_apex_manifest_minimal_proto_lite",
"libcdm_protos",
],
shared_libs: [
"libbase",

View File

@@ -27,6 +27,7 @@
#include "media/stagefright/MediaErrors.h"
#include "openssl/sha.h"
#include "string_conversions.h"
#include "widevine_apex_info.h"
#include "wv_cdm_constants.h"
#include "wv_metrics.pb.h"
#include "wv_metrics_adapter.h"
@@ -1063,7 +1064,18 @@ Status WVDrmPlugin::unprovisionDevice() {
std::string value;
if (name == "vendor") {
#ifdef __ANDROID_APEX__
auto info = ::widevine::apex::GetApexInfo();
if (info.ok()) {
value = info->name;
} else {
auto err = info.error();
ALOGW("apex info error %d: %s", err.code().value(), err.message().c_str());
value = "Google";
}
#else
value = "Google";
#endif
} else if (name == "version") {
status = queryProperty(wvcdm::QUERY_KEY_WVCDM_VERSION, value);
} else if (name == "description") {