• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 
16 /**
17  * @addtogroup DeviceInfo
18  * @{
19  *
20  * @brief Provides APIs for querying terminal device information.
21  *
22  * @since 10
23  */
24 
25 /**
26  * @file deviceinfo.h
27  * @kit BasicServicesKit
28  * @brief Declares APIs for querying terminal device information.
29  * @library libdeviceinfo_ndk.z.so
30  * @syscap SystemCapability.Startup.SystemInfo
31  * @since 10
32  */
33 
34 #ifndef DEVICEINFO_CSDK_H
35 #define DEVICEINFO_CSDK_H
36 
37 #ifdef __cplusplus
38 #if __cplusplus
39 extern "C" {
40 #endif
41 #endif
42 
43 /**
44  * Obtains the device type represented by a string,
45  * which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable},
46  * {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}.
47  * @syscap SystemCapability.Startup.SystemInfo
48  * @since 10
49  */
50 const char *OH_GetDeviceType(void);
51 
52 /**
53  * Obtains the device manufacturer represented by a string.
54  * @syscap SystemCapability.Startup.SystemInfo
55  * @since 10
56  */
57 const char *OH_GetManufacture(void);
58 
59 /**
60  * Obtains the device brand represented by a string.
61  * @syscap SystemCapability.Startup.SystemInfo
62  * @since 10
63  */
64 const char *OH_GetBrand(void);
65 
66 /**
67  * Obtains the product name speaded in the market
68  * @syscap SystemCapability.Startup.SystemInfo
69  * @since 10
70  */
71 const char *OH_GetMarketName(void);
72 
73 /**
74  * Obtains the product series represented by a string.
75  * @syscap SystemCapability.Startup.SystemInfo
76  * @since 10
77  */
78 const char *OH_GetProductSeries(void);
79 
80 /**
81  * Obtains the product model represented by a string.
82  * @syscap SystemCapability.Startup.SystemInfo
83  * @since 10
84  */
85 const char *OH_GetProductModel(void);
86 
87 /**
88  * Obtains the software model represented by a string.
89  * @syscap SystemCapability.Startup.SystemInfo
90  * @since 10
91  */
92 const char *OH_GetSoftwareModel(void);
93 
94 /**
95  * Obtains the hardware model represented by a string.
96  * @syscap SystemCapability.Startup.SystemInfo
97  * @since 10
98  */
99 const char *OH_GetHardwareModel(void);
100 
101 /**
102  * Obtains the bootloader version number represented by a string.
103  * @syscap SystemCapability.Startup.SystemInfo
104  * @since 10
105  */
106 const char *OH_GetBootloaderVersion(void);
107 
108 /**
109  * Obtains the application binary interface (Abi) list represented by a string.
110  * @syscap SystemCapability.Startup.SystemInfo
111  * @since 10
112  */
113 const char *OH_GetAbiList(void);
114 
115 /**
116  * Obtains the security patch tag represented by a string.
117  * @syscap SystemCapability.Startup.SystemInfo
118  * @since 10
119  */
120 const char *OH_GetSecurityPatchTag(void);
121 
122 /**
123  * Obtains the product version displayed for customer represented by a string.
124  * @syscap SystemCapability.Startup.SystemInfo
125  * @since 10
126  */
127 const char *OH_GetDisplayVersion(void);
128 
129 /**
130  * Obtains the incremental version represented by a string.
131  * @syscap SystemCapability.Startup.SystemInfo
132  * @since 10
133  */
134 const char *OH_GetIncrementalVersion(void);
135 
136 /**
137  * Obtains the OS release type represented by a string.
138  *
139  * <p>The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}.
140  * The specific release type may be {@code Release}, {@code Beta1}, or others alike.
141  * @syscap SystemCapability.Startup.SystemInfo
142  * @since 10
143  */
144 const char *OH_GetOsReleaseType(void);
145 
146 /**
147  * Obtains the OS full version name represented by a string.
148  * @syscap SystemCapability.Startup.SystemInfo
149  * @since 10
150  */
151 const char *OH_GetOSFullName(void);
152 
153 /**
154  * Obtains the SDK API version number.
155  * @syscap SystemCapability.Startup.SystemInfo
156  * @since 10
157  */
158 int OH_GetSdkApiVersion(void);
159 
160 /**
161  * Obtains the first API version number.
162  * @syscap SystemCapability.Startup.SystemInfo
163  * @since 10
164  */
165 int OH_GetFirstApiVersion(void);
166 
167 /**
168  * Obtains the version ID by a string.
169  * @syscap SystemCapability.Startup.SystemInfo
170  * @since 10
171  */
172 const char *OH_GetVersionId(void);
173 
174 /**
175  * Obtains the build type of the current running OS.
176  * @syscap SystemCapability.Startup.SystemInfo
177  * @since 10
178  */
179 const char *OH_GetBuildType(void);
180 
181 /**
182  * Obtains the build user of the current running OS.
183  * @syscap SystemCapability.Startup.SystemInfo
184  * @since 10
185  */
186 const char *OH_GetBuildUser(void);
187 
188 /**
189  * Obtains the build host of the current running OS.
190  * @syscap SystemCapability.Startup.SystemInfo
191  * @since 10
192  */
193 const char *OH_GetBuildHost(void);
194 
195 /**
196  * Obtains the build time of the current running OS.
197  * @syscap SystemCapability.Startup.SystemInfo
198  * @since 10
199  */
200 const char *OH_GetBuildTime(void);
201 
202 /**
203  * Obtains the version hash of the current running OS.
204  * @syscap SystemCapability.Startup.SystemInfo
205  * @since 10
206  */
207 const char *OH_GetBuildRootHash(void);
208 
209 /**
210  * Obtains the Distribution OS name represented by a string.
211  *
212  * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS name.
213  * If ISV not specified, it will return an empty string
214  * @syscap SystemCapability.Startup.SystemInfo
215  * @since 10
216  */
217 const char *OH_GetDistributionOSName(void);
218 
219 /**
220  * Obtains the ISV distribution OS version represented by a string.
221  * If ISV not specified, it will return the same value as OH_GetOSFullName
222  * @syscap SystemCapability.Startup.SystemInfo
223  * @since 10
224  */
225 const char *OH_GetDistributionOSVersion(void);
226 
227 /**
228  * Obtains the ISV distribution OS api version represented by a integer.
229  * If ISV not specified, it will return the same value as OH_GetSdkApiVersion
230  * @syscap SystemCapability.Startup.SystemInfo
231  * @since 10
232  */
233 int OH_GetDistributionOSApiVersion(void);
234 
235 /**
236  * Obtains the ISV distribution OS release type represented by a string.
237  * If ISV not specified, it will return the same value as OH_GetOsReleaseType
238  * @syscap SystemCapability.Startup.SystemInfo
239  * @since 10
240  */
241 const char *OH_GetDistributionOSReleaseType(void);
242 
243 #ifdef __cplusplus
244 #if __cplusplus
245 }
246 #endif
247 #endif
248 #endif
249 /** @} */
250