1 /* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef HIVIEW_OAL_SYSTEM_PROPERTY_H 16 #define HIVIEW_OAL_SYSTEM_PROPERTY_H 17 #include <cstdint> 18 #include <string> 19 namespace OHOS { 20 namespace HiviewDFX { 21 constexpr char KEY_BUILD_CHARACTER[] = "ro.build.characteristics"; 22 constexpr char KEY_HIVIEW_VERSION_TYPE[] = "const.logsystem.versiontype"; 23 namespace Parameter { 24 enum DeviceType { 25 UNKNOWN = 0, 26 PHONE, 27 WATCH, 28 TV, 29 IVI, 30 }; 31 32 std::string GetString(const std::string& key, const std::string& defaultValue); 33 int64_t GetInteger(const std::string& key, const int64_t defaultValue); 34 uint64_t GetUnsignedInteger(const std::string& key, const uint64_t defaultValue); 35 bool GetBoolean(const std::string& key, const bool defaultValue); 36 bool SetProperty(const std::string& key, const std::string& defaultValue); 37 int WaitParamSync(const char *key, const char *value, int timeout); 38 bool IsBetaVersion(); 39 DeviceType GetDeviceType(); 40 }; 41 } // namespace HiviewDFX 42 } // namespace OHOS 43 #endif // HIVIEW_OAL_SYSTEM_PROPERTY_H 44