/* * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef DMS_SWITCH_STATUS_DEPENDENCY_H #define DMS_SWITCH_STATUS_DEPENDENCY_H #include #include #include #include "json/json.h" #include "datashare_helper.h" namespace OHOS { namespace DistributedSchedule { class SwitchStatusDependency { public: static SwitchStatusDependency &GetInstance(); bool IsContinueSwitchOn(); static const std::string SETTINGS_USER_SECURE_URI; static const std::string SETTINGS_DATA_FIELD_KEY; static const std::string SETTINGS_DATA_FIELD_VAL; static const std::string CONTINUE_SWITCH_STATUS_KEY; static const std::string CONTINUE_SWITCH_OFF; static const std::string CONTINUE_SWITCH_ON; private: std::string GetSwitchStatus(const std::string &key, const std::string &defaultValue); std::shared_ptr GetDataShareHelper(); std::mutex dataShareMutex_; std::string switchStatus_; }; } // namespace DistributedSchedule } // namespace OHOS #endif // DMS_SWITCH_STATUS_DEPENDENCY_H