From 7102baaf65d652857823f63c58c19f7dbb158592 Mon Sep 17 00:00:00 2001 From: Daniel Zheng Date: Thu, 22 Feb 2024 13:25:28 -0800 Subject: [PATCH] Turn on V3 cow On all api levels shipping higher than 34 (pixel 8), we want to enable v3 cow version of the cow format We need to make this change in product_config.mk since PRODUCT variables have special interactions with inherit-product. PRODUCT_SHIPPING_API_LEVEL is defined in device.mk and is unavailable to the parent makefile (PRODUCT vars are cleared at the beginning of makefiles?). Having the fallback vabc_cow_version in this file allows us to avoid the hack below (we would have to modify each device.mk to add a temporary variable) alternate solution: We have to create a new variable SHIPPING_API_LEVEL that is a duplicate of PRODUCT_SHIPPING_API_LEVEL. This is a hack to workaround the inheritance flow (since vabc_features.mk -> android_t_baseline.mk -> device.mk).This hack allows this variable to be seen by the parent .mk file Bug: 313962438 Test: u->v upgrade path for pixel 8. v->u dowgrade path for pixel 8 Change-Id: I6e1480e461c20a2fb07c5339828df0e6f6c0f9ec --- core/product_config.mk | 9 +++++++++ target/product/virtual_ab_ota/android_t_baseline.mk | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/core/product_config.mk b/core/product_config.mk index 500735e71c..4525423b4f 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -606,6 +606,15 @@ ifneq ($$(filter-out true false,$$(PRODUCT_BUILD_$(1)_IMAGE)),) endif endef +ifndef PRODUCT_VIRTUAL_AB_COW_VERSION + PRODUCT_VIRTUAL_AB_COW_VERSION := 2 + ifdef PRODUCT_SHIPPING_API_LEVEL + ifeq (true,$(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),34)) + PRODUCT_VIRTUAL_AB_COW_VERSION := 3 + endif + endif +endif + # Copy and check the value of each PRODUCT_BUILD_*_IMAGE variable $(foreach image, \ PVMFW \ diff --git a/target/product/virtual_ab_ota/android_t_baseline.mk b/target/product/virtual_ab_ota/android_t_baseline.mk index af0f7a9371..418aaa4c2d 100644 --- a/target/product/virtual_ab_ota/android_t_baseline.mk +++ b/target/product/virtual_ab_ota/android_t_baseline.mk @@ -20,5 +20,3 @@ # # All U+ launching devices should instead use vabc_features.mk. $(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/vabc_features.mk) - -PRODUCT_VIRTUAL_AB_COW_VERSION ?= 2