Skip to content

Commit c8e4154

Browse files
Tom CherryGerrit Code Review
Tom Cherry
authored and
Gerrit Code Review
committed
Merge "init: skip RejectsCriticalAndOneshotService for devices launched before R"
2 parents 69b513c + 0e40ba3 commit c8e4154

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)