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

Commit b6bfd93a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Move startThreadPool up in VHAL init."

parents d782e069 1edc327a
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -27,6 +27,13 @@ using ::android::hardware::automotive::vehicle::DefaultVehicleHal;
using ::android::hardware::automotive::vehicle::fake::FakeVehicleHardware;

int main(int /* argc */, char* /* argv */[]) {
    ALOGI("Starting thread pool...");
    if (!ABinderProcess_setThreadPoolMaxThreadCount(4)) {
        ALOGE("%s", "failed to set thread pool max thread count");
        return 1;
    }
    ABinderProcess_startThreadPool();

    std::unique_ptr<FakeVehicleHardware> hardware = std::make_unique<FakeVehicleHardware>();
    std::shared_ptr<DefaultVehicleHal> vhal =
            ::ndk::SharedRefBase::make<DefaultVehicleHal>(std::move(hardware));
@@ -39,12 +46,6 @@ int main(int /* argc */, char* /* argv */[]) {
        return 1;
    }

    if (!ABinderProcess_setThreadPoolMaxThreadCount(4)) {
        ALOGE("%s", "failed to set thread pool max thread count");
        return 1;
    }
    ABinderProcess_startThreadPool();

    ALOGI("Vehicle Service Ready");

    ABinderProcess_joinThreadPool();