Make virtual a/b mandatory for T launch devices
Bug: 211787235
Test: th
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I93b7aaf5c405733cee04a710bbc70fffbe037eb0
diff --git a/virtual_ab/requirement.cpp b/virtual_ab/requirement.cpp
index e97ee4a..e192225 100644
--- a/virtual_ab/requirement.cpp
+++ b/virtual_ab/requirement.cpp
@@ -19,6 +19,8 @@
static constexpr const char kEnabled[] = "ro.virtual_ab.enabled";
static constexpr const char kRetrofit[] = "ro.virtual_ab.retrofit";
+static constexpr const char kUserspaceSnapshots[] =
+ "ro.virtual_ab.userspace.snapshots.enabled";
using android::base::GetBoolProperty;
@@ -28,3 +30,12 @@
EXPECT_FALSE(GetBoolProperty(kRetrofit, false))
<< "Device must not retrofit Virtual A/B.";
}
+
+TEST(VirtualAbRequirementTest, EnabledOnLaunchT) {
+ int vsr_level = android::base::GetIntProperty("ro.vendor.api_level", -1);
+
+ if (vsr_level >= __ANDROID_API_T__) {
+ EXPECT_TRUE(GetBoolProperty(kUserspaceSnapshots, false))
+ << "Device must use Virtual A/B with Userspace snapshots";
+ }
+}