blob: 014ae34f692e02accbbc7cc1fcda62804fd40a32 [file] [log] [blame]
Yifan Hong830cdb12021-01-11 20:47:23 -08001/*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <android-base/logging.h>
18#include <android/binder_interface_utils.h>
19#include <health-impl/Health.h>
20#include <health/utils.h>
21
22using aidl::android::hardware::health::HalHealthLoop;
23using aidl::android::hardware::health::Health;
24
25static constexpr const char* gInstanceName = "default";
26
27int main() {
28 // TODO(b/203246116): handle charger
29 // make a default health service
30 auto config = std::make_unique<healthd_config>();
31 ::android::hardware::health::InitHealthdConfig(config.get());
32 auto binder = ndk::SharedRefBase::make<Health>(gInstanceName, std::move(config));
33 auto hal_health_loop = std::make_shared<HalHealthLoop>(binder, binder);
34 return hal_health_loop->StartLoop();
35}