[systemui]适配组件权限访问新规则

Signed-off-by: gaochao <gaochao55@huawei.com>
This commit is contained in:
gaochao
2022-09-26 15:04:26 +08:00
parent 910e64f88c
commit a13fa55372
6 changed files with 32 additions and 2 deletions
@@ -100,4 +100,22 @@ export default class AbilityManager {
}
});
}
static startServiceExtensionAbility(context: ServiceExtensionContext, want: Want, callback?: (error?: BusinessError) => void): void {
Log.showDebug(TAG, `startServiceExtensionAbility, want: ${JSON.stringify(want)}`);
if (context == null) {
context = AbilityManager.getContext();
}
context.startServiceExtensionAbility(want).then(() => {
Log.showInfo(TAG, 'startServiceExtensionAbility, then');
if (callback) {
callback();
}
}).catch((error: BusinessError) => {
Log.showError(TAG, `startServiceExtensionAbility, error: ${JSON.stringify(error)}`);
if (callback) {
callback(error);
}
});
}
}
+6
View File
@@ -72,6 +72,12 @@
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC",
"reason": "$string:distributed_data_sync_reason"
},
{
"name": "ohos.permission.START_INVISIBLE_ABILITY"
},
{
"name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
}
+6
View File
@@ -72,6 +72,12 @@
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC",
"reason": "$string:distributed_data_sync_reason"
},
{
"name": "ohos.permission.START_INVISIBLE_ABILITY"
},
{
"name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
}
@@ -91,7 +91,7 @@ export class KeyCodeEvent {
}
private sendHomeKeyEvent() {
AbilityManager.startAbility(AbilityManager.getContext(AbilityManager.ABILITY_NAME_NAVIGATION_BAR), {
AbilityManager.startServiceExtensionAbility(AbilityManager.getContext(AbilityManager.ABILITY_NAME_NAVIGATION_BAR), {
bundleName: Constants.LAUNCHER_BUNDLE_NAME,
abilityName: Constants.LAUNCHER_ABILITY_NAME
});
@@ -114,7 +114,7 @@ export class VolumePanelVM {
updateVolumeInfo(volumeInfo: VolumeInfo): void {
Log.showInfo(TAG, `updateVolumeInfo, volumeInfo: ${JSON.stringify(volumeInfo)} , mCurrentAudioVolumeType: ${this.mCurrentAudioVolumeType}`);
if (!volumeInfo.updateUi) {
if (!volumeInfo.updateUi && this.mIsMute.get() == volumeInfo.isMute) {
return;
}
let volumeType = volumeInfo.volumeType;
Binary file not shown.