• 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 "clouddisk_notify.h"
17 #include "clouddisk_notify_utils.h"
18 #include "clouddisk_rdbstore.h"
19 #include "dfs_error.h"
20 #include "ffrt_inner.h"
21 #include "file_column.h"
22 #include "securec.h"
23 #include "uri.h"
24 #include "utils_log.h"
25 
26 namespace OHOS::FileManagement::CloudDisk {
27 const string BUNDLENAME_FLAG = "<BundleName>";
28 const string CLOUDDISK_URI_PREFIX = "file://<BundleName>/data/storage/el2/cloud";
29 const string BACKFLASH = "/";
30 const string RECYCLE_BIN = ".trash";
31 constexpr uint32_t MAX_NOTIFY_LIST_SIZE = 32;
32 constexpr size_t MNOTIFY_TIME_INTERVAL = 500;
33 static pair<string, shared_ptr<CloudDiskRdbStore>> cacheRdbStore("", nullptr);
34 std::mutex cacheRdbMutex;
35 
GetInstance()36 CloudDiskNotify &CloudDiskNotify::GetInstance()
37 {
38     static CloudDiskNotify instance_;
39     return instance_;
40 }
41 
GetRdbStore(const string & bundleName,int32_t userId)42 static shared_ptr<CloudDiskRdbStore> GetRdbStore(const string &bundleName, int32_t userId)
43 {
44     std::lock_guard<std::mutex> lock(cacheRdbMutex);
45     string storeKey = bundleName + to_string(userId);
46     if (cacheRdbStore.first == storeKey) {
47         return cacheRdbStore.second;
48     }
49     cacheRdbStore.first = storeKey;
50     cacheRdbStore.second = make_shared<CloudDiskRdbStore>(bundleName, userId);
51     return cacheRdbStore.second;
52 }
53 
GetTrashNotifyData(const NotifyParamDisk & paramDisk,NotifyData & notifyData)54 static int32_t GetTrashNotifyData(const NotifyParamDisk &paramDisk, NotifyData &notifyData)
55 {
56     if (paramDisk.inoPtr == nullptr) {
57         return E_INVAL_ARG;
58     }
59     string realPrefix = CLOUDDISK_URI_PREFIX;
60     realPrefix.replace(CLOUDDISK_URI_PREFIX.find(BUNDLENAME_FLAG), BUNDLENAME_FLAG.length(),
61                        paramDisk.inoPtr->bundleName);
62     notifyData.uri = realPrefix + BACKFLASH + RECYCLE_BIN + BACKFLASH + paramDisk.inoPtr->fileName;
63     return E_OK;
64 }
65 
GetTrashNotifyData(const CacheNode & cacheNode,const ParamServiceOther & paramOthers,NotifyData & notifyData)66 static int32_t GetTrashNotifyData(const CacheNode &cacheNode, const ParamServiceOther &paramOthers,
67     NotifyData &notifyData)
68 {
69     string realPrefix = CLOUDDISK_URI_PREFIX;
70     realPrefix.replace(CLOUDDISK_URI_PREFIX.find(BUNDLENAME_FLAG), BUNDLENAME_FLAG.length(), paramOthers.bundleName);
71     notifyData.uri = realPrefix + BACKFLASH + RECYCLE_BIN + BACKFLASH + cacheNode.fileName;
72     return E_OK;
73 }
74 
TrashUriAddRowId(shared_ptr<CloudDiskRdbStore> rdbStore,const string & cloudId,string & uri)75 static int32_t TrashUriAddRowId(shared_ptr<CloudDiskRdbStore> rdbStore, const string &cloudId, string &uri)
76 {
77     int64_t rowId = 0;
78     int32_t ret = rdbStore->GetRowId(cloudId, rowId);
79     if (ret != E_OK) {
80         LOGE("Get rowId fail, ret: %{public}d", ret);
81         return ret;
82     }
83     uri = uri + "_" + std::to_string(rowId);
84     return E_OK;
85 }
86 
GetDataInner(const NotifyParamDisk & paramDisk,NotifyData & notifyData)87 static int32_t GetDataInner(const NotifyParamDisk &paramDisk, NotifyData &notifyData)
88 {
89     int32_t ret;
90     if (paramDisk.inoPtr != nullptr) {
91         ret = CloudDiskNotifyUtils::GetNotifyData(paramDisk.data, paramDisk.func,
92             paramDisk.inoPtr, notifyData);
93     } else {
94         ret = CloudDiskNotifyUtils::GetNotifyData(paramDisk.data, paramDisk.func,
95             paramDisk.ino, notifyData);
96     }
97     if (ret != E_OK) {
98         LOGI("GetNotifyData Not E_OK when GetDataInner ret = %{public}d", ret);
99     }
100     return ret;
101 }
102 
GetDataInnerWithName(const NotifyParamDisk & paramDisk,NotifyData & notifyData)103 static int32_t GetDataInnerWithName(const NotifyParamDisk &paramDisk, NotifyData &notifyData)
104 {
105     if (paramDisk.name.empty()) {
106         return E_INVAL_ARG;
107     }
108     int32_t ret;
109     if (paramDisk.inoPtr != nullptr) {
110         ret = CloudDiskNotifyUtils::GetNotifyData(paramDisk.data, paramDisk.func,
111             paramDisk.inoPtr, paramDisk.name, notifyData);
112     } else {
113         ret = CloudDiskNotifyUtils::GetNotifyData(paramDisk.data, paramDisk.func,
114             paramDisk.ino, paramDisk.name, notifyData);
115     }
116     if (ret != E_OK) {
117         LOGI("GetNotifyData Not E_OK when GetDataInnerWithName ret = %{public}d", ret);
118     }
119     return ret;
120 }
121 
HandleSetAttr(const NotifyParamDisk & paramDisk)122 static void HandleSetAttr(const NotifyParamDisk &paramDisk)
123 {
124     NotifyData notifyData;
125     if (GetDataInner(paramDisk, notifyData) != E_OK) {
126         return;
127     }
128     notifyData.type = NotifyType::NOTIFY_MODIFIED;
129     notifyData.isLocalOperation = true;
130     CloudDiskNotify::GetInstance().AddNotify(notifyData);
131 }
132 
HandleRecycleRestore(const NotifyParamDisk & paramDisk)133 static void HandleRecycleRestore(const NotifyParamDisk &paramDisk)
134 {
135     NotifyData trashNotifyData;
136     if (GetTrashNotifyData(paramDisk, trashNotifyData) != E_OK) {
137         LOGE("Get trash notify data fail");
138         return;
139     }
140     shared_ptr<CloudDiskRdbStore> rdbStore = GetRdbStore(paramDisk.inoPtr->bundleName, paramDisk.data->userId);
141     if (rdbStore == nullptr) {
142         LOGE("Get rdb store fail, bundleName: %{public}s", paramDisk.inoPtr->bundleName.c_str());
143         return;
144     }
145     if (TrashUriAddRowId(rdbStore, paramDisk.inoPtr->cloudId, trashNotifyData.uri) != E_OK) {
146         return;
147     }
148 
149     NotifyData originNotifyData;
150     if (GetDataInner(paramDisk, originNotifyData) != E_OK) {
151         LOGE("Get origin notify data fail");
152         return;
153     }
154 
155     NotifyData notifyData;
156     notifyData.type = NotifyType::NOTIFY_RENAMED;
157     notifyData.isDir = originNotifyData.isDir;
158 
159     if (paramDisk.opsType == NotifyOpsType::DAEMON_RECYCLE) {
160         notifyData.uri = trashNotifyData.uri;
161         notifyData.extraUri = originNotifyData.uri;
162     }
163     if (paramDisk.opsType == NotifyOpsType::DAEMON_RESTORE) {
164         notifyData.uri = originNotifyData.uri;
165         notifyData.extraUri = trashNotifyData.uri;
166     }
167     notifyData.isLocalOperation = true;
168     CloudDiskNotify::GetInstance().AddNotify(notifyData);
169 }
170 
HandleWrite(const NotifyParamDisk & paramDisk,const ParamDiskOthers & paramOthers)171 static void HandleWrite(const NotifyParamDisk &paramDisk, const ParamDiskOthers &paramOthers)
172 {
173     NotifyData notifyData;
174     if (GetDataInner(paramDisk, notifyData) != E_OK) {
175         return;
176     }
177 
178     if (paramOthers.dirtyType == static_cast<int32_t>(DirtyType::TYPE_NO_NEED_UPLOAD)) {
179         notifyData.type = NotifyType::NOTIFY_ADDED;
180     }
181     if (paramOthers.isWrite) {
182         notifyData.type = NotifyType::NOTIFY_FILE_CHANGED;
183     }
184     notifyData.isLocalOperation = true;
185     CloudDiskNotify::GetInstance().AddNotify(notifyData);
186 }
187 
HandleMkdir(const NotifyParamDisk & paramDisk)188 static void HandleMkdir(const NotifyParamDisk &paramDisk)
189 {
190     NotifyData notifyData;
191     if (GetDataInnerWithName(paramDisk, notifyData) != E_OK) {
192         return;
193     }
194     notifyData.type = NotifyType::NOTIFY_ADDED;
195     notifyData.isDir = true;
196     notifyData.isLocalOperation = true;
197     CloudDiskNotify::GetInstance().AddNotify(notifyData);
198 }
199 
HandleUnlink(const NotifyParamDisk & paramDisk)200 static void HandleUnlink(const NotifyParamDisk &paramDisk)
201 {
202     NotifyData notifyData;
203     if (GetDataInnerWithName(paramDisk, notifyData) != E_OK) {
204         return;
205     }
206     notifyData.type = NotifyType::NOTIFY_DELETED;
207     notifyData.isDir = paramDisk.opsType == NotifyOpsType::DAEMON_RMDIR;
208     notifyData.isLocalOperation = true;
209     CloudDiskNotify::GetInstance().AddNotify(notifyData);
210 }
211 
HandleRename(const NotifyParamDisk & paramDisk,const ParamDiskOthers & paramOthers)212 static void HandleRename(const NotifyParamDisk &paramDisk, const ParamDiskOthers &paramOthers)
213 {
214     NotifyData oldNotifyData;
215     NotifyData newNotifyData;
216     int32_t ret = CloudDiskNotifyUtils::GetNotifyData(paramDisk.data, paramDisk.func, paramDisk.ino,
217         paramDisk.name, oldNotifyData);
218     if (ret != E_OK) {
219         LOGE("get notify data fail, name: %{public}s", GetAnonyString(paramDisk.name).c_str());
220         return;
221     }
222     ret = CloudDiskNotifyUtils::GetNotifyData(paramDisk.data, paramDisk.func, paramDisk.newIno,
223         paramDisk.newName, newNotifyData);
224     if (ret != E_OK) {
225         LOGE("get new notify data fail, name: %{public}s", GetAnonyString(paramDisk.newName).c_str());
226         return;
227     }
228     NotifyData notifyData;
229     notifyData.uri = newNotifyData.uri;
230     notifyData.extraUri = oldNotifyData.uri;
231     notifyData.isDir = paramOthers.isDir;
232     notifyData.type = NotifyType::NOTIFY_RENAMED;
233     notifyData.isLocalOperation = true;
234     CloudDiskNotify::GetInstance().AddNotify(notifyData);
235 }
236 
TryNotify(const NotifyParamDisk & paramDisk,const ParamDiskOthers & paramOthers)237 void CloudDiskNotify::TryNotify(const NotifyParamDisk &paramDisk, const ParamDiskOthers &paramOthers)
238 {
239     switch (paramDisk.opsType) {
240         case NotifyOpsType::DAEMON_SETATTR:
241         case NotifyOpsType::DAEMON_SETXATTR:
242             HandleSetAttr(paramDisk);
243             break;
244         case NotifyOpsType::DAEMON_RECYCLE:
245         case NotifyOpsType::DAEMON_RESTORE:
246             HandleRecycleRestore(paramDisk);
247             break;
248         case NotifyOpsType::DAEMON_MKDIR:
249             HandleMkdir(paramDisk);
250             break;
251         case NotifyOpsType::DAEMON_RMDIR:
252         case NotifyOpsType::DAEMON_UNLINK:
253             HandleUnlink(paramDisk);
254             break;
255         case NotifyOpsType::DAEMON_RENAME:
256             HandleRename(paramDisk, paramOthers);
257             break;
258         case NotifyOpsType::DAEMON_WRITE:
259             HandleWrite(paramDisk, paramOthers);
260             break;
261         default:
262             LOGE("bad ops, opsType: %{public}d", paramDisk.opsType);
263             break;
264     }
265 }
266 
HandleInsert(const NotifyParamService & paramService,const ParamServiceOther & paramOthers)267 static void HandleInsert(const NotifyParamService &paramService, const ParamServiceOther &paramOthers)
268 {
269     shared_ptr<CloudDiskRdbStore> rdbStore = GetRdbStore(paramOthers.bundleName, paramOthers.userId);
270     if (rdbStore == nullptr) {
271         LOGE("Get rdb store fail, bundleName: %{public}s", paramOthers.bundleName.c_str());
272         return;
273     }
274     NotifyData notifyData;
275     int32_t ret;
276     if (paramService.node.isRecycled) {
277         ret = GetTrashNotifyData(paramService.node, paramOthers, notifyData);
278         if (TrashUriAddRowId(rdbStore, paramService.cloudId, notifyData.uri) != E_OK) {
279             return;
280         }
281         notifyData.isDir = paramService.node.isDir == TYPE_DIR_STR;
282     } else {
283         ret = rdbStore->GetNotifyData(paramService.node, notifyData);
284     }
285     if (ret == E_OK) {
286         notifyData.type = NotifyType::NOTIFY_ADDED;
287         CloudDiskNotify::GetInstance().AddNotify(notifyData);
288     } else {
289         LOGI("HandleInsert failed. ret = %{public}d", ret);
290     }
291 }
292 
HandleUpdate(const NotifyParamService & paramService,const ParamServiceOther & paramOthers)293 static void HandleUpdate(const NotifyParamService &paramService, const ParamServiceOther &paramOthers)
294 {
295     shared_ptr<CloudDiskRdbStore> rdbStore = GetRdbStore(paramOthers.bundleName, paramOthers.userId);
296     if (rdbStore == nullptr) {
297         LOGE("Get rdb store fail, bundleName: %{public}s", paramOthers.bundleName.c_str());
298         return;
299     }
300     NotifyData inNotifyData;
301     NotifyData notifyData;
302     CacheNode curNode{paramService.cloudId};
303     if (rdbStore->GetCurNode(paramService.cloudId, curNode) == E_OK &&
304         rdbStore->GetNotifyUri(curNode, notifyData.uri) == E_OK) {
305         notifyData.type = NotifyType::NOTIFY_MODIFIED;
306         notifyData.isDir = curNode.isDir == TYPE_DIR_STR;
307         if (paramService.notifyType == NotifyType::NOTIFY_NONE &&
308             rdbStore->GetNotifyData(paramService.node, inNotifyData) == E_OK) {
309             if (inNotifyData.uri != notifyData.uri) {
310                 notifyData.type = NotifyType::NOTIFY_DELETED;
311                 inNotifyData.type = NotifyType::NOTIFY_RENAMED;
312             }
313         }
314     }
315     CloudDiskNotify::GetInstance().AddNotify(notifyData);
316     CloudDiskNotify::GetInstance().AddNotify(inNotifyData);
317 }
318 
HandleUpdateRecycle(const NotifyParamService & paramService,const ParamServiceOther & paramOthers)319 static void HandleUpdateRecycle(const NotifyParamService &paramService, const ParamServiceOther &paramOthers)
320 {
321     shared_ptr<CloudDiskRdbStore> rdbStore = GetRdbStore(paramOthers.bundleName, paramOthers.userId);
322     if (rdbStore == nullptr) {
323         LOGE("Get rdb store fail, bundleName: %{public}s", paramOthers.bundleName.c_str());
324         return;
325     }
326     NotifyData trashNotifyData;
327     GetTrashNotifyData(paramService.node, paramOthers, trashNotifyData);
328     if (TrashUriAddRowId(rdbStore, paramService.cloudId, trashNotifyData.uri) != E_OK) {
329         return;
330     }
331 
332     NotifyData originNotifyData;
333     if (rdbStore->GetNotifyData(paramService.node, originNotifyData) != E_OK) {
334         LOGE("Get origin notify data fail");
335         return;
336     }
337     trashNotifyData.isDir = paramService.node.isDir == TYPE_DIR_STR;
338     originNotifyData.isDir = trashNotifyData.isDir;
339     if (paramService.node.isRecycled) {
340         trashNotifyData.type = NotifyType::NOTIFY_ADDED;
341         originNotifyData.type = NotifyType::NOTIFY_DELETED;
342     } else {
343         trashNotifyData.type = NotifyType::NOTIFY_DELETED;
344         originNotifyData.type = NotifyType::NOTIFY_ADDED;
345     }
346     CloudDiskNotify::GetInstance().AddNotify(trashNotifyData);
347     CloudDiskNotify::GetInstance().AddNotify(originNotifyData);
348 }
349 
HandleDelete(const NotifyParamService & paramService,const ParamServiceOther & paramOthers)350 static void HandleDelete(const NotifyParamService &paramService, const ParamServiceOther &paramOthers)
351 {
352     if (paramService.cloudId.empty()) {
353         NotifyData notifyData{"", false, NotifyType::NOTIFY_DELETED};
354         notifyData.uri = CLOUDDISK_URI_PREFIX;
355         notifyData.uri.replace(CLOUDDISK_URI_PREFIX.find(BUNDLENAME_FLAG), BUNDLENAME_FLAG.length(),
356                                paramOthers.bundleName);
357         notifyData.isDir = true;
358         CloudDiskNotify::GetInstance().AddNotify(notifyData);
359     } else {
360         for (auto notifyData : (paramOthers.notifyDataList)) {
361             CloudDiskNotify::GetInstance().AddNotify(notifyData);
362         }
363     }
364 }
365 
HandleDeleteBatch(const NotifyParamService & paramService,const ParamServiceOther & paramOthers)366 static void HandleDeleteBatch(const NotifyParamService &paramService, const ParamServiceOther &paramOthers)
367 {
368     for (auto notifyData : (paramOthers.notifyDataList)) {
369         CloudDiskNotify::GetInstance().AddNotify(notifyData);
370     }
371 }
372 
TryNotifyService(const NotifyParamService & paramService,const ParamServiceOther & paramOthers)373 void CloudDiskNotify::TryNotifyService(const NotifyParamService &paramService, const ParamServiceOther &paramOthers)
374 {
375     switch (paramService.opsType) {
376         case NotifyOpsType::SERVICE_INSERT:
377             HandleInsert(paramService, paramOthers);
378             break;
379         case NotifyOpsType::SERVICE_UPDATE:
380             HandleUpdate(paramService, paramOthers);
381             break;
382         case NotifyOpsType::SERVICE_UPDATE_RECYCLE:
383             HandleUpdateRecycle(paramService, paramOthers);
384             break;
385         case NotifyOpsType::SERVICE_DELETE:
386             HandleDelete(paramService, paramOthers);
387             break;
388         case NotifyOpsType::SERVICE_DELETE_BATCH:
389             HandleDeleteBatch(paramService, paramOthers);
390             break;
391         default:
392             LOGE("bad ops, opsType: %{public}d", paramService.opsType);
393             break;
394     }
395 }
396 
GetDeleteNotifyData(const vector<NativeRdb::ValueObject> & deleteIds,vector<NotifyData> & notifyDataList,const ParamServiceOther & paramOthers)397 int32_t CloudDiskNotify::GetDeleteNotifyData(const vector<NativeRdb::ValueObject> &deleteIds,
398                                              vector<NotifyData> &notifyDataList,
399                                              const ParamServiceOther &paramOthers)
400 {
401     shared_ptr<CloudDiskRdbStore> rdbStore = GetRdbStore(paramOthers.bundleName, paramOthers.userId);
402     if (rdbStore == nullptr) {
403         LOGE("Get rdb store fail, bundleName: %{public}s", paramOthers.bundleName.c_str());
404         return E_RDB;
405     }
406     for (auto deleteId : deleteIds) {
407         NotifyData notifyData{"", false, NotifyType::NOTIFY_DELETED};
408         string cloudId = static_cast<string>(deleteId);
409         CacheNode curNode{cloudId};
410         if (rdbStore->GetCurNode(cloudId, curNode) == E_OK && rdbStore->GetNotifyUri(curNode, notifyData.uri) == E_OK) {
411             notifyData.isDir = curNode.isDir == TYPE_DIR_STR;
412             notifyDataList.push_back(notifyData);
413         }
414     }
415     return E_OK;
416 }
417 
AddNotify(const NotifyData & notifyData)418 void CloudDiskNotify::AddNotify(const NotifyData &notifyData)
419 {
420     LOGD("push cur notify into list type: %{public}d, uri: %{public}s, isDir: %{public}d", notifyData.type,
421          GetAnonyString(notifyData.uri).c_str(), notifyData.isDir);
422     if (notifyData.type == NotifyType::NOTIFY_NONE) {
423         return;
424     }
425 
426     auto notifyFunc = [notifyData] {
427         auto obsMgrClient = AAFwk::DataObsMgrClient::GetInstance();
428         if (obsMgrClient == nullptr) {
429             LOGE("obsMgrClient is null");
430             return;
431         }
432         Parcel parcel;
433         parcel.WriteUint32(1);
434         parcel.WriteBool(notifyData.isDir);
435         parcel.WriteBool(notifyData.isLocalOperation);
436         parcel.WriteString(notifyData.extraUri);
437         uintptr_t buf = parcel.GetData();
438         if (parcel.GetDataSize() == 0) {
439             LOGE("parcel.getDataSize fail");
440             return;
441         }
442 
443         auto *uBuf = new (std::nothrow) uint8_t[parcel.GetDataSize()];
444         if (uBuf == nullptr) {
445             return;
446         }
447         int32_t ret = memcpy_s(uBuf, parcel.GetDataSize(), reinterpret_cast<uint8_t *>(buf), parcel.GetDataSize());
448         if (ret != 0) {
449             LOGE("Parcel Data copy failed, err: %{public}d", ret);
450             delete[] uBuf;
451             return;
452         }
453         ChangeInfo changeInfo({static_cast<ChangeInfo::ChangeType>(notifyData.type), {Uri(notifyData.uri)}, uBuf,
454                                parcel.GetDataSize()});
455         obsMgrClient->NotifyChangeExt(changeInfo);
456         delete[] uBuf;
457     };
458     ffrt::thread(notifyFunc).detach();
459 }
460 
NotifyChangeOuter()461 void CloudDiskNotify::NotifyChangeOuter()
462 {
463     LOGD("Start Notify Outer");
464     list<CacheNotifyInfo> tmpNfList_;
465     {
466         lock_guard<mutex> lock(mutex_);
467         if (nfList_.empty()) {
468             return;
469         }
470         nfList_.swap(tmpNfList_);
471         nfList_.clear();
472     }
473 
474     auto obsMgrClient = AAFwk::DataObsMgrClient::GetInstance();
475     if (obsMgrClient == nullptr) {
476         LOGE("obsMgrClient is null");
477         return;
478     }
479     for (auto cacheNode = tmpNfList_.begin(); cacheNode != tmpNfList_.end(); ++cacheNode) {
480         Parcel parcel;
481         parcel.WriteUint32(static_cast<uint32_t>(cacheNode->isDirList.size()));
482         for (auto isDir = cacheNode->isDirList.begin(); isDir != cacheNode->isDirList.end(); ++isDir) {
483             parcel.WriteBool(*isDir);
484         }
485         uintptr_t buf = parcel.GetData();
486         if (parcel.GetDataSize() == 0) {
487             LOGE("parcel.getDataSize fail");
488             return;
489         }
490 
491         auto *uBuf = new (std::nothrow) uint8_t[parcel.GetDataSize()];
492         if (uBuf == nullptr) {
493             return;
494         }
495         int32_t ret = memcpy_s(uBuf, parcel.GetDataSize(), reinterpret_cast<uint8_t *>(buf), parcel.GetDataSize());
496         if (ret != 0) {
497             LOGE("Parcel Data copy failed, err: %{public}d", ret);
498             delete[] uBuf;
499             return;
500         }
501         ChangeInfo changeInfo({static_cast<ChangeInfo::ChangeType>(cacheNode->notifyType), cacheNode->uriList, uBuf,
502                                parcel.GetDataSize()});
503         obsMgrClient->NotifyChangeExt(changeInfo);
504         delete[] uBuf;
505     }
506 }
507 } // namespace OHOS::FileManagement::CloudDisk
508