From 1caf26737b55ead61cd2b4f744f28d6c259b84e4 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Thu, 18 Apr 2024 17:07:45 +0000 Subject: [PATCH] Use prefer for source vs prebuilts selection of widevine widevine currenty uses `use_source_config_var` and product variables to ensure that products gets the correct selection of source or prebuilts of widevine apex. `use_source_config_var` is being deprecated from Soong to unfiy the mechanisms for source vs prebuilt selection. This CL transitions widevine to a different mechanism `prefer` for prebuilt selection to aid the deprecation. Test: lunch cf_x86_64_phone-trunk_staging-userdebug; m nothing; aninja -t path droid vendor/widevine/libwvdrmengine/apex/prebuilt/com.google.android.widevine.nonupdatable.apks; // no path exists, i.e. uses source Test: lunch osprey-trunk_staging-userdebug; m nothing; aninja -t path droid vendor/widevine/libwvdrmengine/apex/prebuilt/com.google.android.widevine.nonupdatable.apks; // path exists; i.e. uses prebuilts Bug: 332379718 Change-Id: I78800aee49f1de83ea2ce8160923362871806d87 --- libwvdrmengine/apex/prebuilt/Android.bp | 28 ++++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/libwvdrmengine/apex/prebuilt/Android.bp b/libwvdrmengine/apex/prebuilt/Android.bp index bb2aaef3..7aff21f3 100644 --- a/libwvdrmengine/apex/prebuilt/Android.bp +++ b/libwvdrmengine/apex/prebuilt/Android.bp @@ -25,27 +25,39 @@ package { default_applicable_licenses: ["vendor_widevine_license"], } -apex_set { +soong_config_module_type { + name: "widevine_apex_set", + module_type: "apex_set", + config_namespace: "widevine", + bool_variables: ["source_build"], + properties: ["prefer"], +} + +widevine_apex_set { name: "com.google.android.widevine.nonupdatable", apex_name: "com.google.android.widevine", owner: "google", set: "com.google.android.widevine.nonupdatable.apks", vendor: true, - use_source_config_var: { - config_namespace: "widevine", - var_name: "source_build", + prefer: true, + soong_config_variables: { + source_build: { + prefer: false, + }, }, } -apex_set { +widevine_apex_set { name: "com.google.android.widevine.lazy", apex_name: "com.google.android.widevine.lazy", owner: "google", set: "com.google.android.widevine.lazy.apks", vendor: true, - use_source_config_var: { - config_namespace: "widevine", - var_name: "source_build", + prefer: true, + soong_config_variables: { + source_build: { + prefer: false, + }, }, }