Allow OEMs to update old 32/64 devices' vendor partitions.
Without this change, a 32/64 device would suddenly hit the "you need to be 32-only or 64-only" restriction if the vendor partition was updated past API 34. Obviously the intention here is to prevent _new_ 32/64 devices, not prevent OEMs from keeping old devices updated for longer.
Add an early out for this case.
Bug: https://issuetracker.google.com/321167077
Bug: https://issuetracker.google.com/383472631
Change-Id: Ieca1d6436814f786d555ff1fa2d38881be433511
Merged-In: Ieca1d6436814f786d555ff1fa2d38881be433511
(cherry picked from commit c5be2ab06b2db1ba55c97110ff6048fe8ddcb4c4)
diff --git a/abi/src/com/android/tests/abi/KernelAbilistTest.java b/abi/src/com/android/tests/abi/KernelAbilistTest.java
index 315b12a..418bab8 100644
--- a/abi/src/com/android/tests/abi/KernelAbilistTest.java
+++ b/abi/src/com/android/tests/abi/KernelAbilistTest.java
@@ -46,6 +46,19 @@
return;
}
+ // Allow OEMs to keep shipping 32/64 mixed systems if they update their
+ // vendor partition to a newer API level, as long as the device was
+ // first launched before this VSR requirement was added in API 34.
+ // (In that case they wouldn't get the `api_level < 34` early return
+ // that comes next because they updated their vendor partition.)
+ String ro_board_first_api_level = getProp("ro.board.first_api_level");
+ if (!ro_board_first_api_level.isEmpty()) {
+ int originalVsr = Integer.parseInt(ro_board_first_api_level);
+ int deviceFirstLaunched = Integer.parseInt(getProp("ro.product.first_api_level"));
+ boolean isUsingOldBsp = deviceFirstLaunched != originalVsr;
+ if (originalVsr < 34 && isUsingOldBsp) return;
+ }
+
// ro.vendor.api_level is the VSR requirement API level
// calculated from ro.product.first_api_level, ro.board.api_level,
// and ro.board.first_api_level.