!2500 第三方应用创建输入法窗口权限校验

Merge pull request !2500 from ZhengJiangliang/master
This commit is contained in:
openharmony_ci 2023-04-26 07:42:18 +00:00 committed by Gitee
commit 59784c8fcf
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -108,8 +108,10 @@ bool Permission::IsStartByInputMethod()
AppExecFwk::BundleInfo bundleInfo;
// reset ipc identity
std::string identity = IPCSkeleton::ResetCallingIdentity();
// 200000 use uid to caculate userId
int userId = uid / 200000;
bool result = bundleManagerServiceProxy_->GetBundleInfo(bundleName,
AppExecFwk::BundleFlag::GET_BUNDLE_WITH_EXTENSION_INFO, bundleInfo);
AppExecFwk::BundleFlag::GET_BUNDLE_WITH_EXTENSION_INFO, bundleInfo, userId);
// set ipc identity to raw
IPCSkeleton::SetCallingIdentity(identity);
if (!result) {