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 20 #include <android-base/logging.h> 21 #include <android-base/properties.h> 22 23 namespace android { 24 namespace vintf { 25 namespace details { 26 27 std::string PropertyFetcherNoOp::getProperty(const std::string&, 28 const std::string& defaultValue) const { 29 return defaultValue; 30 } 31 32 uint64_t PropertyFetcherNoOp::getUintProperty(const std::string&, uint64_t, 33 uint64_t defaultValue) const { 34 return defaultValue; 35 } 36 37 bool PropertyFetcherNoOp::getBoolProperty(const std::string&, bool defaultValue) const { 38 return defaultValue; 39 } 40 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 55 } // namespace details 56 } // namespace vintf 57 } // namespace android 58