mirror of
https://gitee.com/openharmony/ability_dmsfwk
synced 2024-11-27 00:20:44 +00:00
add OnUserSwitched
Signed-off-by: dengxiaoyu <dengxiaoyu6@huawei.com>
This commit is contained in:
parent
3a236e7ee2
commit
c0d6a739db
@ -24,11 +24,7 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace DistributedSchedule {
|
||||
const std::string SETTINGS_DATA_URI =
|
||||
"datashare:///com.ohos.settingsdata/entry/settingsdata/SETTINGSDATA?Proxy=true&key=Continue_Switch_Status";
|
||||
const std::string SETTINGS_USER_SECURE_URI =
|
||||
"datashare:///com.ohos.settingsdata/entry/settingsdata/USER_SETTINGSDATA_SECURE";
|
||||
|
||||
|
||||
class SettingObserver : public AAFwk::DataAbilityObserverStub {
|
||||
public:
|
||||
SettingObserver();
|
||||
@ -59,7 +55,6 @@ public:
|
||||
|
||||
private:
|
||||
std::shared_ptr<DataShare::DataShareHelper> CreateDataShareHelper();
|
||||
Uri AssembleUri(const std::string &key);
|
||||
sptr<SettingObserver> GetSettingObserver(const std::string &key);
|
||||
|
||||
private:
|
||||
|
@ -114,7 +114,7 @@ void DataShareManager::UnregisterObserver(const std::string &key)
|
||||
Uri uri(AssembleUserSecureUri(userId, key));
|
||||
dataShareHelper->UnregisterObserver(uri, observer);
|
||||
dataShareHelper->Release();
|
||||
|
||||
|
||||
std::lock_guard<std::mutex> lockGuard(observerMapMutex_);
|
||||
settingObserverMap_.erase(key);
|
||||
HILOGI("DataShareManager UnregisterObserver success with key is %{public}s", key.c_str());
|
||||
|
Loading…
Reference in New Issue
Block a user