add OnUserSwitched

Signed-off-by: dengxiaoyu <dengxiaoyu6@huawei.com>
This commit is contained in:
dengxiaoyu 2024-09-09 10:37:06 +08:00
parent c21b65ab37
commit 3a236e7ee2
2 changed files with 14 additions and 8 deletions

View File

@ -29,14 +29,13 @@ class SwitchStatusDependency {
public:
static SwitchStatusDependency &GetInstance();
bool IsContinueSwitchOn();
const std::string SETTINGS_USER_SECURE_URI =
"datashare:///com.ohos.settingsdata/entry/settingsdata/USER_SETTINGSDATA_SECURE";
const std::string SETTINGS_DATA_FIELD_KEY = "KEYWORD";
const std::string SETTINGS_DATA_FIELD_VAL = "VALUE";
const std::string CONTINUE_SWITCH_STATUS_KEY = "Continue_Switch_Status";
const std::string CONTINUE_SWITCH_OFF = "0";
const std::string CONTINUE_SWITCH_ON = "1";
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);

View File

@ -29,6 +29,13 @@ namespace OHOS {
namespace DistributedSchedule {
namespace {
const std::string TAG = "DMSSwitchStatusDep";
const std::string SwitchStatusDependency::SETTINGS_USER_SECURE_URI =
"datashare:///com.ohos.settingsdata/entry/settingsdata/USER_SETTINGSDATA_SECURE";
const std::string SwitchStatusDependency::SETTINGS_DATA_FIELD_KEY = "KEYWORD";
const std::string SwitchStatusDependency::SETTINGS_DATA_FIELD_VAL = "VALUE";
const std::string SwitchStatusDependency::CONTINUE_SWITCH_STATUS_KEY = "Continue_Switch_Status";
const std::string SwitchStatusDependency::CONTINUE_SWITCH_OFF = "0";
const std::string SwitchStatusDependency::CONTINUE_SWITCH_ON = "1";
}
SwitchStatusDependency &SwitchStatusDependency::GetInstance()
{