!125 reason获取粒度修改为module

Merge pull request !125 from fanchenxuan/master-
This commit is contained in:
openharmony_ci 2023-06-12 06:29:09 +00:00 committed by Gitee
commit 2e4911867e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 2 deletions

View File

@ -207,7 +207,9 @@ struct mediaDocumentItem {
permissions.forEach(permission => {
info.reqPermissionDetails.forEach(reqPermissionDetail => {
if (reqPermissionDetail.name == permission) {
let context = globalThis.context.createBundleContext(routerData);
console.info("reqPermissionDetail: " + JSON.stringify(reqPermissionDetail));
let permissionDetail: any = reqPermissionDetail;
let context = globalThis.context.createModuleContext(routerData, permissionDetail.moduleName);
context.resourceManager.getString(reqPermissionDetail.reasonId).then(value => {
if (value !== undefined && !hasReason) {
this.reason = this.reason.replace(this.resource.period, this.resource.comma);

View File

@ -440,7 +440,8 @@ struct PermissionDialog {
if (this.reqPerms.indexOf(permission) != -1) {
this.bundleInfo.reqPermissionDetails.forEach(reqPermissionDetail => {
if (reqPermissionDetail.name == permission) {
let context = globalThis.extensionContext.createBundleContext(bundleName);
Log.info("reqPermissionDetail: " + JSON.stringify(reqPermissionDetail));
let context = globalThis.extensionContext.createModuleContext(bundleName, reqPermissionDetail.moduleName);
context.resourceManager.getString(reqPermissionDetail.reasonId, (err, value) => {
if (value !== undefined && !group.hasReason) {
group.description = group.description.replace(this.resource.period, this.resource.comma);