mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-27 09:21:28 +00:00
代码一致性修改
Signed-off-by: songjindian <songjindian1@huawei.com>
This commit is contained in:
parent
7690d0d7e9
commit
f3a7c1745f
@ -127,7 +127,7 @@ void JsMissionListener::OnMissionIconUpdated(int32_t missionId, const std::share
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::MISSION, "missionId: %{public}d", missionId);
|
||||
if (env_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::MISSION, "env_ null");
|
||||
TAG_LOGE(AAFwkTag::MISSION, "env_ is null");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -752,6 +752,10 @@ ErrCode AbilityContextImpl::SetMissionContinueState(const AAFwk::ContinueState &
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::CONTEXT, "called, stage: %{public}d", state);
|
||||
auto sessionToken = GetSessionToken();
|
||||
if (sessionToken == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "null sessionToken");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->SetMissionContinueState(token_, state, sessionToken);
|
||||
if (err != ERR_OK) {
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "failed: %{public}d", err);
|
||||
|
@ -84,7 +84,7 @@ ErrCode AbilityContext::TerminateAbility()
|
||||
ErrCode err = ERR_OK;
|
||||
switch (info->type) {
|
||||
case AppExecFwk::AbilityType::PAGE:
|
||||
TAG_LOGD(AAFwkTag::CONTEXT, "page type, ability: %{public}s", info->name.c_str());
|
||||
TAG_LOGD(AAFwkTag::CONTEXT, "type: page, ability: %{public}s", info->name.c_str());
|
||||
if (Rosen::SceneBoardJudgement::IsSceneBoardEnabled()) {
|
||||
auto sessionToken = GetSessionToken();
|
||||
if (sessionToken == nullptr) {
|
||||
|
@ -373,16 +373,16 @@ napi_value JsAbilityContext::HideAbility(napi_env env, napi_callback_info info)
|
||||
GET_NAPI_INFO_AND_CALL(env, info, JsAbilityContext, OnHideAbility);
|
||||
}
|
||||
|
||||
napi_value JsAbilityContext::OpenAtomicService(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_NAPI_INFO_AND_CALL(env, info, JsAbilityContext, OnOpenAtomicService);
|
||||
}
|
||||
|
||||
napi_value JsAbilityContext::MoveAbilityToBackground(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_NAPI_INFO_AND_CALL(env, info, JsAbilityContext, OnMoveAbilityToBackground);
|
||||
}
|
||||
|
||||
napi_value JsAbilityContext::OpenAtomicService(napi_env env, napi_callback_info info)
|
||||
{
|
||||
GET_NAPI_INFO_AND_CALL(env, info, JsAbilityContext, OnOpenAtomicService);
|
||||
}
|
||||
|
||||
void JsAbilityContext::ClearFailedCallConnection(
|
||||
const std::weak_ptr<AbilityContext>& abilityContext, const std::shared_ptr<CallerCallBack> &callback)
|
||||
{
|
||||
@ -408,10 +408,7 @@ napi_value JsAbilityContext::OnStartAbility(napi_env env, NapiCallbackInfo& info
|
||||
}
|
||||
|
||||
AAFwk::Want want;
|
||||
if (!AppExecFwk::UnwrapWant(env, info.argv[INDEX_ZERO], want)) {
|
||||
ThrowInvalidParamError(env, "Parse param want failed, must be a Want");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
OHOS::AppExecFwk::UnwrapWant(env, info.argv[INDEX_ZERO], want);
|
||||
InheritWindowMode(want);
|
||||
decltype(info.argc) unwrapArgc = ARGC_ONE;
|
||||
TAG_LOGD(AAFwkTag::CONTEXT, "ability:%{public}s", want.GetElement().GetAbilityName().c_str());
|
||||
@ -1728,10 +1725,8 @@ napi_value CreateJsAbilityContext(napi_env env, std::shared_ptr<AbilityContext>
|
||||
JsAbilityContext::ShowAbility);
|
||||
BindNativeFunction(env, object, "hideAbility", moduleName,
|
||||
JsAbilityContext::HideAbility);
|
||||
BindNativeFunction(env, object, "openAtomicService", moduleName,
|
||||
JsAbilityContext::OpenAtomicService);
|
||||
BindNativeFunction(env, object, "moveAbilityToBackground", moduleName,
|
||||
JsAbilityContext::MoveAbilityToBackground);
|
||||
BindNativeFunction(env, object, "moveAbilityToBackground", moduleName, JsAbilityContext::MoveAbilityToBackground);
|
||||
BindNativeFunction(env, object, "openAtomicService", moduleName, JsAbilityContext::OpenAtomicService);
|
||||
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
BindNativeFunction(env, object, "setMissionLabel", moduleName, JsAbilityContext::SetMissionLabel);
|
||||
@ -1747,20 +1742,20 @@ JSAbilityConnection::~JSAbilityConnection()
|
||||
uv_loop_t *loop = nullptr;
|
||||
napi_get_uv_event_loop(env_, &loop);
|
||||
if (loop == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "~JSAbilityConnection: failed to get uv loop.");
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "null uv loop");
|
||||
return;
|
||||
}
|
||||
|
||||
ConnectCallback *cb = new (std::nothrow) ConnectCallback();
|
||||
if (cb == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "~JSAbilityConnection: failed to create cb.");
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "null cb");
|
||||
return;
|
||||
}
|
||||
cb->jsConnectionObject_ = std::move(jsConnectionObject_);
|
||||
|
||||
uv_work_t *work = new (std::nothrow) uv_work_t;
|
||||
if (work == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "~JSAbilityConnection: failed to create work.");
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "null work");
|
||||
delete cb;
|
||||
cb = nullptr;
|
||||
return;
|
||||
@ -1769,11 +1764,11 @@ JSAbilityConnection::~JSAbilityConnection()
|
||||
int ret = uv_queue_work(loop, work, [](uv_work_t *work) {},
|
||||
[](uv_work_t *work, int status) {
|
||||
if (work == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "~JSAbilityConnection: work is nullptr.");
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "null work");
|
||||
return;
|
||||
}
|
||||
if (work->data == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "~JSAbilityConnection: data is nullptr.");
|
||||
TAG_LOGE(AAFwkTag::CONTEXT, "null data");
|
||||
delete work;
|
||||
work = nullptr;
|
||||
return;
|
||||
@ -2163,6 +2158,7 @@ napi_value JsAbilityContext::OnStartAbilityByType(napi_env env, NapiCallbackInfo
|
||||
task.Reject(env, CreateJsError(env, AbilityErrorCode::ERROR_CODE_INVALID_CONTEXT));
|
||||
return;
|
||||
}
|
||||
|
||||
auto errcode = context->StartAbilityByType(type, wantParam, callback);
|
||||
(errcode != 0) ? task.Reject(env, CreateJsErrorByNativeErr(env, errcode)) :
|
||||
task.ResolveWithNoError(env, CreateJsUndefined(env));
|
||||
@ -2245,6 +2241,36 @@ napi_value JsAbilityContext::ChangeAbilityVisibility(napi_env env, NapiCallbackI
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value JsAbilityContext::OnMoveAbilityToBackground(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::CONTEXT, "start");
|
||||
auto abilityContext = context_.lock();
|
||||
|
||||
NapiAsyncTask::CompleteCallback complete =
|
||||
[weak = context_](napi_env env, NapiAsyncTask& task, int32_t status) {
|
||||
TAG_LOGD(AAFwkTag::CONTEXT, "start task");
|
||||
auto context = weak.lock();
|
||||
if (!context) {
|
||||
TAG_LOGW(AAFwkTag::CONTEXT, "released context");
|
||||
task.Reject(env, CreateJsError(env, AbilityErrorCode::ERROR_CODE_INVALID_CONTEXT));
|
||||
return;
|
||||
}
|
||||
|
||||
auto errcode = context->MoveUIAbilityToBackground();
|
||||
if (errcode == 0) {
|
||||
task.ResolveWithNoError(env, CreateJsUndefined(env));
|
||||
} else {
|
||||
task.Reject(env, CreateJsErrorByNativeErr(env, errcode));
|
||||
}
|
||||
};
|
||||
|
||||
napi_value lastParam = (info.argc > ARGC_ZERO) ? info.argv[INDEX_ZERO] : nullptr;
|
||||
napi_value result = nullptr;
|
||||
NapiAsyncTask::ScheduleHighQos("JsAbilityContext::OnMoveAbilityToBackground",
|
||||
env, CreateAsyncTaskWithLastParam(env, lastParam, nullptr, std::move(complete), &result));
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value JsAbilityContext::OnOpenAtomicService(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
if (info.argc == ARGC_ZERO) {
|
||||
@ -2319,36 +2345,6 @@ napi_value JsAbilityContext::OpenAtomicServiceInner(napi_env env, NapiCallbackIn
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value JsAbilityContext::OnMoveAbilityToBackground(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::CONTEXT, "start");
|
||||
auto abilityContext = context_.lock();
|
||||
|
||||
NapiAsyncTask::CompleteCallback complete =
|
||||
[weak = context_](napi_env env, NapiAsyncTask& task, int32_t status) {
|
||||
TAG_LOGD(AAFwkTag::CONTEXT, "start task");
|
||||
auto context = weak.lock();
|
||||
if (!context) {
|
||||
TAG_LOGW(AAFwkTag::CONTEXT, "released context");
|
||||
task.Reject(env, CreateJsError(env, AbilityErrorCode::ERROR_CODE_INVALID_CONTEXT));
|
||||
return;
|
||||
}
|
||||
|
||||
auto errcode = context->MoveUIAbilityToBackground();
|
||||
if (errcode == 0) {
|
||||
task.ResolveWithNoError(env, CreateJsUndefined(env));
|
||||
} else {
|
||||
task.Reject(env, CreateJsErrorByNativeErr(env, errcode));
|
||||
}
|
||||
};
|
||||
|
||||
napi_value lastParam = (info.argc > ARGC_ZERO) ? info.argv[INDEX_ZERO] : nullptr;
|
||||
napi_value result = nullptr;
|
||||
NapiAsyncTask::ScheduleHighQos("JsAbilityContext::OnMoveAbilityToBackground",
|
||||
env, CreateAsyncTaskWithLastParam(env, lastParam, nullptr, std::move(complete), &result));
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t JsAbilityContext::GenerateRequestCode()
|
||||
{
|
||||
std::lock_guard lock(requestCodeMutex_);
|
||||
|
@ -149,7 +149,7 @@ JsUIAbility::JsUIAbility(JsRuntime &jsRuntime) : jsRuntime_(jsRuntime)
|
||||
|
||||
JsUIAbility::~JsUIAbility()
|
||||
{
|
||||
//"maintenance log
|
||||
// maintenance log
|
||||
TAG_LOGI(AAFwkTag::UIABILITY, "called");
|
||||
if (abilityContext_ != nullptr) {
|
||||
abilityContext_->Unbind();
|
||||
@ -757,8 +757,7 @@ void JsUIAbility::AbilityContinuationOrRecover(const Want &want)
|
||||
{
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
// multi-instance ability continuation
|
||||
TAG_LOGD(AAFwkTag::UIABILITY, "launch reason: %{public}d, last exit reasion: %{public}d",
|
||||
launchParam_.launchReason, launchParam_.lastExitReason);
|
||||
TAG_LOGD(AAFwkTag::UIABILITY, "launch reason: %{public}d", launchParam_.launchReason);
|
||||
if (IsRestoredInContinuation()) {
|
||||
RestorePageStack(want);
|
||||
OnSceneRestored();
|
||||
@ -771,7 +770,7 @@ void JsUIAbility::AbilityContinuationOrRecover(const Want &want)
|
||||
if (mainWindow != nullptr) {
|
||||
mainWindow->NapiSetUIContent(pageStack, env, abilityContext_->GetContentStorage()->GetNapiValue(), true);
|
||||
} else {
|
||||
TAG_LOGE(AAFwkTag::UIABILITY, "null mainWindow");
|
||||
TAG_LOGE(AAFwkTag::UIABILITY, "null MainWindow");
|
||||
}
|
||||
OnSceneRestored();
|
||||
} else {
|
||||
|
@ -219,8 +219,9 @@ bool ContinuationManagerStage::GetContentInfo(WantParams &wantParams)
|
||||
TAG_LOGE(AAFwkTag::CONTINUATION, "GetContentInfo failed");
|
||||
return false;
|
||||
}
|
||||
TAG_LOGD(AAFwkTag::CONTINUATION, "pageStack: %{public}s.", pageStack.c_str());
|
||||
TAG_LOGD(AAFwkTag::CONTINUATION, "pageStack: %{public}s", pageStack.c_str());
|
||||
wantParams.SetParam(PAGE_STACK_PROPERTY_NAME, String::Box(pageStack));
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
@ -13,6 +13,7 @@
|
||||
"ability.particleAbility",
|
||||
"resourceschedule.backgroundTaskManager",
|
||||
"multimedia.camera",
|
||||
"multimedia.audio",
|
||||
"multimedia.media"
|
||||
],
|
||||
"FileAccessExtension": [
|
||||
@ -132,6 +133,7 @@
|
||||
"nfctech",
|
||||
"reminderAgent",
|
||||
"reminderAgentManager",
|
||||
"sensor",
|
||||
"tagSession",
|
||||
"telephony.call",
|
||||
"telephony.data",
|
||||
|
@ -101,7 +101,6 @@ void ExtensionImpl::HandleExtensionTransaction(const Want &want, const AAFwk::Li
|
||||
}
|
||||
SetLaunchParam(targetState.launchParam);
|
||||
bool ret = true;
|
||||
|
||||
switch (targetState.state) {
|
||||
case AAFwk::ABILITY_STATE_INITIAL: {
|
||||
bool isAsyncCallback = false;
|
||||
@ -136,7 +135,6 @@ void ExtensionImpl::HandleExtensionTransaction(const Want &want, const AAFwk::Li
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret && !UIExtensionAbilityExecuteInsightIntent(want)) {
|
||||
TAG_LOGD(AAFwkTag::EXT, "call abilityms");
|
||||
AAFwk::PacMap restoreData;
|
||||
@ -190,7 +188,7 @@ void ExtensionImpl::Start(const Want &want, sptr<AAFwk::SessionInfo> sessionInfo
|
||||
return;
|
||||
}
|
||||
|
||||
TAG_LOGD(AAFwkTag::EXT, "ExtensionImpl::Start");
|
||||
TAG_LOGD(AAFwkTag::EXT, "called");
|
||||
if (extension_->abilityInfo_->extensionAbilityType == AppExecFwk::ExtensionAbilityType::WINDOW) {
|
||||
extension_->OnStart(want, sessionInfo);
|
||||
} else {
|
||||
|
@ -132,7 +132,7 @@ int FormExtensionProviderClient::NotifyFormDelete(const int64_t formId, const Wa
|
||||
formId, want, callerToken]() {
|
||||
client->NotifyFormExtensionDelete(formId, want, callerToken);
|
||||
};
|
||||
mainHandler->PostSyncTask(notifyFormExtensionDeleteFunc);
|
||||
mainHandler->PostSyncTask(notifyFormExtensionDeleteFunc, "FormExtensionProviderClient::NotifyFormDelete");
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,6 @@ private:
|
||||
{
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
TAG_LOGD(AAFwkTag::SERVICE_EXT, "OnOpenLink");
|
||||
|
||||
std::string linkValue("");
|
||||
AAFwk::OpenLinkOptions openLinkOptions;
|
||||
AAFwk::Want want;
|
||||
|
@ -39,7 +39,6 @@ constexpr int32_t DEFAULT_DMS_SESSION_ID = 0;
|
||||
constexpr char LAUNCHER_BUNDLE_NAME[] = "com.ohos.launcher";
|
||||
constexpr char LAUNCHER_ABILITY_NAME[] = "com.ohos.launcher.MainAbility";
|
||||
constexpr char SHOW_ON_LOCK_SCREEN[] = "ShowOnLockScreen";
|
||||
|
||||
constexpr char DLP_PARAMS_SECURITY_FLAG[] = "ohos.dlp.params.securityFlag";
|
||||
constexpr char COMPONENT_STARTUP_NEW_RULES[] = "component.startup.newRules";
|
||||
constexpr int32_t ERR_INVALID_VALUE = -1;
|
||||
@ -156,14 +155,14 @@ void UIAbility::OnStart(const AAFwk::Want &want, sptr<AAFwk::SessionInfo> sessio
|
||||
{
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
if (abilityInfo_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::UIABILITY, "null abilityInfo_");
|
||||
TAG_LOGE(AAFwkTag::UIABILITY, "null AbilityInfo_");
|
||||
return;
|
||||
}
|
||||
|
||||
securityFlag_ = want.GetBoolParam(DLP_PARAMS_SECURITY_FLAG, false);
|
||||
(const_cast<AAFwk::Want &>(want)).RemoveParam(DLP_PARAMS_SECURITY_FLAG);
|
||||
SetWant(want);
|
||||
TAG_LOGD(AAFwkTag::UIABILITY, "ability: %{public}s", abilityInfo_->name.c_str());
|
||||
TAG_LOGD(AAFwkTag::UIABILITY, "ability: %{public}s.", abilityInfo_->name.c_str());
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
if (sessionInfo != nullptr) {
|
||||
SetSessionToken(sessionInfo->sessionToken);
|
||||
@ -191,7 +190,10 @@ void UIAbility::OnStop()
|
||||
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
TAG_LOGD(AAFwkTag::UIABILITY, "called");
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
TAG_LOGD(AAFwkTag::UIABILITY, "unregisterDisplayInfoChangedListener");
|
||||
if (abilityRecovery_ == nullptr) {
|
||||
abilityRecovery_->ScheduleSaveAbilityState(AppExecFwk::StateReason::LIFECYCLE);
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::UIABILITY, "UnregisterDisplayInfoChangedListener");
|
||||
(void)Rosen::WindowManager::GetInstance().UnregisterDisplayInfoChangedListener(token_, abilityDisplayListener_);
|
||||
auto &&window = GetWindow();
|
||||
if (window != nullptr) {
|
||||
|
@ -593,7 +593,7 @@ void JsEmbeddableUIAbilityContext::WrapJsUIExtensionContext(napi_env env,
|
||||
napi_value JsEmbeddableUIAbilityContext::CreateJsEmbeddableUIAbilityContext(napi_env env,
|
||||
std::shared_ptr<AbilityContext> uiAbiContext, std::shared_ptr<UIExtensionContext> uiExtContext, int32_t screenMode)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::UI_EXT, "Create JS embeddable UIAbility context begin");
|
||||
TAG_LOGD(AAFwkTag::UI_EXT, "begin");
|
||||
napi_value objValue = nullptr;
|
||||
if (screenMode == AAFwk::JUMP_SCREEN_MODE) {
|
||||
WrapJsUIAbilityContext(env, uiAbiContext, objValue, screenMode);
|
||||
@ -629,6 +629,7 @@ napi_value JsEmbeddableUIAbilityContext::CreateJsEmbeddableUIAbilityContext(napi
|
||||
BindNativeFunction(env, objValue, "reportDrawnCompleted", moduleName, ReportDrawnCompleted);
|
||||
BindNativeFunction(env, objValue, "setMissionContinueState", moduleName, SetMissionContinueState);
|
||||
BindNativeFunction(env, objValue, "startAbilityByType", moduleName, StartAbilityByType);
|
||||
BindNativeFunction(env, objValue, "moveAbilityToBackground", moduleName, MoveAbilityToBackground);
|
||||
BindNativeFunction(env, objValue, "requestModalUIExtension", moduleName, RequestModalUIExtension);
|
||||
BindNativeFunction(env, objValue, "openAtomicService", moduleName, OpenAtomicService);
|
||||
BindNativeFunction(env, objValue, "showAbility", moduleName, ShowAbility);
|
||||
@ -637,7 +638,6 @@ napi_value JsEmbeddableUIAbilityContext::CreateJsEmbeddableUIAbilityContext(napi
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
BindNativeFunction(env, objValue, "setMissionLabel", moduleName, SetMissionLabel);
|
||||
BindNativeFunction(env, objValue, "setMissionIcon", moduleName, SetMissionIcon);
|
||||
BindNativeFunction(env, objValue, "moveAbilityToBackground", moduleName, MoveAbilityToBackground);
|
||||
#endif
|
||||
return objValue;
|
||||
}
|
||||
|
@ -612,7 +612,7 @@ napi_value JsUIExtensionContentSession::OnSetReceiveDataCallback(napi_env env, N
|
||||
ThrowTooFewParametersError(env);
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
|
||||
if (!CheckTypeForNapiValue(env, info.argv[INDEX_ZERO], napi_function)) {
|
||||
TAG_LOGE(AAFwkTag::UI_EXT, "invalid param");
|
||||
ThrowInvalidParamError(env, "Parameter error: Callback must be a function");
|
||||
@ -827,6 +827,8 @@ napi_value JsUIExtensionContentSession::OnSetWindowPrivacyMode(napi_env env, Nap
|
||||
|
||||
napi_value JsUIExtensionContentSession::OnStartAbilityByType(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGE(AAFwkTag::UI_EXT, "called");
|
||||
|
||||
std::string type;
|
||||
AAFwk::WantParams wantParam;
|
||||
|
||||
|
@ -1018,6 +1018,5 @@ void JSUIExtensionConnection::CallJsFailed(int32_t errorCode)
|
||||
napi_call_function(env_, obj, method, ARGC_ONE, argv, nullptr);
|
||||
TAG_LOGD(AAFwkTag::UI_EXT, "CallJsFailed end");
|
||||
}
|
||||
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
|
@ -243,7 +243,6 @@ sptr<Rosen::Window> UIExtensionContext::GetWindow()
|
||||
{
|
||||
return window_;
|
||||
}
|
||||
|
||||
Ace::UIContent* UIExtensionContext::GetUIContent()
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::UI_EXT, "called");
|
||||
@ -266,12 +265,6 @@ ErrCode UIExtensionContext::OpenAtomicService(AAFwk::Want& want, const AAFwk::St
|
||||
return err;
|
||||
}
|
||||
|
||||
ErrCode UIExtensionContext::OpenLink(const AAFwk::Want& want, int requestCode)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::UI_EXT, "called");
|
||||
return AAFwk::AbilityManagerClient::GetInstance()->OpenLink(want, token_, -1, requestCode);
|
||||
}
|
||||
|
||||
ErrCode UIExtensionContext::AddFreeInstallObserver(const sptr<IFreeInstallObserver> &observer)
|
||||
{
|
||||
ErrCode ret = AAFwk::AbilityManagerClient::GetInstance()->AddFreeInstallObserver(token_, observer);
|
||||
@ -281,6 +274,12 @@ ErrCode UIExtensionContext::AddFreeInstallObserver(const sptr<IFreeInstallObserv
|
||||
return ret;
|
||||
}
|
||||
|
||||
ErrCode UIExtensionContext::OpenLink(const AAFwk::Want& want, int requestCode)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::UI_EXT, "called");
|
||||
return AAFwk::AbilityManagerClient::GetInstance()->OpenLink(want, token_, -1, requestCode);
|
||||
}
|
||||
|
||||
int32_t UIExtensionContext::curRequestCode_ = 0;
|
||||
std::mutex UIExtensionContext::requestCodeMutex_;
|
||||
} // namespace AbilityRuntime
|
||||
|
@ -883,10 +883,10 @@ ErrCode BundleMgrHelper::QueryCloneExtensionAbilityInfoWithAppIndex(const Elemen
|
||||
ErrCode BundleMgrHelper::GetCloneAppIndexes(const std::string &bundleName, std::vector<int32_t> &appIndexes,
|
||||
int32_t userId)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::BUNDLEMGRHELPER, "Called");
|
||||
TAG_LOGD(AAFwkTag::BUNDLEMGRHELPER, "Called.");
|
||||
auto bundleMgr = Connect();
|
||||
if (bundleMgr == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::BUNDLEMGRHELPER, "Failed to connect");
|
||||
TAG_LOGE(AAFwkTag::BUNDLEMGRHELPER, "Failed to connect.");
|
||||
return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,6 @@ bool ApplicationImpl::PerformTerminate(bool isLastProcess)
|
||||
curState_ = APP_STATE_TERMINATED;
|
||||
return true;
|
||||
}
|
||||
TAG_LOGE(AAFwkTag::APPKIT, "curState is %{public}d", curState_);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1462,9 +1462,7 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con
|
||||
};
|
||||
runtime->SetDeviceDisconnectCallback(cb);
|
||||
}
|
||||
|
||||
auto perfCmd = appLaunchData.GetPerfCmd();
|
||||
|
||||
int32_t pid = -1;
|
||||
std::string processName = "";
|
||||
if (processInfo_ != nullptr) {
|
||||
@ -2181,7 +2179,7 @@ void MainThread::HandleForegroundApplication()
|
||||
void MainThread::HandleBackgroundApplication()
|
||||
{
|
||||
HITRACE_METER_NAME(HITRACE_TAG_APP, __PRETTY_FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::APPKIT, "start");
|
||||
TAG_LOGD(AAFwkTag::APPKIT, "start");
|
||||
|
||||
if ((application_ == nullptr) || (appMgr_ == nullptr)) {
|
||||
TAG_LOGE(AAFwkTag::APPKIT, "error");
|
||||
@ -3288,12 +3286,6 @@ int32_t MainThread::ScheduleDumpIpcStat(std::string& result)
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
int32_t MainThread::ScheduleDumpFfrt(std::string& result)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::APPKIT, "pid:%{public}d", getprocpid());
|
||||
return DumpFfrtHelper::DumpFfrt(result);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Notify application to prepare for process caching.
|
||||
@ -3344,7 +3336,6 @@ void MainThread::ParseAppConfigurationParams(const std::string configuration, Co
|
||||
}
|
||||
if (jsonObject.contains(JSON_KEY_APP_FONT_SIZE_SCALE)
|
||||
&& jsonObject[JSON_KEY_APP_FONT_SIZE_SCALE].is_string()) {
|
||||
std::string configFontSizeScal = jsonObject.at(JSON_KEY_APP_FONT_SIZE_SCALE).get<std::string>();
|
||||
appConfig.AddItem(AAFwk::GlobalConfigurationKey::APP_FONT_SIZE_SCALE,
|
||||
jsonObject.at(JSON_KEY_APP_FONT_SIZE_SCALE).get<std::string>());
|
||||
}
|
||||
@ -3379,5 +3370,11 @@ void MainThread::HandleCacheProcess()
|
||||
runtime->ForceFullGC();
|
||||
}
|
||||
}
|
||||
|
||||
int32_t MainThread::ScheduleDumpFfrt(std::string& result)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::APPKIT, "pid:%{public}d", getprocpid());
|
||||
return DumpFfrtHelper::DumpFfrt(result);
|
||||
}
|
||||
} // namespace AppExecFwk
|
||||
} // namespace OHOS
|
||||
|
@ -118,7 +118,7 @@ Ability_NativeChildProcess_ErrCode OH_Ability_StartNativeChildProcess(const char
|
||||
return NCP_ERR_INVALID_PARAM;
|
||||
}
|
||||
if (pid == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::PROCESSMGR, "pid null.");
|
||||
TAG_LOGE(AAFwkTag::PROCESSMGR, "pid null");
|
||||
return NCP_ERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,6 @@ ConnectServerManager::~ConnectServerManager()
|
||||
|
||||
ConnectServerManager& ConnectServerManager::Get()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(instanceMutex_);
|
||||
static ConnectServerManager connectServerManager;
|
||||
return connectServerManager;
|
||||
}
|
||||
|
@ -57,8 +57,8 @@ void OHOSJsEnvironmentImpl::PostTaskToHandler(void* handler, uv_io_cb func, void
|
||||
break;
|
||||
}
|
||||
|
||||
if (g_eventHandler == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::JSRUNTIME, "Invalid parameters");
|
||||
if (g_eventHandler == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::JSRUNTIME, "Invalid parameters!");
|
||||
return;
|
||||
}
|
||||
g_eventHandler->PostTask(task, "uv_io_cb", 0, prio);
|
||||
|
@ -70,7 +70,7 @@ void AbilityContext::SetOptions(const Options &options)
|
||||
TAG_LOGD(AAFwkTag::ABILITY_SIM, "themeId:%{public}d", options.themeId);
|
||||
TAG_LOGD(AAFwkTag::ABILITY_SIM, "deviceWidth:%{public}d", options.deviceWidth);
|
||||
TAG_LOGD(AAFwkTag::ABILITY_SIM, "deviceHeight:%{public}d", options.deviceHeight);
|
||||
TAG_LOGD(AAFwkTag::ABILITY_SIM, "isRound:%{public}d", options.themeId);
|
||||
TAG_LOGD(AAFwkTag::ABILITY_SIM, "isRound:%{public}d", options.isRound);
|
||||
TAG_LOGD(AAFwkTag::ABILITY_SIM, "compatibleVersion:%{public}d", options.compatibleVersion);
|
||||
TAG_LOGD(AAFwkTag::ABILITY_SIM, "installationFree:%{public}d", options.installationFree);
|
||||
TAG_LOGD(AAFwkTag::ABILITY_SIM, "labelId:%{public}d", options.labelId);
|
||||
|
@ -1409,7 +1409,7 @@ public:
|
||||
*/
|
||||
int32_t RestartApp(const AAFwk::Want &want);
|
||||
|
||||
/**
|
||||
/*
|
||||
* @brief Get host info of root caller.
|
||||
*
|
||||
* @param token The ability token.
|
||||
|
@ -1177,7 +1177,6 @@ public:
|
||||
}
|
||||
|
||||
virtual void EnableRecoverAbility(const sptr<IRemoteObject>& token) {};
|
||||
|
||||
virtual void ScheduleRecoverAbility(const sptr<IRemoteObject> &token, int32_t reason,
|
||||
const Want *want = nullptr) {};
|
||||
|
||||
@ -1530,7 +1529,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* @brief Get host info of root caller.
|
||||
*
|
||||
* @param token The ability token.
|
||||
|
@ -705,16 +705,6 @@ public:
|
||||
*/
|
||||
virtual void SetAppAssertionPauseState(bool flag) {}
|
||||
|
||||
/**
|
||||
* Start native child process, callde by ChildProcessManager.
|
||||
* @param libName lib file name to be load in child process
|
||||
* @param childProcessCount current started child process count
|
||||
* @param callback callback for notify start result
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int32_t StartNativeChildProcess(const std::string &libName, int32_t childProcessCount,
|
||||
const sptr<IRemoteObject> &callback) = 0;
|
||||
|
||||
virtual void SaveBrowserChannel(sptr<IRemoteObject> browser) = 0;
|
||||
|
||||
/**
|
||||
@ -728,6 +718,16 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start native child process, callde by ChildProcessManager.
|
||||
* @param libName lib file name to be load in child process
|
||||
* @param childProcessCount current started child process count
|
||||
* @param callback callback for notify start result
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int32_t StartNativeChildProcess(const std::string &libName, int32_t childProcessCount,
|
||||
const sptr<IRemoteObject> &callback) = 0;
|
||||
|
||||
/**
|
||||
* Notify that the process depends on web by itself.
|
||||
*/
|
||||
|
@ -16,7 +16,6 @@
|
||||
#ifndef OHOS_ABILITY_RUNTIME_APP_SCHEDULER_HOST_H
|
||||
#define OHOS_ABILITY_RUNTIME_APP_SCHEDULER_HOST_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
|
||||
#include "iremote_object.h"
|
||||
|
@ -353,9 +353,7 @@ ErrCode AmsMgrStub::HandleKillProcessWithAccount(MessageParcel &data, MessagePar
|
||||
std::string bundleName = data.ReadString();
|
||||
int accountId = data.ReadInt32();
|
||||
|
||||
TAG_LOGI(AAFwkTag::APPMGR,
|
||||
"bundleName = %{public}s, accountId = %{public}d",
|
||||
bundleName.c_str(), accountId);
|
||||
TAG_LOGI(AAFwkTag::APPMGR, "bundleName = %{public}s, accountId = %{public}d", bundleName.c_str(), accountId);
|
||||
|
||||
int32_t result = KillProcessWithAccount(bundleName, accountId);
|
||||
reply.WriteInt32(result);
|
||||
@ -370,9 +368,6 @@ ErrCode AmsMgrStub::HandleKillApplication(MessageParcel &data, MessageParcel &re
|
||||
HITRACE_METER(HITRACE_TAG_APP);
|
||||
std::string bundleName = data.ReadString();
|
||||
|
||||
TAG_LOGI(AAFwkTag::APPMGR, "bundleName = %{public}s",
|
||||
bundleName.c_str());
|
||||
|
||||
int32_t result = KillApplication(bundleName);
|
||||
reply.WriteInt32(result);
|
||||
return NO_ERROR;
|
||||
|
@ -22,15 +22,15 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
#include "iremote_broker.h"
|
||||
#include "element_name.h"
|
||||
#include "refbase.h"
|
||||
#include "context.h"
|
||||
#include "extra_params.h"
|
||||
#include "continuation_request.h"
|
||||
#include "ability_connect_callback_stub.h"
|
||||
#include "continuation_request.h"
|
||||
#include "continuation/kits/continuation_device_callback_interface.h"
|
||||
#include "continuation/remote_register_service_interface.h"
|
||||
#include "context.h"
|
||||
#include "element_name.h"
|
||||
#include "extra_params.h"
|
||||
#include "iremote_broker.h"
|
||||
#include "refbase.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AppExecFwk {
|
||||
|
@ -62,7 +62,6 @@ protected:
|
||||
private:
|
||||
sptr<JsFreeInstallObserver> freeInstallObserver_ = nullptr;
|
||||
friend class JsEmbeddableUIAbilityContext;
|
||||
|
||||
bool CheckStartAbilityInputParam(napi_env env, NapiCallbackInfo& info, AAFwk::Want& want,
|
||||
AAFwk::StartOptions& startOptions, size_t& unwrapArgc) const;
|
||||
napi_value OpenAtomicServiceInner(napi_env env, NapiCallbackInfo& info, AAFwk::Want &want,
|
||||
|
@ -166,9 +166,12 @@ protected:
|
||||
private:
|
||||
static int ILLEGAL_REQUEST_CODE;
|
||||
std::map<int, RuntimeTask> resultCallbacks_;
|
||||
|
||||
static int32_t curRequestCode_;
|
||||
static std::mutex requestCodeMutex_;
|
||||
|
||||
sptr<Rosen::Window> window_ = nullptr;
|
||||
|
||||
std::mutex mutexlock_;
|
||||
/**
|
||||
* @brief Get Current Ability Type
|
||||
|
@ -29,13 +29,13 @@
|
||||
#endif
|
||||
|
||||
#include "ability_delegator_infos.h"
|
||||
#include "ability_lifecycle_executor.h"
|
||||
#include "delegator_thread.h"
|
||||
#include "iability_monitor.h"
|
||||
#include "iability_stage_monitor.h"
|
||||
#include "delegator_thread.h"
|
||||
#include "shell_cmd_result.h"
|
||||
#include "test_runner.h"
|
||||
|
||||
#include "ability_lifecycle_executor.h"
|
||||
#include "foundation/ability/ability_runtime/interfaces/kits/native/appkit/ability_runtime/context/context.h"
|
||||
#include "want.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user