• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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_USER_TYPE[] = "ro.logsystem.usertype";
23 namespace Parameter {
24 enum UserType {
25     UNKNOWN_TYPE = -1,
26     COMMERCIAL = 1,
27     FANS,
28     BETA,
29     TEST,
30     OVERSEAS_BETA,
31     OVERSEAS_COMMERCIAL,
32 };
33 
34 enum DeviceType {
35     UNKNOWN = 0,
36     PHONE,
37     WATCH,
38     TV,
39     IVI,
40 };
41 
42 std::string GetString(const std::string& key, const std::string& defaultValue);
43 int64_t GetInteger(const std::string& key, const int64_t defaultValue);
44 uint64_t GetUnsignedInteger(const std::string& key, const uint64_t defaultValue);
45 bool GetBoolean(const std::string& key, const bool defaultValue);
46 bool SetProperty(const std::string& key, const std::string& defaultValue);
47 int WaitParamSync(const char *key, const char *value, int timeout);
48 bool IsBetaVersion();
49 DeviceType GetDeviceType();
50 };
51 } // namespace HiviewDFX
52 } // namespace OHOS
53 #endif // HIVIEW_OAL_SYSTEM_PROPERTY_H
54