• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-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 #ifndef OHOS_DP_CONTENT_SENSOR_MANAGER_UTILS_H
17 #define OHOS_DP_CONTENT_SENSOR_MANAGER_UTILS_H
18 
19 #include <atomic>
20 #include <map>
21 #include <mutex>
22 #include <string>
23 #include "single_instance.h"
24 
25 namespace OHOS {
26 namespace DistributedDeviceProfile {
27 class ContentSensorManagerUtils {
28 DECLARE_SINGLE_INSTANCE(ContentSensorManagerUtils);
29 public:
30     std::string ObtainProductModel();
31     std::string ObtainDeviceType();
32     std::string ObtainDeviceTypeId();
33     std::string ObtainManufacture();
34     std::string ObtainSerial();
35     std::string ObtainMarketName();
36     std::string ObtainOsFullName();
37     std::string ObtainDisplayVersion();
38     std::string ObtainLocalUdid();
39     std::string ObtainProductId();
40     void ObtainDeviceDataSyncMode();
41     bool IsDeviceE2ESync();
42     int32_t GetProtType();
43     std::string GetSubProductId();
44     std::string DecodeHexStr(const std::string &str);
45 
46 private:
47     bool IsWifiOnly();
48     std::string GetBackcolor();
49     std::map<std::string, std::string> GetSubProdIdMap();
50 
51     std::string deviceModel_ = "";
52     std::string deviceType_ = "";
53     std::string manufacture_ = "";
54     std::string serial_ = "";
55     std::string marketName_ = "";
56     std::string osFullName_ = "";
57     std::string displayVersion_ = "";
58     std::string localUdid_ = "";
59     std::string productId_ = "";
60     std::string deviceTypeId_ = "";
61     std::atomic<bool> isDeviceE2ESync_ {false};
62     int32_t protType_ = 0;
63     std::string backcolor_ = "";
64     std::map<std::string, std::string> subProdIdMap_ = {};
65     std::mutex csMutex_;
66 };
67 }
68 }
69 #endif // OHOS_DP_MANAGER_CONTENT_SENSOR_MANAGER_UTILS_H
70