blob: d40626200cbe02ad2c36269a0a6d416a6241bf2d [file] [log] [blame]
Yifan Hongd14640a2018-02-27 18:35:39 -08001
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 Hong9f78c182018-07-12 14:45:52 -070020#include <android-base/logging.h>
21#include <android-base/properties.h>
22
Yifan Hongd14640a2018-02-27 18:35:39 -080023namespace android {
24namespace vintf {
25namespace details {
26
Yifan Hong9f78c182018-07-12 14:45:52 -070027std::string PropertyFetcherNoOp::getProperty(const std::string&,
28 const std::string& defaultValue) const {
Yifan Hongd14640a2018-02-27 18:35:39 -080029 return defaultValue;
30}
31
Yifan Hong9f78c182018-07-12 14:45:52 -070032uint64_t PropertyFetcherNoOp::getUintProperty(const std::string&, uint64_t,
33 uint64_t defaultValue) const {
Yifan Hongd14640a2018-02-27 18:35:39 -080034 return defaultValue;
35}
36
Yifan Hong9f78c182018-07-12 14:45:52 -070037bool PropertyFetcherNoOp::getBoolProperty(const std::string&, bool defaultValue) const {
Yifan Hongd14640a2018-02-27 18:35:39 -080038 return defaultValue;
39}
40
Yifan Hong9f78c182018-07-12 14:45:52 -070041std::string PropertyFetcherImpl::getProperty(const std::string& key,
42 const std::string& defaultValue) const {
43 return android::base::GetProperty(key, defaultValue);
44}
45
46uint64_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
51bool PropertyFetcherImpl::getBoolProperty(const std::string& key, bool defaultValue) const {
52 return android::base::GetBoolProperty(key, defaultValue);
53}
54
Yifan Hongd14640a2018-02-27 18:35:39 -080055} // namespace details
56} // namespace vintf
57} // namespace android