• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2023 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 <if_system_ability_manager.h>
17 #include <ipc_skeleton.h>
18 #include <iservice_registry.h>
19 #include <chrono>
20 
21 #include "file_uri.h"
22 #include "hiview_adapter.h"
23 #include "hitrace_meter.h"
24 #include "pasteboard_client.h"
25 #include "pasteboard_error.h"
26 #include "pasteboard_load_callback.h"
27 #include "pasteboard_observer.h"
28 #include "string_ex.h"
29 #include "system_ability_definition.h"
30 #include "pasteboard_web_controller.h"
31 
32 using namespace OHOS::Media;
33 
34 namespace OHOS {
35 namespace MiscServices {
36 constexpr const int32_t HITRACE_GETPASTEDATA = 0;
37 constexpr int32_t LOADSA_TIMEOUT_MS = 10000;
38 sptr<IPasteboardService> PasteboardClient::pasteboardServiceProxy_;
39 PasteboardClient::StaticDestoryMonitor PasteboardClient::staticDestoryMonitor_;
40 std::mutex PasteboardClient::instanceLock_;
41 std::condition_variable PasteboardClient::proxyConVar_;
PasteboardClient()42 PasteboardClient::PasteboardClient(){};
~PasteboardClient()43 PasteboardClient::~PasteboardClient()
44 {
45     if (pasteboardServiceProxy_ != nullptr && !staticDestoryMonitor_.IsDestoryed()) {
46         auto remoteObject = pasteboardServiceProxy_->AsObject();
47         if (remoteObject != nullptr) {
48             remoteObject->RemoveDeathRecipient(deathRecipient_);
49         }
50     }
51 }
52 
CreateHtmlTextRecord(const std::string & htmlText)53 std::shared_ptr<PasteDataRecord> PasteboardClient::CreateHtmlTextRecord(const std::string &htmlText)
54 {
55     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New text record");
56     return PasteDataRecord::NewHtmlRecord(htmlText);
57 }
58 
CreateWantRecord(std::shared_ptr<OHOS::AAFwk::Want> want)59 std::shared_ptr<PasteDataRecord> PasteboardClient::CreateWantRecord(std::shared_ptr<OHOS::AAFwk::Want> want)
60 {
61     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New want record");
62     return PasteDataRecord::NewWantRecord(std::move(want));
63 }
64 
CreatePlainTextRecord(const std::string & text)65 std::shared_ptr<PasteDataRecord> PasteboardClient::CreatePlainTextRecord(const std::string &text)
66 {
67     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New text record");
68     return PasteDataRecord::NewPlaintTextRecord(text);
69 }
70 
CreatePixelMapRecord(std::shared_ptr<PixelMap> pixelMap)71 std::shared_ptr<PasteDataRecord> PasteboardClient::CreatePixelMapRecord(std::shared_ptr<PixelMap> pixelMap)
72 {
73     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New pixelMap record");
74     return PasteDataRecord::NewPixelMapRecord(std::move(pixelMap));
75 }
76 
CreateUriRecord(const OHOS::Uri & uri)77 std::shared_ptr<PasteDataRecord> PasteboardClient::CreateUriRecord(const OHOS::Uri &uri)
78 {
79     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New uri record");
80     return PasteDataRecord::NewUriRecord(uri);
81 }
82 
CreateKvRecord(const std::string & mimeType,const std::vector<uint8_t> & arrayBuffer)83 std::shared_ptr<PasteDataRecord> PasteboardClient::CreateKvRecord(
84     const std::string &mimeType, const std::vector<uint8_t> &arrayBuffer)
85 {
86     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New kv record");
87     return PasteDataRecord::NewKvRecord(mimeType, arrayBuffer);
88 }
89 
CreateHtmlData(const std::string & htmlText)90 std::shared_ptr<PasteData> PasteboardClient::CreateHtmlData(const std::string &htmlText)
91 {
92     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New htmlText data");
93     auto pasteData = std::make_shared<PasteData>();
94     pasteData->AddHtmlRecord(htmlText);
95     return pasteData;
96 }
97 
CreateWantData(std::shared_ptr<OHOS::AAFwk::Want> want)98 std::shared_ptr<PasteData> PasteboardClient::CreateWantData(std::shared_ptr<OHOS::AAFwk::Want> want)
99 {
100     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New want data");
101     auto pasteData = std::make_shared<PasteData>();
102     pasteData->AddWantRecord(std::move(want));
103     return pasteData;
104 }
105 
CreatePlainTextData(const std::string & text)106 std::shared_ptr<PasteData> PasteboardClient::CreatePlainTextData(const std::string &text)
107 {
108     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New plain data");
109     auto pasteData = std::make_shared<PasteData>();
110     pasteData->AddTextRecord(text);
111     return pasteData;
112 }
113 
CreatePixelMapData(std::shared_ptr<PixelMap> pixelMap)114 std::shared_ptr<PasteData> PasteboardClient::CreatePixelMapData(std::shared_ptr<PixelMap> pixelMap)
115 {
116     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New pixelMap data");
117     auto pasteData = std::make_shared<PasteData>();
118     pasteData->AddPixelMapRecord(std::move(pixelMap));
119     return pasteData;
120 }
121 
CreateUriData(const OHOS::Uri & uri)122 std::shared_ptr<PasteData> PasteboardClient::CreateUriData(const OHOS::Uri &uri)
123 {
124     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New uri data");
125     auto pasteData = std::make_shared<PasteData>();
126     pasteData->AddUriRecord(uri);
127     return pasteData;
128 }
129 
CreateKvData(const std::string & mimeType,const std::vector<uint8_t> & arrayBuffer)130 std::shared_ptr<PasteData> PasteboardClient::CreateKvData(
131     const std::string &mimeType, const std::vector<uint8_t> &arrayBuffer)
132 {
133     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "New Kv data");
134     auto pasteData = std::make_shared<PasteData>();
135     pasteData->AddKvRecord(mimeType, arrayBuffer);
136     return pasteData;
137 }
138 
Clear()139 void PasteboardClient::Clear()
140 {
141     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "Clear start.");
142     if (!IsServiceAvailable()) {
143         return;
144     }
145     pasteboardServiceProxy_->Clear();
146     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "Clear end.");
147     return;
148 }
149 
GetPasteData(PasteData & pasteData)150 int32_t PasteboardClient::GetPasteData(PasteData &pasteData)
151 {
152     StartAsyncTrace(HITRACE_TAG_MISC, "PasteboardClient::GetPasteData", HITRACE_GETPASTEDATA);
153     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "GetPasteData start.");
154     if (!IsServiceAvailable()) {
155         return static_cast<int32_t>(PasteboardError::E_SA_DIED);
156     }
157     int32_t ret = pasteboardServiceProxy_->GetPasteData(pasteData);
158     RetainUri(pasteData);
159     RebuildWebviewPasteData(pasteData);
160     FinishAsyncTrace(HITRACE_TAG_MISC, "PasteboardClient::GetPasteData", HITRACE_GETPASTEDATA);
161     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "GetPasteData end.");
162     return ret;
163 }
164 
RebuildWebviewPasteData(PasteData & pasteData)165 void PasteboardClient::RebuildWebviewPasteData(PasteData &pasteData)
166 {
167     if (pasteData.GetTag() != PasteData::WEBVIEW_PASTEDATA_TAG || pasteData.GetPrimaryHtml() == nullptr) {
168         return;
169     }
170     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "Rebuild webview PasteData start.");
171     for (auto& item : pasteData.AllRecords()) {
172         if (item->GetUri() == nullptr) {
173             PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "Rebuild webview one of uri is null.");
174             continue;
175         }
176         std::shared_ptr<Uri> uri = item->GetUri();
177         std::string puri = uri->ToString();
178         std::string realUri = puri;
179         if (puri.substr(0, PasteData::FILE_SCHEME_PREFIX.size()) == PasteData::FILE_SCHEME_PREFIX) {
180             AppFileService::ModuleFileUri::FileUri fileUri(puri);
181             realUri = PasteData::FILE_SCHEME_PREFIX + fileUri.GetRealPath();
182             PASTEBOARD_HILOGI(PASTEBOARD_MODULE_CLIENT, "Rebuild webview uri is file uri.");
183         }
184         PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "Rebuild webview realUri is = %{public}s.", realUri.c_str());
185         if (realUri.find(PasteData::DISTRIBUTEDFILES_TAG) != std::string::npos) {
186             item->SetConvertUri(realUri);
187         } else {
188             item->SetUri(std::make_shared<OHOS::Uri>(realUri));
189         }
190     }
191     auto PasteboardWebController = PasteboardWebController::GetInstance();
192     auto webData = std::make_shared<PasteData>(pasteData);
193     PasteboardWebController.RebuildHtml(webData);
194 
195     std::shared_ptr<std::string> primaryText = pasteData.GetPrimaryText();
196     std::shared_ptr<std::string> html = webData->GetPrimaryHtml();
197     std::string mimeType = MIMETYPE_TEXT_HTML;
198     PasteDataRecord::Builder builder(MIMETYPE_TEXT_HTML);
199     std::shared_ptr<PasteDataRecord> pasteDataRecord =
200         builder.SetMimeType(mimeType).SetPlainText(primaryText).SetHtmlText(html).Build();
201     webData->AddRecord(pasteDataRecord);
202     webData->RemoveRecordAt(webData->GetRecordCount() - 1);
203     pasteData = *webData;
204 
205     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "Rebuild webview PasteData end.");
206 }
207 
RetainUri(PasteData & pasteData)208 void PasteboardClient::RetainUri(PasteData &pasteData)
209 {
210     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "RetainUri start.");
211     if (!pasteData.IsLocalPaste()) {
212         return;
213     }
214     // clear convert uri
215     for (size_t i = 0; i < pasteData.GetRecordCount(); ++i) {
216         auto record = pasteData.GetRecordAt(i);
217         if (record != nullptr) {
218             record->SetConvertUri("");
219         }
220     }
221     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "RetainUri end.");
222 }
223 
HasPasteData()224 bool PasteboardClient::HasPasteData()
225 {
226     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "HasPasteData start.");
227     if (!IsServiceAvailable()) {
228         return false;
229     }
230     return pasteboardServiceProxy_->HasPasteData();
231 }
232 
SetPasteData(PasteData & pasteData)233 int32_t PasteboardClient::SetPasteData(PasteData &pasteData)
234 {
235     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "SetPasteData start.");
236     if (!IsServiceAvailable()) {
237         return static_cast<int32_t>(PasteboardError::E_SA_DIED);
238     }
239     std::shared_ptr<std::string> html = pasteData.GetPrimaryHtml();
240     if (pasteData.GetTag() != PasteData::WEBVIEW_PASTEDATA_TAG || html == nullptr) {
241         return pasteboardServiceProxy_->SetPasteData(pasteData);
242     }
243     auto webData = SplitWebviewPasteData(pasteData);
244     if (webData == nullptr) {
245         return static_cast<int32_t>(PasteboardError::E_INVALID_VALUE);
246     }
247     return pasteboardServiceProxy_->SetPasteData(*webData);
248 }
249 
SplitWebviewPasteData(PasteData & pasteData)250 std::shared_ptr<PasteData> PasteboardClient::SplitWebviewPasteData(PasteData &pasteData)
251 {
252     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "SplitWebviewPasteData start.");
253     std::shared_ptr<std::string> html = pasteData.GetPrimaryHtml();
254     std::shared_ptr<std::string> primaryText = pasteData.GetPrimaryText();
255     auto PasteboardWebController = PasteboardWebController::GetInstance();
256     std::shared_ptr<PasteData> webPasteData = PasteboardWebController.SplitHtml(html);
257     webPasteData->SetProperty(pasteData.GetProperty());
258     std::string mimeType = MIMETYPE_TEXT_HTML;
259     PasteDataRecord::Builder builder(MIMETYPE_TEXT_HTML);
260     std::shared_ptr<PasteDataRecord> pasteDataRecord =
261         builder.SetMimeType(mimeType).SetPlainText(primaryText).SetHtmlText(html).Build();
262     webPasteData->AddRecord(pasteDataRecord);
263     webPasteData->RemoveRecordAt(webPasteData->GetRecordCount() - 1);
264     webPasteData->SetTag(PasteData::WEBVIEW_PASTEDATA_TAG);
265     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "SplitWebviewPasteData end.");
266     return webPasteData;
267 }
268 
AddPasteboardChangedObserver(sptr<PasteboardObserver> callback)269 void PasteboardClient::AddPasteboardChangedObserver(sptr<PasteboardObserver> callback)
270 {
271     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "start.");
272     if (callback == nullptr) {
273         PASTEBOARD_HILOGW(PASTEBOARD_MODULE_CLIENT, "input nullptr.");
274         return;
275     }
276     if (!IsServiceAvailable()) {
277         return;
278     }
279     pasteboardServiceProxy_->AddPasteboardChangedObserver(callback);
280     return;
281 }
282 
AddPasteboardEventObserver(sptr<PasteboardObserver> callback)283 void PasteboardClient::AddPasteboardEventObserver(sptr<PasteboardObserver> callback)
284 {
285     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "start.");
286     if (callback == nullptr) {
287         PASTEBOARD_HILOGW(PASTEBOARD_MODULE_CLIENT, "input nullptr.");
288         return;
289     }
290     if (!IsServiceAvailable()) {
291         return;
292     }
293     pasteboardServiceProxy_->AddPasteboardEventObserver(callback);
294 }
295 
RemovePasteboardChangedObserver(sptr<PasteboardObserver> callback)296 void PasteboardClient::RemovePasteboardChangedObserver(sptr<PasteboardObserver> callback)
297 {
298     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "start.");
299     if (!IsServiceAvailable()) {
300         return;
301     }
302     if (callback == nullptr) {
303         PASTEBOARD_HILOGW(PASTEBOARD_MODULE_CLIENT, "remove all.");
304         pasteboardServiceProxy_->RemoveAllChangedObserver();
305         PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "end.");
306         return;
307     }
308     pasteboardServiceProxy_->RemovePasteboardChangedObserver(callback);
309     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "end.");
310     return;
311 }
312 
RemovePasteboardEventObserver(sptr<PasteboardObserver> callback)313 void PasteboardClient::RemovePasteboardEventObserver(sptr<PasteboardObserver> callback)
314 {
315     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "start.");
316     if (!IsServiceAvailable()) {
317         return;
318     }
319     if (callback == nullptr) {
320         PASTEBOARD_HILOGW(PASTEBOARD_MODULE_CLIENT, "remove all.");
321         pasteboardServiceProxy_->RemoveAllEventObserver();
322         PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "end.");
323         return;
324     }
325     pasteboardServiceProxy_->RemovePasteboardEventObserver(callback);
326     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "end.");
327 }
328 
IsRemoteData()329 bool PasteboardClient::IsRemoteData()
330 {
331     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "IsRemoteData start.");
332     if (!IsServiceAvailable()) {
333         return false;
334     }
335     auto ret = pasteboardServiceProxy_->IsRemoteData();
336     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "IsRemoteData end.");
337     return ret;
338 }
339 
GetDataSource(std::string & bundleName)340 int32_t PasteboardClient::GetDataSource(std::string &bundleName)
341 {
342     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "GetDataSource start.");
343     if (!IsServiceAvailable()) {
344         return static_cast<int32_t>(PasteboardError::E_SA_DIED);
345     }
346     int32_t ret = pasteboardServiceProxy_->GetDataSource(bundleName);
347     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "GetDataSource end.");
348     return ret;
349 }
350 
HasDataType(const std::string & mimeType)351 bool PasteboardClient::HasDataType(const std::string &mimeType)
352 {
353     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "HasDataType start.");
354     if (!IsServiceAvailable()) {
355         return false;
356     }
357     if (mimeType.empty()) {
358         PASTEBOARD_HILOGE(PASTEBOARD_MODULE_CLIENT, "parameter is invalid");
359         return false;
360     }
361     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "type is %{public}s", mimeType.c_str());
362     bool ret = pasteboardServiceProxy_->HasDataType(mimeType);
363     PASTEBOARD_HILOGD(PASTEBOARD_MODULE_CLIENT, "HasDataType end.");
364     return ret;
365 }
366 
IsServiceAvailable()367 inline bool PasteboardClient::IsServiceAvailable()
368 {
369     if (pasteboardServiceProxy_ == nullptr) {
370         PASTEBOARD_HILOGW(PASTEBOARD_MODULE_CLIENT, "Redo ConnectService");
371         ConnectService();
372     }
373 
374     if (pasteboardServiceProxy_ == nullptr) {
375         PASTEBOARD_HILOGE(PASTEBOARD_MODULE_CLIENT, "Service proxy null.");
376         return false;
377     }
378     return true;
379 }
380 
ConnectService()381 void PasteboardClient::ConnectService()
382 {
383     std::unique_lock<std::mutex> lock(instanceLock_);
384     if (pasteboardServiceProxy_ != nullptr) {
385         return;
386     }
387     PASTEBOARD_HILOGI(PASTEBOARD_MODULE_CLIENT, "ConnectService start.");
388     sptr<ISystemAbilityManager> samgrProxy = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
389     if (samgrProxy == nullptr) {
390         PASTEBOARD_HILOGE(PASTEBOARD_MODULE_CLIENT, "Get SystemAbilityManager failed.");
391         pasteboardServiceProxy_ = nullptr;
392         return;
393     }
394     sptr<IRemoteObject> remoteObject = samgrProxy->CheckSystemAbility(PASTEBOARD_SERVICE_ID);
395     if (remoteObject != nullptr) {
396         PASTEBOARD_HILOGE(PASTEBOARD_MODULE_CLIENT, "Get PasteboardServiceProxy succeed.");
397         if (deathRecipient_ == nullptr) {
398             deathRecipient_ = sptr<IRemoteObject::DeathRecipient>(new PasteboardSaDeathRecipient());
399         }
400         remoteObject->AddDeathRecipient(deathRecipient_);
401         pasteboardServiceProxy_ = iface_cast<IPasteboardService>(remoteObject);
402         return;
403     }
404     PASTEBOARD_HILOGE(PASTEBOARD_MODULE_CLIENT, "remoteObject is null.");
405     sptr<PasteboardLoadCallback> loadCallback = new PasteboardLoadCallback();
406     if (loadCallback == nullptr) {
407         PASTEBOARD_HILOGI(PASTEBOARD_MODULE_CLIENT, "loadCallback is nullptr.");
408         return;
409     }
410     int32_t ret = samgrProxy->LoadSystemAbility(PASTEBOARD_SERVICE_ID, loadCallback);
411     if (ret != ERR_OK) {
412         PASTEBOARD_HILOGI(PASTEBOARD_MODULE_CLIENT, "Failed to load systemAbility.");
413         return;
414     }
415     auto waitStatus = proxyConVar_.wait_for(lock, std::chrono::milliseconds(LOADSA_TIMEOUT_MS),
416         [this]() { return pasteboardServiceProxy_ != nullptr; });
417     if (!waitStatus) {
418         PASTEBOARD_HILOGI(PASTEBOARD_MODULE_CLIENT, "Load systemAbility timeout.");
419         return;
420     }
421     PASTEBOARD_HILOGE(PASTEBOARD_MODULE_CLIENT, "Getting PasteboardServiceProxy succeeded.");
422 }
423 
LoadSystemAbilitySuccess(const sptr<IRemoteObject> & remoteObject)424 void PasteboardClient::LoadSystemAbilitySuccess(const sptr<IRemoteObject> &remoteObject)
425 {
426     std::lock_guard<std::mutex> lock(instanceLock_);
427     if (deathRecipient_ == nullptr) {
428         deathRecipient_ = sptr<IRemoteObject::DeathRecipient>(new PasteboardSaDeathRecipient());
429     }
430     if (remoteObject != nullptr) {
431         remoteObject->AddDeathRecipient(deathRecipient_);
432         pasteboardServiceProxy_ = iface_cast<IPasteboardService>(remoteObject);
433     }
434     proxyConVar_.notify_one();
435 }
436 
LoadSystemAbilityFail()437 void PasteboardClient::LoadSystemAbilityFail()
438 {
439     std::lock_guard<std::mutex> lock(instanceLock_);
440     pasteboardServiceProxy_ = nullptr;
441     proxyConVar_.notify_one();
442 }
443 
OnRemoteSaDied(const wptr<IRemoteObject> & remote)444 void PasteboardClient::OnRemoteSaDied(const wptr<IRemoteObject> &remote)
445 {
446     PASTEBOARD_HILOGI(PASTEBOARD_MODULE_CLIENT, "OnRemoteSaDied start.");
447     pasteboardServiceProxy_ = nullptr;
448     ConnectService();
449 }
450 
PasteboardSaDeathRecipient()451 PasteboardSaDeathRecipient::PasteboardSaDeathRecipient()
452 {
453 }
454 
OnRemoteDied(const wptr<IRemoteObject> & object)455 void PasteboardSaDeathRecipient::OnRemoteDied(const wptr<IRemoteObject> &object)
456 {
457     PASTEBOARD_HILOGE(PASTEBOARD_MODULE_CLIENT, "PasteboardSaDeathRecipient on remote systemAbility died.");
458     PasteboardClient::GetInstance()->OnRemoteSaDied(object);
459 }
460 } // namespace MiscServices
461 } // namespace OHOS
462