diff options
author | David Anderson <dvander@google.com> | 2019-01-08 18:22:07 -0800 |
---|---|---|
committer | David Anderson <dvander@google.com> | 2019-01-11 12:41:17 -0800 |
commit | c053b3bfd0e1aed6c24e5f154427d7bebf324557 (patch) | |
tree | 4199205d1c5279052b6d32eb04d51c4ce67311d7 /daemon.cpp | |
parent | 9e20bdff0377e8f16d0170d0e099ea412e0f282b (diff) | |
download | gsid-c053b3bfd0e1aed6c24e5f154427d7bebf324557.tar.gz |
Introduce a daemon (gsid) for managing GSI installs.
Bug: 122556707
Test: manual test
Change-Id: I96d833f77740e6b791992336e590dd1a089895c9
Diffstat (limited to 'daemon.cpp')
-rw-r--r-- | daemon.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/daemon.cpp b/daemon.cpp new file mode 100644 index 0000000..5f8576e --- /dev/null +++ b/daemon.cpp @@ -0,0 +1,38 @@ +// +// Copyright (C) 2019 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include "gsi_service.h" + +#include <android-base/logging.h> +#include <binder/IPCThreadState.h> +#include <binder/ProcessState.h> + +using android::ProcessState; +using android::sp; + +int main(int /* argc */, char** argv) { + android::base::InitLogging(argv, android::base::LogdLogger(android::base::SYSTEM)); + + android::gsi::GsiService::Register(); + { + sp<ProcessState> ps(ProcessState::self()); + ps->startThreadPool(); + ps->giveThreadPoolName(); + } + android::IPCThreadState::self()->joinThreadPool(); + + exit(0); +} |