!9237 增加动效参数,解决rk下的任务列表截图问题

Merge pull request !9237 from gongyuechen/wms_param__4.1
This commit is contained in:
openharmony_ci 2024-07-02 14:07:06 +00:00 committed by Gitee
commit 6b9c642c30
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
24 changed files with 68 additions and 27 deletions

View File

@ -958,7 +958,8 @@ public:
* @param handler Indidate handler of WindowManagerService.
* @return ErrCode Returns ERR_OK on success, others on failure.
*/
ErrCode RegisterWindowManagerServiceHandler(sptr<IWindowManagerServiceHandler> handler);
ErrCode RegisterWindowManagerServiceHandler(sptr<IWindowManagerServiceHandler> handler,
bool animationEnabled = true);
/**
* WindowManager notification AbilityManager after the first frame is drawn.

View File

@ -774,7 +774,11 @@ public:
* @param handler Indidate handler of WindowManagerService.
* @return ErrCode Returns ERR_OK on success, others on failure.
*/
virtual int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) = 0;
virtual int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled)
{
return 0;
}
/**
* WindowManager notification AbilityManager after the first frame is drawn.

View File

@ -636,7 +636,8 @@ public:
virtual int SetMissionIcon(const sptr<IRemoteObject> &token,
const std::shared_ptr<OHOS::Media::PixelMap> &icon) override;
virtual int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override;
virtual int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled) override;
virtual void CompleteFirstFrameDrawing(const sptr<IRemoteObject> &abilityToken) override;

View File

@ -909,7 +909,8 @@ public:
virtual int SetMissionIcon(const sptr<IRemoteObject> &token,
const std::shared_ptr<OHOS::Media::PixelMap> &icon) override;
virtual int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override;
virtual int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled) override;
virtual void CompleteFirstFrameDrawing(const sptr<IRemoteObject> &abilityToken) override;
@ -931,6 +932,8 @@ public:
int CreateModalDialog(const Want &replaceWant, sptr<IRemoteObject> callerToken, std::string dialogSessionId);
virtual int SendDialogResult(const Want &want, const std::string dialogSessionId, bool isAllowed) override;
bool GetAnimationFlag();
#endif
void ClearUserData(int32_t userId);
@ -1907,6 +1910,7 @@ private:
std::shared_ptr<ImplicitStartProcessor> implicitStartProcessor_;
sptr<IWindowManagerServiceHandler> wmsHandler_;
std::shared_ptr<DialogSessionRecord> dialogSessionRecord_;
bool isAnimationEnabled_ = true; //only use on mission list
#endif
std::shared_ptr<AbilityInterceptorExecuter> interceptorExecuter_;
std::shared_ptr<AbilityInterceptorExecuter> afterCheckExecuter_;

View File

@ -1182,11 +1182,12 @@ ErrCode AbilityManagerClient::SetMissionIcon(
return abms->SetMissionIcon(abilityToken, icon);
}
ErrCode AbilityManagerClient::RegisterWindowManagerServiceHandler(sptr<IWindowManagerServiceHandler> handler)
ErrCode AbilityManagerClient::RegisterWindowManagerServiceHandler(sptr<IWindowManagerServiceHandler> handler,
bool animationEnabled)
{
auto abms = GetAbilityManager();
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
return abms->RegisterWindowManagerServiceHandler(handler);
return abms->RegisterWindowManagerServiceHandler(handler, animationEnabled);
}
void AbilityManagerClient::CompleteFirstFrameDrawing(sptr<IRemoteObject> abilityToken)

View File

@ -2706,7 +2706,8 @@ int AbilityManagerProxy::SetMissionIcon(const sptr<IRemoteObject> &token,
return reply.ReadInt32();
}
int AbilityManagerProxy::RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler)
int AbilityManagerProxy::RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled)
{
if (!handler) {
HILOG_ERROR("%{public}s: handler is nullptr.", __func__);
@ -2721,6 +2722,10 @@ int AbilityManagerProxy::RegisterWindowManagerServiceHandler(const sptr<IWindowM
HILOG_ERROR("%{public}s: handler write failed.", __func__);
return INNER_ERR;
}
if (!data.WriteBool(animationEnabled)) {
HILOG_ERROR("write animationEnabled fail.");
return ERR_INVALID_VALUE;
}
MessageOption option;
MessageParcel reply;
auto error = SendRequest(AbilityManagerInterfaceCode::REGISTER_WMS_HANDLER, data, reply, option);

View File

@ -7837,7 +7837,8 @@ int AbilityManagerService::SetMissionIcon(const sptr<IRemoteObject> &token,
return missionListManager->SetMissionIcon(token, icon);
}
int AbilityManagerService::RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler> &handler)
int AbilityManagerService::RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler> &handler,
bool animationEnabled)
{
auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall();
if (!isSaCall) {
@ -7845,6 +7846,7 @@ int AbilityManagerService::RegisterWindowManagerServiceHandler(const sptr<IWindo
return CHECK_PERMISSION_FAILED;
}
wmsHandler_ = handler;
isAnimationEnabled_ = animationEnabled;
HILOG_DEBUG("%{public}s: WMS handler registered successfully.", __func__);
return ERR_OK;
}
@ -8016,6 +8018,11 @@ void AbilityManagerService::InitPrepareTerminateConfig()
isPrepareTerminateEnable_ = true;
}
}
bool AbilityManagerService::GetAnimationFlag()
{
return isAnimationEnabled_;
}
#endif
int AbilityManagerService::CheckCallServicePermission(const AbilityRequest &abilityRequest)

View File

@ -2387,7 +2387,8 @@ int AbilityManagerStub::RegisterWindowManagerServiceHandlerInner(MessageParcel &
HILOG_ERROR("%{public}s read WMS handler failed!", __func__);
return ERR_NULL_OBJECT;
}
return RegisterWindowManagerServiceHandler(handler);
bool animationEnabled = data.ReadBool();
return RegisterWindowManagerServiceHandler(handler, animationEnabled);
}
int AbilityManagerStub::CompleteFirstFrameDrawingInner(MessageParcel &data, MessageParcel &reply)

View File

@ -1981,7 +1981,8 @@ void MissionListManager::MoveToBackgroundTask(const std::shared_ptr<AbilityRecor
HILOG_INFO("ability:%{public}s.", abilityRecord->GetAbilityInfo().name.c_str());
abilityRecord->SetIsNewWant(false);
if (abilityRecord->lifeCycleStateInfo_.sceneFlag != SCENE_FLAG_KEYGUARD &&
!abilityRecord->IsClearMissionFlag() && !isClose) {
!abilityRecord->IsClearMissionFlag() &&
!(isClose && OHOS::DelayedSingleton<AbilityManagerService>::GetInstance()->GetAnimationFlag())) {
UpdateMissionSnapshot(abilityRecord);
}

View File

@ -310,7 +310,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -274,7 +274,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -471,7 +471,8 @@ int MockAbilityDelegatorStub::SetMissionIcon(
return 0;
}
int MockAbilityDelegatorStub::RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler)
int MockAbilityDelegatorStub::RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled)
{
return 0;
}
@ -482,7 +483,8 @@ int MockAbilityDelegatorStub2::SetMissionIcon(
return 0;
}
int MockAbilityDelegatorStub2::RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler)
int MockAbilityDelegatorStub2::RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled)
{
return 0;
}

View File

@ -183,7 +183,8 @@ public:
MOCK_METHOD2(SetMissionLabel, int(const sptr<IRemoteObject>& token, const std::string& label));
int SetMissionIcon(
const sptr<IRemoteObject>& token, const std::shared_ptr<OHOS::Media::PixelMap>& icon) override;
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler);
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true);
void CompleteFirstFrameDrawing(const sptr<IRemoteObject>& abilityToken) override {}
#endif
MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector<int32_t>&, std::vector<MissionValidResult>&));
@ -363,7 +364,8 @@ public:
MOCK_METHOD2(SetMissionLabel, int(const sptr<IRemoteObject>& token, const std::string& label));
int SetMissionIcon(
const sptr<IRemoteObject>& token, const std::shared_ptr<OHOS::Media::PixelMap>& icon) override;
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler);
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true);
void CompleteFirstFrameDrawing(const sptr<IRemoteObject>& abilityToken) override {}
#endif
MOCK_METHOD2(IsValidMissionIds, int32_t(const std::vector<int32_t>&, std::vector<MissionValidResult>&));

View File

@ -265,7 +265,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -288,7 +288,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -190,7 +190,8 @@ public:
return 0;
}
virtual int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
virtual int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -272,7 +272,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -1580,7 +1580,7 @@ HWTEST_F(AbilityManagerProxyTest, AbilityManagerProxy_SetMissionLabel_001, TestS
HWTEST_F(AbilityManagerProxyTest, AbilityManagerProxy_RegisterWindowManagerServiceHandler_001, TestSize.Level1)
{
sptr<IWindowManagerServiceHandler> handler = nullptr;
auto res = proxy_->RegisterWindowManagerServiceHandler(handler);
auto res = proxy_->RegisterWindowManagerServiceHandler(handler, true);
EXPECT_EQ(res, INNER_ERR);
}

View File

@ -279,7 +279,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -344,7 +344,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -263,7 +263,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -248,7 +248,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -255,7 +255,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}

View File

@ -206,7 +206,8 @@ public:
return 0;
}
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler) override
int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler,
bool animationEnabled = true) override
{
return 0;
}