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
diff --git a/core/product_config.mk b/core/product_config.mk
index 500735e..4525423 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -606,6 +606,15 @@
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 af0f7a9..418aaa4 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