Widevine version genrules

Bug: 327241925
Test: dumpsys android.hardware.drm.IDrmFactory/widevine
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:9f32150e5fae37bc200eaaca3794605a8bf17806)
Merged-In: Ice412cd2739f0c8a95af488cf565a3abf484200a
Change-Id: Ice412cd2739f0c8a95af488cf565a3abf484200a
This commit is contained in:
Robert Shih
2024-02-27 12:24:28 -08:00
committed by Android Build Coastguard Worker
parent 6c7988f8c9
commit cada7659cb
8 changed files with 161 additions and 29 deletions

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;
}