mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-12-11 20:03:42 +00:00
log
Signed-off-by: sodanotgreen <limengzheng@huawei.com>
This commit is contained in:
parent
f5be29f135
commit
bcd15ef09c
@ -104,7 +104,7 @@ void JsFeatureAbility::Finalizer(napi_env env, void *data, void *hint)
|
||||
|
||||
napi_value JsFeatureAbilityInit(napi_env env, napi_value exports)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::FA, "JsFeatureAbilityInit is called");
|
||||
TAG_LOGD(AAFwkTag::FA, "called");
|
||||
if (env == nullptr || exports == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "Invalid input parameters");
|
||||
return exports;
|
||||
@ -220,9 +220,9 @@ napi_value JsFeatureAbility::TerminateAbility(napi_env env, napi_callback_info i
|
||||
#ifdef SUPPORT_SCREEN
|
||||
napi_value JsFeatureAbility::OnHasWindowFocus(napi_env env, const NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGD(AAFwkTag::FA, "called");
|
||||
if (info.argc > ARGS_ONE || info.argc < ARGS_ZERO) {
|
||||
TAG_LOGE(AAFwkTag::FA, " wrong number of arguments.");
|
||||
TAG_LOGE(AAFwkTag::FA, " wrong number of arguments");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
NapiAsyncTask::CompleteCallback complete =
|
||||
@ -239,7 +239,7 @@ napi_value JsFeatureAbility::OnHasWindowFocus(napi_env env, const NapiCallbackIn
|
||||
napi_value lastParam = (info.argc == ARGS_ZERO) ? nullptr : info.argv[PARAM0];
|
||||
NapiAsyncTask::ScheduleHighQos("JSFeatureAbility::OnHasWindowFocus",
|
||||
env, CreateAsyncTaskWithLastParam(env, lastParam, nullptr, std::move(complete), &result));
|
||||
TAG_LOGD(AAFwkTag::FA, "OnHasWindowFocus is called end");
|
||||
TAG_LOGD(AAFwkTag::FA, "end");
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
@ -277,9 +277,9 @@ Ability* JsFeatureAbility::GetAbility(napi_env env)
|
||||
|
||||
napi_value JsFeatureAbility::OnStartAbilityForResult(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGD(AAFwkTag::FA, "called");
|
||||
if (info.argc < ARGS_ONE || info.argc > ARGS_TWO) {
|
||||
TAG_LOGE(AAFwkTag::FA, "wrong number of arguments.");
|
||||
TAG_LOGE(AAFwkTag::FA, "wrong number of arguments");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ napi_value JsFeatureAbility::OnStartAbilityForResult(napi_env env, NapiCallbackI
|
||||
startAbilityCallback->env = env;
|
||||
|
||||
if (UnwrapForResultParam(*abilityParam, env, info.argv[0]) == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "OnStartAbilityForResult UnwrapForResultParam failed.");
|
||||
TAG_LOGE(AAFwkTag::FA, "UnwrapForResultParam failed");
|
||||
startAbilityCallback->errCode = NAPI_ERR_PARAM_INVALID;
|
||||
}
|
||||
|
||||
@ -321,14 +321,14 @@ napi_value JsFeatureAbility::OnStartAbilityForResult(napi_env env, NapiCallbackI
|
||||
|
||||
napi_value JsFeatureAbility::OnFinishWithResult(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGD(AAFwkTag::FA, "called");
|
||||
if (info.argc > ARGS_TWO || info.argc < ARGS_ONE) {
|
||||
TAG_LOGE(AAFwkTag::FA, "wrong number of arguments.");
|
||||
TAG_LOGE(AAFwkTag::FA, "wrong number of arguments");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
if (!AppExecFwk::IsTypeForNapiValue(env, info.argv[0], napi_object)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "OnFinishWithResult param is not object.");
|
||||
TAG_LOGE(AAFwkTag::FA, "param is not object");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
@ -336,11 +336,11 @@ napi_value JsFeatureAbility::OnFinishWithResult(napi_env env, NapiCallbackInfo&
|
||||
napi_value jsRequestCode = nullptr;
|
||||
napi_get_named_property(env, info.argv[0], "resultCode", &jsRequestCode);
|
||||
if (!AppExecFwk::IsTypeForNapiValue(env, jsRequestCode, napi_number)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "OnFinishWithResult resultCode type failed.");
|
||||
TAG_LOGE(AAFwkTag::FA, "resultCode type failed");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
if (!ConvertFromJsValue(env, jsRequestCode, param.requestCode)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "OnFinishWithResult convert resultCode failed.");
|
||||
TAG_LOGE(AAFwkTag::FA, "convert resultCode failed");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
bool hasWant = false;
|
||||
@ -349,11 +349,11 @@ napi_value JsFeatureAbility::OnFinishWithResult(napi_env env, NapiCallbackInfo&
|
||||
napi_value jsWant = nullptr;
|
||||
napi_get_named_property(env, info.argv[0], "want", &jsWant);
|
||||
if (!AppExecFwk::IsTypeForNapiValue(env, jsWant, napi_object)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "OnFinishWithResult want type failed.");
|
||||
TAG_LOGE(AAFwkTag::FA, "want type failed");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
if (!UnwrapWant(env, jsWant, param.want)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "OnFinishWithResult UnwrapWant failed.");
|
||||
TAG_LOGE(AAFwkTag::FA, "UnwrapWant failed");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
}
|
||||
@ -363,7 +363,7 @@ napi_value JsFeatureAbility::OnFinishWithResult(napi_env env, NapiCallbackInfo&
|
||||
obj->ability_->SetResult(param.requestCode, param.want);
|
||||
obj->ability_->TerminateAbility();
|
||||
} else {
|
||||
TAG_LOGE(AAFwkTag::FA, "OnFinishWithResult ability is nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "ability is nullptr");
|
||||
}
|
||||
task.Resolve(env, CreateJsNull(env));
|
||||
};
|
||||
@ -378,8 +378,8 @@ napi_value JsFeatureAbility::OnFinishWithResult(napi_env env, NapiCallbackInfo&
|
||||
napi_value JsFeatureAbility::GetWindow(napi_env env, napi_callback_info info)
|
||||
{
|
||||
if (env == nullptr || info == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "JsFeatureAbility::%{public}s is called, but input parameters %{public}s is nullptr",
|
||||
__func__, ((env == nullptr) ? "env" : "info"));
|
||||
TAG_LOGE(AAFwkTag::FA, "input parameters %{public}s is nullptr",
|
||||
((env == nullptr) ? "env" : "info"));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -394,7 +394,7 @@ napi_value JsFeatureAbility::GetWindow(napi_env env, napi_callback_info info)
|
||||
|
||||
napi_value JsFeatureAbility::OnGetWindow(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::FA, "%{public}s called", __func__);
|
||||
TAG_LOGD(AAFwkTag::FA, "called");
|
||||
size_t argc = ARGS_MAX_COUNT;
|
||||
napi_value argv[ARGS_MAX_COUNT] = { nullptr };
|
||||
napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr);
|
||||
@ -405,7 +405,7 @@ napi_value JsFeatureAbility::OnGetWindow(napi_env env, napi_callback_info info)
|
||||
|
||||
auto complete = [obj = this] (napi_env env, NapiAsyncTask& task, int32_t status) {
|
||||
if (obj->ability_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "OnGetWindow task execute error, the ability is nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "task execute error, the ability is nullptr");
|
||||
task.Resolve(env, CreateJsNull(env));
|
||||
return;
|
||||
}
|
||||
@ -435,29 +435,29 @@ napi_value JsFeatureAbility::OnGetWindow(napi_env env, napi_callback_info info)
|
||||
|
||||
napi_value NAPI_SetResult(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = CreateAsyncCallbackInfo(env);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s,asyncCallbackInfo == nullptr", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "asyncCallbackInfo == nullptr");
|
||||
return WrapVoidToJS(env);
|
||||
}
|
||||
|
||||
napi_value ret = SetResultWrap(env, info, asyncCallbackInfo);
|
||||
if (ret == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s,ret == nullptr", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "ret == nullptr");
|
||||
if (asyncCallbackInfo != nullptr) {
|
||||
delete asyncCallbackInfo;
|
||||
asyncCallbackInfo = nullptr;
|
||||
}
|
||||
ret = WrapVoidToJS(env);
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return ret;
|
||||
}
|
||||
|
||||
napi_value SetResultWrap(napi_env env, napi_callback_info info, AsyncCallbackInfo *asyncCallbackInfo)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
size_t argcAsync = 2;
|
||||
const size_t argcPromise = 1;
|
||||
const size_t argCountWithAsync = argcPromise + ARGS_ASYNC_COUNT;
|
||||
@ -466,13 +466,13 @@ napi_value SetResultWrap(napi_env env, napi_callback_info info, AsyncCallbackInf
|
||||
|
||||
NAPI_CALL(env, napi_get_cb_info(env, info, &argcAsync, args, nullptr, nullptr));
|
||||
if (argcAsync > argCountWithAsync || argcAsync > ARGS_MAX_COUNT) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, Fail argument count.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "Fail argument count");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CallAbilityParam param;
|
||||
if (UnwrapAbilityResult(param, env, args[0]) == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, call unwrapWant failed.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "call unwrapWant failed");
|
||||
return nullptr;
|
||||
}
|
||||
asyncCallbackInfo->param = param;
|
||||
@ -482,7 +482,7 @@ napi_value SetResultWrap(napi_env env, napi_callback_info info, AsyncCallbackInf
|
||||
} else {
|
||||
ret = SetResultPromise(env, asyncCallbackInfo);
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -490,10 +490,10 @@ napi_value CreateAsyncWork(napi_env env, napi_value &resourceName, AsyncCallback
|
||||
{
|
||||
NAPI_CALL(env, napi_create_async_work(env, nullptr, resourceName,
|
||||
[](napi_env env, void *data) {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_SetResult, worker pool thread enter.");
|
||||
TAG_LOGI(AAFwkTag::FA, "worker pool thread enter");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = static_cast<AsyncCallbackInfo *>(data);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPI_SetResult, execute asyncCallbackInfo is nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "execute asyncCallbackInfo is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -502,15 +502,15 @@ napi_value CreateAsyncWork(napi_env env, napi_value &resourceName, AsyncCallback
|
||||
asyncCallbackInfo->param.requestCode, asyncCallbackInfo->param.want);
|
||||
asyncCallbackInfo->ability->TerminateAbility();
|
||||
} else {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPI_SetResult, ability == null");
|
||||
TAG_LOGE(AAFwkTag::FA, "ability == null");
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_SetResult, worker pool thread execute exit.");
|
||||
TAG_LOGI(AAFwkTag::FA, "worker pool thread execute exit");
|
||||
},
|
||||
[](napi_env env, napi_status status, void *data) {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_SetResult, main event thread complete.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = static_cast<AsyncCallbackInfo *>(data);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPI_SetResult, complete asyncCallbackInfo is nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "complete asyncCallbackInfo is nullptr");
|
||||
return;
|
||||
}
|
||||
napi_value result[ARGS_TWO] = {nullptr};
|
||||
@ -529,23 +529,23 @@ napi_value CreateAsyncWork(napi_env env, napi_value &resourceName, AsyncCallback
|
||||
}
|
||||
napi_delete_async_work(env, asyncCallbackInfo->asyncWork);
|
||||
delete asyncCallbackInfo;
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_SetResult, main event thread complete end.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete end");
|
||||
},
|
||||
static_cast<void *>(asyncCallbackInfo),
|
||||
&asyncCallbackInfo->asyncWork));
|
||||
NAPI_CALL(env, napi_queue_async_work(env, asyncCallbackInfo->asyncWork));
|
||||
napi_value result = nullptr;
|
||||
NAPI_CALL(env, napi_get_null(env, &result));
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, asyncCallback end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "asyncCallback end");
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value SetResultAsync(
|
||||
napi_env env, napi_value *args, const size_t argCallback, AsyncCallbackInfo *asyncCallbackInfo)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, asyncCallback.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "asyncCallback");
|
||||
if (args == nullptr || asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, param == nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "param == nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
napi_value resourceName = nullptr;
|
||||
@ -562,9 +562,9 @@ napi_value SetResultAsync(
|
||||
|
||||
napi_value SetResultPromise(napi_env env, AsyncCallbackInfo *asyncCallbackInfo)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, promise.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "promise");
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "SetResultPromise, param == nullptr.");
|
||||
TAG_LOGE(AAFwkTag::FA, "param == nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
napi_value resourceName = nullptr;
|
||||
@ -576,10 +576,10 @@ napi_value SetResultPromise(napi_env env, AsyncCallbackInfo *asyncCallbackInfo)
|
||||
|
||||
NAPI_CALL(env, napi_create_async_work(env, nullptr, resourceName,
|
||||
[](napi_env env, void *data) {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_SetResult, worker pool thread execute.");
|
||||
TAG_LOGI(AAFwkTag::FA, "worker pool thread execute");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = static_cast<AsyncCallbackInfo *>(data);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPI_SetResult promise, execute asyncCallbackInfo is nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "execute asyncCallbackInfo is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -588,15 +588,15 @@ napi_value SetResultPromise(napi_env env, AsyncCallbackInfo *asyncCallbackInfo)
|
||||
asyncCallbackInfo->param.requestCode, asyncCallbackInfo->param.want);
|
||||
asyncCallbackInfo->ability->TerminateAbility();
|
||||
} else {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPI_SetResult, ability == nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "ability == nullptr");
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_SetResult, worker pool thread execute end.");
|
||||
TAG_LOGI(AAFwkTag::FA, "worker pool thread execute end");
|
||||
},
|
||||
[](napi_env env, napi_status status, void *data) {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_SetResult, main event thread complete.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = static_cast<AsyncCallbackInfo *>(data);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPI_SetResult promise, execute asyncCallbackInfo is nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "execute asyncCallbackInfo is nullptr");
|
||||
return;
|
||||
}
|
||||
napi_value result = nullptr;
|
||||
@ -604,12 +604,12 @@ napi_value SetResultPromise(napi_env env, AsyncCallbackInfo *asyncCallbackInfo)
|
||||
napi_resolve_deferred(env, asyncCallbackInfo->deferred, result);
|
||||
napi_delete_async_work(env, asyncCallbackInfo->asyncWork);
|
||||
delete asyncCallbackInfo;
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_SetResult, main event thread complete end.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete end");
|
||||
},
|
||||
static_cast<void *>(asyncCallbackInfo),
|
||||
&asyncCallbackInfo->asyncWork));
|
||||
NAPI_CALL(env, napi_queue_async_work(env, asyncCallbackInfo->asyncWork));
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, promise end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "promise end");
|
||||
return promise;
|
||||
}
|
||||
|
||||
@ -623,12 +623,12 @@ int CreateUVQueueWork(uv_loop_t *loop, uv_work_t *work)
|
||||
[](uv_work_t *work, int status) {
|
||||
// JS Thread
|
||||
if (work == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, uv_queue_work work == nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "uv_queue_work work == nullptr");
|
||||
return;
|
||||
}
|
||||
auto onAbilityCB = static_cast<OnAbilityCallback *>(work->data);
|
||||
if (onAbilityCB == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, uv_queue_work onAbilityCB == nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "uv_queue_work onAbilityCB == nullptr");
|
||||
delete work;
|
||||
work = nullptr;
|
||||
return;
|
||||
@ -662,21 +662,21 @@ int CreateUVQueueWork(uv_loop_t *loop, uv_work_t *work)
|
||||
onAbilityCB = nullptr;
|
||||
delete work;
|
||||
work = nullptr;
|
||||
TAG_LOGI(AAFwkTag::FA, "CallOnAbilityResult, uv_queue_work end");
|
||||
TAG_LOGI(AAFwkTag::FA, "uv_queue_work end");
|
||||
});
|
||||
return rev;
|
||||
}
|
||||
|
||||
void CallOnAbilityResult(int requestCode, int resultCode, const Want &resultData, CallbackInfo callbackInfo)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
if (callbackInfo.env == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "CallOnAbilityResult cb.env is nullptr.");
|
||||
TAG_LOGE(AAFwkTag::FA, "cb.env is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
if (callbackInfo.napiAsyncTask == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "CallOnAbilityResult cb.asyncTask is nullptr.");
|
||||
TAG_LOGE(AAFwkTag::FA, "asyncTask is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -693,9 +693,9 @@ void CallOnAbilityResult(int requestCode, int resultCode, const Want &resultData
|
||||
onAbilityCB->resultCode = resultCode;
|
||||
onAbilityCB->resultData = resultData;
|
||||
onAbilityCB->cb = callbackInfo;
|
||||
|
||||
|
||||
if (work == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "work == nullptr.");
|
||||
TAG_LOGE(AAFwkTag::FA, "work == nullptr");
|
||||
return;
|
||||
}
|
||||
work->data = static_cast<void *>(onAbilityCB);
|
||||
@ -711,23 +711,23 @@ void CallOnAbilityResult(int requestCode, int resultCode, const Want &resultData
|
||||
work = nullptr;
|
||||
}
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
}
|
||||
EXTERN_C_END
|
||||
|
||||
bool InnerUnwrapWant(napi_env env, napi_value args, Want &want)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
napi_valuetype valueType = napi_undefined;
|
||||
NAPI_CALL_BASE(env, napi_typeof(env, args, &valueType), false);
|
||||
if (valueType != napi_object) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s wrong argument type", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "wrong argument type");
|
||||
return false;
|
||||
}
|
||||
|
||||
napi_value jsWant = GetPropertyValueByPropertyName(env, args, "want", napi_object);
|
||||
if (jsWant == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s jsWant == nullptr", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "jsWant == nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -736,13 +736,12 @@ bool InnerUnwrapWant(napi_env env, napi_value args, Want &want)
|
||||
|
||||
napi_value UnwrapForResultParam(CallAbilityParam ¶m, napi_env env, napi_value args)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
// dummy requestCode for NativeC++ interface and onabilityresult callback
|
||||
param.requestCode = dummyRequestCode_;
|
||||
param.forResultOption = true;
|
||||
dummyRequestCode_ = (dummyRequestCode_ < INT32_MAX) ? (dummyRequestCode_ + 1) : 0;
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, reqCode=%{public}d forResultOption=%{public}d.",
|
||||
__func__,
|
||||
TAG_LOGI(AAFwkTag::FA, "reqCode=%{public}d forResultOption=%{public}d.",
|
||||
param.requestCode,
|
||||
param.forResultOption);
|
||||
|
||||
@ -760,20 +759,20 @@ napi_value UnwrapForResultParam(CallAbilityParam ¶m, napi_env env, napi_valu
|
||||
if (jsSettingObj != nullptr) {
|
||||
param.setting = AbilityStartSetting::GetEmptySetting();
|
||||
if (!UnwrapAbilityStartSetting(env, jsSettingObj, *(param.setting))) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, unwrap abilityStartSetting failed.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "unwrap abilityStartSetting failed");
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s abilityStartSetting", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "abilityStartSetting");
|
||||
}
|
||||
|
||||
napi_value result;
|
||||
NAPI_CALL(env, napi_create_int32(env, 1, &result));
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value UnwrapAbilityResult(CallAbilityParam ¶m, napi_env env, napi_value args)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
// unwrap the param
|
||||
napi_valuetype valueType = napi_undefined;
|
||||
NAPI_CALL(env, napi_typeof(env, args, &valueType));
|
||||
@ -784,14 +783,14 @@ napi_value UnwrapAbilityResult(CallAbilityParam ¶m, napi_env env, napi_value
|
||||
NAPI_CALL(env, napi_typeof(env, property, &valueType));
|
||||
NAPI_ASSERT(env, valueType == napi_number, "property type mismatch!");
|
||||
NAPI_CALL(env, napi_get_value_int32(env, property, ¶m.requestCode));
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, requestCode=%{public}d.", __func__, param.requestCode);
|
||||
TAG_LOGI(AAFwkTag::FA, "requestCode=%{public}d", param.requestCode);
|
||||
|
||||
// unwrap the param : want object
|
||||
InnerUnwrapWant(env, args, param.want);
|
||||
|
||||
napi_value result;
|
||||
NAPI_CALL(env, napi_create_int32(env, 1, &result));
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -805,15 +804,15 @@ napi_value UnwrapAbilityResult(CallAbilityParam ¶m, napi_env env, napi_value
|
||||
*/
|
||||
napi_value GetWantSyncWrap(napi_env env, napi_callback_info info, AsyncCallbackInfo *asyncCallbackInfo)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, asyncCallbackInfo == nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "asyncCallbackInfo == nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
asyncCallbackInfo->errCode = NAPI_ERR_NO_ERROR;
|
||||
if (asyncCallbackInfo->ability == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, ability == nullptr", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "ability == nullptr");
|
||||
asyncCallbackInfo->errCode = NAPI_ERR_ACE_ABILITY;
|
||||
return nullptr;
|
||||
}
|
||||
@ -831,7 +830,7 @@ napi_value GetWantSyncWrap(napi_env env, napi_callback_info info, AsyncCallbackI
|
||||
} else {
|
||||
result = WrapVoidToJS(env);
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, end.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -845,7 +844,7 @@ napi_value GetWantSyncWrap(napi_env env, napi_callback_info info, AsyncCallbackI
|
||||
*/
|
||||
napi_value NAPI_GetWantSync(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = CreateAsyncCallbackInfo(env);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
return WrapVoidToJS(env);
|
||||
@ -859,9 +858,9 @@ napi_value NAPI_GetWantSync(napi_env env, napi_callback_info info)
|
||||
|
||||
if (ret == nullptr) {
|
||||
ret = WrapVoidToJS(env);
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s ret == null", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "ret == null");
|
||||
} else {
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, exit.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "exit");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -876,7 +875,7 @@ napi_value NAPI_GetWantSync(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_GetAppType(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_GetAppTypeCommon(env, info, AbilityType::PAGE);
|
||||
}
|
||||
|
||||
@ -890,7 +889,7 @@ napi_value NAPI_GetAppType(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_GetAbilityName(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_GetAbilityNameCommon(env, info, AbilityType::PAGE);
|
||||
}
|
||||
|
||||
@ -904,7 +903,7 @@ napi_value NAPI_GetAbilityName(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_GetAbilityInfo(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_GetAbilityInfoCommon(env, info, AbilityType::PAGE);
|
||||
}
|
||||
|
||||
@ -918,7 +917,7 @@ napi_value NAPI_GetAbilityInfo(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_GetHapModuleInfo(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_GetHapModuleInfoCommon(env, info, AbilityType::PAGE);
|
||||
}
|
||||
|
||||
@ -932,23 +931,23 @@ napi_value NAPI_GetHapModuleInfo(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_GetDataAbilityHelper(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
DataAbilityHelperCB *dataAbilityHelperCB = new (std::nothrow) DataAbilityHelperCB;
|
||||
if (dataAbilityHelperCB == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, dataAbilityHelperCB == nullptr", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "dataAbilityHelperCB == nullptr");
|
||||
return WrapVoidToJS(env);
|
||||
}
|
||||
dataAbilityHelperCB->cbBase.cbInfo.env = env;
|
||||
napi_value ret = GetDataAbilityHelperWrap(env, info, dataAbilityHelperCB);
|
||||
if (ret == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, ret == nullptr", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "ret == nullptr");
|
||||
if (dataAbilityHelperCB != nullptr) {
|
||||
delete dataAbilityHelperCB;
|
||||
dataAbilityHelperCB = nullptr;
|
||||
}
|
||||
ret = WrapVoidToJS(env);
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -962,9 +961,9 @@ napi_value NAPI_GetDataAbilityHelper(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value GetDataAbilityHelperWrap(napi_env env, napi_callback_info info, DataAbilityHelperCB *dataAbilityHelperCB)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
if (dataAbilityHelperCB == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s,dataAbilityHelperCB == nullptr", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "dataAbilityHelperCB == nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -976,7 +975,7 @@ napi_value GetDataAbilityHelperWrap(napi_env env, napi_callback_info info, DataA
|
||||
|
||||
NAPI_CALL(env, napi_get_cb_info(env, info, &argcAsync, args, nullptr, nullptr));
|
||||
if (argcAsync > argCountWithAsync || argcAsync > ARGS_MAX_COUNT) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, Wrong argument count.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "Wrong argument count");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -991,16 +990,16 @@ napi_value GetDataAbilityHelperWrap(napi_env env, napi_callback_info info, DataA
|
||||
} else {
|
||||
ret = GetDataAbilityHelperPromise(env, dataAbilityHelperCB);
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return ret;
|
||||
}
|
||||
|
||||
napi_value GetDataAbilityHelperAsync(
|
||||
napi_env env, napi_value *args, const size_t argCallback, DataAbilityHelperCB *dataAbilityHelperCB)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, asyncCallback.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "asyncCallback");
|
||||
if (args == nullptr || dataAbilityHelperCB == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, param == nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "param == nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
napi_value resourceName = nullptr;
|
||||
@ -1015,7 +1014,7 @@ napi_value GetDataAbilityHelperAsync(
|
||||
NAPI_CALL(env,
|
||||
napi_create_async_work(env, nullptr, resourceName,
|
||||
[](napi_env env, void *data) {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_GetDataAbilityHelper, worker pool thread execute.");
|
||||
TAG_LOGI(AAFwkTag::FA, "worker pool thread execute.");
|
||||
},
|
||||
GetDataAbilityHelperAsyncCompleteCB,
|
||||
static_cast<void *>(dataAbilityHelperCB),
|
||||
@ -1024,15 +1023,15 @@ napi_value GetDataAbilityHelperAsync(
|
||||
napi_qos_user_initiated));
|
||||
napi_value result = nullptr;
|
||||
NAPI_CALL(env, napi_get_null(env, &result));
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, asyncCallback end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "asyncCallback end");
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value GetDataAbilityHelperPromise(napi_env env, DataAbilityHelperCB *dataAbilityHelperCB)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, promise.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "promise");
|
||||
if (dataAbilityHelperCB == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, param == nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "param == nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
napi_value resourceName;
|
||||
@ -1045,23 +1044,23 @@ napi_value GetDataAbilityHelperPromise(napi_env env, DataAbilityHelperCB *dataAb
|
||||
NAPI_CALL(env,
|
||||
napi_create_async_work(env, nullptr, resourceName,
|
||||
[](napi_env env, void *data) {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_GetDataAbilityHelper, worker pool thread execute.");
|
||||
TAG_LOGI(AAFwkTag::FA, "worker pool thread execute.");
|
||||
},
|
||||
GetDataAbilityHelperPromiseCompleteCB,
|
||||
static_cast<void *>(dataAbilityHelperCB),
|
||||
&dataAbilityHelperCB->cbBase.asyncWork));
|
||||
NAPI_CALL(env, napi_queue_async_work_with_qos(env, dataAbilityHelperCB->cbBase.asyncWork,
|
||||
napi_qos_user_initiated));
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, promise end.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "promise end");
|
||||
return promise;
|
||||
}
|
||||
|
||||
void GetDataAbilityHelperAsyncCompleteCB(napi_env env, napi_status status, void *data)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_GetDataAbilityHelper, main event thread complete.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete.");
|
||||
DataAbilityHelperCB *dataAbilityHelperCB = static_cast<DataAbilityHelperCB *>(data);
|
||||
if (dataAbilityHelperCB == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "GetDataAbilityHelperAsyncCompleteCB, dataAbilityHelperCB is nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "dataAbilityHelperCB is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1078,7 +1077,7 @@ void GetDataAbilityHelperAsyncCompleteCB(napi_env env, napi_status status, void
|
||||
if (IsTypeForNapiValue(env, dataAbilityHelperCB->result, napi_object)) {
|
||||
result[PARAM1] = dataAbilityHelperCB->result;
|
||||
} else {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_GetDataAbilityHelper, helper is nullptr.");
|
||||
TAG_LOGI(AAFwkTag::FA, "helper is nullptr");
|
||||
result[PARAM1] = WrapVoidToJS(env);
|
||||
}
|
||||
result[PARAM0] = GetCallbackErrorValue(env, NO_ERROR);
|
||||
@ -1090,15 +1089,15 @@ void GetDataAbilityHelperAsyncCompleteCB(napi_env env, napi_status status, void
|
||||
napi_delete_reference(env, dataAbilityHelperCB->uri);
|
||||
}
|
||||
napi_delete_async_work(env, dataAbilityHelperCB->cbBase.asyncWork);
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_GetDataAbilityHelper, main event thread complete end.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete end");
|
||||
}
|
||||
|
||||
void GetDataAbilityHelperPromiseCompleteCB(napi_env env, napi_status status, void *data)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_GetDataAbilityHelper, main event thread complete.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete");
|
||||
DataAbilityHelperCB *dataAbilityHelperCB = static_cast<DataAbilityHelperCB *>(data);
|
||||
if (dataAbilityHelperCB == nullptr) {
|
||||
TAG_LOGI(AAFwkTag::FA, "GetDataAbilityHelperPromiseCompleteCB, dataAbilityHelperCB is nullptr.");
|
||||
TAG_LOGI(AAFwkTag::FA, "dataAbilityHelperCB is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1112,14 +1111,14 @@ void GetDataAbilityHelperPromiseCompleteCB(napi_env env, napi_status status, voi
|
||||
} else {
|
||||
result = GetCallbackErrorValue(env, dataAbilityHelperCB->cbBase.errCode);
|
||||
napi_reject_deferred(env, dataAbilityHelperCB->cbBase.deferred, result);
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_GetDataAbilityHelper, helper is nullptr.");
|
||||
TAG_LOGI(AAFwkTag::FA, "helper is nullptr");
|
||||
}
|
||||
|
||||
if (dataAbilityHelperCB->uri != nullptr) {
|
||||
napi_delete_reference(env, dataAbilityHelperCB->uri);
|
||||
}
|
||||
napi_delete_async_work(env, dataAbilityHelperCB->cbBase.asyncWork);
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_GetDataAbilityHelper, main event thread complete end.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete end");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1145,10 +1144,10 @@ napi_value NAPI_AcquireDataAbilityHelper(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_FAContinueAbility(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = CreateAsyncCallbackInfo(env);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, asyncCallbackInfo == nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "asyncCallbackInfo == nullptr");
|
||||
return WrapVoidToJS(env);
|
||||
}
|
||||
|
||||
@ -1160,7 +1159,7 @@ napi_value NAPI_FAContinueAbility(napi_env env, napi_callback_info info)
|
||||
}
|
||||
ret = WrapVoidToJS(env);
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,end.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1174,7 +1173,7 @@ napi_value NAPI_FAContinueAbility(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value ContinueAbilityWrap(napi_env env, napi_callback_info info, AsyncCallbackInfo *asyncCallbackInfo)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
size_t argc = 2;
|
||||
napi_value args[ARGS_MAX_COUNT] = {nullptr};
|
||||
napi_value ret = nullptr;
|
||||
@ -1183,7 +1182,7 @@ napi_value ContinueAbilityWrap(napi_env env, napi_callback_info info, AsyncCallb
|
||||
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, args, nullptr, nullptr));
|
||||
NAPI_CALL(env, napi_typeof(env, args[0], &valueType));
|
||||
if (valueType != napi_object && valueType != napi_function) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, Wrong argument type. Object or function expected.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "Wrong argument type. Object or function expected");
|
||||
return nullptr;
|
||||
}
|
||||
if (argc == 0) {
|
||||
@ -1198,14 +1197,14 @@ napi_value ContinueAbilityWrap(napi_env env, napi_callback_info info, AsyncCallb
|
||||
napi_valuetype value = napi_undefined;
|
||||
NAPI_CALL(env, napi_typeof(env, args[1], &value));
|
||||
if (value != napi_function) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, Wrong argument type. function expected.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "Wrong argument type, function expected");
|
||||
return nullptr;
|
||||
}
|
||||
ret = ContinueAbilityAsync(env, args, asyncCallbackInfo, argc);
|
||||
} else {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, Wrong argument count.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "Wrong argument count");
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,end.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1213,25 +1212,25 @@ void CreateContinueAsyncWork(napi_env env, napi_value &resourceName, AsyncCallba
|
||||
{
|
||||
napi_create_async_work(env, nullptr, resourceName,
|
||||
[](napi_env env, void *data) {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_ContinueAbility, worker pool thread execute.");
|
||||
TAG_LOGI(AAFwkTag::FA, "worker pool thread execute");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = static_cast<AsyncCallbackInfo *>(data);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPI_ContinueAbility, asyncCallbackInfo is nullptr.");
|
||||
TAG_LOGE(AAFwkTag::FA, "asyncCallbackInfo is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
if (asyncCallbackInfo->ability != nullptr) {
|
||||
asyncCallbackInfo->ability->ContinueAbility(asyncCallbackInfo->optionInfo.deviceId);
|
||||
} else {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPI_ContinueAbilityForResult, asyncCallbackInfo == nullptr.");
|
||||
TAG_LOGE(AAFwkTag::FA, "asyncCallbackInfo == nullptr");
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_ContinueAbilityForResult, worker pool thread execute exit.");
|
||||
TAG_LOGI(AAFwkTag::FA, "worker pool thread execute exit");
|
||||
},
|
||||
[](napi_env env, napi_status status, void *data) {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_ContinueAbility, main event thread end.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread end");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = static_cast<AsyncCallbackInfo *>(data);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPI_ContinueAbility complete, asyncCallbackInfo is nullptr.");
|
||||
TAG_LOGE(AAFwkTag::FA, "asyncCallbackInfo is nullptr");
|
||||
return;
|
||||
}
|
||||
napi_value callback = nullptr;
|
||||
@ -1249,7 +1248,7 @@ void CreateContinueAsyncWork(napi_env env, napi_value &resourceName, AsyncCallba
|
||||
}
|
||||
napi_delete_async_work(env, asyncCallbackInfo->asyncWork);
|
||||
delete asyncCallbackInfo;
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_ContinueAbilityForResult, main event thread complete end.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete end");
|
||||
},
|
||||
static_cast<void *>(asyncCallbackInfo),
|
||||
&asyncCallbackInfo->asyncWork);
|
||||
@ -1257,9 +1256,9 @@ void CreateContinueAsyncWork(napi_env env, napi_value &resourceName, AsyncCallba
|
||||
|
||||
napi_value ContinueAbilityAsync(napi_env env, napi_value *args, AsyncCallbackInfo *asyncCallbackInfo, size_t argc)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, asyncCallback.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "asyncCallback");
|
||||
if (args == nullptr || asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, param == nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "param == nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
napi_value resourceName = nullptr;
|
||||
@ -1270,11 +1269,11 @@ napi_value ContinueAbilityAsync(napi_env env, napi_value *args, AsyncCallbackInf
|
||||
napi_valuetype valueTypeOptions = napi_undefined;
|
||||
NAPI_CALL(env, napi_typeof(env, args[0], &valueTypeOptions));
|
||||
if (valueTypeOptions != napi_object) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, Wrong argument type. Object expected.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "Wrong argument type. Object expected");
|
||||
return nullptr;
|
||||
}
|
||||
if (GetContinueAbilityOptionsInfoCommon(env, args[0], asyncCallbackInfo->optionInfo) == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, GetContinueAbilityOptionsInfoCommonFail", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "GetContinueAbilityOptionsInfoCommonFail");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -1298,15 +1297,15 @@ napi_value ContinueAbilityAsync(napi_env env, napi_value *args, AsyncCallbackInf
|
||||
napi_queue_async_work(env, asyncCallbackInfo->asyncWork);
|
||||
napi_value result = nullptr;
|
||||
napi_get_null(env, &result);
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, asyncCallback end.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "asyncCallback end");
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value ContinueAbilityPromise(napi_env env, napi_value *args, AsyncCallbackInfo *asyncCallbackInfo, size_t argc)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, promise.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "promise");
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, param == nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "param == nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -1315,7 +1314,7 @@ napi_value ContinueAbilityPromise(napi_env env, napi_value *args, AsyncCallbackI
|
||||
napi_valuetype valueTypeOptions = napi_undefined;
|
||||
NAPI_CALL(env, napi_typeof(env, args[0], &valueTypeOptions));
|
||||
if (valueTypeOptions != napi_object) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, Wrong argument type. Object expected.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "Wrong argument type, Object expected");
|
||||
return nullptr;
|
||||
}
|
||||
if (GetContinueAbilityOptionsInfoCommon(env, args[0], asyncCallbackInfo->optionInfo) == nullptr) {
|
||||
@ -1333,26 +1332,26 @@ napi_value ContinueAbilityPromise(napi_env env, napi_value *args, AsyncCallbackI
|
||||
|
||||
napi_create_async_work(env, nullptr, resourceName,
|
||||
[](napi_env env, void *data) {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_ContinueAbility, worker pool thread execute.");
|
||||
TAG_LOGI(AAFwkTag::FA, "worker pool thread execute");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = static_cast<AsyncCallbackInfo *>(data);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(
|
||||
AAFwkTag::FA, "NAPI_ContinueAbility, worker pool thread execute asyncCallbackInfo is nullptr.");
|
||||
AAFwkTag::FA, "worker pool thread execute asyncCallbackInfo is nullptr");
|
||||
return;
|
||||
}
|
||||
if (asyncCallbackInfo->ability != nullptr) {
|
||||
asyncCallbackInfo->ability->ContinueAbility(asyncCallbackInfo->optionInfo.deviceId);
|
||||
} else {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPI_ContinueAbilityForResult, asyncCallbackInfo == nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "asyncCallbackInfo == nullptr");
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_ContinueAbilityForResult, worker pool thread execute end.");
|
||||
TAG_LOGI(AAFwkTag::FA, "worker pool thread execute end");
|
||||
},
|
||||
[](napi_env env, napi_status status, void *data) {
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_ContinueAbility, main event thread complete.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete");
|
||||
AsyncCallbackInfo *asyncCallbackInfo = static_cast<AsyncCallbackInfo *>(data);
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
TAG_LOGE(
|
||||
AAFwkTag::FA, "NAPI_ContinueAbility, main event thread complete asyncCallbackInfo is nullptr.");
|
||||
AAFwkTag::FA, "main event thread complete asyncCallbackInfo is nullptr");
|
||||
return;
|
||||
}
|
||||
napi_value result = nullptr;
|
||||
@ -1360,11 +1359,11 @@ napi_value ContinueAbilityPromise(napi_env env, napi_value *args, AsyncCallbackI
|
||||
napi_resolve_deferred(env, asyncCallbackInfo->deferred, result);
|
||||
napi_delete_async_work(env, asyncCallbackInfo->asyncWork);
|
||||
delete asyncCallbackInfo;
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPI_ContinueAbilityForResult, main event thread complete end.");
|
||||
TAG_LOGI(AAFwkTag::FA, "main event thread complete end");
|
||||
},
|
||||
static_cast<void *>(asyncCallbackInfo), &asyncCallbackInfo->asyncWork);
|
||||
napi_queue_async_work(env, asyncCallbackInfo->asyncWork);
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, promise end.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "promise end");
|
||||
return promise;
|
||||
}
|
||||
} // namespace AppExecFwk
|
||||
|
@ -67,7 +67,7 @@ napi_value FAConstantInit(napi_env env, napi_value exports)
|
||||
|
||||
void SetNamedProperty(napi_env env, napi_value dstObj, const char *objName, const char *propName)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::FA, "SetNamedProperty start");
|
||||
TAG_LOGD(AAFwkTag::FA, "start");
|
||||
napi_value prop = nullptr;
|
||||
napi_create_string_utf8(env, objName, NAPI_AUTO_LENGTH, &prop);
|
||||
napi_set_named_property(env, dstObj, propName, prop);
|
||||
@ -75,7 +75,7 @@ void SetNamedProperty(napi_env env, napi_value dstObj, const char *objName, cons
|
||||
|
||||
void SetNamedProperty(napi_env env, napi_value dstObj, const int32_t objValue, const char *propName)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::FA, "SetNamedProperty start");
|
||||
TAG_LOGD(AAFwkTag::FA, "start");
|
||||
napi_value prop = nullptr;
|
||||
napi_create_int32(env, objValue, &prop);
|
||||
napi_set_named_property(env, dstObj, propName, prop);
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -27,18 +27,18 @@ void NAPIDataAbilityObserver::ReleaseJSCallback()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (ref_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "NAPIDataAbilityObserver::ReleaseJSCallback, ref_ is null.");
|
||||
TAG_LOGE(AAFwkTag::FA, "ref_ is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (isCallingback_) {
|
||||
needRelease_ = true;
|
||||
TAG_LOGW(AAFwkTag::FA, "%{public}s, ref_ is calling back.", __func__);
|
||||
TAG_LOGW(AAFwkTag::FA, "ref_ is calling back");
|
||||
return;
|
||||
}
|
||||
|
||||
SafeReleaseJSCallback();
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPIDataAbilityObserver::%{public}s, called. end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
}
|
||||
|
||||
void NAPIDataAbilityObserver::SafeReleaseJSCallback()
|
||||
@ -46,7 +46,7 @@ void NAPIDataAbilityObserver::SafeReleaseJSCallback()
|
||||
uv_loop_s* loop = nullptr;
|
||||
napi_get_uv_event_loop(env_, &loop);
|
||||
if (loop == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, loop == nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "loop == nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -100,25 +100,25 @@ void NAPIDataAbilityObserver::SafeReleaseJSCallback()
|
||||
void NAPIDataAbilityObserver::SetEnv(const napi_env &env)
|
||||
{
|
||||
env_ = env;
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPIDataAbilityObserver::%{public}s, called. end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
}
|
||||
|
||||
void NAPIDataAbilityObserver::SetCallbackRef(const napi_ref &ref)
|
||||
{
|
||||
ref_ = ref;
|
||||
TAG_LOGI(AAFwkTag::FA, "NAPIDataAbilityObserver::%{public}s, called. end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
}
|
||||
|
||||
static void OnChangeJSThreadWorker(uv_work_t *work, int status)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "OnChange, uv_queue_work");
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
if (work == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "OnChange, uv_queue_work input work is nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "input work is nullptr");
|
||||
return;
|
||||
}
|
||||
DAHelperOnOffCB *onCB = (DAHelperOnOffCB *)work->data;
|
||||
if (onCB == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "OnChange, uv_queue_work onCB is nullptr");
|
||||
TAG_LOGE(AAFwkTag::FA, "onCB is nullptr");
|
||||
delete work;
|
||||
work = nullptr;
|
||||
return;
|
||||
@ -132,7 +132,7 @@ static void OnChangeJSThreadWorker(uv_work_t *work, int status)
|
||||
onCB = nullptr;
|
||||
delete work;
|
||||
work = nullptr;
|
||||
TAG_LOGI(AAFwkTag::FA, "OnChange, uv_queue_work. end");
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
}
|
||||
|
||||
void NAPIDataAbilityObserver::CallJsMethod()
|
||||
@ -140,7 +140,7 @@ void NAPIDataAbilityObserver::CallJsMethod()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (ref_ == nullptr || env_ == nullptr) {
|
||||
TAG_LOGW(AAFwkTag::FA, "%{public}s observer is invalid.", __func__);
|
||||
TAG_LOGW(AAFwkTag::FA, "observer is invalid");
|
||||
return;
|
||||
}
|
||||
isCallingback_ = true;
|
||||
@ -157,7 +157,7 @@ void NAPIDataAbilityObserver::CallJsMethod()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (needRelease_ && ref_ != nullptr) {
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s to delete callback.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "to delete callback");
|
||||
napi_delete_reference(env_, ref_);
|
||||
ref_ = nullptr;
|
||||
needRelease_ = false;
|
||||
@ -169,13 +169,13 @@ void NAPIDataAbilityObserver::CallJsMethod()
|
||||
void NAPIDataAbilityObserver::OnChange()
|
||||
{
|
||||
if (ref_ == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, OnChange ref is nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "ref is nullptr");
|
||||
return;
|
||||
}
|
||||
uv_loop_s *loop = nullptr;
|
||||
napi_get_uv_event_loop(env_, &loop);
|
||||
if (loop == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, loop is nullptr.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "loop is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ void NAPIDataAbilityObserver::OnChange()
|
||||
work = nullptr;
|
||||
}
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, called. end", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
}
|
||||
|
||||
} // namespace AppExecFwk
|
||||
|
@ -52,9 +52,9 @@ napi_value DataAbilityOperationInit(napi_env env, napi_value exports)
|
||||
napi_value UnwrapDataAbilityOperation(
|
||||
std::shared_ptr<DataAbilityOperation> &dataAbilityOperation, napi_env env, napi_value param)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
if (!IsTypeForNapiValue(env, param, napi_object)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, Params is invalid.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "Params is invalid");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -65,28 +65,28 @@ napi_value UnwrapDataAbilityOperation(
|
||||
napi_value BuildDataAbilityOperation(
|
||||
std::shared_ptr<DataAbilityOperation> &dataAbilityOperation, napi_env env, napi_value param)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s start.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "start");
|
||||
|
||||
// get uri property
|
||||
std::string uriStr("");
|
||||
if (!UnwrapStringByPropertyName(env, param, "uri", uriStr)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, uri is not exist.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "uri is not exist");
|
||||
return nullptr;
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, uri:%{public}s", __func__, uriStr.c_str());
|
||||
TAG_LOGI(AAFwkTag::FA, "uri:%{public}s", uriStr.c_str());
|
||||
std::shared_ptr<Uri> uri = std::make_shared<Uri>(uriStr);
|
||||
|
||||
// get type property
|
||||
int type = 0;
|
||||
if (!UnwrapInt32ByPropertyName(env, param, "type", type)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, type:%{public}d is not exist.", __func__, type);
|
||||
TAG_LOGE(AAFwkTag::FA, "type:%{public}d is not exist", type);
|
||||
return nullptr;
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, type:%{public}d", __func__, type);
|
||||
TAG_LOGI(AAFwkTag::FA, "type:%{public}d", type);
|
||||
|
||||
std::shared_ptr<DataAbilityOperationBuilder> builder = nullptr;
|
||||
if (!GetDataAbilityOperationBuilder(builder, type, uri)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, GetDataAbilityOperationBuilder failed.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "GetDataAbilityOperationBuilder failed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ napi_value BuildDataAbilityOperation(
|
||||
// get expectedCount property
|
||||
int expectedCount = 0;
|
||||
UnwrapInt32ByPropertyName(env, param, "expectedCount", expectedCount);
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, expectedCount:%{public}d", __func__, expectedCount);
|
||||
TAG_LOGI(AAFwkTag::FA, "expectedCount:%{public}d", expectedCount);
|
||||
if (expectedCount > 0) {
|
||||
builder->WithExpectedCount(expectedCount);
|
||||
}
|
||||
@ -129,19 +129,19 @@ napi_value BuildDataAbilityOperation(
|
||||
builder->WithValueBackReferences(backReferences);
|
||||
|
||||
if (builder != nullptr) {
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, builder is not nullptr", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "builder is not nullptr");
|
||||
dataAbilityOperation = builder->Build();
|
||||
}
|
||||
napi_value result;
|
||||
NAPI_CALL(env, napi_create_int32(env, 1, &result));
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s end.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return result;
|
||||
}
|
||||
|
||||
bool GetDataAbilityOperationBuilder(
|
||||
std::shared_ptr<DataAbilityOperationBuilder> &builder, const int type, const std::shared_ptr<Uri> &uri)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
switch (type) {
|
||||
case DataAbilityOperation::TYPE_INSERT:
|
||||
builder = DataAbilityOperation::NewInsertBuilder(uri);
|
||||
@ -156,7 +156,7 @@ bool GetDataAbilityOperationBuilder(
|
||||
builder = DataAbilityOperation::NewAssertBuilder(uri);
|
||||
break;
|
||||
default:
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, type:%{public}d is invalid.", __func__, type);
|
||||
TAG_LOGE(AAFwkTag::FA, "type:%{public}d is invalid", type);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -165,11 +165,11 @@ bool GetDataAbilityOperationBuilder(
|
||||
napi_value UnwrapValuesBucket(const std::shared_ptr<NativeRdb::ValuesBucket> ¶m, napi_env env,
|
||||
napi_value valueBucketParam)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
napi_value result;
|
||||
|
||||
if (param == nullptr) {
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s input param is nullptr.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "input param is nullptr");
|
||||
NAPI_CALL(env, napi_create_int32(env, 0, &result));
|
||||
return result;
|
||||
}
|
||||
@ -182,10 +182,10 @@ napi_value UnwrapValuesBucket(const std::shared_ptr<NativeRdb::ValuesBucket> &pa
|
||||
napi_value UnwrapDataAbilityPredicatesBackReferences(
|
||||
std::shared_ptr<DataAbilityOperationBuilder> &builder, napi_env env, napi_value predicatesBackReferencesParam)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
|
||||
if (!IsTypeForNapiValue(env, predicatesBackReferencesParam, napi_object)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "%{public}s, predicatesBackReferencesParam is invalid.", __func__);
|
||||
TAG_LOGE(AAFwkTag::FA, "predicatesBackReferencesParam is invalid");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ napi_value UnwrapDataAbilityPredicatesBackReferences(
|
||||
|
||||
NAPI_CALL(env, napi_get_property_names(env, predicatesBackReferencesParam, &jsProNameList));
|
||||
NAPI_CALL(env, napi_get_array_length(env, jsProNameList, &jsProCount));
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, Property size=%{public}d.", __func__, jsProCount);
|
||||
TAG_LOGI(AAFwkTag::FA, "Property size=%{public}d", jsProCount);
|
||||
|
||||
napi_value jsProName = nullptr;
|
||||
napi_value jsProValue = nullptr;
|
||||
@ -203,12 +203,12 @@ napi_value UnwrapDataAbilityPredicatesBackReferences(
|
||||
NAPI_CALL(env, napi_get_element(env, jsProNameList, index, &jsProName));
|
||||
std::string strProName = UnwrapStringFromJS(env, jsProName);
|
||||
int intProName = std::atoi(strProName.c_str());
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, Property name=%{public}d.", __func__, intProName);
|
||||
TAG_LOGI(AAFwkTag::FA, "Property name=%{public}d", intProName);
|
||||
NAPI_CALL(env, napi_get_property(env, predicatesBackReferencesParam, jsProName, &jsProValue));
|
||||
NAPI_CALL(env, napi_typeof(env, jsProValue, &jsValueType));
|
||||
int32_t natValue32 = 0;
|
||||
if (napi_get_value_int32(env, jsProValue, &natValue32) == napi_ok) {
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s, Property value=%{public}d.", __func__, natValue32);
|
||||
TAG_LOGI(AAFwkTag::FA, "Property value=%{public}d", natValue32);
|
||||
builder->WithPredicatesBackReference(intProName, natValue32);
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ const std::string RESULT_DATA_TAG = "resultData";
|
||||
|
||||
void JsFeatureAbility::Finalizer(napi_env env, void* data, void* hint)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "JsFeatureAbility::Finalizer is called");
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
std::unique_ptr<JsFeatureAbility>(static_cast<JsFeatureAbility*>(data));
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ napi_value JsFeatureAbility::UnsubscribeMsg(napi_env env, napi_callback_info inf
|
||||
|
||||
napi_value JsFeatureAbility::OnStartAbility(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
if (info.argc != 1) {
|
||||
TAG_LOGE(AAFwkTag::FA, "arguments not match");
|
||||
return CreateJsUndefined(env);
|
||||
@ -124,7 +124,7 @@ napi_value JsFeatureAbility::OnStartAbility(napi_env env, NapiCallbackInfo& info
|
||||
|
||||
napi_value JsFeatureAbility::OnStartAbilityForResult(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
if (info.argc != 1) {
|
||||
TAG_LOGE(AAFwkTag::FA, "Params not match");
|
||||
return CreateJsUndefined(env);
|
||||
@ -147,7 +147,7 @@ napi_value JsFeatureAbility::OnStartAbilityForResult(napi_env env, NapiCallbackI
|
||||
|
||||
std::shared_ptr<NapiAsyncTask> asyncTask = std::move(uasyncTask);
|
||||
FeatureAbilityTask task = [env, asyncTask](int resultCode, const AAFwk::Want& want) {
|
||||
TAG_LOGI(AAFwkTag::FA, "OnStartAbilityForResult async callback is called");
|
||||
TAG_LOGI(AAFwkTag::FA, "async callback is called");
|
||||
std::string data = want.GetStringParam(RESULT_DATA_TAG);
|
||||
napi_value abilityResult = JsFeatureAbility::CreateJsResult(env, resultCode, data);
|
||||
if (abilityResult == nullptr) {
|
||||
@ -156,20 +156,20 @@ napi_value JsFeatureAbility::OnStartAbilityForResult(napi_env env, NapiCallbackI
|
||||
} else {
|
||||
asyncTask->Resolve(env, abilityResult);
|
||||
}
|
||||
TAG_LOGI(AAFwkTag::FA, "OnStartAbilityForResult async callback is called end");
|
||||
TAG_LOGI(AAFwkTag::FA, "async callback is called end");
|
||||
};
|
||||
|
||||
want.SetParam(Want::PARAM_RESV_FOR_RESULT, true);
|
||||
requestCode_ = (requestCode_ == INT_MAX) ? 0 : (requestCode_ + 1);
|
||||
ability->StartFeatureAbilityForResult(want, requestCode_, std::move(task));
|
||||
|
||||
TAG_LOGI(AAFwkTag::FA, "OnStartAbilityForResult is called end");
|
||||
TAG_LOGI(AAFwkTag::FA, "end");
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value JsFeatureAbility::OnFinishWithResult(napi_env env, NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
if (info.argc != 1) {
|
||||
TAG_LOGE(AAFwkTag::FA, "Params not match");
|
||||
return CreateJsUndefined(env);
|
||||
@ -182,19 +182,19 @@ napi_value JsFeatureAbility::OnFinishWithResult(napi_env env, NapiCallbackInfo&
|
||||
}
|
||||
|
||||
if (!IsTypeForNapiValue(env, info.argv[0], napi_object)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "Params is invalid.");
|
||||
TAG_LOGE(AAFwkTag::FA, "Params is invalid");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
int32_t code = ERR_OK;
|
||||
if (!UnwrapInt32ByPropertyName(env, info.argv[0], "code", code)) {
|
||||
TAG_LOGE(AAFwkTag::FA, "Failed to get code.");
|
||||
TAG_LOGE(AAFwkTag::FA, "Failed to get code");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
napi_value jsResultObj = GetPropertyValueByPropertyName(env, info.argv[0], "result", napi_object);
|
||||
if (jsResultObj == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "Failed to get result.");
|
||||
TAG_LOGE(AAFwkTag::FA, "Failed to get result");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
@ -228,49 +228,49 @@ napi_value JsFeatureAbility::OnFinishWithResult(napi_env env, NapiCallbackInfo&
|
||||
|
||||
napi_value JsFeatureAbility::OnGetDeviceList(napi_env env, const NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
napi_value JsFeatureAbility::OnCallAbility(napi_env env, const NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
napi_value JsFeatureAbility::OnContinueAbility(napi_env env, const NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
napi_value JsFeatureAbility::OnSubscribeAbilityEvent(napi_env env, const NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
napi_value JsFeatureAbility::OnUnsubscribeAbilityEvent(napi_env env, const NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
napi_value JsFeatureAbility::OnSendMsg(napi_env env, const NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
napi_value JsFeatureAbility::OnSubscribeMsg(napi_env env, const NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
napi_value JsFeatureAbility::OnUnsubscribeMsg(napi_env env, const NapiCallbackInfo& info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s is called", __FUNCTION__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return CreateJsUndefined(env);
|
||||
}
|
||||
|
||||
@ -282,7 +282,7 @@ Ability* JsFeatureAbility::GetAbility(napi_env env)
|
||||
ret = napi_get_global(env, &global);
|
||||
if (ret != napi_ok) {
|
||||
napi_get_last_error_info(env, &errorInfo);
|
||||
TAG_LOGE(AAFwkTag::FA, "JsFeatureAbility::GetAbility, get_global=%{public}d err:%{public}s",
|
||||
TAG_LOGE(AAFwkTag::FA, "get_global=%{public}d err:%{public}s",
|
||||
ret, errorInfo->error_message);
|
||||
return nullptr;
|
||||
}
|
||||
@ -291,7 +291,7 @@ Ability* JsFeatureAbility::GetAbility(napi_env env)
|
||||
ret = napi_get_named_property(env, global, "ability", &abilityObj);
|
||||
if (ret != napi_ok) {
|
||||
napi_get_last_error_info(env, &errorInfo);
|
||||
TAG_LOGE(AAFwkTag::FA, "JsFeatureAbility::GetAbility, get_named_property=%{public}d err:%{public}s",
|
||||
TAG_LOGE(AAFwkTag::FA, "get_named_property=%{public}d err:%{public}s",
|
||||
ret, errorInfo->error_message);
|
||||
return nullptr;
|
||||
}
|
||||
@ -300,7 +300,7 @@ Ability* JsFeatureAbility::GetAbility(napi_env env)
|
||||
ret = napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability));
|
||||
if (ret != napi_ok) {
|
||||
napi_get_last_error_info(env, &errorInfo);
|
||||
TAG_LOGE(AAFwkTag::FA, "JsFeatureAbility::GetAbility, get_value_external=%{public}d err:%{public}s",
|
||||
TAG_LOGE(AAFwkTag::FA, "get_value_external=%{public}d err:%{public}s",
|
||||
ret, errorInfo->error_message);
|
||||
return nullptr;
|
||||
}
|
||||
@ -390,10 +390,10 @@ bool JsFeatureAbility::CheckThenGetDeepLinkUri(const DistributeReqParam &request
|
||||
|
||||
bool JsFeatureAbility::UnWrapRequestParams(napi_env env, napi_value param, DistributeReqParam &requestParam)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
|
||||
if (!IsTypeForNapiValue(env, param, napi_object)) {
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called. Params is invalid.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "Params is invalid");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -490,7 +490,7 @@ napi_value JsFeatureAbilityInit(napi_env env, napi_value exports)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::FA, "called");
|
||||
if (env == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "env nullptr.");
|
||||
TAG_LOGE(AAFwkTag::FA, "env nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace AppExecFwk {
|
||||
*/
|
||||
napi_value NAPI_PAGetAppType(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_GetAppTypeCommon(env, info, AbilityType::UNKNOWN);
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ napi_value NAPI_PAGetAppType(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_PAGetAbilityInfo(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_GetAbilityInfoCommon(env, info, AbilityType::UNKNOWN);
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ napi_value NAPI_PAGetAbilityInfo(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_PAGetHapModuleInfo(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_GetHapModuleInfoCommon(env, info, AbilityType::UNKNOWN);
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ napi_value NAPI_PAGetHapModuleInfo(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_PAGetContext(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_GetContextCommon(env, info, AbilityType::UNKNOWN);
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ napi_value NAPI_PAGetContext(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_PAGetWant(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_GetWantCommon(env, info, AbilityType::UNKNOWN);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ napi_value NAPI_PAGetWant(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_PAGetAbilityName(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_GetAbilityNameCommon(env, info, AbilityType::UNKNOWN);
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ napi_value NAPI_PAGetAbilityName(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_PAStopAbility(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_StopAbilityCommon(env, info, AbilityType::UNKNOWN);
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ napi_value NAPI_PAStopAbility(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_PAAcquireDataAbilityHelper(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_AcquireDataAbilityHelperCommon(env, info, AbilityType::UNKNOWN);
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ napi_value NAPI_PAAcquireDataAbilityHelper(napi_env env, napi_callback_info info
|
||||
*/
|
||||
napi_value NAPI_PAStartBackgroundRunning(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_StartBackgroundRunningCommon(env, info);
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ napi_value NAPI_PAStartBackgroundRunning(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value NAPI_PACancelBackgroundRunning(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s,called", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
return NAPI_CancelBackgroundRunningCommon(env, info);
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ napi_value NAPI_PACancelBackgroundRunning(napi_env env, napi_callback_info info)
|
||||
*/
|
||||
napi_value ParticleAbilityInit(napi_env env, napi_value exports)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "%{public}s called.", __func__);
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
napi_property_descriptor properties[] = {
|
||||
DECLARE_NAPI_FUNCTION("getAppType", NAPI_PAGetAppType),
|
||||
DECLARE_NAPI_FUNCTION("getAbilityInfo", NAPI_PAGetAbilityInfo),
|
||||
@ -201,7 +201,7 @@ napi_value ParticleAbilityInit(napi_env env, napi_value exports)
|
||||
|
||||
void JsParticleAbility::Finalizer(napi_env env, void *data, void *hint)
|
||||
{
|
||||
TAG_LOGI(AAFwkTag::FA, "JsParticleAbility::Finalizer is called");
|
||||
TAG_LOGI(AAFwkTag::FA, "called");
|
||||
std::unique_ptr<JsParticleAbility>(static_cast<JsParticleAbility*>(data));
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ Ability* JsParticleAbility::GetAbility(napi_env env)
|
||||
ret = napi_get_global(env, &global);
|
||||
if (ret != napi_ok) {
|
||||
napi_get_last_error_info(env, &errorInfo);
|
||||
TAG_LOGE(AAFwkTag::FA, "JsParticleAbility::GetAbility, get_global=%{public}d err:%{public}s",
|
||||
TAG_LOGE(AAFwkTag::FA, "get_global=%{public}d err:%{public}s",
|
||||
ret, errorInfo->error_message);
|
||||
return nullptr;
|
||||
}
|
||||
@ -244,7 +244,7 @@ Ability* JsParticleAbility::GetAbility(napi_env env)
|
||||
ret = napi_get_named_property(env, global, "ability", &abilityObj);
|
||||
if (ret != napi_ok) {
|
||||
napi_get_last_error_info(env, &errorInfo);
|
||||
TAG_LOGE(AAFwkTag::FA, "JsParticleAbility::GetAbility, get_named_property=%{public}d err:%{public}s",
|
||||
TAG_LOGE(AAFwkTag::FA, "get_named_property=%{public}d err:%{public}s",
|
||||
ret, errorInfo->error_message);
|
||||
return nullptr;
|
||||
}
|
||||
@ -252,7 +252,7 @@ Ability* JsParticleAbility::GetAbility(napi_env env)
|
||||
ret = napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability));
|
||||
if (ret != napi_ok) {
|
||||
napi_get_last_error_info(env, &errorInfo);
|
||||
TAG_LOGE(AAFwkTag::FA, "JsParticleAbility::GetAbility, get_value_external=%{public}d err:%{public}s",
|
||||
TAG_LOGE(AAFwkTag::FA, "get_value_external=%{public}d err:%{public}s",
|
||||
ret, errorInfo->error_message);
|
||||
return nullptr;
|
||||
}
|
||||
@ -261,7 +261,7 @@ Ability* JsParticleAbility::GetAbility(napi_env env)
|
||||
|
||||
napi_value JsParticleAbilityInit(napi_env env, napi_value exportObj)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::FA, "JsParticleAbility is called");
|
||||
TAG_LOGD(AAFwkTag::FA, "called");
|
||||
|
||||
if (env == nullptr || exportObj == nullptr) {
|
||||
TAG_LOGE(AAFwkTag::FA, "env or exportObj null");
|
||||
@ -283,7 +283,7 @@ napi_value JsParticleAbilityInit(napi_env env, napi_value exportObj)
|
||||
BindNativeFunction(env, exportObj, "startAbility", moduleName, JsParticleAbility::PAStartAbility);
|
||||
BindNativeFunction(env, exportObj, "terminateSelf", moduleName, JsParticleAbility::PATerminateAbility);
|
||||
|
||||
TAG_LOGD(AAFwkTag::FA, "JsParticleAbility end");
|
||||
TAG_LOGD(AAFwkTag::FA, "end");
|
||||
return exportObj;
|
||||
}
|
||||
} // namespace AppExecFwk
|
||||
|
@ -313,7 +313,7 @@ void FAAbilityThread::AttachInner(const std::shared_ptr<AppExecFwk::OHOSApplicat
|
||||
}
|
||||
abilityImpl_->Init(application, abilityRecord, currentAbility_, abilityHandler_, token_);
|
||||
// 4. ability attach : ipc
|
||||
TAG_LOGD(AAFwkTag::FA, "LoadLifecycle: Attach ability.");
|
||||
TAG_LOGD(AAFwkTag::FA, "LoadLifecycle: Attach ability");
|
||||
FreezeUtil::LifecycleFlow flow = { token_, FreezeUtil::TimeoutState::LOAD };
|
||||
std::string entry = std::to_string(AbilityRuntime::TimeUtil::SystemTimeMillisecond()) +
|
||||
"; AbilityThread::Attach; the load lifecycle.";
|
||||
|
Loading…
Reference in New Issue
Block a user