Widevine version genrules (2nd attempt)

Bug: 327241925
Bug: 328438268
Test: dumpsys android.hardware.drm.IDrmFactory/widevine
Change-Id: I0336f366910de9c4ea8903b09d64c32b8d68c977
This commit is contained in:
Robert Shih
2024-03-06 10:41:55 -08:00
parent 543c875b55
commit 6f03887937
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;
}