101195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser/*
201195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser * Copyright 2013, The Android Open Source Project
301195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser *
401195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser * Licensed under the Apache License, Version 2.0 (the "License");
501195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser * you may not use this file except in compliance with the License.
601195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser * You may obtain a copy of the License at
701195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser *
801195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser *     http://www.apache.org/licenses/LICENSE-2.0
901195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser *
1001195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser * Unless required by applicable law or agreed to in writing, software
1101195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser * distributed under the License is distributed on an "AS IS" BASIS,
1201195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1301195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser * See the License for the specific language governing permissions and
1401195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser * limitations under the License.
1501195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser */
1601195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser
1701195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#ifndef BCC_SUPPORT_PROPERTIES_H
1801195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#define BCC_SUPPORT_PROPERTIES_H
1901195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser
2001195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#include <stdint.h>
2101195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#include <stdlib.h>
2201195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser
2301195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#if !defined(RS_SERVER) && defined(HAVE_ANDROID_OS)
2401195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#include <cutils/properties.h>
2501195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#endif
2601195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser
2701195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosserstatic inline uint32_t getProperty(const char *str) {
2801195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#if !defined(RS_SERVER) && defined(HAVE_ANDROID_OS)
2901195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser    char buf[PROPERTY_VALUE_MAX];
3001195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser    property_get(str, buf, "0");
3101195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser    return atoi(buf);
3201195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#else
3301195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser    return 0;
3401195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#endif
3501195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser}
3601195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser
3701195ba2a34c6f2318376f7a79da6daa30d2703eTobias Grosser#endif // BCC_SUPPORT_PROPERTIES_H
38