diff --git a/services/bundlemgr/src/bundle_permission_mgr.cpp b/services/bundlemgr/src/bundle_permission_mgr.cpp index 04c6c7ee3beafd896b843001efc13f473c7fb01a..ef4920fa7d6002c3bd2b604dd28d9bb54f1b6f80 100644 --- a/services/bundlemgr/src/bundle_permission_mgr.cpp +++ b/services/bundlemgr/src/bundle_permission_mgr.cpp @@ -215,10 +215,9 @@ std::vector BundlePermissionMgr::GetPermission for (const auto &reqPermission : reqPermissions) { AccessToken::PermissionStateFull perState; perState.permissionName = reqPermission.name; - perState.isGeneral = true; - perState.resDeviceID.emplace_back(innerBundleInfo.GetBaseApplicationInfo().deviceId); - perState.grantStatus.emplace_back(AccessToken::PermissionState::PERMISSION_DENIED); - perState.grantFlags.emplace_back(AccessToken::PermissionFlag::PERMISSION_DEFAULT_FLAG); + perState.deviceID = innerBundleInfo.GetBaseApplicationInfo().deviceId; + perState.permGrantStatus = AccessToken::PermissionState::PERMISSION_DENIED; + perState.grantFlag = AccessToken::PermissionFlag::PERMISSION_DEFAULT_FLAG; permStateFullList.emplace_back(perState); } } else { @@ -266,11 +265,9 @@ bool BundlePermissionMgr::GetRequestPermissionStates( }); if (iter != allPermissionState.end()) { LOG_D(BMS_TAG_DEFAULT, "GetRequestPermissionStates request permission name: %{public}s", req.c_str()); - for (std::vector::size_type i = 0; i < iter->resDeviceID.size(); i++) { - if (iter->resDeviceID[i] == deviceId) { - bundleInfo.reqPermissionStates.emplace_back(iter->grantStatus[i]); - break; - } + if (iter->deviceID == deviceId) { + bundleInfo.reqPermissionStates.emplace_back(iter->permGrantStatus); + break; } } else { LOG_E(BMS_TAG_DEFAULT, "request permission name : %{public}s is not exit in AccessTokenMgr", req.c_str());