From 0e40ba3183b684fb6b3e62d542125a5a7440b98a Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Thu, 9 Jul 2020 08:47:24 -0700 Subject: [PATCH] init: skip RejectsCriticalAndOneshotService for devices launched before R This restriction is only added for devices launching with R or later. Bug: 160663765 Test: this test runs when appropriate Change-Id: I2353bfa7f598bd19ba57498cc5bbad7a3ed34707 --- init/init_test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init/init_test.cpp b/init/init_test.cpp index 07b472455..fa6574026 100644 --- a/init/init_test.cpp +++ b/init/init_test.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include "action.h" @@ -32,6 +33,8 @@ #include "service_parser.h" #include "util.h" +using android::base::GetIntProperty; + namespace android { namespace init { @@ -240,6 +243,10 @@ TEST(init, EventTriggerOrderMultipleFiles) { } TEST(init, RejectsCriticalAndOneshotService) { + if (GetIntProperty("ro.product.first_api_level", 10000) < 30) { + GTEST_SKIP() << "Test only valid for devices launching with R or later"; + } + std::string init_script = R"init( service A something