• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024-2025 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 #include <gtest/gtest.h>
17 
18 #include "ans_inner_errors.h"
19 #include "ans_ut_constant.h"
20 #include "notification_bundle_option.h"
21 #include "notification_constant.h"
22 #define private public
23 #define protected public
24 #include "notification_preferences_info.h"
25 #include "advanced_notification_service.h"
26 #undef private
27 #undef protected
28 
29 using namespace testing::ext;
30 namespace OHOS {
31 namespace Notification {
32 class NotificationPreferencesInfoTest : public testing::Test {
33 public:
SetUpTestCase()34     static void SetUpTestCase() {};
TearDownTestCase()35     static void TearDownTestCase() {};
SetUp()36     void SetUp() {};
TearDown()37     void TearDown() {};
38 };
39 
40 /**
41  * @tc.name: GetSlotFlagsKeyFromType_00001
42  * @tc.desc: Test GetSlotFlagsKeyFromType
43  * @tc.type: FUNC
44  * @tc.require: issue
45  */
46 HWTEST_F(NotificationPreferencesInfoTest, GetSlotFlagsKeyFromType_00001, Function | SmallTest | Level1)
47 {
48     NotificationPreferencesInfo::BundleInfo bundleInfo;
49     const char *res= bundleInfo.GetSlotFlagsKeyFromType(NotificationConstant::SlotType::SOCIAL_COMMUNICATION);
50     std::string resStr(res);
51     ASSERT_EQ(resStr, "Social_communication");
52 
53     res = bundleInfo.GetSlotFlagsKeyFromType(NotificationConstant::SlotType::SERVICE_REMINDER);
54     resStr = res;
55     ASSERT_EQ(resStr, "Service_reminder");
56 
57     res = bundleInfo.GetSlotFlagsKeyFromType(NotificationConstant::SlotType::CONTENT_INFORMATION);
58     resStr = res;
59     ASSERT_EQ(resStr, "Content_information");
60 
61     res = bundleInfo.GetSlotFlagsKeyFromType(NotificationConstant::SlotType::OTHER);
62     resStr = res;
63     ASSERT_EQ(resStr, "Other");
64 
65     res = bundleInfo.GetSlotFlagsKeyFromType(NotificationConstant::SlotType::CUSTOM);
66     resStr = res;
67     ASSERT_EQ(resStr, "Custom");
68 
69     res = bundleInfo.GetSlotFlagsKeyFromType(NotificationConstant::SlotType::LIVE_VIEW);
70     resStr = res;
71     ASSERT_EQ(resStr, "Live_view");
72 
73     res = bundleInfo.GetSlotFlagsKeyFromType(NotificationConstant::SlotType::CUSTOMER_SERVICE);
74     resStr = res;
75     ASSERT_EQ(resStr, "Custom_service");
76 
77     res = bundleInfo.GetSlotFlagsKeyFromType(NotificationConstant::SlotType::EMERGENCY_INFORMATION);
78     resStr = res;
79     ASSERT_EQ(resStr, "Emergency_information");
80 }
81 
82 
83 /**
84  * @tc.name: SetSlotFlagsForSlot_00001
85  * @tc.desc: Test SetSlotFlagsForSlot
86  * @tc.type: FUNC
87  * @tc.require: issue
88  */
89 HWTEST_F(NotificationPreferencesInfoTest, SetSlotFlagsForSlot_00001, Function | SmallTest | Level1)
90 {
91     NotificationPreferencesInfo::BundleInfo bundleInfo;
92     bundleInfo.SetSlotFlags(1);
93     bundleInfo.SetSlotFlagsForSlot(NotificationConstant::SlotType::SOCIAL_COMMUNICATION);
94     int res = bundleInfo.GetSlotFlagsForSlot(NotificationConstant::SlotType::SOCIAL_COMMUNICATION);
95     ASSERT_EQ(res, 0);
96 }
97 
98 /**
99  * @tc.name: SetSlotFlagsForSlot_00002
100  * @tc.desc: Test SetSlotFlagsForSlot
101  * @tc.type: FUNC
102  * @tc.require: issue
103  */
104 HWTEST_F(NotificationPreferencesInfoTest, SetSlotFlagsForSlot_00002, Function | SmallTest | Level1)
105 {
106     NotificationPreferencesInfo::BundleInfo bundleInfo;
107     bundleInfo.SetSlotFlags(1);
108     bundleInfo.slotFlagsMap_["Social_communication"] = 63;
109     bundleInfo.SetSlotFlagsForSlot(NotificationConstant::SlotType::SOCIAL_COMMUNICATION);
110     auto size = bundleInfo.slotFlagsMap_.size();
111     ASSERT_EQ(bundleInfo.GetSlotFlagsForSlot(NotificationConstant::SlotType::SOCIAL_COMMUNICATION), 63);
112 
113     bundleInfo.slotFlagsMap_["Social_communication"] = 1;
114     bundleInfo.SetSlotFlagsForSlot(NotificationConstant::SlotType::SOCIAL_COMMUNICATION);
115     ASSERT_EQ(bundleInfo.GetSlotFlagsForSlot(NotificationConstant::SlotType::SOCIAL_COMMUNICATION), 1);
116 }
117 
118 
119 /**
120  * @tc.name: MakeDoNotDisturbProfileKey_0100
121  * @tc.desc: test MakeDoNotDisturbProfileKey can convert key right.
122  * @tc.type: FUNC
123  */
124 HWTEST_F(NotificationPreferencesInfoTest, MakeDoNotDisturbProfileKey_0100, TestSize.Level1)
125 {
126     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
127     int32_t userId = 1;
128     int32_t profileId = 1;
129     string profilekey = "1_1";
130     auto res = preferencesInfo->MakeDoNotDisturbProfileKey(userId, profileId);
131     ASSERT_EQ(res, profilekey);
132 }
133 
134 /**
135  * @tc.name: AddDoNotDisturbProfiles_0100
136  * @tc.desc: test AddDoNotDisturbProfiles can add success.
137  * @tc.type: FUNC
138  */
139 HWTEST_F(NotificationPreferencesInfoTest, AddDoNotDisturbProfiles_0100, TestSize.Level1)
140 {
141     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
142     int32_t userId = 1;
143     std::vector<sptr<NotificationDoNotDisturbProfile>> profiles;
144     sptr<NotificationDoNotDisturbProfile> profile = new (std::nothrow) NotificationDoNotDisturbProfile();
145     int32_t profileId = 1;
146     profile->SetProfileId(profileId);
147     profiles.emplace_back(profile);
148     profiles.emplace_back(nullptr);
149     preferencesInfo->AddDoNotDisturbProfiles(userId, profiles);
150 
151     auto res = preferencesInfo->GetDoNotDisturbProfiles(profileId, userId, profile);
152     ASSERT_EQ(res, true);
153 }
154 
155 /**
156  * @tc.name: RemoveDoNotDisturbProfiles_0100
157  * @tc.desc: test RemoveDoNotDisturbProfiles can remove success.
158  * @tc.type: FUNC
159  */
160 HWTEST_F(NotificationPreferencesInfoTest, RemoveDoNotDisturbProfiles_0100, TestSize.Level1)
161 {
162     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
163     int32_t userId = 1;
164     std::vector<sptr<NotificationDoNotDisturbProfile>> profiles;
165     sptr<NotificationDoNotDisturbProfile> profile = new (std::nothrow) NotificationDoNotDisturbProfile();
166     profiles.emplace_back(profile);
167     profiles.emplace_back(nullptr);
168     preferencesInfo->RemoveDoNotDisturbProfiles(userId, profiles);
169     int32_t profileId = 1;
170     auto res = preferencesInfo->GetDoNotDisturbProfiles(profileId, userId, profile);
171     ASSERT_EQ(res, false);
172 }
173 
174 /**
175  * @tc.name: GetDoNotDisturbProfiles_0100
176  * @tc.desc: test GetDoNotDisturbProfiles can get success.
177  * @tc.type: FUNC
178  */
179 HWTEST_F(NotificationPreferencesInfoTest, GetDoNotDisturbProfiles_0100, TestSize.Level1)
180 {
181     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
182     int32_t userId = 1;
183     std::vector<sptr<NotificationDoNotDisturbProfile>> profiles;
184     sptr<NotificationDoNotDisturbProfile> profile = new (std::nothrow) NotificationDoNotDisturbProfile();
185     int32_t profileId = 1;
186     profile->SetProfileId(profileId);
187     profiles.emplace_back(profile);
188     preferencesInfo->AddDoNotDisturbProfiles(userId, profiles);
189     auto res = preferencesInfo->GetDoNotDisturbProfiles(profileId, userId, profile);
190     ASSERT_EQ(res, true);
191 }
192 
193 /**
194  * @tc.name: RemoveBundleInfo_0100
195  * @tc.desc: test RemoveBundleInfo.
196  * @tc.type: FUNC
197  */
198 HWTEST_F(NotificationPreferencesInfoTest, RemoveBundleInfo_0100, TestSize.Level1)
199 {
200     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
201     sptr<NotificationBundleOption> bundleInfo = new NotificationBundleOption("test", 1);;
202     auto res = preferencesInfo->RemoveBundleInfo(bundleInfo);
203     ASSERT_EQ(res, false);
204 }
205 
206 /**
207  * @tc.name: GetDisableNotificationInfo_0100
208  * @tc.desc: test GetDisableNotificationInfo.
209  * @tc.type: FUNC
210  */
211 HWTEST_F(NotificationPreferencesInfoTest, GetDisableNotificationInfo_0100, TestSize.Level1)
212 {
213     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
214     NotificationDisable notificationDisable;
215     EXPECT_FALSE(preferencesInfo->GetDisableNotificationInfo(notificationDisable));
216 }
217 
218 /**
219  * @tc.name: GetDisableNotificationInfo_0200
220  * @tc.desc: test GetDisableNotificationInfo.
221  * @tc.type: FUNC
222  */
223 HWTEST_F(NotificationPreferencesInfoTest, GetDisableNotificationInfo_0200, TestSize.Level1)
224 {
225     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
226     sptr<NotificationDisable> notificationDisable = new (std::nothrow) NotificationDisable();
227     notificationDisable->SetDisabled(true);
228     notificationDisable->SetBundleList({});
229     preferencesInfo->SetDisableNotificationInfo(notificationDisable);
230 
231     NotificationDisable disable;
232     bool ret = preferencesInfo->GetDisableNotificationInfo(disable);
233     EXPECT_FALSE(ret);
234 }
235 
236 /**
237  * @tc.name: GetDisableNotificationInfo_0300
238  * @tc.desc: test GetDisableNotificationInfo.
239  * @tc.type: FUNC
240  */
241 HWTEST_F(NotificationPreferencesInfoTest, GetDisableNotificationInfo_0300, TestSize.Level1)
242 {
243     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
244     sptr<NotificationDisable> notificationDisable = new (std::nothrow) NotificationDisable();
245     notificationDisable->SetDisabled(false);
246     notificationDisable->SetBundleList({ "com.example.app" });
247     preferencesInfo->SetDisableNotificationInfo(notificationDisable);
248 
249     NotificationDisable disable;
250     EXPECT_TRUE(preferencesInfo->GetDisableNotificationInfo(disable));
251 }
252 
253 /**
254  * @tc.name: GetDisableNotificationInfo_0400
255  * @tc.desc: test GetDisableNotificationInfo.
256  * @tc.type: FUNC
257  */
258 HWTEST_F(NotificationPreferencesInfoTest, GetDisableNotificationInfo_0400, TestSize.Level1)
259 {
260     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
261     sptr<NotificationDisable> notificationDisable = new (std::nothrow) NotificationDisable();
262     notificationDisable->SetDisabled(true);
263     notificationDisable->SetBundleList({ "com.example.app" });
264     preferencesInfo->SetDisableNotificationInfo(notificationDisable);
265     NotificationDisable disable;
266     bool ret = preferencesInfo->GetDisableNotificationInfo(disable);
267     EXPECT_TRUE(ret);
268 }
269 
270 /**
271  * @tc.name: RemoveSlot_0100
272  * @tc.desc: test RemoveSlot.
273  * @tc.type: FUNC
274  */
275 HWTEST_F(NotificationPreferencesInfoTest, RemoveSlot_0100, TestSize.Level1)
276 {
277     NotificationPreferencesInfo::BundleInfo bundleInfo;
278     ASSERT_FALSE(bundleInfo.RemoveSlot(NotificationConstant::SlotType::SOCIAL_COMMUNICATION));
279 }
280 
281 /**
282  * @tc.name: IsExsitBundleInfo_0100
283  * @tc.desc: test IsExsitBundleInfo.
284  * @tc.type: FUNC
285  */
286 HWTEST_F(NotificationPreferencesInfoTest, IsExsitBundleInfo_0100, TestSize.Level1)
287 {
288     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
289     sptr<NotificationBundleOption> bundleOption(new NotificationBundleOption());
290     bundleOption->SetBundleName("test");
291     bundleOption->SetUid(100);
292 
293     NotificationPreferencesInfo::BundleInfo bundleInfo;
294     preferencesInfo->SetBundleInfoFromDb(bundleInfo, "test100");
295 
296     ASSERT_TRUE(preferencesInfo->IsExsitBundleInfo(bundleOption));
297 
298     bundleOption->SetBundleName("test111");
299     ASSERT_FALSE(preferencesInfo->IsExsitBundleInfo(bundleOption));
300 }
301 
302 /**
303  * @tc.name: GetAllDoNotDisturbProfiles_0100
304  * @tc.desc: test GetAllDoNotDisturbProfiles.
305  * @tc.type: FUNC
306  */
307 HWTEST_F(NotificationPreferencesInfoTest, GetAllDoNotDisturbProfiles_0100, TestSize.Level1)
308 {
309     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
310     std::vector<sptr<NotificationDoNotDisturbProfile>> profiles;
311 
312     NotificationPreferencesInfo::BundleInfo bundleInfo;
313 
314     sptr<NotificationDoNotDisturbProfile> profile;
315     preferencesInfo->doNotDisturbProfiles_["2_100_3"] = profile;
316 
317     preferencesInfo->GetAllDoNotDisturbProfiles(100, profiles);
318     ASSERT_EQ(profiles.size(), 1);
319 }
320 
321 /**
322  * @tc.name: GetAllCLoneBundlesInfo_0100
323  * @tc.desc: test GetAllCLoneBundlesInfo.
324  * @tc.type: FUNC
325  */
326 HWTEST_F(NotificationPreferencesInfoTest, GetAllCLoneBundlesInfo_0100, TestSize.Level1)
327 {
328     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
329     std::unordered_map<std::string, std::string> bunlesMap;
330     std::vector<NotificationCloneBundleInfo> cloneBundles;
331     bunlesMap["test"] = "test100";
332 
333     NotificationPreferencesInfo::BundleInfo bundleInfo;
334     preferencesInfo->SetBundleInfoFromDb(bundleInfo, "test100");
335 
336     preferencesInfo->GetAllCLoneBundlesInfo(100, bunlesMap, cloneBundles);
337     ASSERT_EQ(cloneBundles.size(), 1);
338 }
339 
340 /**
341  * @tc.name: GetAllLiveViewEnabledBundles_0100
342  * @tc.desc: test GetAllLiveViewEnabledBundles.
343  * @tc.type: FUNC
344  */
345 HWTEST_F(NotificationPreferencesInfoTest, GetAllLiveViewEnabledBundles_0100, TestSize.Level1)
346 {
347     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
348     preferencesInfo->SetEnabledAllNotification(100, true);
349     std::vector<NotificationBundleOption> bundleOption;
350     auto res = preferencesInfo->GetAllLiveViewEnabledBundles(100, bundleOption);
351     ASSERT_EQ(res, ERR_OK);
352     ASSERT_EQ(bundleOption.size(), 0);
353 }
354 
355 /**
356  * @tc.name: GetAllLiveViewEnabledBundles_0200
357  * @tc.desc: test GetAllLiveViewEnabledBundles.
358  * @tc.type: FUNC
359  */
360 HWTEST_F(NotificationPreferencesInfoTest, GetAllLiveViewEnabledBundles_0200, TestSize.Level1)
361 {
362     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
363     preferencesInfo->SetEnabledAllNotification(100, false);
364     std::vector<NotificationBundleOption> bundleOption;
365     auto res = preferencesInfo->GetAllLiveViewEnabledBundles(100, bundleOption);
366     ASSERT_EQ(res, ERR_OK);
367     ASSERT_EQ(bundleOption.size(), 0);
368 }
369 
370 /**
371  * @tc.name: GetAllLiveViewEnabledBundles_0300
372  * @tc.desc: test GetAllLiveViewEnabledBundles.
373  * @tc.type: FUNC
374  */
375 HWTEST_F(NotificationPreferencesInfoTest, GetAllLiveViewEnabledBundles_0300, TestSize.Level1)
376 {
377     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
378 
379     NotificationPreferencesInfo::BundleInfo bundleInfo;
380     sptr<NotificationSlot> slot(new NotificationSlot(
381         NotificationConstant::SlotType::LIVE_VIEW));
382     slot->SetEnable(true);
383     bundleInfo.SetSlot(slot);
384     preferencesInfo->SetBundleInfoFromDb(bundleInfo, "test100");
385 
386     preferencesInfo->isEnabledAllNotification_[100] = true;
387     std::vector<NotificationBundleOption> bundleOption;
388     auto res = preferencesInfo->GetAllLiveViewEnabledBundles(100, bundleOption);
389     ASSERT_EQ(res, ERR_OK);
390     ASSERT_EQ(bundleOption.size(), 1);
391 }
392 
393 /**
394  * @tc.name: SetkioskAppTrustList_0100
395  * @tc.desc: test SetkioskAppTrustList.
396  * @tc.type: FUNC
397  */
398 HWTEST_F(NotificationPreferencesInfoTest, SetkioskAppTrustList_0100, TestSize.Level1)
399 {
400     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
401     ASSERT_NE(preferencesInfo, nullptr);
402     std::vector<std::string> kioskAppTrustList;
403     kioskAppTrustList.push_back("testBundleName");
404     preferencesInfo->SetkioskAppTrustList(kioskAppTrustList);
405     ASSERT_EQ(preferencesInfo->kioskAppTrustList_.size(), 1);
406 }
407 
408 /**
409  * @tc.name: GetkioskAppTrustList_0100
410  * @tc.desc: test GetkioskAppTrustList.
411  * @tc.type: FUNC
412  */
413 HWTEST_F(NotificationPreferencesInfoTest, GetkioskAppTrustList_0100, TestSize.Level1)
414 {
415     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
416     ASSERT_NE(preferencesInfo, nullptr);
417     std::vector<std::string> resultList;
418     auto ret = preferencesInfo->GetkioskAppTrustList(resultList);
419     ASSERT_EQ(ret, false);
420 
421     std::vector<std::string> kioskAppTrustList;
422     kioskAppTrustList.push_back("testBundleName");
423     preferencesInfo->SetkioskAppTrustList(kioskAppTrustList);
424     ASSERT_EQ(preferencesInfo->kioskAppTrustList_.size(), 1);
425 
426     ret = preferencesInfo->GetkioskAppTrustList(resultList);
427     ASSERT_EQ(ret, true);
428 }
429 
430 /**
431  * @tc.name: GetDisableNotificationInfo_0500
432  * @tc.desc: test GetDisableNotificationInfo.
433  * @tc.type: FUNC
434  */
435 HWTEST_F(NotificationPreferencesInfoTest, GetDisableNotificationInfo_0500, TestSize.Level1)
436 {
437     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
438     sptr<NotificationDisable> notificationDisable = new (std::nothrow) NotificationDisable();
439     notificationDisable->SetDisabled(true);
440     notificationDisable->SetBundleList({ "com.example.app" });
441     notificationDisable->SetUserId(101);
442     preferencesInfo->SetDisableNotificationInfo(notificationDisable);
443     NotificationDisable disable;
444     bool ret = preferencesInfo->GetUserDisableNotificationInfo(101, disable);
445     EXPECT_TRUE(ret);
446 }
447 
448 /**
449  * @tc.name: GetDisableNotificationInfo_0600
450  * @tc.desc: test GetDisableNotificationInfo.
451  * @tc.type: FUNC
452  */
453 HWTEST_F(NotificationPreferencesInfoTest, GetDisableNotificationInfo_0600, TestSize.Level1)
454 {
455     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
456     sptr<NotificationDisable> notificationDisable = new (std::nothrow) NotificationDisable();
457     notificationDisable->SetDisabled(false);
458     notificationDisable->SetBundleList({ "com.example.app" });
459     notificationDisable->SetUserId(101);
460     preferencesInfo->SetDisableNotificationInfo(notificationDisable);
461     NotificationDisable disable;
462     bool ret = preferencesInfo->GetUserDisableNotificationInfo(101, disable);
463     EXPECT_TRUE(ret);
464 }
465 
466 /**
467  * @tc.name: GetDisableNotificationInfo_0700
468  * @tc.desc: test GetDisableNotificationInfo.
469  * @tc.type: FUNC
470  */
471 HWTEST_F(NotificationPreferencesInfoTest, GetDisableNotificationInfo_0700, TestSize.Level1)
472 {
473     std::shared_ptr<NotificationPreferencesInfo> preferencesInfo = std::make_shared<NotificationPreferencesInfo>();
474     NotificationPreferencesInfo::DisableNotificationInfo disableNotificationInfo;
475     disableNotificationInfo.disabled = -1;
476     preferencesInfo->userDisableNotificationInfo_.insert_or_assign(101, disableNotificationInfo);
477     NotificationDisable disable;
478     bool ret = preferencesInfo->GetUserDisableNotificationInfo(101, disable);
479     EXPECT_FALSE(ret);
480     disableNotificationInfo.disabled = 1;
481     preferencesInfo->userDisableNotificationInfo_.insert_or_assign(101, disableNotificationInfo);
482     ret = preferencesInfo->GetUserDisableNotificationInfo(101, disable);
483     EXPECT_FALSE(ret);
484     ret = preferencesInfo->GetUserDisableNotificationInfo(102, disable);
485     EXPECT_FALSE(ret);
486     preferencesInfo->userDisableNotificationInfo_.clear();
487 }
488 }
489 }
490