Skip to content

Commit 0e40ba3

Browse files
author
Tom Cherry
committed
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
1 parent c3f1784 commit 0e40ba3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

init/init_test.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <functional>
1818

1919
#include <android-base/file.h>
20+
#include <android-base/properties.h>
2021
#include <gtest/gtest.h>
2122

2223
#include "action.h"
@@ -32,6 +33,8 @@
3233
#include "service_parser.h"
3334
#include "util.h"
3435

36+
using android::base::GetIntProperty;
37+
3538
namespace android {
3639
namespace init {
3740

@@ -240,6 +243,10 @@ TEST(init, EventTriggerOrderMultipleFiles) {
240243
}
241244

242245
TEST(init, RejectsCriticalAndOneshotService) {
246+
if (GetIntProperty("ro.product.first_api_level", 10000) < 30) {
247+
GTEST_SKIP() << "Test only valid for devices launching with R or later";
248+
}
249+
243250
std::string init_script =
244251
R"init(
245252
service A something

0 commit comments

Comments
 (0)