Widevine version genrules

Bug: 327241925
Test: dumpsys android.hardware.drm.IDrmFactory/widevine
Change-Id: Ice412cd2739f0c8a95af488cf565a3abf484200a
This commit is contained in:
Robert Shih
2024-02-27 12:24:28 -08:00
parent 2edd6ec714
commit 9f32150e5f
8 changed files with 161 additions and 29 deletions

View File

@@ -11,8 +11,7 @@ namespace wvcdm {
// Note: If you change this, make sure you also change
// https://developers.google.com/widevine/drm/client/oemcrypto/compatibility
static const std::string kWVAndroidCdmVersion_18_0_1 = "18.0.1";
static const std::string kWVAndroidCdmVersion_18_0_2 = "18.0.2";
static const std::string kWVAndroidCdmVersion = "18.0.1";
} // namespace wvcdm

View File

@@ -4,6 +4,7 @@
#include "properties.h"
#include "properties_configuration.h"
#include "wv_android_build_id.h"
#include <unistd.h>
#include <sstream>
@@ -142,19 +143,11 @@ bool Properties::GetWVCdmVersion(std::string* version) {
return false;
}
std::string apex_version = "";
#ifdef __ANDROID_APEX__
{
auto info = widevine::apex::GetApexInfo();
apex_version = "@" + std::to_string(info->version);
}
#endif
*version = kWVAndroidCdmVersion;
if (mediadrm_flags::update_cdm_version_to_18_0_2()) {
*version = kWVAndroidCdmVersion_18_0_2 + apex_version;
} else {
*version = kWVAndroidCdmVersion_18_0_1 + apex_version;
(*version)[kWVAndroidCdmVersion.size() - 1] = '2';
}
*version = *version + "@" + WV_ANDROID_BUILD_ID;
return true;
}