Yifan Hong | d14640a | 2018-02-27 18:35:39 -0800 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright (C) 2017 The Android Open Source Project |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | #include "utils.h" |
| 19 | |
Yifan Hong | 9f78c18 | 2018-07-12 14:45:52 -0700 | [diff] [blame] | 20 | #include <android-base/logging.h> |
| 21 | #include <android-base/properties.h> |
| 22 | |
Yifan Hong | d14640a | 2018-02-27 18:35:39 -0800 | [diff] [blame] | 23 | namespace android { |
| 24 | namespace vintf { |
| 25 | namespace details { |
| 26 | |
Yifan Hong | 9f78c18 | 2018-07-12 14:45:52 -0700 | [diff] [blame] | 27 | std::string PropertyFetcherNoOp::getProperty(const std::string&, |
| 28 | const std::string& defaultValue) const { |
Yifan Hong | d14640a | 2018-02-27 18:35:39 -0800 | [diff] [blame] | 29 | return defaultValue; |
| 30 | } |
| 31 | |
Yifan Hong | 9f78c18 | 2018-07-12 14:45:52 -0700 | [diff] [blame] | 32 | uint64_t PropertyFetcherNoOp::getUintProperty(const std::string&, uint64_t, |
| 33 | uint64_t defaultValue) const { |
Yifan Hong | d14640a | 2018-02-27 18:35:39 -0800 | [diff] [blame] | 34 | return defaultValue; |
| 35 | } |
| 36 | |
Yifan Hong | 9f78c18 | 2018-07-12 14:45:52 -0700 | [diff] [blame] | 37 | bool PropertyFetcherNoOp::getBoolProperty(const std::string&, bool defaultValue) const { |
Yifan Hong | d14640a | 2018-02-27 18:35:39 -0800 | [diff] [blame] | 38 | return defaultValue; |
| 39 | } |
| 40 | |
Yifan Hong | 9f78c18 | 2018-07-12 14:45:52 -0700 | [diff] [blame] | 41 | std::string PropertyFetcherImpl::getProperty(const std::string& key, |
| 42 | const std::string& defaultValue) const { |
| 43 | return android::base::GetProperty(key, defaultValue); |
| 44 | } |
| 45 | |
| 46 | uint64_t PropertyFetcherImpl::getUintProperty(const std::string& key, uint64_t defaultValue, |
| 47 | uint64_t max) const { |
| 48 | return android::base::GetUintProperty(key, defaultValue, max); |
| 49 | } |
| 50 | |
| 51 | bool PropertyFetcherImpl::getBoolProperty(const std::string& key, bool defaultValue) const { |
| 52 | return android::base::GetBoolProperty(key, defaultValue); |
| 53 | } |
| 54 | |
Yifan Hong | d14640a | 2018-02-27 18:35:39 -0800 | [diff] [blame] | 55 | } // namespace details |
| 56 | } // namespace vintf |
| 57 | } // namespace android |