Add feature flag to change the CDM version to 18.0.2

[ Merge of http://go/wvgerrit/191139 ]

Adding an initial flag that include identifiable differences when
the feature is enabled or disabled.

Bug: 311951236
Test: WVTS tests
Change-Id: I57a8e05d3b7c0cb6b43cbef022b436330985fe11
This commit is contained in:
Rahul Frias
2024-01-09 12:40:43 -08:00
parent 35d09f3f00
commit 10f6252e4d
10 changed files with 62 additions and 3 deletions

View File

@@ -153,6 +153,7 @@ cc_binary {
shared_libs: [
"libbinder_ndk",
"wv_media_drm_flags_c_lib",
],
init_rc: ["src/android.hardware.drm-service.widevine.rc"],
@@ -177,7 +178,10 @@ cc_binary {
"frameworks/native/libs/binder/include",
],
shared_libs: ["libbinder_ndk"],
shared_libs: [
"libbinder_ndk",
"wv_media_drm_flags_c_lib",
],
init_rc: ["src/android.hardware.drm-service-lazy.widevine.rc"],
vintf_fragments: ["manifest_android.hardware.drm-service-lazy.widevine.xml"],
@@ -223,6 +227,7 @@ cc_library_static {
"libbinder_ndk",
"libcrypto",
"liblog",
"wv_media_drm_flags_c_lib",
],
static_libs: [
@@ -296,6 +301,7 @@ cc_library {
"libcrypto",
"libdl",
"liblog",
"wv_media_drm_flags_c_lib",
],
header_libs: ["libstagefright_foundation_headers"],
@@ -328,6 +334,9 @@ cc_fuzz {
"service_fuzzer_defaults",
"fuzzer_disable_leaks",
],
shared_libs: [
"wv_media_drm_flags_c_lib",
],
static_libs: [
"libbase",
"libbinder_random_parcel",

View File

@@ -0,0 +1,28 @@
// Copyright (C) 2023 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
aconfig_declarations {
name: "wv_media_drm_flags",
package: "com.android.mediadrm.widevine.flags",
srcs: [
"wv_media_drm_flags.aconfig",
],
}
cc_aconfig_library {
name: "wv_media_drm_flags_c_lib",
aconfig_declarations: "wv_media_drm_flags",
vendor_available: true,
min_sdk_version: "34",
}

View File

@@ -0,0 +1,8 @@
package: "com.android.mediadrm.widevine.flags"
flag {
name: "update_cdm_version_to_18_0_2"
namespace: "media_drm"
description: "Update CDM version to 18.0.2"
bug: "311951236"
}

View File

@@ -11,7 +11,8 @@ 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.0";
static const std::string kWVAndroidCdmVersion_18_0_1 = "18.0.1";
static const std::string kWVAndroidCdmVersion_18_0_2 = "18.0.2";
} // namespace wvcdm

View File

@@ -12,11 +12,15 @@
#include <android-base/properties.h>
#include <android/sysprop/WidevineProperties.sysprop.h>
#include <com_android_mediadrm_widevine_flags.h>
#include "log.h"
#include "wv_android_constants.h"
#include "widevine_apex_info.h"
using namespace android::sysprop;
namespace mediadrm_flags = com::android::mediadrm::widevine::flags;
namespace {
const char kBasePathPrefix[] = "/data/vendor/mediadrm/IDM";
@@ -146,7 +150,11 @@ bool Properties::GetWVCdmVersion(std::string* version) {
}
#endif
*version = kWVAndroidCdmVersion + apex_version;
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;
}
return true;
}

View File

@@ -75,6 +75,7 @@ LOCAL_SHARED_LIBRARIES := \
libssl \
libstagefright_foundation \
libutils \
wv_media_drm_flags_c_lib \
LOCAL_CFLAGS += -DUNIT_TEST

View File

@@ -42,6 +42,7 @@ LOCAL_SHARED_LIBRARIES := \
libprotobuf-cpp-lite \
libutils \
libwvaidl \
wv_media_drm_flags_c_lib \
LOCAL_HEADER_LIBRARIES := \
libstagefright_headers \

View File

@@ -41,6 +41,7 @@ LOCAL_SHARED_LIBRARIES := \
libprotobuf-cpp-lite \
libutils \
libwvaidl \
wv_media_drm_flags_c_lib \
LOCAL_HEADER_LIBRARIES := \
libstagefright_headers \

View File

@@ -65,6 +65,7 @@ cc_test {
"libdl",
"liblog",
"libssl",
"wv_media_drm_flags_c_lib",
],
cflags: [
"-Wall",