!699 UIExtension生命周期调整

Merge pull request !699 from jsjzju/master
This commit is contained in:
openharmony_ci 2023-12-12 12:40:57 +00:00 committed by Gitee
commit f79d0e819a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 3 deletions

View File

@ -125,7 +125,7 @@ public:
* The extension in the <b>STATE_FOREGROUND</b> state is visible.
* You can override this function to implement your own processing logic.
*/
virtual void OnForeground(const Want &want) override;
virtual void OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo) override;
/**
* @brief Called when this extension enters the <b>STATE_BACKGROUND</b> state.

View File

@ -310,11 +310,13 @@ void JsUserAuthExtension::OnCommand(const AAFwk::Want &want, bool restart, int s
IAM_LOGD("JsUserAuthExtension onCommand end.");
}
void JsUserAuthExtension::OnForeground(const Want &want)
void JsUserAuthExtension::OnForeground(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo)
{
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
IAM_LOGD("JsUserAuthExtension onForeground begin.");
Extension::OnForeground(want);
Extension::OnForeground(want, sessionInfo);
ForegroundWindow(want, sessionInfo);
HandleScope handleScope(jsRuntime_);
CallObjectMethod("onForeground");