Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5521b0d authored by Devin Moore's avatar Devin Moore Committed by Steven Moreland
Browse files

init_kill_services_test: don't always try to kill hwservicemanager

When HIDL is not supported, hwservicemanager will not be running and may
not even be installed on the device.

Ignore-AOSP-First: Disabling HIDL internally first. Will cherry-pick
these test CLs after.

Test: init_kill_services_test
Bug: 218588089
Change-Id: Iae41e35e4669dd62c99ab9f138fc419be2f5fa29
parent bc3476d5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -10,7 +10,10 @@ package {
cc_test {
    name: "init_kill_services_test",
    srcs: ["init_kill_services_test.cpp"],
    shared_libs: ["libbase"],
    shared_libs: [
        "libbase",
        "libhidlbase",
    ],
    test_suites: ["general-tests"],

    // TODO(b/153565474): switch back to auto-generation
+5 −0
Original line number Diff line number Diff line
@@ -18,15 +18,20 @@

#include <android-base/logging.h>
#include <android-base/properties.h>
#include <hidl/ServiceManagement.h>

#include <iostream>

using ::android::base::GetProperty;
using ::android::base::SetProperty;
using ::android::base::WaitForProperty;
using ::android::hardware::isHidlSupported;
using std::literals::chrono_literals::operator""s;

void ExpectKillingServiceRecovers(const std::string& service_name) {
    if (!isHidlSupported() && service_name == "hwservicemanager") {
        GTEST_SKIP() << "No HIDL support on device so hwservicemanager will not be running";
    }
    LOG(INFO) << "before we say hi to " << service_name << ", I can't have apexd around!";

    // b/280514080 - servicemanager will restart apexd, and apexd will restart the