From ca39586f8dfdcdfd7b24aa55097b6235d0c59310 Mon Sep 17 00:00:00 2001 From: Rahul Frias Date: Mon, 16 Mar 2020 14:55:37 -0700 Subject: [PATCH] Move the CDM version string to a header file [ Merge of http://go/wvgerrit/95943 ] The CDM version for android is now defined in a platform specific header file. A check for version number match has been removed from integration tests as it will always be true. We will still get a notification to change the CDM version when the Android OS version gets updated. Bug: 151663718 Test: WV unit/integration tests Change-Id: I96bac87186e30a709585514be7f338ad2209cdf6 --- libwvdrmengine/cdm/include/wv_android_constants.h | 12 ++++++++++++ libwvdrmengine/cdm/src/properties_android.cpp | 5 ++--- libwvdrmengine/cdm/test/request_license_test.cpp | 8 +------- 3 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 libwvdrmengine/cdm/include/wv_android_constants.h diff --git a/libwvdrmengine/cdm/include/wv_android_constants.h b/libwvdrmengine/cdm/include/wv_android_constants.h new file mode 100644 index 00000000..2a56977b --- /dev/null +++ b/libwvdrmengine/cdm/include/wv_android_constants.h @@ -0,0 +1,12 @@ +#ifndef WVCDM_WV_ANDROID_CONSTANTS_H_ +#define WVCDM_WV_ANDROID_CONSTANTS_H_ + +#include + +namespace wvcdm { + +static const std::string kWVAndroidCdmVersion = "16.0.0"; + +} // namespace wvcdm + +#endif // WVCDM_WV_ANDROID_CONSTANTS_H_ diff --git a/libwvdrmengine/cdm/src/properties_android.cpp b/libwvdrmengine/cdm/src/properties_android.cpp index 9ec43be4..82a7c7b9 100644 --- a/libwvdrmengine/cdm/src/properties_android.cpp +++ b/libwvdrmengine/cdm/src/properties_android.cpp @@ -12,6 +12,7 @@ #include #include "log.h" +#include "wv_android_constants.h" namespace { @@ -21,8 +22,6 @@ const char kL2Dir[] = "/L2/"; const char kL3Dir[] = "/L3/"; const char kFactoryKeyboxPath[] = "/factory/wv.keys"; -const char kWVCdmVersion[] = "16.0.0"; - bool GetAndroidProperty(const char* key, std::string* value) { if (!key) { LOGW("GetAndroidProperty: Invalid property key parameter"); @@ -109,7 +108,7 @@ bool Properties::GetWVCdmVersion(std::string* version) { LOGW("Properties::GetWVCdmVersion: Invalid parameter"); return false; } - *version = kWVCdmVersion; + *version = kWVAndroidCdmVersion; return true; } diff --git a/libwvdrmengine/cdm/test/request_license_test.cpp b/libwvdrmengine/cdm/test/request_license_test.cpp index 8d78c804..66c38afa 100644 --- a/libwvdrmengine/cdm/test/request_license_test.cpp +++ b/libwvdrmengine/cdm/test/request_license_test.cpp @@ -5646,13 +5646,7 @@ TEST(VersionNumberTest, VersionNumberChangeCanary) { EXPECT_STREQ("R", release_number.c_str()) << "The Android version number has changed. You need to update this test " "and also possibly update the Widevine version number in " - "properties_android.cpp."; - - std::string widevine_version; - ASSERT_TRUE(Properties::GetWVCdmVersion(&widevine_version)); - EXPECT_EQ("16.0.0", widevine_version) - << "The Widevine CDM version number has changed. Did you forget to " - "update this test after changing it?"; + "wv_android_constants.h"; } TEST_F(WvCdmRequestLicenseTest, AddHlsStreamingKeyTest) {