mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 22:21:36 -04:00
@@ -124,11 +124,13 @@ NativeValue *AbilityStateInit(NativeEngine *engine)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
object->SetProperty("INITIAL", CreateJsValue(*engine, (int32_t)AAFwk::AbilityState::INITIAL));
|
||||
object->SetProperty("FOREGROUND", CreateJsValue(*engine, (int32_t)AAFwk::AbilityState::FOREGROUND));
|
||||
object->SetProperty("BACKGROUND", CreateJsValue(*engine, (int32_t)AAFwk::AbilityState::BACKGROUND));
|
||||
object->SetProperty("FOREGROUNDING", CreateJsValue(*engine, (int32_t)AAFwk::AbilityState::FOREGROUNDING));
|
||||
object->SetProperty("BACKGROUNDING", CreateJsValue(*engine, (int32_t)AAFwk::AbilityState::BACKGROUNDING));
|
||||
object->SetProperty("INITIAL", CreateJsValue(*engine, static_cast<int32_t>(AAFwk::AbilityState::INITIAL)));
|
||||
object->SetProperty("FOREGROUND", CreateJsValue(*engine, static_cast<int32_t>(AAFwk::AbilityState::FOREGROUND)));
|
||||
object->SetProperty("BACKGROUND", CreateJsValue(*engine, static_cast<int32_t>(AAFwk::AbilityState::BACKGROUND)));
|
||||
object->SetProperty("FOREGROUNDING",
|
||||
CreateJsValue(*engine, static_cast<int32_t>(AAFwk::AbilityState::FOREGROUNDING)));
|
||||
object->SetProperty("BACKGROUNDING",
|
||||
CreateJsValue(*engine, static_cast<int32_t>(AAFwk::AbilityState::BACKGROUNDING)));
|
||||
|
||||
return objValue;
|
||||
}
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ static napi_module _module = {
|
||||
.nm_filename = nullptr,
|
||||
.nm_register_func = ApplicationContextConstantInit,
|
||||
.nm_modname = "app.ability.contextConstant",
|
||||
.nm_priv = ((void *)0),
|
||||
.nm_priv = (static_cast<void *>(0)),
|
||||
.reserved = {0}
|
||||
};
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ Ability* JsFeatureAbility::GetAbility(NativeEngine &engine)
|
||||
}
|
||||
|
||||
Ability *ability = nullptr;
|
||||
ret = napi_get_value_external(env, abilityObj, (void **)&ability);
|
||||
ret = napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability));
|
||||
if (ret != napi_ok) {
|
||||
napi_get_last_error_info(env, &errorInfo);
|
||||
HILOG_ERROR("get_value_external=%{public}d err:%{public}s", ret, errorInfo->error_message);
|
||||
|
||||
@@ -69,7 +69,7 @@ static Ability* GetJSAbilityObject(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
return ability;
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ static napi_value SetWakeUpScreenWrap(napi_env env, napi_callback_info info, Set
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
cbData->cbBase.ability = ability;
|
||||
napi_value ret = nullptr;
|
||||
@@ -1220,7 +1220,7 @@ AppInfoCB *CreateAppInfoCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
AppInfoCB *appInfoCB = new (std::nothrow) AppInfoCB;
|
||||
if (appInfoCB == nullptr) {
|
||||
@@ -1488,7 +1488,7 @@ ProcessInfoCB *CreateProcessInfoCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
ProcessInfoCB *processInfoCB = new (std::nothrow) ProcessInfoCB;
|
||||
if (processInfoCB == nullptr) {
|
||||
@@ -1514,7 +1514,7 @@ ElementNameCB *CreateElementNameCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
ElementNameCB *elementNameCB = new (std::nothrow) ElementNameCB;
|
||||
if (elementNameCB == nullptr) {
|
||||
@@ -1733,7 +1733,7 @@ ProcessNameCB *CreateProcessNameCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
ProcessNameCB *processNameCB = new (std::nothrow) ProcessNameCB;
|
||||
if (processNameCB == nullptr) {
|
||||
@@ -1924,7 +1924,7 @@ CallingBundleCB *CreateCallingBundleCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
CallingBundleCB *callingBundleCB = new (std::nothrow) CallingBundleCB;
|
||||
if (callingBundleCB == nullptr) {
|
||||
@@ -2116,7 +2116,7 @@ GetOrCreateLocalDirCB *CreateGetOrCreateLocalDirCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
GetOrCreateLocalDirCB *getOrCreateLocalDirCB = new (std::nothrow) GetOrCreateLocalDirCB;
|
||||
if (getOrCreateLocalDirCB == nullptr) {
|
||||
@@ -2466,7 +2466,7 @@ DatabaseDirCB *CreateGetDatabaseDirCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
DatabaseDirCB *getDatabaseDirCB = new (std::nothrow) DatabaseDirCB;
|
||||
if (getDatabaseDirCB == nullptr) {
|
||||
@@ -2564,7 +2564,7 @@ PreferencesDirCB *CreateGetPreferencesDirCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
PreferencesDirCB *getPreferencesDirCB = new (std::nothrow) PreferencesDirCB;
|
||||
if (getPreferencesDirCB == nullptr) {
|
||||
@@ -3186,7 +3186,7 @@ bool NapiJsContext::DataInit(NativeEngine &engine)
|
||||
HILOG_INFO("Get Ability to start");
|
||||
NAPI_CALL_BASE(env, napi_get_global(env, &global), false);
|
||||
NAPI_CALL_BASE(env, napi_get_named_property(env, global, "ability", &abilityObj), false);
|
||||
NAPI_CALL_BASE(env, napi_get_value_external(env, abilityObj, (void **)&ability_), false);
|
||||
NAPI_CALL_BASE(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability_)), false);
|
||||
HILOG_INFO("Get Ability to done");
|
||||
|
||||
return true;
|
||||
|
||||
@@ -311,7 +311,7 @@ Ability* JsFeatureAbility::GetAbility(napi_env env)
|
||||
}
|
||||
|
||||
Ability* ability = nullptr;
|
||||
ret = napi_get_value_external(env, abilityObj, (void **)&ability);
|
||||
ret = napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability));
|
||||
if (ret != napi_ok) {
|
||||
napi_get_last_error_info(env, &errorInfo);
|
||||
HILOG_ERROR("JsFeatureAbility::GetAbility, get_value_external=%{public}d err:%{public}s",
|
||||
|
||||
@@ -934,7 +934,7 @@ AppTypeCB *CreateAppTypeCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
AppTypeCB *appTypeCB = new (std::nothrow) AppTypeCB;
|
||||
if (appTypeCB == nullptr) {
|
||||
@@ -1220,7 +1220,7 @@ napi_value GetDisplayOrientationWrap(napi_env env, napi_callback_info info, Asyn
|
||||
}
|
||||
}
|
||||
|
||||
void GetDisplayOrientationExecuteCallback(napi_env, void *data)
|
||||
void GetDisplayOrientationExecuteCallback(napi_env env, void *data)
|
||||
{
|
||||
HILOG_INFO("%{public}s called.", __func__);
|
||||
AsyncJSCallbackInfo *asyncCallbackInfo = static_cast<AsyncJSCallbackInfo *>(data);
|
||||
@@ -1309,7 +1309,7 @@ AbilityInfoCB *CreateAbilityInfoCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
AbilityInfoCB *abilityInfoCB = new (std::nothrow) AbilityInfoCB;
|
||||
if (abilityInfoCB == nullptr) {
|
||||
@@ -1718,7 +1718,7 @@ HapModuleInfoCB *CreateHapModuleInfoCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
HapModuleInfoCB *hapModuleInfoCB = new (std::nothrow) HapModuleInfoCB;
|
||||
if (hapModuleInfoCB == nullptr) {
|
||||
@@ -2048,7 +2048,7 @@ AppVersionInfoCB *CreateAppVersionInfoCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
AppVersionInfoCB *appVersionInfoCB = new (std::nothrow) AppVersionInfoCB;
|
||||
if (appVersionInfoCB == nullptr) {
|
||||
@@ -2333,7 +2333,7 @@ AsyncCallbackInfo *CreateAsyncCallbackInfo(napi_env env)
|
||||
}
|
||||
|
||||
Ability *ability = nullptr;
|
||||
ret = napi_get_value_external(env, abilityObj, (void **)&ability);
|
||||
ret = napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability));
|
||||
if (ret != napi_ok) {
|
||||
napi_get_last_error_info(env, &errorInfo);
|
||||
HILOG_ERROR("%{public}s get_value_external=%{public}d err:%{public}s", __func__, ret, errorInfo->error_message);
|
||||
@@ -2750,7 +2750,7 @@ AbilityNameCB *CreateAbilityNameCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
AbilityNameCB *abilityNameCB = new (std::nothrow) AbilityNameCB;
|
||||
if (abilityNameCB == nullptr) {
|
||||
@@ -3494,7 +3494,7 @@ ConnectAbilityCB *CreateConnectAbilityCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
ConnectAbilityCB *connectAbilityCB = new (std::nothrow) ConnectAbilityCB;
|
||||
if (connectAbilityCB == nullptr) {
|
||||
@@ -3759,7 +3759,7 @@ ConnectAbilityCB *CreateDisConnectAbilityCBInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
ConnectAbilityCB *connectAbilityCB = new (std::nothrow) ConnectAbilityCB;
|
||||
if (connectAbilityCB == nullptr) {
|
||||
@@ -4339,7 +4339,7 @@ napi_value UnwrapParamForWantAgent(napi_env &env, napi_value &args, AbilityRunti
|
||||
napi_get_named_property(env, args, "wantAgent", &wantAgentParam);
|
||||
NAPI_CALL(env, napi_typeof(env, wantAgentParam, &valuetype));
|
||||
NAPI_ASSERT(env, valuetype == napi_object, "Wrong argument type. Object expected.");
|
||||
napi_unwrap(env, wantAgentParam, (void **)&wantAgent);
|
||||
napi_unwrap(env, wantAgentParam, reinterpret_cast<void **>(&wantAgent));
|
||||
}
|
||||
|
||||
napi_get_null(env, &result);
|
||||
|
||||
@@ -844,7 +844,7 @@ AsyncJSCallbackInfo *CreateAsyncJSCallbackInfo(napi_env env)
|
||||
NAPI_CALL(env, napi_get_named_property(env, global, "ability", &abilityObj));
|
||||
|
||||
Ability *ability = nullptr;
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, (void **)&ability));
|
||||
NAPI_CALL(env, napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability)));
|
||||
|
||||
AsyncJSCallbackInfo *asyncCallbackInfo = new (std::nothrow) AsyncJSCallbackInfo;
|
||||
if (asyncCallbackInfo == nullptr) {
|
||||
|
||||
@@ -298,7 +298,7 @@ Ability* JsParticleAbility::GetAbility(napi_env env)
|
||||
return nullptr;
|
||||
}
|
||||
Ability* ability = nullptr;
|
||||
ret = napi_get_value_external(env, abilityObj, (void **)&ability);
|
||||
ret = napi_get_value_external(env, abilityObj, reinterpret_cast<void **>(&ability));
|
||||
if (ret != napi_ok) {
|
||||
napi_get_last_error_info(env, &errorInfo);
|
||||
HILOG_ERROR("JsParticleAbility::GetAbility, get_value_external=%{public}d err:%{public}s",
|
||||
|
||||
@@ -523,7 +523,6 @@ NativeValue* JsWantAgent::OnCancel(NativeEngine &engine, NativeCallbackInfo &inf
|
||||
task.Resolve(engine, engine.CreateUndefined());
|
||||
};
|
||||
|
||||
|
||||
NativeValue* result = nullptr;
|
||||
AsyncTask::Schedule("JsWantAgent::OnCancel",
|
||||
engine, CreateAsyncTaskWithLastParam(engine, lastParam, nullptr, std::move(complete), &result));
|
||||
@@ -757,7 +756,7 @@ NativeValue* JsWantAgent::OnGetWantAgent(NativeEngine &engine, NativeCallbackInf
|
||||
|
||||
NativeValue *lastParam = (info.argc >= ARGC_TWO) ? info.argv[INDEX_ONE] : nullptr;
|
||||
std::shared_ptr<WantAgentWantsParas> spParas = std::make_shared<WantAgentWantsParas>();
|
||||
uint32_t ret = GetWantAgentParam(engine, info, *spParas);
|
||||
int32_t ret = GetWantAgentParam(engine, info, *spParas);
|
||||
if (ret != 0) {
|
||||
HILOG_ERROR("Failed to get wantAgent param.");
|
||||
return RetErrMsg(engine, lastParam, ret);
|
||||
@@ -863,7 +862,7 @@ NativeValue* JsWantAgent::OnNapiGetWantAgent(NativeEngine &engine, NativeCallbac
|
||||
}
|
||||
|
||||
std::shared_ptr<WantAgentWantsParas> spParas = std::make_shared<WantAgentWantsParas>();
|
||||
uint32_t ret = GetWantAgentParam(engine, info, *spParas);
|
||||
int32_t ret = GetWantAgentParam(engine, info, *spParas);
|
||||
if (ret != 0) {
|
||||
HILOG_ERROR("Failed to get wantAgent param.");
|
||||
AbilityRuntimeErrorUtil::Throw(engine, ERR_ABILITY_RUNTIME_EXTERNAL_INVALID_PARAMETER);
|
||||
|
||||
@@ -156,7 +156,7 @@ bool AbilityContext::ConnectAbility(const Want &want, const sptr<AAFwk::IAbility
|
||||
|
||||
HILOG_INFO("Connect ability begin, ability:%{public}s.", abilityInfo->name.c_str());
|
||||
|
||||
if (AppExecFwk::AbilityType::PAGE != type && AppExecFwk::AbilityType::SERVICE != type) {
|
||||
if (type != AppExecFwk::AbilityType::PAGE && type != AppExecFwk::AbilityType::SERVICE) {
|
||||
HILOG_ERROR("AbilityContext::ConnectAbility AbilityType = %{public}d", type);
|
||||
return false;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ ErrCode AbilityContext::DisconnectAbility(const sptr<AAFwk::IAbilityConnection>
|
||||
HILOG_INFO("Disconnect ability begin, caller:%{public}s.", info == nullptr ? "" : info->name.c_str());
|
||||
|
||||
AppExecFwk::AbilityType type = GetAbilityInfoType();
|
||||
if (AppExecFwk::AbilityType::PAGE != type && AppExecFwk::AbilityType::SERVICE != type) {
|
||||
if (type != AppExecFwk::AbilityType::PAGE && type != AppExecFwk::AbilityType::SERVICE) {
|
||||
HILOG_ERROR("AbilityContext::DisconnectAbility AbilityType = %{public}d", type);
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
@@ -194,7 +194,7 @@ bool AbilityContext::StopAbility(const AAFwk::Want &want)
|
||||
{
|
||||
HILOG_DEBUG("%{public}s begin.", __func__);
|
||||
AppExecFwk::AbilityType type = GetAbilityInfoType();
|
||||
if (AppExecFwk::AbilityType::PAGE != type && AppExecFwk::AbilityType::SERVICE != type) {
|
||||
if (type != AppExecFwk::AbilityType::PAGE && type != AppExecFwk::AbilityType::SERVICE) {
|
||||
HILOG_ERROR("AbilityContext::StopAbility AbilityType = %{public}d", type);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ void AbilityLifecycleExecutor::DispatchLifecycleState(const AbilityLifecycleExec
|
||||
state_ = state;
|
||||
}
|
||||
|
||||
int AbilityLifecycleExecutor::GetState()
|
||||
int AbilityLifecycleExecutor::GetState() const
|
||||
{
|
||||
return state_;
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ NativeValue* JsBaseContext::OnGetApplicationContext(NativeEngine& engine, Native
|
||||
}
|
||||
} // namespace
|
||||
|
||||
NativeValue* AttachBaseContext(NativeEngine* engine, void* value, void*)
|
||||
NativeValue* AttachBaseContext(NativeEngine* engine, void* value, void* hint)
|
||||
{
|
||||
HILOG_INFO("AttachBaseContext");
|
||||
if (value == nullptr || engine == nullptr) {
|
||||
@@ -484,7 +484,7 @@ NativeValue* AttachBaseContext(NativeEngine* engine, void* value, void*)
|
||||
return contextObj;
|
||||
}
|
||||
|
||||
NativeValue* AttachApplicationContext(NativeEngine* engine, void* value, void*)
|
||||
NativeValue* AttachApplicationContext(NativeEngine* engine, void* value, void* hint)
|
||||
{
|
||||
HILOG_INFO("AttachApplicationContext");
|
||||
if (value == nullptr || engine == nullptr) {
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
virtual void ScheduleShrinkMemory(const int32_t) override;
|
||||
virtual void ScheduleShrinkMemory(const int32_t level) override;
|
||||
|
||||
/**
|
||||
* ScheduleLowMemory, call ScheduleLowMemory() through proxy project,
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
virtual void ScheduleLaunchApplication(const AppLaunchData &, const Configuration &) override;
|
||||
virtual void ScheduleLaunchApplication(const AppLaunchData &launchData, const Configuration &config) override;
|
||||
|
||||
/**
|
||||
* Notify application to launch ability stage.
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
* @param The ability token.
|
||||
* @return
|
||||
*/
|
||||
virtual void ScheduleCleanAbility(const sptr<IRemoteObject> &) override;
|
||||
virtual void ScheduleCleanAbility(const sptr<IRemoteObject> &token) override;
|
||||
|
||||
/**
|
||||
* ScheduleProfileChanged, call ScheduleProfileChanged() through proxy project,
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
* @param The profile data.
|
||||
* @return
|
||||
*/
|
||||
virtual void ScheduleProfileChanged(const Profile &) override;
|
||||
virtual void ScheduleProfileChanged(const Profile &profile) override;
|
||||
|
||||
/**
|
||||
* ScheduleConfigurationUpdated, call ScheduleConfigurationUpdated() through proxy project,
|
||||
|
||||
@@ -132,7 +132,7 @@ void AppSchedulerProxy::ScheduleShrinkMemory(const int32_t level)
|
||||
ScheduleMemoryCommon(level, operation);
|
||||
}
|
||||
|
||||
void AppSchedulerProxy::ScheduleMemoryCommon(const int32_t level, uint32_t operation)
|
||||
void AppSchedulerProxy::ScheduleMemoryCommon(const int32_t level, const uint32_t operation)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
|
||||
@@ -65,7 +65,7 @@ std::shared_ptr<PendingWant> PendingWant::GetAbility(
|
||||
}
|
||||
|
||||
WantSenderInfo wantSenderInfo;
|
||||
wantSenderInfo.type = (int32_t)WantAgentConstant::OperationType::START_ABILITY;
|
||||
wantSenderInfo.type = static_cast<int32_t>(WantAgentConstant::OperationType::START_ABILITY);
|
||||
wantSenderInfo.allWants.push_back(wantsInfo);
|
||||
wantSenderInfo.bundleName = context->GetBundleName();
|
||||
wantSenderInfo.flags = flags;
|
||||
@@ -94,7 +94,7 @@ std::shared_ptr<PendingWant> PendingWant::GetAbilities(
|
||||
}
|
||||
|
||||
WantSenderInfo wantSenderInfo;
|
||||
wantSenderInfo.type = (int32_t)WantAgentConstant::OperationType::START_ABILITIES;
|
||||
wantSenderInfo.type = static_cast<int32_t>(WantAgentConstant::OperationType::START_ABILITIES);
|
||||
wantSenderInfo.bundleName = context->GetBundleName();
|
||||
wantSenderInfo.flags = flags;
|
||||
wantSenderInfo.userId = -1; // -1 : invalid user id
|
||||
@@ -138,7 +138,7 @@ std::shared_ptr<PendingWant> PendingWant::GetCommonEventAsUser(
|
||||
wantsInfo.resolvedTypes = want != nullptr ? want->GetType() : "";
|
||||
|
||||
WantSenderInfo wantSenderInfo;
|
||||
wantSenderInfo.type = (int32_t)WantAgentConstant::OperationType::SEND_COMMON_EVENT;
|
||||
wantSenderInfo.type = static_cast<int32_t>(WantAgentConstant::OperationType::SEND_COMMON_EVENT);
|
||||
wantSenderInfo.allWants.push_back(wantsInfo);
|
||||
wantSenderInfo.bundleName = context->GetBundleName();
|
||||
wantSenderInfo.flags = flags;
|
||||
@@ -182,7 +182,7 @@ std::shared_ptr<PendingWant> PendingWant::BuildServicePendingWant(
|
||||
wantsInfo.resolvedTypes = want != nullptr ? want->GetType() : "";
|
||||
|
||||
WantSenderInfo wantSenderInfo;
|
||||
wantSenderInfo.type = (int32_t)serviceKind;
|
||||
wantSenderInfo.type = static_cast<int32_t>(serviceKind);
|
||||
wantSenderInfo.allWants.push_back(wantsInfo);
|
||||
wantSenderInfo.bundleName = context->GetBundleName();
|
||||
wantSenderInfo.flags = flags;
|
||||
|
||||
@@ -35,26 +35,26 @@ unsigned int WantAgentHelper::FlagsTransformer(const std::vector<WantAgentConsta
|
||||
{
|
||||
unsigned int wantFlags = 0;
|
||||
if (flags.empty()) {
|
||||
wantFlags |= (unsigned int)FLAG_UPDATE_CURRENT;
|
||||
wantFlags |= static_cast<unsigned int>(FLAG_UPDATE_CURRENT);
|
||||
return wantFlags;
|
||||
}
|
||||
|
||||
for (auto flag : flags) {
|
||||
switch (flag) {
|
||||
case WantAgentConstant::Flags::ONE_TIME_FLAG:
|
||||
wantFlags |= (unsigned int)FLAG_ONE_SHOT;
|
||||
wantFlags |= static_cast<unsigned int>(FLAG_ONE_SHOT);
|
||||
break;
|
||||
case WantAgentConstant::Flags::NO_BUILD_FLAG:
|
||||
wantFlags |= (unsigned int)FLAG_NO_CREATE;
|
||||
wantFlags |= static_cast<unsigned int>(FLAG_NO_CREATE);
|
||||
break;
|
||||
case WantAgentConstant::Flags::CANCEL_PRESENT_FLAG:
|
||||
wantFlags |= (unsigned int)FLAG_CANCEL_CURRENT;
|
||||
wantFlags |= static_cast<unsigned int>(FLAG_CANCEL_CURRENT);
|
||||
break;
|
||||
case WantAgentConstant::Flags::UPDATE_PRESENT_FLAG:
|
||||
wantFlags |= (unsigned int)FLAG_UPDATE_CURRENT;
|
||||
wantFlags |= static_cast<unsigned int>(FLAG_UPDATE_CURRENT);
|
||||
break;
|
||||
case WantAgentConstant::Flags::CONSTANT_FLAG:
|
||||
wantFlags |= (unsigned int)FLAG_IMMUTABLE;
|
||||
wantFlags |= static_cast<unsigned int>(FLAG_IMMUTABLE);
|
||||
break;
|
||||
default:
|
||||
WANT_AGENT_LOGE("WantAgentHelper::flags is error.");
|
||||
@@ -155,7 +155,7 @@ std::shared_ptr<WantAgent> WantAgentHelper::GetWantAgent(const WantAgentInfo &pa
|
||||
wantSenderInfo.allWants.push_back(wantsInfo);
|
||||
wantSenderInfo.bundleName = want->GetOperation().GetBundleName();
|
||||
wantSenderInfo.flags = FlagsTransformer(paramsInfo.GetFlags());
|
||||
wantSenderInfo.type = (int32_t)paramsInfo.GetOperationType();
|
||||
wantSenderInfo.type = static_cast<int32_t>(paramsInfo.GetOperationType());
|
||||
wantSenderInfo.userId = userId;
|
||||
|
||||
sptr<IWantSender> target = WantAgentClient::GetInstance().GetWantSender(wantSenderInfo, nullptr);
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
* @return errCode ERR_OK on success, others on failure.
|
||||
*/
|
||||
using ContextContainer::StartAbility;
|
||||
ErrCode StartAbility(const AAFwk::Want &Want, int requestCode) override;
|
||||
ErrCode StartAbility(const AAFwk::Want &want, int requestCode) override;
|
||||
|
||||
/**
|
||||
* @brief Starts a new ability with special ability start setting.
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
* @return return Returns the int value of the ability lifecycle state represented
|
||||
* by the AbilityLifecycleExecutor.LifecycleState enum constant.
|
||||
*/
|
||||
int GetState();
|
||||
int GetState() const;
|
||||
|
||||
private:
|
||||
AbilityLifecycleExecutor::LifecycleState state_ = UNINITIALIZED;
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
virtual ~AbilityProcess();
|
||||
static std::shared_ptr<AbilityProcess> GetInstance();
|
||||
|
||||
ErrCode StartAbility(Ability *ability, CallAbilityParam param, CallbackInfo callbackInfo);
|
||||
ErrCode StartAbility(Ability *ability, CallAbilityParam param, CallbackInfo callback);
|
||||
void OnAbilityResult(Ability *ability, int requestCode, int resultCode, const Want &resultData);
|
||||
void AddAbilityResultCallback(Ability *ability, CallAbilityParam ¶m, int32_t errCode, CallbackInfo &callback);
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ int32_t PendingWantRecord::SenderInner(SenderInfo &senderInfo)
|
||||
break;
|
||||
}
|
||||
case static_cast<int32_t>(OperationType::START_SERVICE):
|
||||
case (int32_t)OperationType::START_FOREGROUND_SERVICE:
|
||||
case static_cast<int32_t>(OperationType::START_FOREGROUND_SERVICE):
|
||||
res = pendingWantManager->PendingWantStartAbility(want, callerToken_, -1, callerUid_);
|
||||
break;
|
||||
case static_cast<int32_t>(OperationType::SEND_COMMON_EVENT):
|
||||
|
||||
@@ -62,7 +62,6 @@ bool DoSomethingInterestingWithMyAPI(const char* data, size_t size)
|
||||
appStateObserverManager->HandleOnRenderProcessCreated(renderRecord);
|
||||
appStateObserverManager->HandleOnRenderProcessDied(renderRecord);
|
||||
|
||||
|
||||
ProcessData processData;
|
||||
appStateObserverManager->HandleOnProcessCreated(processData);
|
||||
appStateObserverManager->HandleOnProcessStateChanged(appRecord);
|
||||
|
||||
Reference in New Issue
Block a user