权限弹窗标题超长处理

Signed-off-by: fanchenxuan <fanchenxuan@huawei.com>
This commit is contained in:
fanchenxuan 2024-07-08 20:12:39 +08:00
parent 85403ea690
commit c122e1412d
11 changed files with 123 additions and 190 deletions

View File

@ -14,4 +14,4 @@
*/ */
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks;

View File

@ -14,4 +14,4 @@
*/ */
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').appTasks module.exports = require('@ohos/hvigor-ohos-plugin').appTasks;

View File

@ -14,4 +14,4 @@
*/ */
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks;

View File

@ -77,8 +77,8 @@ export default class SecurityExtensionAbility extends extension {
win.setWindowBackgroundColor(BG_COLOR); win.setWindowBackgroundColor(BG_COLOR);
await win.showWindow(); await win.showWindow();
this.monitorFold(win); this.monitorFold(win);
} catch { } catch (err) {
console.error(TAG + 'window create failed!'); console.error(TAG + `window create failed! err: ${JSON.stringify(err)}`);
} }
} }

View File

@ -94,27 +94,26 @@ export default class ServiceExtensionAbility extends extension {
console.info(TAG + 'showWindow end.'); console.info(TAG + 'showWindow end.');
globalThis.windowNum ++; globalThis.windowNum ++;
GlobalContext.store('windowNum', globalThis.windowNum); GlobalContext.store('windowNum', globalThis.windowNum);
} catch { } catch (err) {
console.info(TAG + 'window create failed!'); console.error(TAG + `window create failed! err: ${JSON.stringify(err)}`);
} }
} }
private async BindDialogTarget(win, want): Promise<void> { private async BindDialogTarget(win, want): Promise<void> {
let proxy = want.parameters['ohos.ability.params.callback'].value; let proxy = want.parameters['ohos.ability.params.callback'].value;
win.bindDialogTarget(want.parameters['ohos.ability.params.token'].value, () => {
let option = new rpc.MessageOption(); let option = new rpc.MessageOption();
let data = new rpc.MessageSequence(); let data = new rpc.MessageSequence();
let reply = new rpc.MessageSequence(); let reply = new rpc.MessageSequence();
win.bindDialogTarget(want.parameters['ohos.ability.params.token'].value, () => { try {
Promise.all([ data.writeInterfaceToken(ACCESS_TOKEN);
data.writeInterfaceToken(ACCESS_TOKEN),
]).then(() => {
proxy.sendMessageRequest(RESULT_CODE_1, data, reply, option); proxy.sendMessageRequest(RESULT_CODE_1, data, reply, option);
} catch (err) {
console.error(TAG + `write result failed: ${JSON.stringify(err)}`);
} finally {
data.reclaim(); data.reclaim();
reply.reclaim(); reply.reclaim();
}).catch(() => { }
data.reclaim();
reply.reclaim();
console.error('write result failed!');
});
let windowNum = GlobalContext.load('windowNum'); let windowNum = GlobalContext.load('windowNum');
windowNum --; windowNum --;
GlobalContext.store('windowNum', windowNum); GlobalContext.store('windowNum', windowNum);

View File

@ -50,24 +50,24 @@ export const permissionGroups: PermissionInfo[] = [
] ]
export const groups: GroupInfo[] = [ export const groups: GroupInfo[] = [
new GroupInfo('LOCATION', $r('app.string.groupName_location'), $r('app.string.group_label_location'), $r('app.media.ic_public_gps'), [], '', ['ohos.permission.LOCATION_IN_BACKGROUND', 'ohos.permission.APPROXIMATELY_LOCATION', 'ohos.permission.LOCATION'], true, 'app.string.enable_description_location', $r('app.string.forbidden_description_location')), new GroupInfo('LOCATION', $r('app.string.groupName_location'), 'app.string.group_label_location', $r('app.media.ic_public_gps'), [], '', ['ohos.permission.LOCATION_IN_BACKGROUND', 'ohos.permission.APPROXIMATELY_LOCATION', 'ohos.permission.LOCATION'], true, 'app.string.enable_description_location', $r('app.string.forbidden_description_location')),
new GroupInfo('CAMERA', $r('app.string.groupName_camera'), $r('app.string.group_label_camera'), $r('app.media.ic_public_camera'), [], '', ['ohos.permission.CAMERA'], true, 'app.string.enable_description_camera', $r('app.string.forbidden_description_camera')), new GroupInfo('CAMERA', $r('app.string.groupName_camera'), 'app.string.group_label_camera', $r('app.media.ic_public_camera'), [], '', ['ohos.permission.CAMERA'], true, 'app.string.enable_description_camera', $r('app.string.forbidden_description_camera')),
new GroupInfo('MICROPHONE', $r('app.string.groupName_microphone'), $r('app.string.group_label_microphone'), $r('app.media.ic_public_voice'), [], '', ['ohos.permission.MICROPHONE'], true, 'app.string.enable_description_microphone', $r('app.string.forbidden_description_microphone')), new GroupInfo('MICROPHONE', $r('app.string.groupName_microphone'), 'app.string.group_label_microphone', $r('app.media.ic_public_voice'), [], '', ['ohos.permission.MICROPHONE'], true, 'app.string.enable_description_microphone', $r('app.string.forbidden_description_microphone')),
new GroupInfo('CONTACTS', $r('app.string.groupName_contacts'), $r('app.string.group_label_contacts'), $r('app.media.ic_public_contacts_group'), [], '', ['ohos.permission.READ_CONTACTS', 'ohos.permission.WRITE_CONTACTS'], false), new GroupInfo('CONTACTS', $r('app.string.groupName_contacts'), 'app.string.group_label_contacts', $r('app.media.ic_public_contacts_group'), [], '', ['ohos.permission.READ_CONTACTS', 'ohos.permission.WRITE_CONTACTS'], false),
new GroupInfo('CALENDAR', $r('app.string.groupName_calendar'), $r('app.string.group_label_calendar'), $r('app.media.ic_public_calendar'), [], '', ['ohos.permission.READ_CALENDAR', 'ohos.permission.WRITE_CALENDAR', 'ohos.permission.READ_WHOLE_CALENDAR', 'ohos.permission.WRITE_WHOLE_CALENDAR'], true), new GroupInfo('CALENDAR', $r('app.string.groupName_calendar'), 'app.string.group_label_calendar', $r('app.media.ic_public_calendar'), [], '', ['ohos.permission.READ_CALENDAR', 'ohos.permission.WRITE_CALENDAR', 'ohos.permission.READ_WHOLE_CALENDAR', 'ohos.permission.WRITE_WHOLE_CALENDAR'], true),
new GroupInfo('SPORT', $r('app.string.groupName_sport'), $r('app.string.group_label_sport'), $r('app.media.ic_sport'), [], '', ['ohos.permission.ACTIVITY_MOTION'], true, 'app.string.enable_description_sport', $r('app.string.forbidden_description_sport')), new GroupInfo('SPORT', $r('app.string.groupName_sport'), 'app.string.group_label_sport', $r('app.media.ic_sport'), [], '', ['ohos.permission.ACTIVITY_MOTION'], true, 'app.string.enable_description_sport', $r('app.string.forbidden_description_sport')),
new GroupInfo('HEALTH', $r('app.string.groupName_health'), $r('app.string.group_label_health'), $r('app.media.ic_ssensor'), [], '', ['ohos.permission.READ_HEALTH_DATA'], true, 'app.string.enable_description_health', $r('app.string.forbidden_description_health')), new GroupInfo('HEALTH', $r('app.string.groupName_health'), 'app.string.group_label_health', $r('app.media.ic_ssensor'), [], '', ['ohos.permission.READ_HEALTH_DATA'], true, 'app.string.enable_description_health', $r('app.string.forbidden_description_health')),
new GroupInfo('OTHER', $r('app.string.groupName_other'), '', $r('app.media.ic_more'), [], '', [], true), new GroupInfo('OTHER', $r('app.string.groupName_other'), '', $r('app.media.ic_more'), [], '', [], true),
new GroupInfo('IMAGE_AND_VIDEOS', $r('sys.string.ohos_lab_read_imagevideo'), $r('app.string.group_label_image_and_videos'), $r('app.media.ic_public_picture'), [], '', ['ohos.permission.READ_IMAGEVIDEO', 'ohos.permission.WRITE_IMAGEVIDEO', 'ohos.permission.MEDIA_LOCATION'], false, 'app.string.enable_description_image', $r('app.string.forbidden_description_image')), new GroupInfo('IMAGE_AND_VIDEOS', $r('sys.string.ohos_lab_read_imagevideo'), 'app.string.group_label_image_and_videos', $r('app.media.ic_public_picture'), [], '', ['ohos.permission.READ_IMAGEVIDEO', 'ohos.permission.WRITE_IMAGEVIDEO', 'ohos.permission.MEDIA_LOCATION'], false, 'app.string.enable_description_image', $r('app.string.forbidden_description_image')),
new GroupInfo('AUDIOS', $r('sys.string.ohos_lab_read_audio'), $r('app.string.group_label_audios'), $r('app.media.ic_public_audio'), [], '', ['ohos.permission.READ_AUDIO', 'ohos.permission.WRITE_AUDIO'], false, 'app.string.enable_description_audios', $r('app.string.forbidden_description_audios')), new GroupInfo('AUDIOS', $r('sys.string.ohos_lab_read_audio'), 'app.string.group_label_audios', $r('app.media.ic_public_audio'), [], '', ['ohos.permission.READ_AUDIO', 'ohos.permission.WRITE_AUDIO'], false, 'app.string.enable_description_audios', $r('app.string.forbidden_description_audios')),
new GroupInfo('DOCUMENTS', $r('sys.string.ohos_lab_read_document'), $r('app.string.group_label_document'), $r('app.media.ic_public_folder'), [], '', ['ohos.permission.READ_DOCUMENT', 'ohos.permission.WRITE_DOCUMENT', 'ohos.permission.READ_MEDIA', 'ohos.permission.WRITE_MEDIA'], false, 'app.string.enable_description_documents', $r('app.string.forbidden_description_documents')), new GroupInfo('DOCUMENTS', $r('sys.string.ohos_lab_read_document'), 'app.string.group_label_document', $r('app.media.ic_public_folder'), [], '', ['ohos.permission.READ_DOCUMENT', 'ohos.permission.WRITE_DOCUMENT', 'ohos.permission.READ_MEDIA', 'ohos.permission.WRITE_MEDIA'], false, 'app.string.enable_description_documents', $r('app.string.forbidden_description_documents')),
new GroupInfo('ADS', $r('app.string.groupName_ADS'), $r('app.string.group_label_ADS'), $r('app.media.track'), [], '', ['ohos.permission.APP_TRACKING_CONSENT'], false, 'app.string.enable_description_ADS', $r('app.string.forbidden_description_ADS')), new GroupInfo('ADS', $r('app.string.groupName_ADS'), 'app.string.group_label_ADS', $r('app.media.track'), [], '', ['ohos.permission.APP_TRACKING_CONSENT'], false, 'app.string.enable_description_ADS', $r('app.string.forbidden_description_ADS')),
new GroupInfo('GET_INSTALLED_BUNDLE_LIST', $r('app.string.groupName_appList'), $r('app.string.group_label_appList'), $r('app.media.ic_public_app_list'), [], '', ['ohos.permission.GET_INSTALLED_BUNDLE_LIST'], false, 'app.string.enable_description_appList', $r('app.string.forbidden_description_appList')), new GroupInfo('GET_INSTALLED_BUNDLE_LIST', $r('app.string.groupName_appList'), 'app.string.group_label_appList', $r('app.media.ic_public_app_list'), [], '', ['ohos.permission.GET_INSTALLED_BUNDLE_LIST'], false, 'app.string.enable_description_appList', $r('app.string.forbidden_description_appList')),
new GroupInfo('DISTRIBUTED_DATASYNC', $r('app.string.multi_device_collaboration'), $r('app.string.group_label_distributed_datasync'), $r('app.media.ic_multi_device_vector'), [], '', ['ohos.permission.DISTRIBUTED_DATASYNC'], false, 'app.string.enable_description_distributed_datasync', $r('app.string.forbidden_description_distributed_datasync')), new GroupInfo('DISTRIBUTED_DATASYNC', $r('app.string.multi_device_collaboration'), 'app.string.group_label_distributed_datasync', $r('app.media.ic_multi_device_vector'), [], '', ['ohos.permission.DISTRIBUTED_DATASYNC'], false, 'app.string.enable_description_distributed_datasync', $r('app.string.forbidden_description_distributed_datasync')),
new GroupInfo('BLUETOOTH', $r('app.string.groupName_bluetooth'), $r('app.string.group_label_bluetooth'), $r('app.media.ic_public_bluetooth'), [], '', ['ohos.permission.ACCESS_BLUETOOTH'], false, 'app.string.enable_description_bluetooth', $r('app.string.forbidden_description_bluetooth')), new GroupInfo('BLUETOOTH', $r('app.string.groupName_bluetooth'), 'app.string.group_label_bluetooth', $r('app.media.ic_public_bluetooth'), [], '', ['ohos.permission.ACCESS_BLUETOOTH'], false, 'app.string.enable_description_bluetooth', $r('app.string.forbidden_description_bluetooth')),
new GroupInfo('PASTEBOARD', $r('app.string.groupName_pasteboard'), $r('app.string.group_label_pasteboard'), $r('app.media.ic_clipboard'), [], '', ['ohos.permission.READ_PASTEBOARD'], false, 'app.string.enable_description_pasteboard', $r('app.string.forbidden_description_pasteboard')), new GroupInfo('PASTEBOARD', $r('app.string.groupName_pasteboard'), 'app.string.group_label_pasteboard', $r('app.media.ic_clipboard'), [], '', ['ohos.permission.READ_PASTEBOARD'], false, 'app.string.enable_description_pasteboard', $r('app.string.forbidden_description_pasteboard')),
new GroupInfo('FOLDER', $r('app.string.groupName_folder'), $r('app.string.group_label_folder'), $r('app.media.ic_public_folder'), [], '', ['ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY', 'ohos.permission.READ_WRITE_DESKTOP_DIRECTORY', 'ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY'], false, 'app.string.enable_description_folder', $r('app.string.forbidden_description_folder')), new GroupInfo('FOLDER', $r('app.string.groupName_folder'), 'app.string.group_label_folder', $r('app.media.ic_public_folder'), [], '', ['ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY', 'ohos.permission.READ_WRITE_DESKTOP_DIRECTORY', 'ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY'], false, 'app.string.enable_description_folder', $r('app.string.forbidden_description_folder')),
new GroupInfo('NEARLINK', $r('app.string.groupName_nearLink'), $r('app.string.group_label_nearLink'), $r('app.media.ic_nearLink'), [], '', ['ohos.permission.ACCESS_NEARLINK'], false, 'app.string.enable_description_nearLink', $r('app.string.forbidden_description_nearLink')) new GroupInfo('NEARLINK', $r('app.string.groupName_nearLink'), 'app.string.group_label_nearLink', $r('app.media.ic_nearLink'), [], '', ['ohos.permission.ACCESS_NEARLINK'], false, 'app.string.enable_description_nearLink', $r('app.string.forbidden_description_nearLink'))
]; ];
export const userGrantPermissions: string[] = [ export const userGrantPermissions: string[] = [

View File

@ -252,7 +252,7 @@ export class PermissionInfo {
export class GroupInfo { export class GroupInfo {
public name: string public name: string
public groupName: ResourceStr public groupName: ResourceStr
public label: ResourceStr public label: string
public icon: ResourceStr public icon: ResourceStr
public description: Array<ResourceStr> public description: Array<ResourceStr>
public reason: string public reason: string
@ -264,7 +264,7 @@ export class GroupInfo {
constructor( constructor(
name: string, name: string,
groupName: ResourceStr, groupName: ResourceStr,
label: ResourceStr, label: string,
icon: ResourceStr, icon: ResourceStr,
description: Array<ResourceStr>, description: Array<ResourceStr>,
reason: string, reason: string,

View File

@ -97,27 +97,30 @@ struct dialogPlusPage {
Scroll() { Scroll() {
Column() { Column() {
Row() { Row() {
Flex({ justifyContent: FlexAlign.Start }) { Column() {
Text() { Text($r(this.showTitle(), this.appName))
Span($r('app.string.whether_to_allow')) .textAlign(TextAlign.Center)
Span(this.appName) .fontSize($r('sys.float.Title_S'))
Span($r('app.string.quotes')) .fontColor($r('sys.color.font_primary'))
Span(this.showTitle()) .fontWeight(FontWeight.Bold)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.maxLines(Constants.SECURITY_HEADER_MAX_LINES)
.minFontSize($r('sys.float.Subtitle_M'))
.maxFontSize($r('sys.float.Title_S'))
.heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST)
} }
.fontSize(Constants.DIALOG_REQ_FONT_SIZE) .height(Constants.HEADLINE_HEIGHT)
.fontColor($r('sys.color.ohos_id_color_text_primary')) .justifyContent(FlexAlign.Center)
.fontWeight(FontWeight.Medium) .padding({
.lineHeight(Constants.DIALOG_REQ_LINE_HEIGHT) top: Constants.DEFAULT_PADDING_TOP,
.margin({ bottom: Constants.DEFAULT_PADDING_BOTTOM,
top: Constants.DIALOG_REQ_MARGIN_TOP, left: Constants.PADDING_24,
left: Constants.DIALOG_REQ_MARGIN_LEFT, right: Constants.PADDING_24
right: Constants.DIALOG_REQ_MARGIN_RIGHT
}) })
} }
}
Row() { Row() {
Flex({ justifyContent: FlexAlign.Start }) { Flex({ justifyContent: FlexAlign.Center }) {
Text() { Text() {
if ( if (
this.currentGroup().name === 'LOCATION' && this.currentGroup().name === 'LOCATION' &&
@ -141,11 +144,10 @@ struct dialogPlusPage {
} }
} }
.textAlign(TextAlign.Start) .textAlign(TextAlign.Start)
.fontSize($r('sys.float.ohos_id_text_size_body1')) .fontColor($r('sys.color.font_primary'))
.fontColor($r('sys.color.ohos_id_color_text_secondary')) .fontSize($r('sys.float.Body_L'))
.lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT) .lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT)
.margin({ .margin({
top: Constants.DIALOG_DESP_MARGIN_TOP,
left: Constants.DIALOG_DESP_MARGIN_LEFT, left: Constants.DIALOG_DESP_MARGIN_LEFT,
right: Constants.DIALOG_DESP_MARGIN_RIGHT, right: Constants.DIALOG_DESP_MARGIN_RIGHT,
bottom: Constants.DIALOG_DESP_MARGIN_BOTTOM bottom: Constants.DIALOG_DESP_MARGIN_BOTTOM
@ -160,7 +162,7 @@ struct dialogPlusPage {
}.constraintSize({ maxHeight: Constants.MAXIMUM_HEADER_HEIGHT }) }.constraintSize({ maxHeight: Constants.MAXIMUM_HEADER_HEIGHT })
if (this.currentGroup().name === 'LOCATION') { if (this.currentGroup().name === 'LOCATION') {
Column() { Column() {
Button($r('app.string.ALLOWED_ONLY_DURING_USE')) Button($r('app.string.allowed_only_during_use'))
.customizeButton() .customizeButton()
.width(Constants.FULL_WIDTH) .width(Constants.FULL_WIDTH)
.margin({ bottom: Constants.MARGIN_4 }) .margin({ bottom: Constants.MARGIN_4 })
@ -192,7 +194,7 @@ struct dialogPlusPage {
} else { } else {
Row() { Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Button($r('app.string.BAN')) Button($r('app.string.ban'))
.onClick(() => { .onClick(() => {
this.privacyCancel( this.privacyCancel(
this.grantGroups[this.count], this.accessTokenId, this.reqPerms, this.userFixedFlag this.grantGroups[this.count], this.accessTokenId, this.reqPerms, this.userFixedFlag
@ -206,7 +208,7 @@ struct dialogPlusPage {
.opacity(0.2) .opacity(0.2)
.margin({ left: Constants.MARGIN_4, right: Constants.MARGIN_4 }) .margin({ left: Constants.MARGIN_4, right: Constants.MARGIN_4 })
Button( Button(
this.currentGroup().name === 'PASTEBOARD' ? $r('app.string.THIS_TIME_ONLY') : $r('app.string.ALLOW') this.currentGroup().name === 'PASTEBOARD' ? $r('app.string.This_time_only') : $r('app.string.allow')
) )
.onClick(() => { .onClick(() => {
this.privacyAccept( this.privacyAccept(
@ -233,14 +235,14 @@ struct dialogPlusPage {
build() {} build() {}
showTitle(): ResourceStr { showTitle(): string {
let index = this.count >= this.grantGroups.length ? this.grantGroups.length - 1 : this.count; let index = this.count >= this.grantGroups.length ? this.grantGroups.length - 1 : this.count;
if (this.grantGroups[index].name == 'LOCATION') { if (this.grantGroups[index].name == 'LOCATION') {
if (this.locationFlag == Constants.LOCATION_FUZZY) { if (this.locationFlag == Constants.LOCATION_FUZZY) {
return $r('app.string.access_general_location'); return 'app.string.access_general_location';
} }
if (this.locationFlag == Constants.LOCATION_UPGRADE) { if (this.locationFlag == Constants.LOCATION_UPGRADE) {
return $r('app.string.fuzzy_to_exact'); return 'app.string.fuzzy_to_exact';
} }
} }
return this.grantGroups[index].label; return this.grantGroups[index].label;
@ -400,17 +402,17 @@ struct dialogPlusPage {
if (group.name === 'FOLDER') { if (group.name === 'FOLDER') {
switch (permission) { switch (permission) {
case DOWNLOAD_PERMISSION: case DOWNLOAD_PERMISSION:
let downloadGroup = new GroupInfo(group.name, group.groupName, $r('app.string.group_label_download_folder'), let downloadGroup = new GroupInfo(group.name, group.groupName, 'app.string.group_label_download_folder',
group.icon, group.description, group.reason, [DOWNLOAD_PERMISSION], group.isShow) group.icon, group.description, group.reason, [DOWNLOAD_PERMISSION], group.isShow)
this.grantGroups.push(downloadGroup); this.grantGroups.push(downloadGroup);
break; break;
case DESKTOP_PERMISSION: case DESKTOP_PERMISSION:
let desktopGroup = new GroupInfo(group.name, group.groupName, $r('app.string.group_label_desktop_folder'), let desktopGroup = new GroupInfo(group.name, group.groupName, 'app.string.group_label_desktop_folder',
group.icon, group.description, group.reason, [DESKTOP_PERMISSION], group.isShow) group.icon, group.description, group.reason, [DESKTOP_PERMISSION], group.isShow)
this.grantGroups.push(desktopGroup); this.grantGroups.push(desktopGroup);
break; break;
case DOCUMENTS_PERMISSION: case DOCUMENTS_PERMISSION:
let documentGroup = new GroupInfo(group.name, group.groupName, $r('app.string.group_label_document_folder'), let documentGroup = new GroupInfo(group.name, group.groupName, 'app.string.group_label_document_folder',
group.icon, group.description, group.reason, [DOCUMENTS_PERMISSION], group.isShow) group.icon, group.description, group.reason, [DOCUMENTS_PERMISSION], group.isShow)
this.grantGroups.push(documentGroup); this.grantGroups.push(documentGroup);
break; break;

View File

@ -62,7 +62,7 @@ struct SecurityDialog {
} }
}, },
{ {
value: $r('app.string.ALLOW'), value: $r('app.string.allow'),
buttonStyle: ButtonStyleMode.TEXTUAL, buttonStyle: ButtonStyleMode.TEXTUAL,
action: () => { action: () => {
if (this.dialogController !== null) { if (this.dialogController !== null) {
@ -119,6 +119,10 @@ struct SecurityDialog {
} }
.height(Constants.HEADLINE_HEIGHT) .height(Constants.HEADLINE_HEIGHT)
.justifyContent(FlexAlign.Center) .justifyContent(FlexAlign.Center)
.padding({
top: Constants.DEFAULT_PADDING_TOP,
bottom: Constants.DEFAULT_PADDING_BOTTOM,
})
Text($r(this.securityParams[this.index].description, this.appName)) Text($r(this.securityParams[this.index].description, this.appName))
.textAlign(TextAlign.Start) .textAlign(TextAlign.Start)

View File

@ -117,20 +117,8 @@
"value": "Per inquiry" "value": "Per inquiry"
}, },
{ {
"name": "ALLOW", "name": "This_time_only",
"value": "ALLOW" "value": "This time only"
},
{
"name": "BAN",
"value": "BAN"
},
{
"name": "THIS_TIME_ONLY",
"value": "THIS TIME ONLY"
},
{
"name": "ALLOWED_ONLY_DURING_USE",
"value": "ALLOWED ONLY DURING USE"
}, },
{ {
"name": "allowed_only_during_use", "name": "allowed_only_during_use",
@ -138,7 +126,7 @@
}, },
{ {
"name": "allow_this_time", "name": "allow_this_time",
"value": "ALLOW THIS TIME" "value": "Allow this time"
}, },
{ {
"name": "precise_location", "name": "precise_location",
@ -160,33 +148,25 @@
"name": "close_exact_position", "name": "close_exact_position",
"value": "When Precise location is turned off, the location obtained by the application is biased." "value": "When Precise location is turned off, the location obtained by the application is biased."
}, },
{
"name": "whether_to_allow",
"value": "Whether to allow \""
},
{
"name": "quotes",
"value": "\""
},
{ {
"name": "access_general_location", "name": "access_general_location",
"value": " access the general location?" "value": "Allow \"%s\" access the general location?"
}, },
{ {
"name": "fuzzy_to_exact", "name": "fuzzy_to_exact",
"value": " position access to change from \"APPROXIMATE POSITION\" to \"EXACT POSITION\"?" "value": "Allow \"%s\" position access to change from \"APPROXIMATE POSITION\" to \"EXACT POSITION\"?"
}, },
{ {
"name": "cancel", "name": "cancel",
"value": "CANCEL" "value": "Cancel"
}, },
{ {
"name": "open", "name": "open",
"value": "OPEN" "value": "Open"
}, },
{ {
"name": "close", "name": "close",
"value": "CLOSE" "value": "Close"
}, },
{ {
"name": "camera", "name": "camera",
@ -330,99 +310,83 @@
}, },
{ {
"name": "group_label_location", "name": "group_label_location",
"value": " access location information?" "value": "Allow \"%s\" access location information?"
}, },
{ {
"name": "group_label_camera", "name": "group_label_camera",
"value": " using a camera?" "value": "Allow \"%s\" using a camera?"
}, },
{ {
"name": "group_label_microphone", "name": "group_label_microphone",
"value": " using a microphone?" "value": "Allow \"%s\" using a microphone?"
},
{
"name": "group_label_phone",
"value": " use to dial a phone?"
},
{
"name": "group_label_sms",
"value": " access to information?"
}, },
{ {
"name": "group_label_contacts", "name": "group_label_contacts",
"value": " access the address book?" "value": "Allow \"%s\" access the address book?"
},
{
"name": "group_label_call_log",
"value": " access to call records?"
},
{
"name": "group_label_media",
"value": " access to media and files?"
}, },
{ {
"name": "group_label_calendar", "name": "group_label_calendar",
"value": " access to the calendar?" "value": "Allow \"%s\" access to the calendar?"
}, },
{ {
"name": "group_label_sport", "name": "group_label_sport",
"value": " visit the gym?" "value": "Allow \"%s\" visit the gym?"
}, },
{ {
"name": "group_label_health", "name": "group_label_health",
"value": " use body sensors?" "value": "Allow \"%s\" use body sensors?"
}, },
{ {
"name": "group_label_distributed_datasync", "name": "group_label_distributed_datasync",
"value": " use multiple device collaboration?" "value": "Allow \"%s\" use multiple device collaboration?"
}, },
{ {
"name": "group_label_image_and_videos", "name": "group_label_image_and_videos",
"value": " access to pictures and videos?" "value": "Allow \"%s\" access to pictures and videos?"
}, },
{ {
"name": "group_label_audios", "name": "group_label_audios",
"value": " access to music and audio?" "value": "Allow \"%s\" access to music and audio?"
}, },
{ {
"name": "group_label_document", "name": "group_label_document",
"value": " access to files?" "value": "Allow \"%s\" access to files?"
}, },
{ {
"name": "group_label_ADS", "name": "group_label_ADS",
"value": " access AD tracking?" "value": "Allow \"%s\" access AD tracking?"
}, },
{ {
"name": "group_label_appList", "name": "group_label_appList",
"value": " read the list of installed apps?" "value": "Allow \"%s\" read the list of installed apps?"
}, },
{ {
"name": "group_label_bluetooth", "name": "group_label_bluetooth",
"value": " access Bluetooth?" "value": "Allow \"%s\" access Bluetooth?"
}, },
{ {
"name": "group_label_pasteboard", "name": "group_label_pasteboard",
"value": " access Pasteboard?" "value": "Allow \"%s\" access Pasteboard?"
}, },
{ {
"name": "group_label_folder", "name": "group_label_folder",
"value": " access Folder?" "value": "Allow \"%s\" access Folder?"
}, },
{ {
"name": "group_label_download_folder", "name": "group_label_download_folder",
"value": " access the \"Downloads\" folder?" "value": "Allow \"%s\" access the \"Downloads\" folder?"
}, },
{ {
"name": "group_label_desktop_folder", "name": "group_label_desktop_folder",
"value": " access the \"Desktop\" folder?" "value": "Allow \"%s\" access the \"Desktop\" folder?"
}, },
{ {
"name": "group_label_document_folder", "name": "group_label_document_folder",
"value": " access the \"Document\" folder?" "value": "Allow \"%s\" access the \"Document\" folder?"
}, },
{ {
"name": "group_label_nearLink", "name": "group_label_nearLink",
"value": " access NearLink?" "value": "Allow \"%s\" access NearLink?"
}, },
{ {
"name": "enable_description_location", "name": "enable_description_location",

View File

@ -117,21 +117,9 @@
"value": "每次询问" "value": "每次询问"
}, },
{ {
"name": "ALLOW", "name": "This_time_only",
"value": "允许"
},
{
"name": "BAN",
"value": "禁止"
},
{
"name": "THIS_TIME_ONLY",
"value": "仅本次允许" "value": "仅本次允许"
}, },
{
"name": "ALLOWED_ONLY_DURING_USE",
"value": "仅使用期间允许"
},
{ {
"name": "allowed_only_during_use", "name": "allowed_only_during_use",
"value": "仅使用期间允许" "value": "仅使用期间允许"
@ -160,21 +148,13 @@
"name": "close_exact_position", "name": "close_exact_position",
"value": "关闭精确位置后,应用获取的位置会有偏差。" "value": "关闭精确位置后,应用获取的位置会有偏差。"
}, },
{
"name": "whether_to_allow",
"value": "是否允许“"
},
{
"name": "quotes",
"value": "”"
},
{ {
"name": "access_general_location", "name": "access_general_location",
"value": "访问大致位置?" "value": "允许“%s”访问大致位置"
}, },
{ {
"name": "fuzzy_to_exact", "name": "fuzzy_to_exact",
"value": "的位置访问权限从“大致位置”改为“精确位置”?" "value": "允许“%s”的位置访问权限从“大致位置”改为“精确位置”"
}, },
{ {
"name": "cancel", "name": "cancel",
@ -330,99 +310,83 @@
}, },
{ {
"name": "group_label_location", "name": "group_label_location",
"value": "访问位置信息?" "value": "允许“%s”访问位置信息?"
}, },
{ {
"name": "group_label_camera", "name": "group_label_camera",
"value": "使用相机?" "value": "允许“%s”使用相机?"
}, },
{ {
"name": "group_label_microphone", "name": "group_label_microphone",
"value": "使用麦克风?" "value": "允许“%s”使用麦克风"
},
{
"name": "group_label_phone",
"value": "使用拨打电话?"
},
{
"name": "group_label_sms",
"value": "访问信息?"
}, },
{ {
"name": "group_label_contacts", "name": "group_label_contacts",
"value": "访问通讯录?" "value": "允许“%s”访问通讯录"
},
{
"name": "group_label_call_log",
"value": "访问通话记录?"
},
{
"name": "group_label_media",
"value": "访问媒体和文件?"
}, },
{ {
"name": "group_label_calendar", "name": "group_label_calendar",
"value": "访问日历?" "value": "允许“%s”访问日历"
}, },
{ {
"name": "group_label_sport", "name": "group_label_sport",
"value": "访问健身运动?" "value": "允许“%s”访问健身运动"
}, },
{ {
"name": "group_label_health", "name": "group_label_health",
"value": "使用身体传感器?" "value": "允许“%s”使用身体传感器?"
}, },
{ {
"name": "group_label_distributed_datasync", "name": "group_label_distributed_datasync",
"value": "使用多设备协同?" "value": "允许“%s”使用多设备协同?"
}, },
{ {
"name": "group_label_image_and_videos", "name": "group_label_image_and_videos",
"value": "访问图片和视频?" "value": "允许“%s”访问图片和视频?"
}, },
{ {
"name": "group_label_audios", "name": "group_label_audios",
"value": "访问音乐和音频?" "value": "允许“%s”访问音乐和音频?"
}, },
{ {
"name": "group_label_document", "name": "group_label_document",
"value": "访问文件?" "value": "允许“%s”访问文件?"
}, },
{ {
"name": "group_label_ADS", "name": "group_label_ADS",
"value": "访问广告跟踪?" "value": "允许“%s”访问广告跟踪?"
}, },
{ {
"name": "group_label_appList", "name": "group_label_appList",
"value": "读取已安装应用列表?" "value": "允许“%s”读取已安装应用列表?"
}, },
{ {
"name": "group_label_bluetooth", "name": "group_label_bluetooth",
"value": "访问蓝牙?" "value": "允许“%s”访问蓝牙?"
}, },
{ {
"name": "group_label_pasteboard", "name": "group_label_pasteboard",
"value": "访问剪贴板?" "value": "允许“%s”访问剪贴板?"
}, },
{ {
"name": "group_label_folder", "name": "group_label_folder",
"value": "访问文件夹?" "value": "允许“%s”访问文件夹?"
}, },
{ {
"name": "group_label_download_folder", "name": "group_label_download_folder",
"value": "访问“下载”文件夹?" "value": "允许“%s”访问“下载”文件夹?"
}, },
{ {
"name": "group_label_desktop_folder", "name": "group_label_desktop_folder",
"value": "访问“桌面”文件夹?" "value": "允许“%s”访问“桌面”文件夹?"
}, },
{ {
"name": "group_label_document_folder", "name": "group_label_document_folder",
"value": "访问“文档”文件夹?" "value": "允许“%s”访问“文档”文件夹?"
}, },
{ {
"name": "group_label_nearLink", "name": "group_label_nearLink",
"value": "访问星闪?" "value": "允许“%s”访问星闪?"
}, },
{ {
"name": "enable_description_location", "name": "enable_description_location",