diff --git a/frameworks/ets/ani/accesstoken/src/ani_ability_access_ctrl.cpp b/frameworks/ets/ani/accesstoken/src/ani_ability_access_ctrl.cpp index 92f6ae3083a69f29df5532516981f2cfb545ac29..407d42c8939b327f6b0e34e7aa32f69dd4b1832d 100644 --- a/frameworks/ets/ani/accesstoken/src/ani_ability_access_ctrl.cpp +++ b/frameworks/ets/ani/accesstoken/src/ani_ability_access_ctrl.cpp @@ -412,11 +412,6 @@ static ani_ref GetPermissionsStatusExecute([[maybe_unused]] ani_env* env, return nullptr; } std::vector permissionList = ParseAniStringVector(env, aniPermissionList); - if (permissionList.empty()) { - BusinessErrorAni::ThrowError( - env, STS_ERROR_INNER, GetErrorMessage(STS_ERROR_INNER, "The permissionList is empty.")); - return nullptr; - } std::vector permList; for (const auto& permission : permissionList) { @@ -727,13 +722,16 @@ static bool FindAndGetSubscriberInVector(RegisterPermStateChangeInf* unregisterP LOGI(ATM_DOMAIN, ATM_TAG, "Callback is null."); callbackEqual = IsCurrentThread(item->threadId); } else { - LOGI(ATM_DOMAIN, ATM_TAG, "Compare callback."); if (!AniIsCallbackRefEqual(unregisterPermStateChangeInf->env, callbackRef, - unregisterPermStateChangeInf->callbackRef, item->threadId, callbackEqual)) { + item->callbackRef, item->threadId, callbackEqual)) { + continue; + } + if (!callbackEqual) { continue; } } + LOGI(ATM_DOMAIN, ATM_TAG, "Callback is equal."); PermStateChangeScope scopeInfo; item->subscriber->GetScope(scopeInfo); if (scopeInfo.tokenIDs == targetTokenIDs && scopeInfo.permList == targetPermList) {