diff --git a/frameworks/ans/src/notification_disable.cpp b/frameworks/ans/src/notification_disable.cpp index 4b8041a5e4ba72205cb5511503e8ccf96720876f..780d81e1cd12795ec6eac02c678a57c55308d7c9 100644 --- a/frameworks/ans/src/notification_disable.cpp +++ b/frameworks/ans/src/notification_disable.cpp @@ -24,6 +24,7 @@ namespace Notification { namespace { constexpr const char *DISABLED = "disabled"; constexpr const char *BUNDLELIST = "bundleList"; +constexpr const char *USERID = "userId"; constexpr int32_t MAX_NOTIFICATION_DISABLE_NUM = 1000; } // namespace void NotificationDisable::SetDisabled(bool disabled) @@ -36,6 +37,11 @@ void NotificationDisable::SetBundleList(const std::vector &bundleLi bundleList_ = bundleList; } +void NotificationDisable::SetUserId(int32_t userId) +{ + userId_ = userId; +} + bool NotificationDisable::GetDisabled() const { return disabled_; @@ -46,6 +52,11 @@ std::vector NotificationDisable::GetBundleList() const return bundleList_; } +int32_t NotificationDisable::GetUserId() const +{ + return userId_; +} + bool NotificationDisable::Marshalling(Parcel &parcel) const { if (!parcel.WriteBool(disabled_)) { @@ -67,6 +78,10 @@ bool NotificationDisable::Marshalling(Parcel &parcel) const return false; } } + if (!parcel.WriteInt32(userId_)) { + ANS_LOGE("Failed to write userId"); + return false; + } return true; } @@ -85,6 +100,7 @@ bool NotificationDisable::ReadFromParcel(Parcel &parcel) return false; } } + userId_ = parcel.ReadInt32(); return true; } @@ -103,6 +119,7 @@ std::string NotificationDisable::ToJson() nlohmann::json jsonObject; jsonObject[DISABLED] = disabled_; jsonObject[BUNDLELIST] = nlohmann::json(bundleList_); + jsonObject[USERID] = userId_; return jsonObject.dump(); } @@ -128,6 +145,9 @@ void NotificationDisable::FromJson(const std::string &jsonObj) if (jsonObject.find(BUNDLELIST) != jsonEnd && jsonObject.at(BUNDLELIST).is_array()) { bundleList_ = jsonObject.at(BUNDLELIST).get>(); } + if (jsonObject.find(USERID) != jsonEnd && jsonObject.at(USERID).is_number_integer()) { + userId_ = jsonObject.at(USERID).get(); + } } } } \ No newline at end of file diff --git a/frameworks/ans/test/unittest/notification_disable_test.cpp b/frameworks/ans/test/unittest/notification_disable_test.cpp index 481e434f84c1429c202f11516f1331f628c0e646..456689bc7a518067b64b90dace74c9393e251f50 100644 --- a/frameworks/ans/test/unittest/notification_disable_test.cpp +++ b/frameworks/ans/test/unittest/notification_disable_test.cpp @@ -141,5 +141,17 @@ HWTEST_F(NotificationDisableTest, FromJson_0100, Function | SmallTest | Level1) notificationDisable.FromJson(jsonObjString); ASSERT_FALSE(notificationDisable.GetDisabled()); } + +/** + * @tc.name: GetUserId_0100 + * @tc.desc: Test GetUserId. + * @tc.type: FUNC + */ +HWTEST_F(NotificationDisableTest, GetUserId_0100, Function | SmallTest | Level1) +{ + NotificationDisable notificationDisable; + notificationDisable.SetUserId(1); + EXPECT_EQ(notificationDisable.GetUserId(), 1); +} } } diff --git a/frameworks/js/napi/include/disable_notification.h b/frameworks/js/napi/include/disable_notification.h index b4adfafb9e3f20c685093a7291b515cebed68067..63a64c4097f8fad5eb7015c1cf551bcc4a4deefb 100644 --- a/frameworks/js/napi/include/disable_notification.h +++ b/frameworks/js/napi/include/disable_notification.h @@ -31,6 +31,7 @@ struct AsyncCallbackInfoDisableNotification { bool ParseDisabledParameters(const napi_env &env, const napi_value &value, bool &disabled); bool ParseBundleListParameters(const napi_env &env, const napi_value &value, std::vector &bundleList); +bool ParseUserIdParameters(const napi_env &env, const napi_value &value, int32_t &userId); bool ParseDisableNotificationParameters( const napi_env &env, const napi_callback_info &info, NotificationDisable ¶s); } // namespace NotificationNapi diff --git a/frameworks/js/napi/src/disable_notification.cpp b/frameworks/js/napi/src/disable_notification.cpp index e2f10b252c93faff90c36933ef15d91f9c4243a2..ea7585138927756eeeb2b2472fa060e7812781d4 100644 --- a/frameworks/js/napi/src/disable_notification.cpp +++ b/frameworks/js/napi/src/disable_notification.cpp @@ -18,7 +18,9 @@ namespace OHOS { namespace NotificationNapi { -constexpr int8_t DISABLE_MAX_PARA = 2; +constexpr int8_t DISABLE_MAX_PARA = 3; +constexpr int8_t DISABLE_MIN_PARA = 2; +constexpr int32_t MAX_USER_ID = 10736; bool ParseDisabledParameters(const napi_env &env, const napi_value &value, bool &disabled) { @@ -79,6 +81,24 @@ bool ParseBundleListParameters(const napi_env &env, const napi_value &value, std return true; } +bool ParseUserIdParameters(const napi_env &env, const napi_value &value, int32_t &userId) +{ + napi_status status = napi_get_value_int32(env, value, &userId); + if (status != napi_ok) { + ANS_LOGE("Failed to parse the third parameter as number"); + std::string msg = "Third argument must be a number"; + Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); + return false; + } + if (userId < 0 || userId > MAX_USER_ID) { + ANS_LOGE("Invalid userId"); + std::string msg = "UserId must be a non-negative integer and less than " + std::to_string(MAX_USER_ID); + Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); + return false; + } + return true; +} + bool ParseDisableNotificationParameters( const napi_env &env, const napi_callback_info &info, NotificationDisable ¶m) { @@ -87,10 +107,10 @@ bool ParseDisableNotificationParameters( napi_value argv[DISABLE_MAX_PARA] = {nullptr}; napi_value thisVar = nullptr; NAPI_CALL_BASE(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, NULL), false); - if (argc != DISABLE_MAX_PARA) { + if (argc > DISABLE_MAX_PARA || argc < DISABLE_MIN_PARA) { ANS_LOGE("wrong number of arguments"); std::string msg = - "Wrong number of arguments.The number of parameters is not " + std::to_string(DISABLE_MAX_PARA); + "Wrong number of arguments. Expected 2 or 3, but get " + std::to_string(argc); Common::NapiThrow(env, ERROR_PARAM_INVALID, msg); return false; } @@ -105,6 +125,14 @@ bool ParseDisableNotificationParameters( return false; } param.SetBundleList(bundleList); + + if (argc == DISABLE_MAX_PARA) { + int32_t userId = SUBSCRIBE_USER_INIT; + if (!ParseUserIdParameters(env, argv[PARAM2], userId)) { + return false; + } + param.SetUserId(userId); + } return true; } } diff --git a/interfaces/inner_api/notification_disable.h b/interfaces/inner_api/notification_disable.h index d89d1909792d720172f47851b1a2ebad50c0b295..c0327975ec1bb90929c8e02c40dcdbaec2639273 100644 --- a/interfaces/inner_api/notification_disable.h +++ b/interfaces/inner_api/notification_disable.h @@ -28,8 +28,10 @@ public: void SetDisabled(bool disabled); void SetBundleList(const std::vector &bundleList); + void SetUserId(int32_t userId); bool GetDisabled() const; std::vector GetBundleList() const; + int32_t GetUserId() const; bool Marshalling(Parcel &parcel) const override; bool ReadFromParcel(Parcel &parcel); @@ -40,6 +42,7 @@ public: private: bool disabled_ = false; std::vector bundleList_; + int32_t userId_ = -1; }; } } diff --git a/services/ans/include/notification_preferences.h b/services/ans/include/notification_preferences.h index 107e1c7c185347770099d3de08ed0c8eee1ed5dd..3154f43b7bb1f38058e88eb4fa7459afc8a18449 100644 --- a/services/ans/include/notification_preferences.h +++ b/services/ans/include/notification_preferences.h @@ -504,6 +504,7 @@ public: const std::vector>& profileInfo); ErrCode SetDisableNotificationInfo(const sptr ¬ificationDisable); bool GetDisableNotificationInfo(NotificationDisable ¬ificationDisable); + bool GetUserDisableNotificationInfo(int32_t userId, NotificationDisable ¬ificationDisable); ErrCode SetSubscriberExistFlag(const std::string& deviceType, bool existFlag); ErrCode GetSubscriberExistFlag(const std::string& deviceType, bool& existFlag); /** diff --git a/services/ans/include/notification_preferences_database.h b/services/ans/include/notification_preferences_database.h index 9f3b5b23e888153f5ae80795a00747b2f9ea4c44..c741f232a0cd5ac52cff6e6e15258f228f6ccc7e 100644 --- a/services/ans/include/notification_preferences_database.h +++ b/services/ans/include/notification_preferences_database.h @@ -354,6 +354,7 @@ public: const std::vector& cloneBundleInfo); bool SetDisableNotificationInfo(const sptr ¬ificationDisable); bool GetDisableNotificationInfo(NotificationDisable ¬ificationDisable); + bool GetUserDisableNotificationInfo(int32_t userId, NotificationDisable ¬ificationDisable); bool SetSubscriberExistFlag(const std::string& deviceType, bool existFlag); bool GetSubscriberExistFlag(const std::string& deviceType, bool& existFlag); bool IsDistributedEnabledEmptyForBundle( diff --git a/services/ans/include/notification_preferences_info.h b/services/ans/include/notification_preferences_info.h index 3307c3cc450e7472e593f650b884375514a24eb2..12246dbff0028598dd2b75f615ab2778650b918b 100644 --- a/services/ans/include/notification_preferences_info.h +++ b/services/ans/include/notification_preferences_info.h @@ -348,6 +348,7 @@ public: ErrCode GetAllLiveViewEnabledBundles(const int32_t userId, std::vector &bundleOption); void SetkioskAppTrustList(const std::vector &kioskAppTrustList); bool GetkioskAppTrustList(std::vector &kioskAppTrustList) const; + bool GetUserDisableNotificationInfo(int32_t userId, NotificationDisable ¬ificationDisable); private: std::map isEnabledAllNotification_; @@ -362,6 +363,7 @@ private: std::vector bundleList; }; DisableNotificationInfo disableNotificationInfo_; + std::map userDisableNotificationInfo_; }; } // namespace Notification } // namespace OHOS diff --git a/services/ans/src/advanced_notification_publish_service.cpp b/services/ans/src/advanced_notification_publish_service.cpp index 17cfaabba7c493ddc02f6a1e6c3a01d85f2dc056..ddc7c5896781797071c2cfbd91cc1ef177e77756 100644 --- a/services/ans/src/advanced_notification_publish_service.cpp +++ b/services/ans/src/advanced_notification_publish_service.cpp @@ -1074,6 +1074,21 @@ bool AdvancedNotificationService::IsDisableNotification(const std::string &bundl return true; } } + } + int32_t userId = SUBSCRIBE_USER_INIT; + if (OsAccountManagerHelper::GetInstance().GetCurrentActiveUserId(userId) != ERR_OK) { + ANS_LOGD("GetCurrentActiveUserId failed"); + return false; + } + if (NotificationPreferences::GetInstance()->GetUserDisableNotificationInfo(userId, notificationDisable)) { + if (notificationDisable.GetDisabled()) { + ANS_LOGD("get disabled is open"); + std::vector bundleList = notificationDisable.GetBundleList(); + auto it = std::find(bundleList.begin(), bundleList.end(), bundleName); + if (it != bundleList.end()) { + return true; + } + } } else { ANS_LOGD("no disabled has been set up or set disabled to close"); } diff --git a/services/ans/src/notification_preferences.cpp b/services/ans/src/notification_preferences.cpp index fe38cf6c4214a6977d8f2bf8716f4498c9b6dd51..4b01f589831360fb945a91a3192caac5b73fed0a 100644 --- a/services/ans/src/notification_preferences.cpp +++ b/services/ans/src/notification_preferences.cpp @@ -1536,6 +1536,28 @@ bool NotificationPreferences::GetDisableNotificationInfo(NotificationDisable &no return true; } +bool NotificationPreferences::GetUserDisableNotificationInfo(int32_t userId, NotificationDisable ¬ificationDisable) +{ + std::lock_guard lock(preferenceMutex_); + if (preferencesInfo_.GetUserDisableNotificationInfo(userId, notificationDisable)) { + ANS_LOGD("info get disable notification success"); + return true; + } + if (preferncesDB_ == nullptr) { + ANS_LOGE("the prefernces db is nullptr"); + return false; + } + if (preferncesDB_->GetUserDisableNotificationInfo(userId, notificationDisable)) { + ANS_LOGD("db get disable notification success"); + sptr notificationDisablePtr = new (std::nothrow) NotificationDisable(notificationDisable); + preferencesInfo_.SetDisableNotificationInfo(notificationDisablePtr); + } else { + ANS_LOGD("db get disable notification fail"); + return false; + } + return true; +} + bool NotificationPreferences::GetkioskAppTrustList(std::vector &kioskAppTrustList) { ANS_LOGD("%{public}s", __FUNCTION__); diff --git a/services/ans/src/notification_preferences_database.cpp b/services/ans/src/notification_preferences_database.cpp index 87e47d781c52b5df07e7e938da625a353f2dfce5..7f27a8788342888dca636221558bb1c993d05242 100644 --- a/services/ans/src/notification_preferences_database.cpp +++ b/services/ans/src/notification_preferences_database.cpp @@ -2762,7 +2762,11 @@ bool NotificationPreferencesDatabase::SetDisableNotificationInfo(const sptrToJson(); - int32_t result = rdbDataManager_->InsertData(KEY_DISABLE_NOTIFICATION, value, ZERO_USER_ID); + int32_t userId = notificationDisable->GetUserId(); + if (userId == SUBSCRIBE_USER_INIT) { + userId = ZERO_USER_ID; + } + int32_t result = rdbDataManager_->InsertData(KEY_DISABLE_NOTIFICATION, value, userId); return (result == NativeRdb::E_OK); } @@ -2782,6 +2786,23 @@ bool NotificationPreferencesDatabase::GetDisableNotificationInfo(NotificationDis return true; } +bool NotificationPreferencesDatabase::GetUserDisableNotificationInfo( + int32_t userId, NotificationDisable ¬ificationDisable) +{ + if (!CheckRdbStore()) { + ANS_LOGE("null rdbStore"); + return false; + } + std::string value; + int32_t result = rdbDataManager_->QueryData(KEY_DISABLE_NOTIFICATION, value, userId); + if (result != NativeRdb::E_OK) { + ANS_LOGE("query data failed"); + return false; + } + notificationDisable.FromJson(value); + return true; +} + void NotificationPreferencesDatabase::GetDisableNotificationInfo(NotificationPreferencesInfo &info) { if (!CheckRdbStore()) { diff --git a/services/ans/src/notification_preferences_info.cpp b/services/ans/src/notification_preferences_info.cpp index 7797677038f4c532f4e5658bd5affa9422986fbc..e2cad6f5b072d183add1dfccaeaeb89a94431136 100644 --- a/services/ans/src/notification_preferences_info.cpp +++ b/services/ans/src/notification_preferences_info.cpp @@ -448,7 +448,18 @@ void NotificationPreferencesInfo::SetDisableNotificationInfo(const sptrGetUserId() > 0) { + DisableNotificationInfo disableNotificationInfo; + if (notificationDisable->GetDisabled()) { + disableNotificationInfo.disabled = 1; + } else { + disableNotificationInfo.disabled = 0; + } + disableNotificationInfo.bundleList = notificationDisable->GetBundleList(); + userDisableNotificationInfo_.insert_or_assign(notificationDisable->GetUserId(), disableNotificationInfo); + return; + } + if (notificationDisable->GetDisabled()) { disableNotificationInfo_.disabled = 1; } else { @@ -527,5 +538,27 @@ ErrCode NotificationPreferencesInfo::GetAllLiveViewEnabledBundles(const int32_t } return ERR_OK; } + +bool NotificationPreferencesInfo::GetUserDisableNotificationInfo( + int32_t userId, NotificationDisable ¬ificationDisable) +{ + auto itr = userDisableNotificationInfo_.find(userId); + if (itr != userDisableNotificationInfo_.end()) { + if (itr->second.disabled == -1) { + ANS_LOGD("notificationDisable is invalid"); + return false; + } + if (itr->second.bundleList.empty()) { + ANS_LOGE("notificationDisable bundleList is empty"); + return false; + } + notificationDisable.SetDisabled(itr->second.disabled); + notificationDisable.SetBundleList(itr->second.bundleList); + } else { + ANS_LOGE("userDisableNotificationInfo not found for userId: %{public}d", userId); + return false; + } + return true; +} } // namespace Notification } // namespace OHOS diff --git a/services/ans/test/unittest/advanced_notification_publish_service_test.cpp b/services/ans/test/unittest/advanced_notification_publish_service_test.cpp index 0072ed62dc95d549ca02eb6e4dba2ab382d5937c..d59588ffee5d79fded866b343ea54ac7e128271c 100644 --- a/services/ans/test/unittest/advanced_notification_publish_service_test.cpp +++ b/services/ans/test/unittest/advanced_notification_publish_service_test.cpp @@ -2640,5 +2640,80 @@ HWTEST_F(AnsPublishServiceTest, IsDisableNotificationForSaByKiosk_002, Function bool result = advancedNotificationService_->IsDisableNotificationForSaByKiosk(bundleName, request); EXPECT_TRUE(result); } + +/** + * @tc.name: IsDisableNotification_003 + * @tc.desc: Test IsDisableNotification + * @tc.type: FUNC + * @tc.require: issue + */ +HWTEST_F(AnsPublishServiceTest, IsDisableNotification_003, Function | SmallTest | Level1) +{ + bool defaultPolicy = system::GetBoolParameter("persist.edm.notification_disable", false); + if (defaultPolicy) { + system::SetBoolParameter("persist.edm.notification_disable", false); + } + std::string bundleName = "com.testDisableNotification.example"; + NotificationDisable notificationDisable; + std::vector bundleList = {bundleName}; + notificationDisable.SetDisabled(true); + notificationDisable.SetBundleList(bundleList); + notificationDisable.SetUserId(100); + sptr notificationDisablePtr = new (std::nothrow) NotificationDisable(notificationDisable); + NotificationPreferences::GetInstance()->preferencesInfo_.SetDisableNotificationInfo(notificationDisablePtr); + bool result = advancedNotificationService_->IsDisableNotification(bundleName); + ASSERT_FALSE(result); + system::SetBoolParameter("persist.edm.notification_disable", defaultPolicy); +} + +/** + * @tc.name: IsDisableNotification_004 + * @tc.desc: Test IsDisableNotification + * @tc.type: FUNC + * @tc.require: issue + */ +HWTEST_F(AnsPublishServiceTest, IsDisableNotification_004, Function | SmallTest | Level1) +{ + bool defaultPolicy = system::GetBoolParameter("persist.edm.notification_disable", false); + if (defaultPolicy) { + system::SetBoolParameter("persist.edm.notification_disable", false); + } + std::string bundleName = "com.testDisableNotification.example"; + NotificationDisable notificationDisable; + std::vector bundleList = {bundleName}; + notificationDisable.SetDisabled(false); + notificationDisable.SetBundleList(bundleList); + notificationDisable.SetUserId(101); + sptr notificationDisablePtr = new (std::nothrow) NotificationDisable(notificationDisable); + NotificationPreferences::GetInstance()->preferencesInfo_.SetDisableNotificationInfo(notificationDisablePtr); + bool result = advancedNotificationService_->IsDisableNotification(bundleName); + ASSERT_FALSE(result); + system::SetBoolParameter("persist.edm.notification_disable", defaultPolicy); +} + +/** + * @tc.name: IsDisableNotification_005 + * @tc.desc: Test IsDisableNotification + * @tc.type: FUNC + * @tc.require: issue + */ +HWTEST_F(AnsPublishServiceTest, IsDisableNotification_005, Function | SmallTest | Level1) +{ + bool defaultPolicy = system::GetBoolParameter("persist.edm.notification_disable", false); + if (defaultPolicy) { + system::SetBoolParameter("persist.edm.notification_disable", false); + } + std::string bundleName = "com.testDisableNotification.example"; + NotificationDisable notificationDisable; + std::vector bundleList = {bundleName}; + notificationDisable.SetDisabled(true); + notificationDisable.SetBundleList(bundleList); + notificationDisable.SetUserId(101); + sptr notificationDisablePtr = new (std::nothrow) NotificationDisable(notificationDisable); + NotificationPreferences::GetInstance()->preferencesInfo_.SetDisableNotificationInfo(notificationDisablePtr); + bool result = advancedNotificationService_->IsDisableNotification(bundleName); + ASSERT_TRUE(result); + system::SetBoolParameter("persist.edm.notification_disable", defaultPolicy); +} } // namespace Notification } // namespace OHOS diff --git a/services/ans/test/unittest/notification_preferences_database_test.cpp b/services/ans/test/unittest/notification_preferences_database_test.cpp index 92d639a89eccefa16f14d4758788a4eb40002643..6465d4320ee272682ae96a777b1a2d302bc39d98 100644 --- a/services/ans/test/unittest/notification_preferences_database_test.cpp +++ b/services/ans/test/unittest/notification_preferences_database_test.cpp @@ -1804,5 +1804,21 @@ HWTEST_F(NotificationPreferencesDatabaseTest, GetDistributedDevicelist_0300, Tes ASSERT_EQ(ret, true); ASSERT_EQ(deviceTypes, deviceTypes1); } + +/** + * @tc.name: SetDisableNotificationInfo_0400 + * @tc.desc: test SetDisableNotificationInfo. + * @tc.type: FUNC + */ +HWTEST_F(NotificationPreferencesDatabaseTest, SetDisableNotificationInfo_0400, TestSize.Level1) +{ + std::shared_ptr notificationPreferencesDatabase = + std::make_shared(); + sptr notificationDisable = new (std::nothrow) NotificationDisable(); + notificationDisable->SetDisabled(true); + notificationDisable->SetBundleList({ "com.example.app" }); + notificationDisable->SetUserId(101); + EXPECT_TRUE(notificationPreferencesDatabase->SetDisableNotificationInfo(notificationDisable)); +} } // namespace Notification } // namespace OHOS diff --git a/services/ans/test/unittest/notification_preferences_info_test.cpp b/services/ans/test/unittest/notification_preferences_info_test.cpp index 746173395c87c1ccd2b94ac10728023fa1c03555..fdfbc2595fae40ae665c79146fdca3f6f1c55842 100644 --- a/services/ans/test/unittest/notification_preferences_info_test.cpp +++ b/services/ans/test/unittest/notification_preferences_info_test.cpp @@ -426,5 +426,41 @@ HWTEST_F(NotificationPreferencesInfoTest, GetkioskAppTrustList_0100, TestSize.Le ret = preferencesInfo->GetkioskAppTrustList(resultList); ASSERT_EQ(ret, true); } + +/** + * @tc.name: GetDisableNotificationInfo_0500 + * @tc.desc: test GetDisableNotificationInfo. + * @tc.type: FUNC + */ +HWTEST_F(NotificationPreferencesInfoTest, GetDisableNotificationInfo_0500, TestSize.Level1) +{ + std::shared_ptr preferencesInfo = std::make_shared(); + sptr notificationDisable = new (std::nothrow) NotificationDisable(); + notificationDisable->SetDisabled(true); + notificationDisable->SetBundleList({ "com.example.app" }); + notificationDisable->SetUserId(101); + preferencesInfo->SetDisableNotificationInfo(notificationDisable); + NotificationDisable disable; + bool ret = preferencesInfo->GetUserDisableNotificationInfo(101, disable); + EXPECT_TRUE(ret); +} + +/** + * @tc.name: GetDisableNotificationInfo_0600 + * @tc.desc: test GetDisableNotificationInfo. + * @tc.type: FUNC + */ +HWTEST_F(NotificationPreferencesInfoTest, GetDisableNotificationInfo_0600, TestSize.Level1) +{ + std::shared_ptr preferencesInfo = std::make_shared(); + sptr notificationDisable = new (std::nothrow) NotificationDisable(); + notificationDisable->SetDisabled(false); + notificationDisable->SetBundleList({ "com.example.app" }); + notificationDisable->SetUserId(101); + preferencesInfo->SetDisableNotificationInfo(notificationDisable); + NotificationDisable disable; + bool ret = preferencesInfo->GetUserDisableNotificationInfo(101, disable); + EXPECT_TRUE(ret); +} } }