| Sandeep Patil | 526f8cf | 2016-11-01 16:41:56 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2016 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 |  | 
| Yifan Hong | 3aa3b3c | 2020-01-31 13:02:07 -0800 | [diff] [blame] | 17 | #include <android-base/logging.h> | 
|  | 18 |  | 
| Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 19 | #include "charger.sysprop.h" | 
| Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 20 | #include "healthd_mode_charger.h" | 
|  | 21 | #include "healthd_mode_charger_nops.h" | 
| Sandeep Patil | 526f8cf | 2016-11-01 16:41:56 -0700 | [diff] [blame] | 22 |  | 
| Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 23 | #ifndef CHARGER_FORCE_NO_UI | 
|  | 24 | #define CHARGER_FORCE_NO_UI 0 | 
| Yifan Hong | b7cd45f | 2017-11-13 18:47:03 -0800 | [diff] [blame] | 25 | #endif | 
| Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 26 |  | 
|  | 27 | int main(int argc, char** argv) { | 
| Yifan Hong | 3aa3b3c | 2020-01-31 13:02:07 -0800 | [diff] [blame] | 28 | android::base::InitLogging(argv, &android::base::KernelLogger); | 
| Yifan Hong | 97eecdc | 2019-07-03 11:07:37 -0700 | [diff] [blame] | 29 | if (CHARGER_FORCE_NO_UI || android::sysprop::ChargerProperties::no_ui().value_or(false)) { | 
|  | 30 | return healthd_charger_nops(argc, argv); | 
|  | 31 | } else { | 
|  | 32 | return healthd_charger_main(argc, argv); | 
|  | 33 | } | 
| Tao Bao | 5747e22 | 2018-09-11 10:46:35 -0700 | [diff] [blame] | 34 | } |