From 8329a2e68b432e1a05f69b47446398ee3db00e83 Mon Sep 17 00:00:00 2001 From: yuwenze Date: Sat, 24 Dec 2022 02:30:53 +0000 Subject: [PATCH] fixed 011ebab from https://gitee.com/altay/interface_sdk-js/pulls/3567 Description:offline requestPermissionFromUser from ams Sig:SIG_ApplicationFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: yuwenze Change-Id: I17b359cd59ec2addd9a86cde610c389d850afcbd --- api/@ohos.app.ability.common.d.ts | 9 ---- api/@ohos.application.context.d.ts | 10 ----- api/application/AbilityContext.d.ts | 30 ------------- api/application/PermissionRequestResult.d.ts | 45 -------------------- api/application/UIAbilityContext.d.ts | 30 ------------- 5 files changed, 124 deletions(-) delete mode 100644 api/application/PermissionRequestResult.d.ts diff --git a/api/@ohos.app.ability.common.d.ts b/api/@ohos.app.ability.common.d.ts index b32a7effba..c6f1460630 100644 --- a/api/@ohos.app.ability.common.d.ts +++ b/api/@ohos.app.ability.common.d.ts @@ -116,15 +116,6 @@ declare namespace common { */ export type EventHub = _EventHub.default - /** - * The result of requestPermissionsFromUser with asynchronous callback. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - * @since 9 - * @deprecated since 9 - */ - export type PermissionRequestResult = _PermissionRequestResult.default - /** * Defines a PacMap object for storing a series of values. * @syscap SystemCapability.Ability.AbilityRuntime.Core diff --git a/api/@ohos.application.context.d.ts b/api/@ohos.application.context.d.ts index be53b9d891..2eeb45fb0c 100644 --- a/api/@ohos.application.context.d.ts +++ b/api/@ohos.application.context.d.ts @@ -107,16 +107,6 @@ declare namespace context { * @StageModelOnly */ export type EventHub = _EventHub.default - - /** - * The result of requestPermissionsFromUser with asynchronous callback. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - * @deprecated since 9 - */ - export type PermissionRequestResult = _PermissionRequestResult.default } export default context; \ No newline at end of file diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index d611800ce6..2038e978fc 100644 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -23,7 +23,6 @@ import { HapModuleInfo } from "../bundleManager/hapModuleInfo"; import Context from "./Context"; import Want from "../@ohos.application.Want"; import StartOptions from "../@ohos.app.ability.StartOptions"; -import PermissionRequestResult from "./PermissionRequestResult"; import { Configuration } from '../@ohos.app.ability.Configuration'; import { Caller } from '../@ohos.app.ability.UIAbility'; import { LocalStorage } from 'StateManagement'; @@ -523,35 +522,6 @@ export default class AbilityContext extends Context { */ setMissionIcon(icon: image.PixelMap): Promise; - /** - * Requests certain permissions from the system. - * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter - * cannot be null or empty. - * @param { AsyncCallback } requestCallback - The callback is used to return the permission - * request result. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - * @since 9 - * @deprecated since 9 - * @useinstead @ohos.abilityAccessCtrl.requestPermissionsFromUser - */ - requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback): void; - - /** - * Requests certain permissions from the system. - * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter - * cannot be null or empty. - * @returns { Promise } Returns the permission request result. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - * @since 9 - * @deprecated since 9 - * @useinstead @ohos.abilityAccessCtrl.requestPermissionsFromUser - */ - requestPermissionsFromUser(permissions: Array): Promise; - /** * Restore window stage data in ability continuation * @param { LocalStorage } localStorage - the storage data used to restore window stage diff --git a/api/application/PermissionRequestResult.d.ts b/api/application/PermissionRequestResult.d.ts deleted file mode 100644 index f98382c0be..0000000000 --- a/api/application/PermissionRequestResult.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * The result of requestPermissionsFromUser with asynchronous callback. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - * @deprecated since 9 - * @useinstead security/PermissionRequestResult - */ -export default class PermissionRequestResult { - /** - * The permissions passed in by the user. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - permissions: Array; - - /** - * The results for the corresponding request permissions. The value 0 indicates that a - * permission is granted, and the value -1 indicates not. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - authResults: Array; -} \ No newline at end of file diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts index a04078e0b8..aab01ad138 100644 --- a/api/application/UIAbilityContext.d.ts +++ b/api/application/UIAbilityContext.d.ts @@ -23,7 +23,6 @@ import { HapModuleInfo } from "../bundleManager/hapModuleInfo"; import Context from "./Context"; import Want from "../@ohos.application.Want"; import StartOptions from "../@ohos.app.ability.StartOptions"; -import PermissionRequestResult from "./PermissionRequestResult"; import { Configuration } from '../@ohos.app.ability.Configuration'; import { Caller } from '../@ohos.app.ability.UIAbility'; import { LocalStorage } from 'StateManagement'; @@ -477,35 +476,6 @@ export default class UIAbilityContext extends Context { */ setMissionIcon(icon: image.PixelMap): Promise; - /** - * Requests certain permissions from the system. - * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter - * cannot be null or empty. - * @param { AsyncCallback } requestCallback - The callback is used to return the permission - * request result. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - * @since 9 - * @deprecated since 9 - * @useinstead @ohos.abilityAccessCtrl.requestPermissionsFromUser - */ - requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback): void; - - /** - * Requests certain permissions from the system. - * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter - * cannot be null or empty. - * @returns { Promise } Returns the permission request result. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - * @since 9 - * @deprecated since 9 - * @useinstead @ohos.abilityAccessCtrl.requestPermissionsFromUser - */ - requestPermissionsFromUser(permissions: Array): Promise; - /** * Restore window stage data in ability continuation * @param { LocalStorage } localStorage - the storage data used to restore window stage -- Gitee