Embed build number in non-apex build

Bug: 316978205
Test: m android.hardware.drm-service.widevine
Change-Id: Ibf77a0135fa832424f38619bdd2df0ccc53f5849
This commit is contained in:
Robert Shih
2024-01-12 22:33:50 -08:00
parent 0a0fea75a8
commit 8b52f39a58
3 changed files with 59 additions and 5 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>
@@ -136,15 +137,17 @@ bool Properties::GetWVCdmVersion(std::string* version) {
return false;
}
std::string apex_version = "";
std::string build_number;
#ifdef __ANDROID_APEX__
{
{
auto info = widevine::apex::GetApexInfo();
apex_version = "@" + std::to_string(info->version);
}
build_number = std::to_string(info->version);
}
#else
build_number = WV_ANDROID_BUILD_ID;
#endif
*version = kWVAndroidCdmVersion + apex_version;
*version = kWVAndroidCdmVersion + "@" + build_number;
return true;
}