已合并
Remove Numeric.xValue methods #18058
Remove Numeric.xValue methods #18058
已合并
smirnovandrei创建于 1月16日
7 个文件变更+20-20
Mframeworks/ets/ani/ani_common/src/ani_common_app_state_filter.cpp+6-6
@@ -36,7 +36,7 @@ bool UnwrapFilterBundleTypeFromEts(ani_env *env,
36 }36 }
37 37 
38 ani_int mid = 0;38 ani_int mid = 0;
39 status = env->Object_CallMethodByName_Int(reinterpret_cast<ani_object>(obj), "intValue", nullptr, &mid);39 status = env->Object_CallMethodByName_Int(reinterpret_cast<ani_object>(obj), "toInt", nullptr, &mid);
40 if (status != ANI_OK) {40 if (status != ANI_OK) {
41 TAG_LOGE(AAFwkTag::APPMGR, "status: %{public}d", status);41 TAG_LOGE(AAFwkTag::APPMGR, "status: %{public}d", status);
42 return false;42 return false;
@@ -66,7 +66,7 @@ bool UnwrapFilterAppStateTypesFromEts(ani_env *env,
66 }66 }
67 67 
68 ani_int mid = 0;68 ani_int mid = 0;
69 status = env->Object_CallMethodByName_Int(reinterpret_cast<ani_object>(obj), "intValue", nullptr, &mid);69 status = env->Object_CallMethodByName_Int(reinterpret_cast<ani_object>(obj), "toInt", nullptr, &mid);
70 if (status != ANI_OK) {70 if (status != ANI_OK) {
71 TAG_LOGE(AAFwkTag::APPMGR, "status: %{public}d", status);71 TAG_LOGE(AAFwkTag::APPMGR, "status: %{public}d", status);
72 return false;72 return false;
@@ -97,7 +97,7 @@ bool UnwrapFilterProcessStateTypeFromEts(ani_env *env,
97 }97 }
98 98 
99 ani_int mid = 0;99 ani_int mid = 0;
100 status = env->Object_CallMethodByName_Int(reinterpret_cast<ani_object>(obj), "intValue", nullptr, &mid);100 status = env->Object_CallMethodByName_Int(reinterpret_cast<ani_object>(obj), "toInt", nullptr, &mid);
101 if (status != ANI_OK) {101 if (status != ANI_OK) {
102 TAG_LOGE(AAFwkTag::APPMGR, "status: %{public}d", status);102 TAG_LOGE(AAFwkTag::APPMGR, "status: %{public}d", status);
103 return false;103 return false;
@@ -129,7 +129,7 @@ bool UnwrapFilterAbilityStateTypeFromEts(ani_env *env,
129 }129 }
130 130 
131 ani_int mid = 0;131 ani_int mid = 0;
132 status = env->Object_CallMethodByName_Int(reinterpret_cast<ani_object>(obj), "intValue", nullptr, &mid);132 status = env->Object_CallMethodByName_Int(reinterpret_cast<ani_object>(obj), "toInt", nullptr, &mid);
133 if (status != ANI_OK) {133 if (status != ANI_OK) {
134 TAG_LOGE(AAFwkTag::APPMGR, "status: %{public}d", status);134 TAG_LOGE(AAFwkTag::APPMGR, "status: %{public}d", status);
135 return false;135 return false;
@@ -171,7 +171,7 @@ bool UnwrapFilterCallbackFromEts(ani_env *env,
171 }171 }
172 172 
173 ani_int mid = 0;173 ani_int mid = 0;
174 status = env->Object_CallMethodByName_Int(reinterpret_cast<ani_object>(obj), "intValue", nullptr, &mid);174 status = env->Object_CallMethodByName_Int(reinterpret_cast<ani_object>(obj), "toInt", nullptr, &mid);
175 if (status != ANI_OK) {175 if (status != ANI_OK) {
176 TAG_LOGE(AAFwkTag::APPMGR, "status: %{public}d", status);176 TAG_LOGE(AAFwkTag::APPMGR, "status: %{public}d", status);
177 return false;177 return false;
@@ -225,4 +225,4 @@ bool UnWrapAppStateFilter(ani_env *env,
225 return true;225 return true;
226}226}
227} //AppExecFwk227} //AppExecFwk
228} //OHOS228} //OHOS
Mframeworks/ets/ani/ani_common/src/ani_common_child_process_param.cpp+1-1
@@ -88,7 +88,7 @@ bool GetFds(ani_env* env, ani_string aniKey, ani_object aniValue, std::map<std::
88 return false;88 return false;
89 }89 }
90 ani_int value;90 ani_int value;
91 ani_status status = env->Object_CallMethodByName_Int(aniValue, "intValue", nullptr, &value);91 ani_status status = env->Object_CallMethodByName_Int(aniValue, "toInt", nullptr, &value);
92 if (status != ANI_OK) {92 if (status != ANI_OK) {
93 TAG_LOGE(AAFwkTag::PROCESSMGR, "Object_CallMethodByName_Int failed status: %{public}d", status);93 TAG_LOGE(AAFwkTag::PROCESSMGR, "Object_CallMethodByName_Int failed status: %{public}d", status);
94 return false;94 return false;
Mframeworks/ets/ani/ani_common/src/ani_common_util.cpp+7-7
@@ -61,7 +61,7 @@ bool GetFieldDoubleByName(ani_env *env, ani_object object, const char *name, dou
61 }61 }
62 ani_double aniValue = 0.0;62 ani_double aniValue = 0.0;
63 if ((status = env->Object_CallMethodByName_Double(63 if ((status = env->Object_CallMethodByName_Double(
64 reinterpret_cast<ani_object>(field), "doubleValue", nullptr, &aniValue)) != ANI_OK) {64 reinterpret_cast<ani_object>(field), "toDouble", nullptr, &aniValue)) != ANI_OK) {
65 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);65 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);
66 return false;66 return false;
67 }67 }
@@ -219,7 +219,7 @@ bool GetFieldIntByName(ani_env *env, ani_object object, const char *name, int32_
219 }219 }
220 ani_int aniInt = 0;220 ani_int aniInt = 0;
221 if ((status = env->Object_CallMethodByName_Int(221 if ((status = env->Object_CallMethodByName_Int(
222 reinterpret_cast<ani_object>(field), "intValue", nullptr, &aniInt)) != ANI_OK) {222 reinterpret_cast<ani_object>(field), "toInt", nullptr, &aniInt)) != ANI_OK) {
223 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);223 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);
224 return false;224 return false;
225 }225 }
@@ -274,7 +274,7 @@ bool GetFieldLongByName(ani_env *env, ani_object object, const char *name, int64
274 }274 }
275 ani_long aniLong = 0;275 ani_long aniLong = 0;
276 if ((status = env->Object_CallMethodByName_Long(276 if ((status = env->Object_CallMethodByName_Long(
277 reinterpret_cast<ani_object>(field), "longValue", nullptr, &aniLong)) != ANI_OK) {277 reinterpret_cast<ani_object>(field), "toLong", nullptr, &aniLong)) != ANI_OK) {
278 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);278 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);
279 return false;279 return false;
280 }280 }
@@ -621,7 +621,7 @@ bool GetDoubleOrUndefined(ani_env *env, ani_object param, const char *name, ani_
621 return false;621 return false;
622 }622 }
623 if ((status = env->Object_CallMethodByName_Double(623 if ((status = env->Object_CallMethodByName_Double(
624 reinterpret_cast<ani_object>(obj), "doubleValue", nullptr, &value)) != ANI_OK) {624 reinterpret_cast<ani_object>(obj), "toDouble", nullptr, &value)) != ANI_OK) {
625 TAG_LOGE(AAFwkTag::ANI, "status : %{public}d", status);625 TAG_LOGE(AAFwkTag::ANI, "status : %{public}d", status);
626 return false;626 return false;
627 }627 }
@@ -1109,7 +1109,7 @@ bool GetDoublePropertyObject(ani_env *env, ani_object param, const char *name, d
1109 return false;1109 return false;
1110 }1110 }
1111 if ((status = env->Object_CallMethodByName_Double(1111 if ((status = env->Object_CallMethodByName_Double(
1112 reinterpret_cast<ani_object>(obj), "doubleValue", nullptr, &value)) != ANI_OK) {1112 reinterpret_cast<ani_object>(obj), "toDouble", nullptr, &value)) != ANI_OK) {
1113 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);1113 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);
1114 return false;1114 return false;
1115 }1115 }
@@ -1130,7 +1130,7 @@ bool GetLongPropertyObject(ani_env *env, ani_object param, const char *name, ani
1130 return false;1130 return false;
1131 }1131 }
1132 if ((status = env->Object_CallMethodByName_Long(1132 if ((status = env->Object_CallMethodByName_Long(
1133 reinterpret_cast<ani_object>(obj), "longValue", nullptr, &value)) != ANI_OK) {1133 reinterpret_cast<ani_object>(obj), "toLong", nullptr, &value)) != ANI_OK) {
1134 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);1134 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);
1135 return false;1135 return false;
1136 }1136 }
@@ -1151,7 +1151,7 @@ bool GetIntPropertyObject(ani_env *env, ani_object param, const char *name, ani_
1151 return false;1151 return false;
1152 }1152 }
1153 if ((status = env->Object_CallMethodByName_Int(1153 if ((status = env->Object_CallMethodByName_Int(
1154 reinterpret_cast<ani_object>(obj), "intValue", nullptr, &value)) != ANI_OK) {1154 reinterpret_cast<ani_object>(obj), "toInt", nullptr, &value)) != ANI_OK) {
1155 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);1155 TAG_LOGE(AAFwkTag::ANI, "status: %{public}d", status);
1156 return false;1156 return false;
1157 }1157 }
Mframeworks/ets/ani/ani_mission_manager/src/ets_mission_manager.cpp+2-2
@@ -375,7 +375,7 @@ private:
375 }375 }
376 int32_t missionId = 0;376 int32_t missionId = 0;
377 status = env->Object_CallMethodByName_Int(377 status = env->Object_CallMethodByName_Int(
378 reinterpret_cast<ani_object>(ref), "intValue", nullptr, &missionId);378 reinterpret_cast<ani_object>(ref), "toInt", nullptr, &missionId);
379 if (status != ANI_OK) {379 if (status != ANI_OK) {
380 TAG_LOGE(AAFwkTag::MISSION, "ConvertAniInt failed at index %{public}zu", i);380 TAG_LOGE(AAFwkTag::MISSION, "ConvertAniInt failed at index %{public}zu", i);
381 AsyncCallback(env, callback,381 AsyncCallback(env, callback,
@@ -426,7 +426,7 @@ private:
426 }426 }
427 int32_t missionId = 0;427 int32_t missionId = 0;
428 status = env->Object_CallMethodByName_Int(428 status = env->Object_CallMethodByName_Int(
429 reinterpret_cast<ani_object>(ref), "intValue", nullptr, &missionId);429 reinterpret_cast<ani_object>(ref), "toInt", nullptr, &missionId);
430 if (status != ANI_OK) {430 if (status != ANI_OK) {
431 TAG_LOGE(AAFwkTag::MISSION, "ConvertAniInt failed at index %{public}zu", i);431 TAG_LOGE(AAFwkTag::MISSION, "ConvertAniInt failed at index %{public}zu", i);
432 AsyncCallback(env, callback,432 AsyncCallback(env, callback,
Mframeworks/ets/ani/app_manager/src/ets_app_manager.cpp+1-1
@@ -210,7 +210,7 @@ void EtsAppManager::PreloadApplication(ani_env *env, ani_object callback, ani_st
210 return;210 return;
211 }211 }
212 if (!isUndefined) {212 if (!isUndefined) {
213 if ((status = env->Object_CallMethodByName_Int(aniAppIndex, "intValue", nullptr, &appIndex)) != ANI_OK) {213 if ((status = env->Object_CallMethodByName_Int(aniAppIndex, "toInt", nullptr, &appIndex)) != ANI_OK) {
214 TAG_LOGE(AAFwkTag::APPMGR, "Object_CallMethodByName_Int status : %{public}d", status);214 TAG_LOGE(AAFwkTag::APPMGR, "Object_CallMethodByName_Int status : %{public}d", status);
215 return;215 return;
216 }216 }
Mframeworks/ets/ani/featureAbility/src/ani_data_ability_helper.cpp+1-1
@@ -27,7 +27,7 @@ constexpr const char* CLASSNAME_ARRAY = "std.core.Array";
27void PutDouble(AppExecFwk::PacMap &pacMap, ani_env* env, std::string keyStr, ani_object aniValue)27void PutDouble(AppExecFwk::PacMap &pacMap, ani_env* env, std::string keyStr, ani_object aniValue)
28{28{
29 ani_double value = 0;29 ani_double value = 0;
30 ani_status status = env->Object_CallMethodByName_Double(aniValue, "doubleValue", nullptr, &value);30 ani_status status = env->Object_CallMethodByName_Double(aniValue, "toDouble", nullptr, &value);
31 if (status != ANI_OK) {31 if (status != ANI_OK) {
32 TAG_LOGE(AAFwkTag::FA, "Object_CallMethodByName_Double status: %{public}d", status);32 TAG_LOGE(AAFwkTag::FA, "Object_CallMethodByName_Double status: %{public}d", status);
33 return;33 return;
Mframeworks/native/appkit/app_startup/ets_startup_config.cpp+2-2
@@ -170,7 +170,7 @@ bool ETSStartupConfig::GetTimeoutMs(ani_env *env, ani_object config, int32_t &ti
170 }170 }
171 ani_int aniInt = 0;171 ani_int aniInt = 0;
172 if ((status = env->Object_CallMethodByName_Int(172 if ((status = env->Object_CallMethodByName_Int(
173 reinterpret_cast<ani_object>(iTimeoutMsRef), "intValue", nullptr, &aniInt)) != ANI_OK) {173 reinterpret_cast<ani_object>(iTimeoutMsRef), "toInt", nullptr, &aniInt)) != ANI_OK) {
174 TAG_LOGE(AAFwkTag::STARTUP, "Object_CallMethodByName failed, status: %{public}d", status);174 TAG_LOGE(AAFwkTag::STARTUP, "Object_CallMethodByName failed, status: %{public}d", status);
175 return false;175 return false;
176 }176 }
@@ -328,4 +328,4 @@ extern "C" ETS_EXPORT StartupConfig* OHOS_CreateEtsStartupConfig(ani_env *env)
328 return new (std::nothrow) ETSStartupConfig(aniVM);328 return new (std::nothrow) ETSStartupConfig(aniVM);
329}329}
330}330}
331}331}