Signed-off-by: m00512953 <mingxihua@huawei.com>
This commit is contained in:
m00512953
2022-10-20 16:01:44 +08:00
parent e55487afae
commit 4cbfee6194
6 changed files with 12 additions and 12 deletions
@@ -13,14 +13,14 @@
* limitations under the License.
*/
#ifndef OHOS_ABILITY_RUNTIME_JS_ABILITY_MANAGER_UTILS_H
#define OHOS_ABILITY_RUNTIME_JS_ABILITY_MANAGER_UTILS_H
#include "ability_running_info.h"
#include "extension_running_info.h"
#include "element_name.h"
#include "native_engine/native_engine.h"
#ifndef OHOS_ABILITY_RUNTIME_JS_ABILITY_MANAGER_UTILS_H
#define OHOS_ABILITY_RUNTIME_JS_ABILITY_MANAGER_UTILS_H
namespace OHOS {
namespace AbilityRuntime {
NativeValue* CreateJsAbilityRunningInfoArray(
@@ -522,18 +522,18 @@ private:
}
if (info.argv[0]->TypeOf() != NATIVE_STRING) {
HILOG_ERROR("Param 0 is not string");
HILOG_ERROR("CheckOnOffType, Param 0 is not string");
return false;
}
std::string type;
if (!ConvertFromJsValue(engine, info.argv[0], type)) {
HILOG_ERROR("Parse on off type failed");
HILOG_ERROR("CheckOnOffType, Parse on off type failed");
return false;
}
if (type != ON_OFF_TYPE) {
HILOG_ERROR("args[0] should be mission.");
HILOG_ERROR("CheckOnOffType, args[0] should be mission.");
return false;
}
return true;
@@ -866,7 +866,7 @@ NativeValue* JsAbilityContext::OnDisconnectAbility(NativeEngine& engine, NativeC
HILOG_INFO("OnDisconnectAbility begin");
auto context = weak.lock();
if (!context) {
HILOG_WARN("context is released");
HILOG_WARN("OnDisconnectAbility context is released");
task.Reject(engine, CreateJsError(engine, AbilityErrorCode::ERROR_CODE_INVALID_CONTEXT));
return;
}
@@ -265,7 +265,7 @@ NativeValue* JsApplicationContextUtils::OnCreateModuleContext(NativeEngine& engi
auto contextObj = systemModule->Get();
NativeObject *nativeObj = ConvertNativeValueTo<NativeObject>(contextObj);
if (nativeObj == nullptr) {
HILOG_ERROR("Failed to get context native object");
HILOG_ERROR("OnCreateModuleContext, Failed to get context native object");
AbilityRuntimeErrorUtil::Throw(engine, ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_PARAMETER);
return engine.CreateUndefined();
}
@@ -225,7 +225,7 @@ NativeValue* JsBaseContext::OnCreateModuleContext(NativeEngine& engine, NativeCa
auto contextObj = systemModule->Get();
NativeObject *nativeObj = ConvertNativeValueTo<NativeObject>(contextObj);
if (nativeObj == nullptr) {
HILOG_ERROR("Failed to get context native object");
HILOG_ERROR("OnCreateModuleContext, Failed to get context native object");
AbilityRuntimeErrorUtil::Throw(engine, ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_PARAMETER);
return engine.CreateUndefined();
}
@@ -424,7 +424,7 @@ NativeValue* JsBaseContext::OnCreateBundleContext(NativeEngine& engine, NativeCa
auto contextObj = systemModule->Get();
NativeObject *nativeObj = ConvertNativeValueTo<NativeObject>(contextObj);
if (nativeObj == nullptr) {
HILOG_ERROR("Failed to get context native object");
HILOG_ERROR("OnCreateBundleContext, Failed to get context native object");
AbilityRuntimeErrorUtil::Throw(engine, ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_PARAMETER);
return engine.CreateUndefined();
}
@@ -466,7 +466,7 @@ NativeValue* JsBaseContext::OnGetApplicationContext(NativeEngine& engine, Native
auto contextObj = systemModule->Get();
NativeObject *nativeObj = ConvertNativeValueTo<NativeObject>(contextObj);
if (nativeObj == nullptr) {
HILOG_ERROR("Failed to get context native object");
HILOG_ERROR("OnGetApplicationContext, Failed to get context native object");
AbilityRuntimeErrorUtil::Throw(engine, ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_PARAMETER);
return engine.CreateUndefined();
}
@@ -63,7 +63,7 @@ public:
bool OnShare(int64_t formId, AAFwk::WantParams &wantParams) override;
private:
NativeValue* CallObjectMethod(const char* name, const char* bakName, NativeValue* const* argv = nullptr,
NativeValue* CallObjectMethod(const char* name, const char* bakName, NativeValue* const * argv = nullptr,
size_t argc = 0);
void BindContext(NativeEngine& engine, NativeObject* obj);