From 2c617c7adda9a539128c4044656a41ca77b03a2e Mon Sep 17 00:00:00 2001 From: lu Date: Mon, 1 Aug 2022 16:29:27 +0800 Subject: [PATCH] UniRending supports Startwindow. Signed-off-by: lu Change-Id: Ie86d01d33b28b93f08c490ca642215b716490f7d --- .../include/window_manager_service_handler.h | 5 +++-- .../include/window_manager_service_handler_proxy.h | 4 ++-- .../src/window_manager_service_handler_proxy.cpp | 11 ++++++----- .../src/window_manager_service_handler_stub.cpp | 10 ++++++---- services/abilitymgr/include/ability_record.h | 2 +- services/abilitymgr/include/mission_data_storage.h | 2 +- services/abilitymgr/include/mission_info_mgr.h | 2 +- .../abilitymgr/include/task_data_persistence_mgr.h | 2 +- services/abilitymgr/src/ability_record.cpp | 4 ++-- services/abilitymgr/src/mission_data_storage.cpp | 4 ++-- services/abilitymgr/src/mission_info_mgr.cpp | 2 +- services/abilitymgr/src/task_data_persistence_mgr.cpp | 2 +- 12 files changed, 27 insertions(+), 23 deletions(-) diff --git a/interfaces/inner_api/ability_manager/include/window_manager_service_handler.h b/interfaces/inner_api/ability_manager/include/window_manager_service_handler.h index 173cc0018f..a87936aac1 100644 --- a/interfaces/inner_api/ability_manager/include/window_manager_service_handler.h +++ b/interfaces/inner_api/ability_manager/include/window_manager_service_handler.h @@ -35,9 +35,10 @@ public: virtual int32_t GetFocusWindow(sptr& abilityToken) = 0; - virtual void StartingWindow(sptr info, sptr pixelMap, uint32_t bgColor) = 0; + virtual void StartingWindow(sptr info, + std::shared_ptr pixelMap, uint32_t bgColor) = 0; - virtual void StartingWindow(sptr info, sptr pixelMap) = 0; + virtual void StartingWindow(sptr info, std::shared_ptr pixelMap) = 0; virtual void CancelStartingWindow(sptr abilityToken) = 0; diff --git a/interfaces/inner_api/ability_manager/include/window_manager_service_handler_proxy.h b/interfaces/inner_api/ability_manager/include/window_manager_service_handler_proxy.h index e4037adcee..a2d692c07d 100644 --- a/interfaces/inner_api/ability_manager/include/window_manager_service_handler_proxy.h +++ b/interfaces/inner_api/ability_manager/include/window_manager_service_handler_proxy.h @@ -32,10 +32,10 @@ public: virtual int32_t GetFocusWindow(sptr& abilityToken) override; - virtual void StartingWindow(sptr info, sptr pixelMap, + virtual void StartingWindow(sptr info, std::shared_ptr pixelMap, uint32_t bgColor) override; - virtual void StartingWindow(sptr info, sptr pixelMap) override; + virtual void StartingWindow(sptr info, std::shared_ptr pixelMap) override; virtual void CancelStartingWindow(sptr abilityToken) override; diff --git a/interfaces/inner_api/ability_manager/src/window_manager_service_handler_proxy.cpp b/interfaces/inner_api/ability_manager/src/window_manager_service_handler_proxy.cpp index 54e6e75044..c9b9455c0c 100644 --- a/interfaces/inner_api/ability_manager/src/window_manager_service_handler_proxy.cpp +++ b/interfaces/inner_api/ability_manager/src/window_manager_service_handler_proxy.cpp @@ -73,8 +73,8 @@ int32_t WindowManagerServiceHandlerProxy::GetFocusWindow(sptr& ab return ret; } -void WindowManagerServiceHandlerProxy::StartingWindow(sptr info, sptr pixelMap, - uint32_t bgColor) +void WindowManagerServiceHandlerProxy::StartingWindow(sptr info, + std::shared_ptr pixelMap, uint32_t bgColor) { HILOG_DEBUG("%{public}s is called.", __func__); MessageParcel data; @@ -86,7 +86,7 @@ void WindowManagerServiceHandlerProxy::StartingWindow(sptr info, sptr pixelMap) +void WindowManagerServiceHandlerProxy::StartingWindow(sptr info, + std::shared_ptr pixelMap) { HILOG_DEBUG("%{public}s is called.", __func__); MessageParcel data; @@ -114,7 +115,7 @@ void WindowManagerServiceHandlerProxy::StartingWindow(sptr pixelMap(data.ReadParcelable()); - if (!pixelMap) { + std::shared_ptr pixelMap + = std::shared_ptr(data.ReadParcelable()); + if (pixelMap == nullptr) { HILOG_ERROR("To read pixelMap failed."); return ERR_AAFWK_PARCEL_FAIL; } @@ -129,8 +130,9 @@ int WindowManagerServiceHandlerStub::StartingWindowHot(MessageParcel &data, Mess HILOG_ERROR("To read info failed."); return ERR_AAFWK_PARCEL_FAIL; } - sptr pixelMap(data.ReadParcelable()); - if (!pixelMap) { + std::shared_ptr pixelMap + = std::shared_ptr(data.ReadParcelable()); + if (pixelMap == nullptr) { HILOG_ERROR("To read pixelMap failed."); return ERR_AAFWK_PARCEL_FAIL; } diff --git a/services/abilitymgr/include/ability_record.h b/services/abilitymgr/include/ability_record.h index e6bf214d9f..0fc6e79e57 100644 --- a/services/abilitymgr/include/ability_record.h +++ b/services/abilitymgr/include/ability_record.h @@ -862,7 +862,7 @@ private: const std::shared_ptr &want, const AbilityRequest &abilityRequest); std::shared_ptr CreateResourceManager( const AppExecFwk::AbilityInfo &abilityInfo) const; - sptr GetPixelMap(const uint32_t windowIconId, + std::shared_ptr GetPixelMap(const uint32_t windowIconId, std::shared_ptr resourceMgr) const; void StartingWindowHot(const std::shared_ptr &startOptions, const std::shared_ptr &want, const AbilityRequest &abilityRequest); diff --git a/services/abilitymgr/include/mission_data_storage.h b/services/abilitymgr/include/mission_data_storage.h index 8bbe9eceb1..3789252804 100644 --- a/services/abilitymgr/include/mission_data_storage.h +++ b/services/abilitymgr/include/mission_data_storage.h @@ -99,7 +99,7 @@ public: * @param missionId Indicates this mission id. * @return Returns PixelMap of snapshot. */ - sptr GetSnapshot(int missionId, bool isLowResolution = false) const; + std::shared_ptr GetSnapshot(int missionId, bool isLowResolution = false) const; std::unique_ptr GetPixelMap(int missionId, bool isLowResolution) const; #endif diff --git a/services/abilitymgr/include/mission_info_mgr.h b/services/abilitymgr/include/mission_info_mgr.h index 93acaa858d..e8c8688864 100644 --- a/services/abilitymgr/include/mission_info_mgr.h +++ b/services/abilitymgr/include/mission_info_mgr.h @@ -149,7 +149,7 @@ public: * @param missionId Indicates this mission id. * @return Returns PixelMap of snapshot. */ - sptr GetSnapshot(int32_t missionId) const; + std::shared_ptr GetSnapshot(int32_t missionId) const; #endif /** diff --git a/services/abilitymgr/include/task_data_persistence_mgr.h b/services/abilitymgr/include/task_data_persistence_mgr.h index 53bc6368b5..714d01bfa0 100644 --- a/services/abilitymgr/include/task_data_persistence_mgr.h +++ b/services/abilitymgr/include/task_data_persistence_mgr.h @@ -82,7 +82,7 @@ public: * @param missionId Indicates this mission id. * @return Returns PixelMap of snapshot. */ - sptr GetSnapshot(int missionId) const; + std::shared_ptr GetSnapshot(int missionId) const; #endif /** diff --git a/services/abilitymgr/src/ability_record.cpp b/services/abilitymgr/src/ability_record.cpp index d4b133d306..dabbbf6929 100644 --- a/services/abilitymgr/src/ability_record.cpp +++ b/services/abilitymgr/src/ability_record.cpp @@ -567,7 +567,7 @@ std::shared_ptr AbilityRecord::CreateResource return resourceMgr; } -sptr AbilityRecord::GetPixelMap(const uint32_t windowIconId, +std::shared_ptr AbilityRecord::GetPixelMap(const uint32_t windowIconId, std::shared_ptr resourceMgr) const { std::string iconPath; @@ -593,7 +593,7 @@ sptr AbilityRecord::GetPixelMap(const uint32_t windowIconId, return nullptr; } HILOG_DEBUG("%{public}s OUT.", __func__); - return sptr(pixelMapPtr.release()); + return std::shared_ptr(pixelMapPtr.release()); } sptr AbilityRecord::CreateAbilityTransitionInfo( diff --git a/services/abilitymgr/src/mission_data_storage.cpp b/services/abilitymgr/src/mission_data_storage.cpp index f2fa88f62f..86287e75be 100644 --- a/services/abilitymgr/src/mission_data_storage.cpp +++ b/services/abilitymgr/src/mission_data_storage.cpp @@ -296,14 +296,14 @@ void MissionDataStorage::DeleteMissionSnapshot(int32_t missionId, bool isLowReso } } -sptr MissionDataStorage::GetSnapshot(int missionId, bool isLowResolution) const +std::shared_ptr MissionDataStorage::GetSnapshot(int missionId, bool isLowResolution) const { auto pixelMapPtr = GetPixelMap(missionId, isLowResolution); if (!pixelMapPtr) { HILOG_ERROR("%{public}s: GetPixelMap failed.", __func__); return nullptr; } - return sptr(pixelMapPtr.release()); + return std::shared_ptr(pixelMapPtr.release()); } std::unique_ptr MissionDataStorage::GetPixelMap(int missionId, bool isLowResolution) const diff --git a/services/abilitymgr/src/mission_info_mgr.cpp b/services/abilitymgr/src/mission_info_mgr.cpp index 25e291b901..c0c9f21d45 100644 --- a/services/abilitymgr/src/mission_info_mgr.cpp +++ b/services/abilitymgr/src/mission_info_mgr.cpp @@ -461,7 +461,7 @@ bool MissionInfoMgr::UpdateMissionSnapshot(int32_t missionId, const sptr MissionInfoMgr::GetSnapshot(int32_t missionId) const +std::shared_ptr MissionInfoMgr::GetSnapshot(int32_t missionId) const { HILOG_INFO("mission_list_info GetSnapshot, missionId:%{public}d", missionId); auto it = find_if(missionInfoList_.begin(), missionInfoList_.end(), [missionId](const InnerMissionInfo &info) { diff --git a/services/abilitymgr/src/task_data_persistence_mgr.cpp b/services/abilitymgr/src/task_data_persistence_mgr.cpp index 53cd6389a1..437cbb5cd0 100644 --- a/services/abilitymgr/src/task_data_persistence_mgr.cpp +++ b/services/abilitymgr/src/task_data_persistence_mgr.cpp @@ -140,7 +140,7 @@ bool TaskDataPersistenceMgr::SaveMissionSnapshot(int missionId, const MissionSna } #ifdef SUPPORT_GRAPHICS -sptr TaskDataPersistenceMgr::GetSnapshot(int missionId) const +std::shared_ptr TaskDataPersistenceMgr::GetSnapshot(int missionId) const { if (!currentMissionDataStorage_) { HILOG_ERROR("snapshot: currentMissionDataStorage_ is nullptr");