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 <mutex> 21 #include <string> 22 #include "single_instance.h" 23 24 namespace OHOS { 25 namespace DistributedDeviceProfile { 26 class ContentSensorManagerUtils { 27 DECLARE_SINGLE_INSTANCE(ContentSensorManagerUtils); 28 public: 29 std::string ObtainProductModel(); 30 std::string ObtainDeviceType(); 31 std::string ObtainManufacture(); 32 std::string ObtainSerial(); 33 std::string ObtainMarketName(); 34 std::string ObtainOsFullName(); 35 std::string ObtainDisplayVersion(); 36 std::string ObtainLocalUdid(); 37 void ObtainDeviceDataSyncMode(); 38 bool IsDeviceE2ESync(); 39 40 private: 41 std::string deviceModel_ = ""; 42 std::string deviceType_ = ""; 43 std::string manufacture_ = ""; 44 std::string serial_ = ""; 45 std::string marketName_ = ""; 46 std::string osFullName_ = ""; 47 std::string displayVersion_ = ""; 48 std::string localUdid_ = ""; 49 std::atomic<bool> isDeviceE2ESync_ {false}; 50 std::mutex csMutex_; 51 }; 52 } 53 } 54 #endif // OHOS_DP_MANAGER_CONTENT_SENSOR_MANAGER_UTILS_H 55