1/*
2 * Copyright (c) 2024 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#include "parameter.h"
17#include "sysversion.h"
18#include "device_info.h"
19
20#include <string>
21#include <memory>
22
23namespace OHOS {
24namespace CJSystemapi {
25namespace DeviceInfo {
26
27const int UDID_LEN = 65;
28
29const char* DeviceInfo::CjGetHardwareProfile()
30{
31    return GetHardwareProfile();
32}
33
34const char* DeviceInfo::CjGetOsFullName()
35{
36    return GetOSFullName();
37}
38
39const char* DeviceInfo::CjGetProductModel()
40{
41    return GetProductModel();
42}
43
44const char* DeviceInfo::CjGetBrand()
45{
46    return GetBrand();
47}
48
49const char* DeviceInfo::CjGetDeviceType()
50{
51    return GetDeviceType();
52}
53
54const char* DeviceInfo::CjGetUdid()
55{
56    char* udid = static_cast<char*>(calloc(1, UDID_LEN));
57    if (udid == nullptr) {
58        return nullptr;
59    }
60    int res = AclGetDevUdid(udid, UDID_LEN);
61    if (res != 0) {
62        free(udid);
63        return nullptr;
64    }
65    return udid;
66}
67
68const char* DeviceInfo::CjGetBuildRootHash()
69{
70    return GetBuildRootHash();
71}
72
73const char* DeviceInfo::CjGetBuildTime()
74{
75    return GetBuildTime();
76}
77
78const char* DeviceInfo::CjGetBuildHost()
79{
80    return GetBuildHost();
81}
82
83const char* DeviceInfo::CjGetBuildUser()
84{
85    return GetBuildUser();
86}
87
88const char* DeviceInfo::CjGetBuildType()
89{
90    return GetBuildType();
91}
92
93const char* DeviceInfo::CjGetVersionId()
94{
95    return GetVersionId();
96}
97
98int64_t DeviceInfo::CjGetFirstApiVersion()
99{
100    return GetFirstApiVersion();
101}
102
103int64_t DeviceInfo::CjGetSdkApiVersion()
104{
105    return GetSdkApiVersion();
106}
107
108int64_t DeviceInfo::CjGetBuildVersion()
109{
110    return GetBuildVersion();
111}
112
113int64_t DeviceInfo::CjGetFeatureVersion()
114{
115    return GetFeatureVersion();
116}
117
118int64_t DeviceInfo::CjGetSeniorVersion()
119{
120    return GetSeniorVersion();
121}
122
123int64_t DeviceInfo::CjGetMajorVersion()
124{
125    return GetMajorVersion();
126}
127
128const char* DeviceInfo::CjGetDisplayVersion()
129{
130    return GetDisplayVersion();
131}
132
133const char* DeviceInfo::CjGetSerial()
134{
135    return AclGetSerial();
136}
137
138const char* DeviceInfo::CjGetOsReleaseType()
139{
140    return GetOsReleaseType();
141}
142
143const char* DeviceInfo::CjGetIncrementalVersion()
144{
145    return GetIncrementalVersion();
146}
147
148const char* DeviceInfo::CjGetSecurityPatchTag()
149{
150    return GetSecurityPatchTag();
151}
152
153const char* DeviceInfo::CjGetAbiList()
154{
155    return GetAbiList();
156}
157
158const char* DeviceInfo::CjGetBootloaderVersion()
159{
160    return GetBootloaderVersion();
161}
162
163const char* DeviceInfo::CjGetHardwareModel()
164{
165    return GetHardwareModel();
166}
167
168const char* DeviceInfo::CjGetSoftwareModel()
169{
170    return GetSoftwareModel();
171}
172
173const char* DeviceInfo::CjGetProductSeries()
174{
175    return GetProductSeries();
176}
177
178const char* DeviceInfo::CjGetMarketName()
179{
180    return GetMarketName();
181}
182
183const char* DeviceInfo::CjGetManufacture()
184{
185    return GetManufacture();
186}
187
188const char* DeviceInfo::CjGetDistributionOSName()
189{
190    return GetDistributionOSName();
191}
192
193const char* DeviceInfo::CjGetDistributionOSVersion()
194{
195    return GetDistributionOSVersion();
196}
197
198int64_t DeviceInfo::CjGetDistributionOSApiVersion()
199{
200    return GetDistributionOSApiVersion();
201}
202
203const char* DeviceInfo::CjGetDistributionOSReleaseType()
204{
205    return GetDistributionOSReleaseType();
206}
207
208} // DeviceInfo
209} // CJSystemapi
210} // OHOS
211