From 6fdafac6d4c5be09980cdd0a1b1f3733b57dc356 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 19:30:40 +0800 Subject: [PATCH] IssueNo: #I5RT32 Description: fix import Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.Ability.d.ts | 2 +- api/@ohos.app.ability.AbilityStage.d.ts | 2 +- api/@ohos.app.ability.ExtensionAbility.d.ts | 2 +- api/@ohos.app.ability.common.d.ts | 27 + api/@ohos.app.ability.missionManager.d.ts | 2 +- api/@ohos.app.form.formHost.d.ts | 2 +- api/@ohos.app.form.formProvider.d.ts | 2 +- api/@ohos.application.Ability.d.ts | 10 +- api/@ohos.application.AbilityConstant.d.ts | 2 + ....application.AbilityLifecycleCallback.d.ts | 2 + api/@ohos.application.AbilityStage.d.ts | 2 + ...@ohos.application.EnvironmentCallback.d.ts | 2 + api/@ohos.application.ExtensionAbility.d.ts | 2 + api/@ohos.application.FormExtension.d.ts | 2 + ...s.application.ServiceExtensionAbility.d.ts | 4 +- api/@ohos.application.StartOptions.d.ts | 2 + ....application.abilityDelegatorRegistry.d.ts | 2 + api/@ohos.application.abilityManager.d.ts | 2 +- api/@ohos.application.appManager.d.ts | 2 + api/@ohos.application.context.d.ts | 2 + api/@ohos.application.errorManager.d.ts | 2 +- api/@ohos.application.missionManager.d.ts | 2 +- api/@ohos.application.quickFixManager.d.ts | 155 ----- api/@ohos.wantAgent.d.ts | 2 +- api/ability/dataAbilityHelper.d.ts | 4 - api/ability/dataAbilityUtils.d.ts | 474 -------------- api/app/context.d.ts | 6 - api/app/featureAbilityContext.d.ts | 593 ------------------ 28 files changed, 65 insertions(+), 1248 deletions(-) delete mode 100644 api/@ohos.application.quickFixManager.d.ts delete mode 100644 api/ability/dataAbilityUtils.d.ts delete mode 100644 api/app/featureAbilityContext.d.ts diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts index 9495a9745f..ee19b722b6 100755 --- a/api/@ohos.app.ability.Ability.d.ts +++ b/api/@ohos.app.ability.Ability.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import AbilityConstant from "./@ohos.application.AbilityConstant"; +import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; import AbilityContext from "./application/AbilityContext"; import Want from './@ohos.application.Want'; import window from './@ohos.window'; diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts index be54070e1d..cc9634994f 100644 --- a/api/@ohos.app.ability.AbilityStage.d.ts +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import AbilityConstant from "./@ohos.application.AbilityConstant"; +import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; import AbilityStageContext from "./application/AbilityStageContext"; import Want from './@ohos.application.Want'; import { Configuration } from './@ohos.application.Configuration'; diff --git a/api/@ohos.app.ability.ExtensionAbility.d.ts b/api/@ohos.app.ability.ExtensionAbility.d.ts index 744d45605a..5e7d6caf0b 100644 --- a/api/@ohos.app.ability.ExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ExtensionAbility.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import AbilityConstant from "./@ohos.application.AbilityConstant"; +import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; import { Configuration } from './@ohos.application.Configuration'; /** diff --git a/api/@ohos.app.ability.common.d.ts b/api/@ohos.app.ability.common.d.ts index 7c2d786101..1716916ce8 100755 --- a/api/@ohos.app.ability.common.d.ts +++ b/api/@ohos.app.ability.common.d.ts @@ -22,6 +22,9 @@ import * as _ExtensionContext from './application/ExtensionContext'; import * as _FormExtensionContext from './application/FormExtensionContext'; import * as _EventHub from './application/EventHub'; import * as _PermissionRequestResult from './application/PermissionRequestResult'; +import { PacMap as _PacMap } from "./ability/dataAbilityHelper"; +import { AbilityResult as _AbilityResult } from "./ability/abilityResult"; +import { ConnectOptions as _ConnectOptions } from "./ability/connectOptions"; /** * The context of an application. It allows access to application-specific resources. @@ -120,6 +123,30 @@ declare namespace common { * @since 9 */ export type PermissionRequestResult = _PermissionRequestResult.default + + /** + * Defines a PacMap object for storing a series of values. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type PacMap = _PacMap + + /** + * Indicates the result of startAbility. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type AbilityResult = _AbilityResult + + /** + * Indicates the callback of connection + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type ConnectOptions = _ConnectOptions } export default common; diff --git a/api/@ohos.app.ability.missionManager.d.ts b/api/@ohos.app.ability.missionManager.d.ts index d8fee24cb5..efbed8686f 100644 --- a/api/@ohos.app.ability.missionManager.d.ts +++ b/api/@ohos.app.ability.missionManager.d.ts @@ -17,7 +17,7 @@ import { AsyncCallback } from './basic'; import { MissionInfo as _MissionInfo } from './application/MissionInfo'; import { MissionListener as _MissionListener } from './application/MissionListener'; import { MissionSnapshot as _MissionSnapshot } from './application/MissionSnapshot'; -import StartOptions from "./@ohos.application.StartOptions"; +import StartOptions from "./@ohos.app.ability.StartOptions"; /** * This module provides the capability to manage abilities and obtaining system task information. diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index 3f696e72a4..dbc95cd2d2 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -16,7 +16,7 @@ import { AsyncCallback } from "./basic"; import { Callback } from "./basic"; import Want from './@ohos.application.Want'; -import formInfo from './@ohos.application.formInfo' +import formInfo from './@ohos.application.formInfo'; /** * Interface of formHost. diff --git a/api/@ohos.app.form.formProvider.d.ts b/api/@ohos.app.form.formProvider.d.ts index f2a87e039e..fb7f4dc857 100644 --- a/api/@ohos.app.form.formProvider.d.ts +++ b/api/@ohos.app.form.formProvider.d.ts @@ -16,7 +16,7 @@ import { AsyncCallback } from "./basic"; import formBindingData from "./@ohos.app.form.formBindingData"; import formInfo from "./@ohos.application.formInfo"; -import Want from "./@ohos.application.Want" +import Want from "./@ohos.application.Want"; /** * Interface of formProvider. diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts index 1d74c2371f..f0c54d72a5 100755 --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -30,7 +30,7 @@ import rpc from './@ohos.rpc'; * @return - * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.app.ability.Ability + * @useinstead ohos.app.ability.Ability */ export interface OnReleaseCallBack { (msg: string): void; @@ -46,7 +46,7 @@ export interface OnReleaseCallBack { * @return rpc.Sequenceable * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.app.ability.Ability + * @useinstead ohos.app.ability.Ability */ export interface CalleeCallBack { (indata: rpc.MessageParcel): rpc.Sequenceable; @@ -60,7 +60,7 @@ export interface CalleeCallBack { * @permission N/A * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.app.ability.Ability + * @useinstead ohos.app.ability.Ability */ export interface Caller { /** @@ -117,7 +117,7 @@ export interface Caller { * @permission N/A * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.app.ability.Ability + * @useinstead ohos.app.ability.Ability */ export interface Callee { @@ -153,7 +153,7 @@ export interface Callee { * @permission N/A * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.app.ability.Ability + * @useinstead ohos.app.ability.Ability */ export default class Ability { /** diff --git a/api/@ohos.application.AbilityConstant.d.ts b/api/@ohos.application.AbilityConstant.d.ts index 2847a26649..1ee74d5e78 100644 --- a/api/@ohos.application.AbilityConstant.d.ts +++ b/api/@ohos.application.AbilityConstant.d.ts @@ -20,6 +20,8 @@ * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.AbilityConstant */ declare namespace AbilityConstant { /** diff --git a/api/@ohos.application.AbilityLifecycleCallback.d.ts b/api/@ohos.application.AbilityLifecycleCallback.d.ts index 33db234da5..4e1f22ac9c 100644 --- a/api/@ohos.application.AbilityLifecycleCallback.d.ts +++ b/api/@ohos.application.AbilityLifecycleCallback.d.ts @@ -23,6 +23,8 @@ import window from './@ohos.window'; * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.AbilityLifecycleCallback */ export default class AbilityLifecycleCallback { /** diff --git a/api/@ohos.application.AbilityStage.d.ts b/api/@ohos.application.AbilityStage.d.ts index a0369329ce..8d7b4cc1c8 100644 --- a/api/@ohos.application.AbilityStage.d.ts +++ b/api/@ohos.application.AbilityStage.d.ts @@ -25,6 +25,8 @@ import { Configuration } from './@ohos.application.Configuration'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.AbilityStage */ export default class AbilityStage { /** diff --git a/api/@ohos.application.EnvironmentCallback.d.ts b/api/@ohos.application.EnvironmentCallback.d.ts index b19bd5792e..55f6504a70 100755 --- a/api/@ohos.application.EnvironmentCallback.d.ts +++ b/api/@ohos.application.EnvironmentCallback.d.ts @@ -21,6 +21,8 @@ import { Configuration } from './@ohos.application.Configuration'; * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.EnvironmentCallback */ export default class EnvironmentCallback { /** diff --git a/api/@ohos.application.ExtensionAbility.d.ts b/api/@ohos.application.ExtensionAbility.d.ts index 3cfd0d9213..eda81a8ac3 100644 --- a/api/@ohos.application.ExtensionAbility.d.ts +++ b/api/@ohos.application.ExtensionAbility.d.ts @@ -22,6 +22,8 @@ import { Configuration } from './@ohos.application.Configuration'; * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.ExtensionAbility */ export default class ExtensionAbility { /** diff --git a/api/@ohos.application.FormExtension.d.ts b/api/@ohos.application.FormExtension.d.ts index 4c52a8387e..e3bbfc7fdc 100644 --- a/api/@ohos.application.FormExtension.d.ts +++ b/api/@ohos.application.FormExtension.d.ts @@ -25,6 +25,8 @@ import { Configuration } from './@ohos.application.Configuration'; * @since 9 * @syscap SystemCapability.Ability.Form * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.form.FormExtensionAbility */ export default class FormExtension { /** diff --git a/api/@ohos.application.ServiceExtensionAbility.d.ts b/api/@ohos.application.ServiceExtensionAbility.d.ts index 93d3064b2e..5b850b90f6 100644 --- a/api/@ohos.application.ServiceExtensionAbility.d.ts +++ b/api/@ohos.application.ServiceExtensionAbility.d.ts @@ -25,6 +25,8 @@ import { Configuration } from './@ohos.application.Configuration'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.ServiceExtensionAbility */ export default class ServiceExtensionAbility { /** @@ -133,6 +135,6 @@ export default class ServiceExtensionAbility { * @return The dump info array. * @StageModelOnly */ - onDump(params: Array): Array; + dump(params: Array): Array; } diff --git a/api/@ohos.application.StartOptions.d.ts b/api/@ohos.application.StartOptions.d.ts index b4cd41bbce..0fc112e6d9 100644 --- a/api/@ohos.application.StartOptions.d.ts +++ b/api/@ohos.application.StartOptions.d.ts @@ -21,6 +21,8 @@ * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.StartOptions */ export default class StartOptions { /** diff --git a/api/@ohos.application.abilityDelegatorRegistry.d.ts b/api/@ohos.application.abilityDelegatorRegistry.d.ts index ad936320c5..d8d7a51a5b 100644 --- a/api/@ohos.application.abilityDelegatorRegistry.d.ts +++ b/api/@ohos.application.abilityDelegatorRegistry.d.ts @@ -26,6 +26,8 @@ import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult' * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.abilityDelegatorRegistry */ declare namespace abilityDelegatorRegistry { /** diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts index a161cc8290..dfa26ab42b 100644 --- a/api/@ohos.application.abilityManager.d.ts +++ b/api/@ohos.application.abilityManager.d.ts @@ -27,7 +27,7 @@ import { ElementName } from './bundle/elementName'; * @systemapi Hide this for inner system use * @permission N/A * @deprecated since 9 - * @useinstead @ohos.app.ability.abilityManager + * @useinstead ohos.app.ability.abilityManager */ declare namespace abilityManager { /** diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts index 834a8ef58d..3be17cb201 100644 --- a/api/@ohos.application.appManager.d.ts +++ b/api/@ohos.application.appManager.d.ts @@ -27,6 +27,8 @@ import { ProcessRunningInformation as _ProcessRunningInformation } from './appli * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import appManager from '@ohos.application.appManager' * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.appManager */ declare namespace appManager { /** diff --git a/api/@ohos.application.context.d.ts b/api/@ohos.application.context.d.ts index cae84c127a..d9fc6b0c6b 100755 --- a/api/@ohos.application.context.d.ts +++ b/api/@ohos.application.context.d.ts @@ -29,6 +29,8 @@ import * as _PermissionRequestResult from './application/PermissionRequestResul * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.common */ declare namespace context { diff --git a/api/@ohos.application.errorManager.d.ts b/api/@ohos.application.errorManager.d.ts index 912f35efd4..1709d8e029 100644 --- a/api/@ohos.application.errorManager.d.ts +++ b/api/@ohos.application.errorManager.d.ts @@ -24,7 +24,7 @@ import * as _ErrorObserver from './application/ErrorObserver'; * @import import errorManager from '@ohos.application.errorManager' * @permission N/A * @deprecated since 9 - * @useinstead @ohos.app.ability.errorManager + * @useinstead ohos.app.ability.errorManager */ declare namespace errorManager { /** diff --git a/api/@ohos.application.missionManager.d.ts b/api/@ohos.application.missionManager.d.ts index 3398ce0a51..46062f5f42 100644 --- a/api/@ohos.application.missionManager.d.ts +++ b/api/@ohos.application.missionManager.d.ts @@ -28,7 +28,7 @@ import StartOptions from "./@ohos.application.StartOptions"; * @permission ohos.permission.MANAGE_MISSIONS * @systemapi hide for inner use. * @deprecated since 9 - * @useinstead @ohos.app.ability.missionManager + * @useinstead ohos.app.ability.missionManager */ declare namespace missionManager { /** diff --git a/api/@ohos.application.quickFixManager.d.ts b/api/@ohos.application.quickFixManager.d.ts deleted file mode 100644 index 4db4e87d7c..0000000000 --- a/api/@ohos.application.quickFixManager.d.ts +++ /dev/null @@ -1,155 +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. - */ - -import { AsyncCallback } from "./basic"; - -/** - * Interface of quickFixManager. - * - * @name quickFixManager - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead @ohos.app.ability.quickFixManager - */ -declare namespace quickFixManager { - /** - * Quick fix info of hap module. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - export interface HapModuleQuickFixInfo { - /** - * Indicates hap module name. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly moduleName: string; - - /** - * Indicates hash value of a hap. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly originHapHash: string; - - /** - * Indicates installed path of quick fix file. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly quickFixFilePath: string; - } - - /** - * Quick fix info of application. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - export interface ApplicationQuickFixInfo { - /** - * Bundle name. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly bundleName: string; - - /** - * The version number of the bundle. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly bundleVersionCode: number; - - /** - * The version name of the bundle. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly bundleVersionName: string; - - /** - * The version number of the quick fix. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly quickFixVersionCode: number; - - /** - * The version name of the quick fix. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly quickFixVersionName: string; - - /** - * Hap module quick fix info. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly hapModuleQuickFixInfo: Array; - } - - /** - * Apply quick fix files. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @param hapModuleQuickFixFiles Quick fix files need to apply, this value should include file path and file name. - * @systemapi Hide this for inner system use. - * @return - - * @permission ohos.permission.INSTALL_BUNDLE - */ - function applyQuickFix(hapModuleQuickFixFiles: Array, callback: AsyncCallback): void; - function applyQuickFix(hapModuleQuickFixFiles: Array): Promise; - - /** - * Get application quick fix info by bundle name. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @param bundleName Bundle name wish to query. - * @systemapi Hide this for inner system use. - * @return Returns the {@link ApplicationQuickFixInfo}. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - */ - function getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void; - function getApplicationQuickFixInfo(bundleName: string): Promise; -} - -export default quickFixManager; \ No newline at end of file diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index a6344ef34f..9863e89de4 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -28,7 +28,7 @@ import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo'; * @import import wantAgent from '@ohos.wantAgent'; * @permission N/A * @deprecated since 9 - * @useinstead @ohos.app.wantAgent + * @useinstead ohos.app.ability.wantAgent */ declare namespace wantAgent { /** diff --git a/api/ability/dataAbilityHelper.d.ts b/api/ability/dataAbilityHelper.d.ts index 2ffbfefded..bb5cba6122 100644 --- a/api/ability/dataAbilityHelper.d.ts +++ b/api/ability/dataAbilityHelper.d.ts @@ -26,8 +26,6 @@ import rdb from '../@ohos.data.rdb'; * * @since 7 * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.ability.dataAbilityHelper */ export interface DataAbilityHelper { /** @@ -243,8 +241,6 @@ export interface DataAbilityHelper { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.ability.dataAbilityHelper */ export interface PacMap { diff --git a/api/ability/dataAbilityUtils.d.ts b/api/ability/dataAbilityUtils.d.ts deleted file mode 100644 index 79ad8e7d7d..0000000000 --- a/api/ability/dataAbilityUtils.d.ts +++ /dev/null @@ -1,474 +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. -*/ - -import { AsyncCallback } from '../basic'; -import { ResultSet } from '../data/rdb/resultSet'; -import { DataAbilityOperation } from './dataAbilityOperation'; -import { DataAbilityResult } from './dataAbilityResult'; -import dataAbility from '../@ohos.data.dataAbility'; -import rdb from '../@ohos.data.rdb'; - -/** - * DataAbilityHelper - * @interface - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ -export interface DataAbilityHelper { - /** - * Opens a file in a specified remote path. - * @param { string } uri - Indicates the path of the file to open. - * @param { string } mode - Indicates the file open mode, which can be "r" for read-only access, "w" for write-only - * access (erasing whatever data is currently in the file), "wt" for write access that - * truncates any existing file, "wa" for write-only access to append to any existing data, - * "rw" for read and write access on any existing data, or "rwt" for read and write access - * that truncates any existing file. - * @param { AsyncCallback } callback - The callback is used to return the file descriptor. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - openFile(uri: string, mode: string, callback: AsyncCallback): void; - - /** - * Opens a file in a specified remote path. - * @param { string } uri - Indicates the path of the file to open. - * @param { string } mode - Indicates the file open mode, which can be "r" for read-only access, "w" for write-only - * access (erasing whatever data is currently in the file), "wt" for write access that - * truncates any existing file, "wa" for write-only access to append to any existing data, - * "rw" for read and write access on any existing data, or "rwt" for read and write access - * that truncates any existing file. - * @returns { Promise } Returns the promise of file descriptor. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - openFile(uri: string, mode: string): Promise; - - /** - * Registers an observer to observe data specified by the given uri. - * @param { string } type - dataChange. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - The callback when dataChange. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - on(type: 'dataChange', uri: string, callback: AsyncCallback): void; - - /** - * Deregisters all observers used for monitoring data specified by the given uri. - * @param { string } type - dataChange. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - The callback when dataChange. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; - - /** - * Obtains the MIME type of the date specified by the given URI. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - The callback is used to return the MIME type. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - getType(uri: string, callback: AsyncCallback): void; - - /** - * Obtains the MIME type of the date specified by the given URI. - * @param { string } uri - Indicates the path of the data to operate. - * @returns { Promise } Returns the promise of MIME type that matches the data specified by uri. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - getType(uri: string): Promise; - - /** - * Obtains the MIME types of files supported. - * @param { string } uri - Indicates the path of the files to obtain. - * @param { string } mimeTypeFilter - Indicates the MIME types of the files to obtain. - * @param { AsyncCallback> } callback - The callback is used to return the matched MIME types Array. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; - - /** - * Obtains the MIME types of files supported. - * @param { string } uri - Indicates the path of the files to obtain. - * @param { string } mimeTypeFilter - Indicates the MIME types of the files to obtain. - * @returns { Promise> } Returns the promise of matched MIME types Array. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - getFileTypes(uri: string, mimeTypeFilter: string): Promise>; - - /** - * Converts the given uri that refers to the Data ability into a normalized uri. - * @param { string } uri - Indicates the uri object to normalize. - * @param { AsyncCallback } callback - The callback is used to return the normalized uri object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - normalizeUri(uri: string, callback: AsyncCallback): void; - - /** - * Converts the given uri that refers to the Data ability into a normalized uri. - * @param { string } uri - Indicates the uri object to normalize. - * @returns { Promise } Returns the promise of normalized uri object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - normalizeUri(uri: string): Promise; - - /** - * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. - * @param { string } uri - Indicates the uri object to normalize. - * @param { AsyncCallback } callback - The callback is used to return the denormalized uri object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - denormalizeUri(uri: string, callback: AsyncCallback): void; - - /** - * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. - * @param { string } uri - Indicates the uri object to normalize. - * @returns { Promise } Returns the denormalized uri object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - denormalizeUri(uri: string): Promise; - - /** - * Notifies the registered observers of a change to the data resource specified by uri. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - The callback of notifyChange. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - notifyChange(uri: string, callback: AsyncCallback): void; - - /** - * Notifies the registered observers of a change to the data resource specified by uri. - * @param { string } uri - Indicates the path of the data to operate. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - notifyChange(uri: string): Promise; - - /** - * Inserts a single data record into the database. - * @param { string } uri - Indicates the path of the data to insert. - * @param { rdb.ValuesBucket } valuesBucket - Indicates the data record to insert. If this parameter is null, - * a blank row will be inserted. - * @param { AsyncCallback } callback - The callback is used to return the index of the inserted data record. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; - - /** - * Inserts a single data record into the database. - * @param { string } uri - Indicates the path of the data to insert. - * @param { rdb.ValuesBucket } valuesBucket - Indicates the data record to insert. If this parameter is null, - * a blank row will be inserted. - * @returns { Promise } Returns the index of the inserted data record. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise; - - /** - * Inserts multiple data records into the database. - * @param { string } uri - Indicates the path of the data to batchInsert. - * @param { Array } valuesBuckets - Indicates the data records to insert. - * @param { AsyncCallback } callback - The callback is used to return the number of data records inserted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - batchInsert(uri: string, valuesBuckets: Array, callback: AsyncCallback): void; - - /** - * Inserts multiple data records into the database. - * @param { string } uri - Indicates the path of the data to batchInsert. - * @param { Array } valuesBuckets - Indicates the data records to insert. - * @returns { Promise } Returns the number of data records inserted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - batchInsert(uri: string, valuesBuckets: Array): Promise; - - /** - * Deletes one or more data records from the database. - * @param { string } uri - Indicates the path of the data to delete. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define the - * processing logic when this parameter is null. - * @param { AsyncCallback } callback - The callback is used to return the number of data records deleted. - * @returns { Promise } Returns the number of data records deleted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - - /** - * Deletes one or more data records from the database. - * @param { string } uri - Indicates the path of the data to delete. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define the - * processing logic when this parameter is null. - * @returns { Promise } Returns the number of data records deleted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise; - - /** - * Deletes one or more data records from the database. - * @param { string } uri - Indicates the path of the data to delete. - * @param { AsyncCallback } callback - The callback is used to return the number of data records deleted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - delete(uri: string, callback: AsyncCallback): void; - - /** - * Updates data records in the database. - * @param { string } uri - Indicates the path of data to update. - * @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define - * the processing logic when this parameter is null. - * @param { AsyncCallback } callback - The callback is used to return the number of data records updated. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - - /** - * Updates data records in the database. - * @param { string } uri - Indicates the path of data to update. - * @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define - * the processing logic when this parameter is null. - * @returns { Promise } Returns the number of data records updated. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.DataAbilityPredicates): Promise; - - /** - * Updates data records in the database. - * @param { string } uri - Indicates the path of data to update. - * @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update. - * @param { AsyncCallback } callback - The callback is used to return the number of data records updated. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - update(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define - * the processing logic when this parameter is null. - * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - query(uri: string, callback: AsyncCallback): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. - * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - query(uri: string, columns: Array, callback: AsyncCallback): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define - * the processing logic when this parameter is null. - * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - query(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define - * the processing logic when this parameter is null. - * @returns { Promise } Returns the query result {@link ResultSet}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - query(uri: string, columns?: Array, predicates?: dataAbility.DataAbilityPredicates): Promise; - - /** - * Calls the extended API of the DataAbility. This method uses a promise to return the result. - * @param { string } uri - URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx" - * @param { string } method - Indicates the method to call. - * @param { string } arg - Indicates the parameter of the String type. - * @param { PacMap } extras - Indicates the parameter of the PacMap type. - * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, - * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. - * If the PacMap object is to be transferred to a non-OHOS process, - * values of primitive types are supported, but not custom Sequenceable objects. - * @param { AsyncCallback } callback - The callback is used to return the query result {@link PacMap}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; - - /** - * Calls the extended API of the DataAbility. This method uses a promise to return the result. - * @param { string } uri - URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx" - * @param { string } method - Indicates the method to call. - * @param { string } arg - Indicates the parameter of the String type. - * @param { PacMap } extras - Indicates the parameter of the PacMap type. - * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, - * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. - * If the PacMap object is to be transferred to a non-OHOS process, - * values of primitive types are supported, but not custom Sequenceable objects. - * @returns { Promise } Returns the query result {@link PacMap}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - call(uri: string, method: string, arg: string, extras: PacMap): Promise; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { Array } operations - Indicates the data operation list, which can contain - * multiple operations on the database. - * @param { AsyncCallback> } callback - The callback is used to return the result of each - * operation, in array {@link DataAbilityResult}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - executeBatch(uri: string, operations: Array, callback: AsyncCallback>): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { Array } operations - Indicates the data operation list, which can contain - * multiple operations on the database. - * @returns { Promise> } Returns the result of each operation, in array {@link DataAbilityResult}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - executeBatch(uri: string, operations: Array): Promise>; -} - -/** - * Defines a PacMap object for storing a series of values. - * @typedef PacMap - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ -export interface PacMap { - /** - * Indicates the parameter of the PacMap type. - * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, - * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. - * If the PacMap object is to be transferred to a non-OHOS process, - * values of primitive types are supported, but not custom Sequenceable objects. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - [key: string]: number | string | boolean | Array | null; -} diff --git a/api/app/context.d.ts b/api/app/context.d.ts index 570a4802e0..e24a3dd24b 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -34,8 +34,6 @@ import bundle from '../@ohos.bundle'; * @import import abilityManager from 'app/context' * @permission N/A * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.featureAbility.context */ export interface Context extends BaseContext { @@ -277,8 +275,6 @@ export interface Context extends BaseContext { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.featureAbility.context */ interface PermissionRequestResult { /** @@ -312,8 +308,6 @@ interface PermissionRequestResult { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.featureAbility.context */ interface PermissionOptions { /** diff --git a/api/app/featureAbilityContext.d.ts b/api/app/featureAbilityContext.d.ts deleted file mode 100644 index 8d0dca6422..0000000000 --- a/api/app/featureAbilityContext.d.ts +++ /dev/null @@ -1,593 +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. -*/ - -import { AsyncCallback } from '../basic'; -import { ApplicationInfo } from '../bundle/applicationInfo'; -import { ProcessInfo } from './processInfo'; -import { ElementName } from '../bundle/elementName'; -import BaseContext from '../application/BaseContext'; -import { HapModuleInfo } from '../bundle/hapModuleInfo'; -import { AppVersionInfo } from './appVersionInfo'; -import { AbilityInfo } from '../bundle/abilityInfo'; -import bundle from '../@ohos.bundle'; - -/** - * The context of an ability or an application. It allows access to - * application-specific resources, request and verification permissions. - * Can only be obtained through the ability. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ -export interface Context extends BaseContext { - /** - * Get the local root dir of an app. If it is the first call, the dir - * will be created. - * @note If in the context of the ability, return the root dir of - * the ability; if in the context of the application, return the - * root dir of the application. - * @returns { Promise } Returns the root dir. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getOrCreateLocalDir(): Promise; - - /** - * Get the local root dir of an app. If it is the first call, the dir - * will be created. - * @note If in the context of the ability, return the root dir of - * the ability; if in the context of the application, return the - * root dir of the application. - * @param { AsyncCallback } callback - The callback is used to return the root dir. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getOrCreateLocalDir(callback: AsyncCallback): void; - - /** - * Verify whether the specified permission is allowed for a particular - * pid and uid running in the system. - * @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission. - * @param { string } permission - The name of the specified permission. - * @param { PermissionOptions } options - Indicates the permission options. - * @returns { Promise } Returns {@code 0} if the PID and UID have the permission. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - verifyPermission(permission: string, options?: PermissionOptions): Promise; - - /** - * Verify whether the specified permission is allowed for a particular - * pid and uid running in the system. - * @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission. - * @param { string } permission - The name of the specified permission. - * @param { PermissionOptions } options - Indicates the permission options. - * @param { AsyncCallback } callback - Returns {@code 0} if the PID and UID have the permission. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - verifyPermission(permission: string, options: PermissionOptions, callback: AsyncCallback): void; - - /** - * Verify whether the specified permission is allowed for a particular - * pid and uid running in the system. - * @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission. - * @param { string } permission - The name of the specified permission. - * @param { AsyncCallback } callback - Returns {@code 0} if the PID and UID have the permission. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - verifyPermission(permission: string, callback: AsyncCallback): void; - - /** - * Requests certain permissions from the system. - * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter cannot be null. - * @param { number } requestCode - Indicates the request code to be passed to the PermissionRequestResult. - * @param { AsyncCallback } resultCallback - The callback is used to return the PermissionRequestResult. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - requestPermissionsFromUser(permissions: Array, requestCode: number, resultCallback: AsyncCallback): void; - - /** - * Requests certain permissions from the system. - * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter cannot be null. - * @param { number } requestCode - Indicates the request code to be passed to the PermissionRequestResult. - * @returns { Promise } Returns the PermissionRequestResult. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - requestPermissionsFromUser(permissions: Array, requestCode: number): Promise; - - /** - * Obtains information about the current application. - * @param { AsyncCallback } callback - The callback is used to return the ApplicationInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getApplicationInfo(callback: AsyncCallback): void - - /** - * Obtains information about the current application. - * @returns { Promise } Returns the ApplicationInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getApplicationInfo(): Promise; - - /** - * Obtains the bundle name of the current ability. - * @param { AsyncCallback } callback - The callback is used to return the bundle name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getBundleName(callback: AsyncCallback): void - - /** - * Obtains the bundle name of the current ability. - * @returns { Promise } Returns the bundle name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getBundleName(): Promise; - - /** - * Obtains the current display orientation of this ability. - * @param { AsyncCallback } callback - The callback is used to return the display orientation. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getDisplayOrientation(callback: AsyncCallback): void - - /** - * Obtains the current display orientation of this ability. - * @returns { Promise } Returns the display orientation. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getDisplayOrientation(): Promise; - - /** - * Sets the display orientation of the current ability. - * @param { bundle.DisplayOrientation } orientation - Indicates the new orientation for the current ability. - * @param { AsyncCallback } callback - The callback of setDisplayOrientation. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setDisplayOrientation(orientation: bundle.DisplayOrientation, callback: AsyncCallback): void - - /** - * Sets the display orientation of the current ability. - * @param { bundle.DisplayOrientation } orientation - Indicates the new orientation for the current ability. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setDisplayOrientation(orientation: bundle.DisplayOrientation): Promise; - - /** - * Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed, - * keeping the ability in the ACTIVE state. - * @param { boolean } show - Specifies whether to show this ability on top of the lock screen. The value true - * means to show it on the lock screen, and the value false means not. - * @param { AsyncCallback } callback - The callback of setShowOnLockScreen. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setShowOnLockScreen(show: boolean, callback: AsyncCallback): void - - /** - * Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed, - * keeping the ability in the ACTIVE state. - * @param { boolean } show - Specifies whether to show this ability on top of the lock screen. The value true - * means to show it on the lock screen, and the value false means not. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setShowOnLockScreen(show: boolean): Promise; - - /** - * Sets whether to wake up the screen when this ability is restored. - * @param { boolean } wakeUp - Specifies whether to wake up the screen. The value true means to wake it up, - * and the value false means not. - * @param { AsyncCallback } callback - The callback of setWakeUpScreen. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback): void - - /** - * Sets whether to wake up the screen when this ability is restored. - * @param { boolean } wakeUp - Specifies whether to wake up the screen. The value true means to wake it up, - * and the value false means not. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setWakeUpScreen(wakeUp: boolean): Promise; - - /** - * Obtains information about the current process, including the process ID and name. - * @param { AsyncCallback } callback - The callback is used to return the ProcessInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getProcessInfo(callback: AsyncCallback): void - - /** - * Obtains information about the current process, including the process ID and name. - * @returns { Promise } Returns the ProcessInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getProcessInfo(): Promise; - - /** - * Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities. - * @param { AsyncCallback } callback - The callback is used to return the ElementName. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getElementName(callback: AsyncCallback): void - - /** - * Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities. - * @returns { Promise } Returns the ElementName. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getElementName(): Promise; - - /** - * Obtains the name of the current process. - * @param { AsyncCallback } callback - The callback is used to return the process name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getProcessName(callback: AsyncCallback): void - - /** - * Obtains the name of the current process. - * @returns { Promise } Returns the process name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getProcessName(): Promise; - - /** - * Obtains the bundle name of the ability that called the current ability. - * @param { AsyncCallback } callback - The callback is used to return the calling bundle name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getCallingBundle(callback: AsyncCallback): void - - /** - * Obtains the bundle name of the ability that called the current ability. - * @returns { Promise } Returns the calling bundle name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getCallingBundle(): Promise; - - /** - * Obtains the file directory of this application on the internal storage. - * @param { AsyncCallback } callback - The callback is used to return the file directory. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getFilesDir(callback: AsyncCallback): void; - - /** - * Obtains the file directory of this application on the internal storage. - * @returns { Promise } Returns the file directory. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getFilesDir(): Promise; - - /** - * Obtains the cache directory of this application on the internal storage. - * @param { AsyncCallback } callback - The callback is used to return the cache directory. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getCacheDir(callback: AsyncCallback): void; - - /** - * Obtains the cache directory of this application on the internal storage. - * @returns { Promise } Returns the cache directory. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getCacheDir(): Promise; - - /** - * Obtains the distributed file path for storing ability or application data files. - * If the distributed file path does not exist, the system will create a path and return the created path. - * @returns { Promise } Returns the distributed file path. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getOrCreateDistributedDir(): Promise; - - /** - * Obtains the distributed file path for storing ability or application data files. - * If the distributed file path does not exist, the system will create a path and return the created path. - * @param { AsyncCallback } callback - The callback is used to return the distributed file path. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getOrCreateDistributedDir(callback: AsyncCallback): void; - - /** - * Obtains the application type. - * @param { AsyncCallback } callback - The callback is used to return the application type. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAppType(callback: AsyncCallback): void - - /** - * Obtains the application type. - * @returns { Promise } Returns the application type. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAppType(): Promise; - - /** - * Obtains the ModuleInfo object for this application. - * @param { AsyncCallback } callback - The callback is used to return the HapModuleInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getHapModuleInfo(callback: AsyncCallback): void - - /** - * Obtains the ModuleInfo object for this application. - * @returns { Promise } Returns the HapModuleInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getHapModuleInfo(): Promise; - - /** - * Obtains the application version information. - * @param { AsyncCallback } callback - The callback is used to return the application version info. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAppVersionInfo(callback: AsyncCallback): void - - /** - * Obtains the application version information. - * @returns { Promise } Returns the application version info. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAppVersionInfo(): Promise; - - /** - * Obtains the context of this application. - * @returns { Context } Returns the context of this application. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getApplicationContext(): Context; - - /** - * Checks the detailed information of this ability. - * @param { AsyncCallback } callback - The callback is used to return the AbilityInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAbilityInfo(callback: AsyncCallback): void - - /** - * Checks the detailed information of this ability. - * @returns { Promise } Returns the AbilityInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAbilityInfo(): Promise; - - /** - * Checks whether the configuration of this ability is changing. - * @param { AsyncCallback } callback - Returns true if the configuration of this ability is changing and false otherwise. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - isUpdatingConfigurations(callback: AsyncCallback): void; - - /** - * Checks whether the configuration of this ability is changing. - * @returns { Promise } Returns true if the configuration of this ability is changing and false otherwise. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - isUpdatingConfigurations(): Promise; - - /** - * Informs the system of the time required for drawing this Page ability. - * @param { AsyncCallback } callback - The callback of printDrawnCompleted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - printDrawnCompleted(callback: AsyncCallback): void; - - /** - * Informs the system of the time required for drawing this Page ability. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - printDrawnCompleted(): Promise; -} - -/** - * the result of requestPermissionsFromUser with asynchronous callback - * @typedef PermissionRequestResult - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ -interface PermissionRequestResult { - /** - * The request code passed in by the user - * @type { number } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - requestCode: number; - - /** - * The permissions passed in by the user - * @type { Array } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - permissions: Array; - - /** - * The results for the corresponding request permissions - * @type { Array } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - authResults: Array; -} - -/** - * @typedef PermissionOptions - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ -interface PermissionOptions { - /** - * The process id - * @type { number } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - pid?: number; - - /** - * The user id - * @type { number } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - uid?: number; -}