1 /*
2 * Copyright (c) 2022 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 #define LOG_TAG "RdbServiceStub"
17
18 #include "rdb_service_stub.h"
19
20 #include <ipc_skeleton.h>
21
22 #include "itypes_util.h"
23 #include "log_print.h"
24 #include "rdb_result_set_stub.h"
25 #include "utils/anonymous.h"
26
27 namespace OHOS::DistributedRdb {
28 using Anonymous = DistributedData::Anonymous;
OnRemoteObtainDistributedTableName(MessageParcel & data,MessageParcel & reply)29 int32_t RdbServiceStub::OnRemoteObtainDistributedTableName(MessageParcel &data, MessageParcel &reply)
30 {
31 std::string device;
32 std::string table;
33 if (!ITypesUtil::Unmarshal(data, device, table)) {
34 ZLOGE("Unmarshal device:%{public}s table:%{public}s", Anonymous::Change(device).c_str(), table.c_str());
35 return IPC_STUB_INVALID_DATA_ERR;
36 }
37
38 std::string distributedTableName = ObtainDistributedTableName(device, table);
39 if (!ITypesUtil::Marshal(reply, distributedTableName)) {
40 ZLOGE("Marshal distributedTableName:%{public}s", distributedTableName.c_str());
41 return IPC_STUB_WRITE_PARCEL_ERR;
42 }
43 return RDB_OK;
44 }
45
OnBeforeOpen(MessageParcel & data,MessageParcel & reply)46 int32_t RdbServiceStub::OnBeforeOpen(MessageParcel &data, MessageParcel &reply)
47 {
48 RdbSyncerParam param;
49 if (!ITypesUtil::Unmarshal(data, param)) {
50 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
51 Anonymous::Change(param.storeName_).c_str());
52 return IPC_STUB_INVALID_DATA_ERR;
53 }
54 auto status = BeforeOpen(param);
55 if (!ITypesUtil::Marshal(reply, status, param)) {
56 ZLOGE("Marshal status:0x%{public}x", status);
57 return IPC_STUB_WRITE_PARCEL_ERR;
58 }
59 return RDB_OK;
60 }
61
OnAfterOpen(MessageParcel & data,MessageParcel & reply)62 int32_t RdbServiceStub::OnAfterOpen(MessageParcel &data, MessageParcel &reply)
63 {
64 RdbSyncerParam param;
65 if (!ITypesUtil::Unmarshal(data, param)) {
66 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
67 Anonymous::Change(param.storeName_).c_str());
68 return IPC_STUB_INVALID_DATA_ERR;
69 }
70 auto status = AfterOpen(param);
71 if (!ITypesUtil::Marshal(reply, status)) {
72 ZLOGE("Marshal status:0x%{public}x", status);
73 return IPC_STUB_WRITE_PARCEL_ERR;
74 }
75 return RDB_OK;
76 }
77
OnReportStatistic(MessageParcel & data,MessageParcel & reply)78 int32_t RdbServiceStub::OnReportStatistic(MessageParcel& data, MessageParcel& reply)
79 {
80 RdbSyncerParam param;
81 RdbStatEvent statEvent;
82 if (!ITypesUtil::Unmarshal(data, param, statEvent)) {
83 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
84 Anonymous::Change(param.storeName_).c_str());
85 return IPC_STUB_INVALID_DATA_ERR;
86 }
87 auto status = ReportStatistic(param, statEvent);
88 if (!ITypesUtil::Marshal(reply, status)) {
89 ZLOGE("Marshal status:0x%{public}x", status);
90 return IPC_STUB_WRITE_PARCEL_ERR;
91 }
92 return RDB_OK;
93 }
94
OnDelete(MessageParcel & data,MessageParcel & reply)95 int32_t RdbServiceStub::OnDelete(MessageParcel &data, MessageParcel &reply)
96 {
97 RdbSyncerParam param;
98 if (!ITypesUtil::Unmarshal(data, param)) {
99 ZLOGE("Unmarshal storeName_:%{public}s", Anonymous::Change(param.storeName_).c_str());
100 return IPC_STUB_INVALID_DATA_ERR;
101 }
102 auto status = Delete(param);
103 if (!ITypesUtil::Marshal(reply, status)) {
104 ZLOGE("Marshal status:0x%{public}x", status);
105 return IPC_STUB_WRITE_PARCEL_ERR;
106 }
107 return RDB_OK;
108 }
109
OnRemoteInitNotifier(MessageParcel & data,MessageParcel & reply)110 int32_t RdbServiceStub::OnRemoteInitNotifier(MessageParcel &data, MessageParcel &reply)
111 {
112 RdbSyncerParam param;
113 sptr<IRemoteObject> notifier;
114 if (!ITypesUtil::Unmarshal(data, param, notifier) || notifier == nullptr) {
115 ZLOGE("Unmarshal bundleName:%{public}s storeName_:%{public}s notifier is nullptr:%{public}d",
116 param.bundleName_.c_str(), Anonymous::Change(param.storeName_).c_str(), notifier == nullptr);
117 return IPC_STUB_INVALID_DATA_ERR;
118 }
119 auto status = InitNotifier(param, notifier);
120 if (!ITypesUtil::Marshal(reply, status)) {
121 ZLOGE("Marshal status:0x%{public}x", status);
122 return IPC_STUB_WRITE_PARCEL_ERR;
123 }
124 return RDB_OK;
125 }
126
OnRemoteSetDistributedTables(MessageParcel & data,MessageParcel & reply)127 int32_t RdbServiceStub::OnRemoteSetDistributedTables(MessageParcel &data, MessageParcel &reply)
128 {
129 RdbSyncerParam param;
130 std::vector<std::string> tables;
131 std::vector<Reference> references;
132 int32_t type;
133 bool isRebuild;
134 if (!ITypesUtil::Unmarshal(data, param, tables, references, type, isRebuild)) {
135 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s tables size:%{public}zu type:%{public}d",
136 param.bundleName_.c_str(), Anonymous::Change(param.storeName_).c_str(), tables.size(), type);
137 return IPC_STUB_INVALID_DATA_ERR;
138 }
139
140 auto status = SetDistributedTables(param, tables, references, isRebuild, type);
141 if (!ITypesUtil::Marshal(reply, status)) {
142 ZLOGE("Marshal status:0x%{public}x", status);
143 return IPC_STUB_WRITE_PARCEL_ERR;
144 }
145 return RDB_OK;
146 }
147
OnRemoteDoSync(MessageParcel & data,MessageParcel & reply)148 int32_t RdbServiceStub::OnRemoteDoSync(MessageParcel &data, MessageParcel &reply)
149 {
150 RdbSyncerParam param;
151 Option option {};
152 PredicatesMemo predicates;
153 if (!ITypesUtil::Unmarshal(data, param, option, predicates)) {
154 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s tables:%{public}zu", param.bundleName_.c_str(),
155 Anonymous::Change(param.storeName_).c_str(), predicates.tables_.size());
156 return IPC_STUB_INVALID_DATA_ERR;
157 }
158
159 Details result = {};
160 auto status = Sync(param, option, predicates, [&result](Details &&details) { result = std::move(details); });
161 if (!ITypesUtil::Marshal(reply, status, result)) {
162 ZLOGE("Marshal status:0x%{public}x result size:%{public}zu", status, result.size());
163 return IPC_STUB_WRITE_PARCEL_ERR;
164 }
165 return RDB_OK;
166 }
167
OnRemoteDoAsync(MessageParcel & data,MessageParcel & reply)168 int32_t RdbServiceStub::OnRemoteDoAsync(MessageParcel &data, MessageParcel &reply)
169 {
170 RdbSyncerParam param;
171 Option option {};
172 PredicatesMemo predicates;
173 if (!ITypesUtil::Unmarshal(data, param, option, predicates)) {
174 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s seqNum:%{public}u table:%{public}s",
175 param.bundleName_.c_str(), Anonymous::Change(param.storeName_).c_str(), option.seqNum,
176 predicates.tables_.empty() ? "null" : predicates.tables_.begin()->c_str());
177 return IPC_STUB_INVALID_DATA_ERR;
178 }
179 auto status = Sync(param, option, predicates, nullptr);
180 if (!ITypesUtil::Marshal(reply, status)) {
181 ZLOGE("Marshal status:0x%{public}x", status);
182 return IPC_STUB_WRITE_PARCEL_ERR;
183 }
184 return RDB_OK;
185 }
186
OnRemoteDoSubscribe(MessageParcel & data,MessageParcel & reply)187 int32_t RdbServiceStub::OnRemoteDoSubscribe(MessageParcel &data, MessageParcel &reply)
188 {
189 RdbSyncerParam param;
190 SubscribeOption option;
191 if (!ITypesUtil::Unmarshal(data, param, option)) {
192 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
193 Anonymous::Change(param.storeName_).c_str());
194 return IPC_STUB_INVALID_DATA_ERR;
195 }
196
197 auto status = Subscribe(param, option, nullptr);
198 if (!ITypesUtil::Marshal(reply, status)) {
199 ZLOGE("Marshal status:0x%{public}x", status);
200 return IPC_STUB_WRITE_PARCEL_ERR;
201 }
202 return RDB_OK;
203 }
204
OnRemoteDoUnSubscribe(MessageParcel & data,MessageParcel & reply)205 int32_t RdbServiceStub::OnRemoteDoUnSubscribe(MessageParcel &data, MessageParcel &reply)
206 {
207 RdbSyncerParam param;
208 SubscribeOption option;
209 if (!ITypesUtil::Unmarshal(data, param, option)) {
210 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
211 Anonymous::Change(param.storeName_).c_str());
212 return IPC_STUB_INVALID_DATA_ERR;
213 }
214
215 auto status = UnSubscribe(param, option, nullptr);
216 if (!ITypesUtil::Marshal(reply, status)) {
217 ZLOGE("Marshal status:0x%{public}x", status);
218 return IPC_STUB_WRITE_PARCEL_ERR;
219 }
220 return RDB_OK;
221 }
222
OnRemoteDoRemoteQuery(MessageParcel & data,MessageParcel & reply)223 int32_t RdbServiceStub::OnRemoteDoRemoteQuery(MessageParcel& data, MessageParcel& reply)
224 {
225 RdbSyncerParam param;
226 std::string device;
227 std::string sql;
228 std::vector<std::string> selectionArgs;
229 if (!ITypesUtil::Unmarshal(data, param, device, sql, selectionArgs)) {
230 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s device:%{public}s sql:%{public}s "
231 "selectionArgs size:%{public}zu", param.bundleName_.c_str(),
232 Anonymous::Change(param.storeName_).c_str(), Anonymous::Change(device).c_str(),
233 Anonymous::Change(sql).c_str(), selectionArgs.size());
234 return IPC_STUB_INVALID_DATA_ERR;
235 }
236
237 auto [status, resultSet] = RemoteQuery(param, device, sql, selectionArgs);
238 sptr<RdbResultSetStub> object = new(std::nothrow) RdbResultSetStub(resultSet);
239 if (object == nullptr) {
240 ZLOGE("Failed to create RdbResultSetStub object.bundleName:%{public}s storeName:%{public}s",
241 param.bundleName_.c_str(), Anonymous::Change(param.storeName_).c_str());
242 return ERR_NULL_OBJECT;
243 }
244 if (!ITypesUtil::Marshal(reply, status, object->AsObject())) {
245 ZLOGE("Marshal status:0x%{public}x", status);
246 return IPC_STUB_WRITE_PARCEL_ERR;
247 }
248 return RDB_OK;
249 }
250
CheckInterfaceToken(MessageParcel & data)251 bool RdbServiceStub::CheckInterfaceToken(MessageParcel& data)
252 {
253 auto localDescriptor = GetDescriptor();
254 auto remoteDescriptor = data.ReadInterfaceToken();
255 if (remoteDescriptor != localDescriptor) {
256 ZLOGE("interface token is not equal");
257 return false;
258 }
259 return true;
260 }
261
OnRemoteRequest(uint32_t code,MessageParcel & data,MessageParcel & reply)262 int RdbServiceStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply)
263 {
264 ZLOGI("code:%{public}u, callingPid:%{public}d", code, IPCSkeleton::GetCallingPid());
265 if (!CheckInterfaceToken(data)) {
266 return RDB_ERROR;
267 }
268 if (code >= 0 && code < static_cast<uint32_t>(RdbServiceCode::RDB_SERVICE_CMD_MAX)) {
269 return (this->*HANDLERS[code])(data, reply);
270 }
271 return RDB_ERROR;
272 }
273
OnRemoteRegisterDetailProgressObserver(MessageParcel & data,MessageParcel & reply)274 int32_t RdbServiceStub::OnRemoteRegisterDetailProgressObserver(MessageParcel& data, MessageParcel& reply)
275 {
276 RdbSyncerParam param;
277 if (!ITypesUtil::Unmarshal(data, param)) {
278 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
279 Anonymous::Change(param.storeName_).c_str());
280 return IPC_STUB_INVALID_DATA_ERR;
281 }
282
283 auto status = RegisterAutoSyncCallback(param, nullptr);
284 if (!ITypesUtil::Marshal(reply, status)) {
285 ZLOGE("Marshal status:0x%{public}x", status);
286 return IPC_STUB_WRITE_PARCEL_ERR;
287 }
288 return RDB_OK;
289 }
290
OnRemoteUnregisterDetailProgressObserver(MessageParcel & data,MessageParcel & reply)291 int32_t RdbServiceStub::OnRemoteUnregisterDetailProgressObserver(MessageParcel& data, MessageParcel& reply)
292 {
293 RdbSyncerParam param;
294 if (!ITypesUtil::Unmarshal(data, param)) {
295 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
296 Anonymous::Change(param.storeName_).c_str());
297 return IPC_STUB_INVALID_DATA_ERR;
298 }
299
300 auto status = UnregisterAutoSyncCallback(param, nullptr);
301 if (!ITypesUtil::Marshal(reply, status)) {
302 ZLOGE("Marshal status:0x%{public}x", status);
303 return IPC_STUB_WRITE_PARCEL_ERR;
304 }
305 return RDB_OK;
306 }
307
OnRemoteNotifyDataChange(MessageParcel & data,MessageParcel & reply)308 int32_t RdbServiceStub::OnRemoteNotifyDataChange(MessageParcel &data, MessageParcel &reply)
309 {
310 RdbSyncerParam param;
311 RdbChangedData rdbChangedData;
312 RdbNotifyConfig rdbNotifyConfig;
313 if (!ITypesUtil::Unmarshal(data, param, rdbChangedData, rdbNotifyConfig)) {
314 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s ", param.bundleName_.c_str(),
315 Anonymous::Change(param.storeName_).c_str());
316 return IPC_STUB_INVALID_DATA_ERR;
317 }
318
319 auto status = NotifyDataChange(param, rdbChangedData, rdbNotifyConfig);
320 if (!ITypesUtil::Marshal(reply, status)) {
321 ZLOGE("Marshal status:0x%{public}x", status);
322 return IPC_STUB_WRITE_PARCEL_ERR;
323 }
324 return RDB_OK;
325 }
326
OnRemoteSetSearchable(MessageParcel & data,MessageParcel & reply)327 int32_t RdbServiceStub::OnRemoteSetSearchable(MessageParcel &data, MessageParcel &reply)
328 {
329 RdbSyncerParam param;
330 bool isSearchable = true;
331 if (!ITypesUtil::Unmarshal(data, param, isSearchable)) {
332 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s ", param.bundleName_.c_str(),
333 Anonymous::Change(param.storeName_).c_str());
334 return IPC_STUB_INVALID_DATA_ERR;
335 }
336
337 auto status = SetSearchable(param, isSearchable);
338 if (!ITypesUtil::Marshal(reply, status)) {
339 ZLOGE("Marshal status:0x%{public}x", status);
340 return IPC_STUB_WRITE_PARCEL_ERR;
341 }
342 return RDB_OK;
343 }
344
OnRemoteQuerySharingResource(MessageParcel & data,MessageParcel & reply)345 int32_t RdbServiceStub::OnRemoteQuerySharingResource(MessageParcel& data, MessageParcel& reply)
346 {
347 RdbSyncerParam param;
348 PredicatesMemo predicates;
349 std::vector<std::string> columns;
350 if (!ITypesUtil::Unmarshal(data, param, predicates, columns)) {
351 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
352 Anonymous::Change(param.storeName_).c_str());
353 return IPC_STUB_INVALID_DATA_ERR;
354 }
355
356 auto [status, resultSet] = QuerySharingResource(param, predicates, columns);
357 sptr<RdbResultSetStub> object = new(std::nothrow) RdbResultSetStub(resultSet);
358 if (object == nullptr) {
359 ZLOGE("Failed to create RdbResultSetStub object.bundleName:%{public}s storeName:%{public}s",
360 param.bundleName_.c_str(), Anonymous::Change(param.storeName_).c_str());
361 return ERR_NULL_OBJECT;
362 }
363 if (!ITypesUtil::Marshal(reply, status, object->AsObject())) {
364 ZLOGE("Marshal status:0x%{public}x", status);
365 return IPC_STUB_WRITE_PARCEL_ERR;
366 }
367 return RDB_OK;
368 }
369
OnDisable(MessageParcel & data,MessageParcel & reply)370 int32_t RdbServiceStub::OnDisable(MessageParcel& data, MessageParcel& reply)
371 {
372 RdbSyncerParam param;
373 if (!ITypesUtil::Unmarshal(data, param)) {
374 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
375 Anonymous::Change(param.storeName_).c_str());
376 return IPC_STUB_INVALID_DATA_ERR;
377 }
378
379 auto status = Disable(param);
380 if (!ITypesUtil::Marshal(reply, status)) {
381 ZLOGE("Marshal status:0x%{public}x", status);
382 return IPC_STUB_WRITE_PARCEL_ERR;
383 }
384 return RDB_OK;
385 }
386
OnEnable(MessageParcel & data,MessageParcel & reply)387 int32_t RdbServiceStub::OnEnable(MessageParcel& data, MessageParcel& reply)
388 {
389 RdbSyncerParam param;
390 if (!ITypesUtil::Unmarshal(data, param)) {
391 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
392 Anonymous::Change(param.storeName_).c_str());
393 return IPC_STUB_INVALID_DATA_ERR;
394 }
395
396 auto status = Enable(param);
397 if (!ITypesUtil::Marshal(reply, status)) {
398 ZLOGE("Marshal status:0x%{public}x", status);
399 return IPC_STUB_WRITE_PARCEL_ERR;
400 }
401 return RDB_OK;
402 }
403
OnGetPassword(MessageParcel & data,MessageParcel & reply)404 int32_t RdbServiceStub::OnGetPassword(MessageParcel &data, MessageParcel &reply)
405 {
406 RdbSyncerParam param;
407 if (!ITypesUtil::Unmarshal(data, param)) {
408 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
409 Anonymous::Change(param.storeName_).c_str());
410 return IPC_STUB_INVALID_DATA_ERR;
411 }
412
413 std::vector<std::vector<uint8_t>> keys;
414 auto status = GetPassword(param, keys);
415 if (!ITypesUtil::Marshal(reply, status, keys)) {
416 for (auto &key : keys) {
417 key.assign(key.size(), 0);
418 }
419 ZLOGE("Marshal status:0x%{public}x", status);
420 return IPC_STUB_WRITE_PARCEL_ERR;
421 }
422 for (auto &key : keys) {
423 key.assign(key.size(), 0);
424 }
425 return RDB_OK;
426 }
427
OnLockCloudContainer(MessageParcel & data,MessageParcel & reply)428 int32_t RdbServiceStub::OnLockCloudContainer(MessageParcel &data, MessageParcel &reply)
429 {
430 RdbSyncerParam param;
431 uint32_t expiredTime = 0;
432 if (!ITypesUtil::Unmarshal(data, param, expiredTime)) {
433 ZLOGE("Unmarshal failed");
434 return IPC_STUB_INVALID_DATA_ERR;
435 }
436
437 auto result = LockCloudContainer(param);
438 return ITypesUtil::Marshal(reply, result.first, result.second) ? RDB_OK : IPC_STUB_WRITE_PARCEL_ERR;
439 }
440
OnUnlockCloudContainer(MessageParcel & data,MessageParcel & reply)441 int32_t RdbServiceStub::OnUnlockCloudContainer(MessageParcel &data, MessageParcel &reply)
442 {
443 RdbSyncerParam param;
444 if (!ITypesUtil::Unmarshal(data, param)) {
445 ZLOGE("Unmarshal failed");
446 return IPC_STUB_INVALID_DATA_ERR;
447 }
448
449 auto status = UnlockCloudContainer(param);
450 if (!ITypesUtil::Marshal(reply, status)) {
451 ZLOGE("Marshal status:0x%{public}x", status);
452 return IPC_STUB_WRITE_PARCEL_ERR;
453 }
454 return RDB_OK;
455 }
456
OnGetDebugInfo(MessageParcel & data,MessageParcel & reply)457 int32_t RdbServiceStub::OnGetDebugInfo(MessageParcel &data, MessageParcel &reply)
458 {
459 RdbSyncerParam param;
460 if (!ITypesUtil::Unmarshal(data, param)) {
461 ZLOGE("Unmarshal failed");
462 return IPC_STUB_INVALID_DATA_ERR;
463 }
464 std::map<std::string, RdbDebugInfo> debugInfo;
465 auto status = GetDebugInfo(param, debugInfo);
466 if (!ITypesUtil::Marshal(reply, status, debugInfo)) {
467 ZLOGE("Marshal status:0x%{public}x", status);
468 return IPC_STUB_WRITE_PARCEL_ERR;
469 }
470 return RDB_OK;
471 }
472
OnGetDfxInfo(MessageParcel & data,MessageParcel & reply)473 int32_t RdbServiceStub::OnGetDfxInfo(MessageParcel &data, MessageParcel &reply)
474 {
475 RdbSyncerParam param;
476 if (!ITypesUtil::Unmarshal(data, param)) {
477 ZLOGE("Unmarshal failed");
478 return IPC_STUB_INVALID_DATA_ERR;
479 }
480 RdbDfxInfo dfxInfo;
481 auto status = GetDfxInfo(param, dfxInfo);
482 if (!ITypesUtil::Marshal(reply, status, dfxInfo)) {
483 ZLOGE("Marshal status:0x%{public}x", status);
484 return IPC_STUB_WRITE_PARCEL_ERR;
485 }
486 return RDB_OK;
487 }
488
OnVerifyPromiseInfo(MessageParcel & data,MessageParcel & reply)489 int32_t RdbServiceStub::OnVerifyPromiseInfo(MessageParcel &data, MessageParcel &reply)
490 {
491 RdbSyncerParam param;
492 if (!ITypesUtil::Unmarshal(data, param)) {
493 ZLOGE("Unmarshal bundleName_:%{public}s storeName_:%{public}s", param.bundleName_.c_str(),
494 Anonymous::Change(param.storeName_).c_str());
495 return IPC_STUB_INVALID_DATA_ERR;
496 }
497 auto status = VerifyPromiseInfo(param);
498 if (!ITypesUtil::Marshal(reply, status)) {
499 ZLOGE("Marshal status:0x%{public}x", status);
500 return IPC_STUB_WRITE_PARCEL_ERR;
501 }
502 return RDB_OK;
503 }
504 } // namespace OHOS::DistributedRdb
505