From cd2d56f52199099006f9ffc3ed5c3d2d58aa9938 Mon Sep 17 00:00:00 2001 From: zhongjianfei Date: Tue, 11 Jan 2022 20:44:00 +0800 Subject: [PATCH] zhongjianfei@huawei.com Signed-off-by: zhongjianfei Change-Id: Ib3fb2c32e08a4882a2f3b4e34e6b36c73604fa2e --- interfaces/innerkits/ability_manager/BUILD.gn | 1 + .../include/ability_manager_client.h | 9 +++ .../ability_manager/include/snapshot.h | 62 +++++++++++++++++++ .../kits/napi/aafwk/abilityManager/BUILD.gn | 1 - .../abilitymgr/src/ability_manager_client.cpp | 5 ++ 5 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 interfaces/innerkits/ability_manager/include/snapshot.h diff --git a/interfaces/innerkits/ability_manager/BUILD.gn b/interfaces/innerkits/ability_manager/BUILD.gn index ea024b0226e..685414f620b 100644 --- a/interfaces/innerkits/ability_manager/BUILD.gn +++ b/interfaces/innerkits/ability_manager/BUILD.gn @@ -107,6 +107,7 @@ ohos_shared_library("ability_manager") { "bytrace_standard:bytrace_core", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "multimedia_image_standard:image_native", "native_appdatamgr:native_appdatafwk", "native_appdatamgr:native_dataability", "native_appdatamgr:native_rdb", diff --git a/interfaces/innerkits/ability_manager/include/ability_manager_client.h b/interfaces/innerkits/ability_manager/include/ability_manager_client.h index 57887f13dc8..f31e9a8a549 100644 --- a/interfaces/innerkits/ability_manager/include/ability_manager_client.h +++ b/interfaces/innerkits/ability_manager/include/ability_manager_client.h @@ -22,6 +22,7 @@ #include "ability_manager_errors.h" #include "ability_scheduler_interface.h" #include "ability_manager_interface.h" +#include "snapshot.h" #include "want.h" #include "iremote_object.h" @@ -591,6 +592,14 @@ public: */ ErrCode MoveMissionToFront(int32_t missionId); + /** + * @brief Register snapshot handler. + * @param handler snapshot handler. + * + * @return Returns ERR_OK on success, others on failure. + */ + ErrCode RegisterSnapshotHandler(const sptr& handler); + /** * Start synchronizing remote device mission * @param devId, deviceId. diff --git a/interfaces/innerkits/ability_manager/include/snapshot.h b/interfaces/innerkits/ability_manager/include/snapshot.h new file mode 100644 index 00000000000..15dd7abf9d3 --- /dev/null +++ b/interfaces/innerkits/ability_manager/include/snapshot.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_AAFWK_SNAPSHOT_H +#define OHOS_AAFWK_SNAPSHOT_H + +#include + +namespace OHOS { +namespace Media { +class PixelMap; +} +namespace AAFwk { +/** + * @class Snapshot + * Snapshot info. + */ +class Snapshot { +public: + Snapshot() = default; + ~Snapshot() = default; + const std::shared_ptr& GetPixelMap() const + { + return pixelMap_; + } + void SetPixelMap(const std::shared_ptr& pixelMap) + { + pixelMap_ = pixelMap; + } + +private: + std::shared_ptr pixelMap_ = nullptr; +}; + +class ISnapshotHandler : public OHOS::IRemoteBroker { +public: + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.aafwk.SnapshotHandler"); + + /** + * @brief Get the Snapshot object + * + * @param token remote object token + * @param snapshot the application snapshot + * @return function invoked result + */ + virtual int32_t GetSnapshot(const sptr& token, Snapshot& snapshot); +}; +} // namespace AAFwk +} // namespace OHOS +#endif // OHOS_AAFWK_SNAPSHOT_H \ No newline at end of file diff --git a/interfaces/kits/napi/aafwk/abilityManager/BUILD.gn b/interfaces/kits/napi/aafwk/abilityManager/BUILD.gn index 37e7973e844..ebf83448b7c 100644 --- a/interfaces/kits/napi/aafwk/abilityManager/BUILD.gn +++ b/interfaces/kits/napi/aafwk/abilityManager/BUILD.gn @@ -27,7 +27,6 @@ ohos_shared_library("abilitymanager") { "napi_ability_manager.cpp", "native_module.cpp", ] - ldflags = [ "-Wl,-rpath=/system/lib/module/multimedia/" ] deps = [ "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", diff --git a/services/abilitymgr/src/ability_manager_client.cpp b/services/abilitymgr/src/ability_manager_client.cpp index 8c336f67077..0fd978153ff 100644 --- a/services/abilitymgr/src/ability_manager_client.cpp +++ b/services/abilitymgr/src/ability_manager_client.cpp @@ -753,6 +753,11 @@ ErrCode AbilityManagerClient::MoveMissionToFront(int32_t missionId) return abms->MoveMissionToFront(missionId); } +ErrCode AbilityManagerClient::RegisterSnapshotHandler(const sptr& handler) +{ + return ERR_OK; +} + /** * Start synchronizing remote device mission * @param devId, deviceId. -- Gitee