From dc15591b048614288de373f269ab8f96713951f7 Mon Sep 17 00:00:00 2001 From: caiminggang Date: Tue, 13 Sep 2022 15:03:34 +0800 Subject: [PATCH 1/3] new api for enterprise device management Signed-off-by: caiminggang --- ...ohos.enterprise.AdminExtensionAbility.d.ts | 131 ++++++++++++++++++ ...s => @ohos.enterprise.accountManager.d.ts} | 42 +++--- ....ts => @ohos.enterprise.adminManager.d.ts} | 81 +++++++---- api/@ohos.enterprise.applicationManager.d .ts | 71 ++++++++++ api/@ohos.enterprise.bundleManager.d.ts | 116 ++++++++++++++++ api/@ohos.enterprise.datetimeManager.d.ts | 65 +++++++++ ...ts => @ohos.enterprise.deviceControl.d.ts} | 24 ++-- api/@ohos.enterprise.deviceInfo.ts | 78 +++++++++++ api/@ohos.enterprise.deviceSettings.d.ts | 53 +++++++ api/@ohos.enterprise.networkManager.ts | 96 +++++++++++++ api/@ohos.enterprise.wifiManager.d.ts | 66 +++++++++ 11 files changed, 759 insertions(+), 64 deletions(-) create mode 100644 api/@ohos.enterprise.AdminExtensionAbility.d.ts rename api/{@ohos.EnterpriseAdminExtensionAbility.d.ts => @ohos.enterprise.accountManager.d.ts} (46%) rename api/{@ohos.enterpriseDeviceManager.d.ts => @ohos.enterprise.adminManager.d.ts} (68%) create mode 100644 api/@ohos.enterprise.applicationManager.d .ts create mode 100644 api/@ohos.enterprise.bundleManager.d.ts create mode 100644 api/@ohos.enterprise.datetimeManager.d.ts rename api/{enterpriseDeviceManager/DeviceSettingsManager.d.ts => @ohos.enterprise.deviceControl.d.ts} (61%) create mode 100644 api/@ohos.enterprise.deviceInfo.ts create mode 100644 api/@ohos.enterprise.deviceSettings.d.ts create mode 100644 api/@ohos.enterprise.networkManager.ts create mode 100644 api/@ohos.enterprise.wifiManager.d.ts diff --git a/api/@ohos.enterprise.AdminExtensionAbility.d.ts b/api/@ohos.enterprise.AdminExtensionAbility.d.ts new file mode 100644 index 0000000000..a73559dcc8 --- /dev/null +++ b/api/@ohos.enterprise.AdminExtensionAbility.d.ts @@ -0,0 +1,131 @@ +/* + * 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. + */ + +/** + * Class of the enterprise admin extension ability. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ +export default class AdminExtensionAbility { + /** + * Called back when an application is enabled. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onAdminEnabled(): void; + + /** + * Called back when an application is disabled. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onAdminDisabled(): void; + + /** + * Called back when a bundle is installed. + * + * @since 9 + * @param admin Indicates the name of the bundle installed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onBundleAdded(bundleName: string): void; + + /** + * Called back when a bundle is uninstalled. + * + * @since 9 + * @param bundleName Indicates the name of the bundle uninstalled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onBundleRemoved(bundleName: string): void; + + /** + * Called back when an application start. + * + * @since 9 + * @param bundleName Indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onAppStart(bundleName: string): void; + + /** + * Called back when an application stop. + * + * @since 9 + * @param bundleName Indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onAppStop(bundleName: string): void; + + /** + * Called back when an application get content on paste board. + * + * @since 9 + * @param bundleName Indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onPasteBoardGet(bundleName: string): void; + + /** + * Called back when an application set content to paste board. + * + * @since 9 + * @param bundleName Indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onPasteBoardSet(bundleName: string): void; + + /** + * Called back when an application screenshot. + * + * @since 9 + * @param bundleName Indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onScreenshot(bundleName: string): void; + + /** + * Called back when an application start share screen. + * + * @since 9 + * @param bundleName Indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onShareScreenStart(bundleName: string): void; + + /** + * Called back when an application stop share screen. + * + * @since 9 + * @param bundleName Indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @StageModelOnly + */ + onShareScreenStop(bundleName: string): void; +} \ No newline at end of file diff --git a/api/@ohos.EnterpriseAdminExtensionAbility.d.ts b/api/@ohos.enterprise.accountManager.d.ts similarity index 46% rename from api/@ohos.EnterpriseAdminExtensionAbility.d.ts rename to api/@ohos.enterprise.accountManager.d.ts index a290390863..3340f88e3c 100644 --- a/api/@ohos.EnterpriseAdminExtensionAbility.d.ts +++ b/api/@ohos.enterprise.accountManager.d.ts @@ -13,29 +13,27 @@ * limitations under the License. */ +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + /** - * Class of the enterprise admin extension ability. - * + * @name Offers set account policies on the devices. * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @StageModelOnly */ -export default class EnterpriseAdminExtensionAbility { - /** - * Called back when an application is enabled. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @StageModelOnly - */ - onAdminEnabled(): void; - - /** - * Called back when an application is disabled. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @StageModelOnly - */ - onAdminDisabled(): void; -} \ No newline at end of file +declare namespace accountManager { + /** + * Disallow add local account. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param disallow True if disallow add local account, otherwise false. + * @permission ohos.permission.ENTERPRISE_SET_ACCOUNT_POLICY + */ + function disalloweAddLocalAccount(admin: Want, disallow: boolean, callback: AsyncCallback): void; + function disalloweAddLocalAccount(admin: Want, disallow: boolean): Promise; +} + +export default accountManager; \ No newline at end of file diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterprise.adminManager.d.ts similarity index 68% rename from api/@ohos.enterpriseDeviceManager.d.ts rename to api/@ohos.enterprise.adminManager.d.ts index 273c97f117..c88fac9b9c 100644 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ b/api/@ohos.enterprise.adminManager.d.ts @@ -13,8 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from "./basic"; -import { DeviceSettingsManager as _DeviceSettingsManager } from "./enterpriseDeviceManager/DeviceSettingsManager"; +import { AsyncCallback } from "./basic"; import Want from "./@ohos.application.Want"; /** @@ -23,7 +22,7 @@ import Want from "./@ohos.application.Want"; * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager */ -declare namespace enterpriseDeviceManager { +declare namespace adminManager { /** * @name EnterpriseInfo @@ -36,20 +35,30 @@ declare namespace enterpriseDeviceManager { } /** - * @name DeviceSettingsManager + * @name AdminType * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager */ - export type DeviceSettingsManager = _DeviceSettingsManager + export enum AdminType { + ADMIN_TYPE_NORMAL = 0x00, + ADMIN_TYPE_SUPER = 0x01 + } /** - * @name AdminType + * @name ManagedEvent * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager */ - export enum AdminType { - ADMIN_TYPE_NORMAL = 0x00, - ADMIN_TYPE_SUPER = 0x01 + export enum ManagedEvent { + MANAGED_EVENT_BUNDLE_ADDED = 0, + MANAGED_EVENT_BUNDLE_REMOVED = 1, + MANAGED_EVENT_APP_START = 2, + MANAGED_EVENT_APP_STOP = 3, + MANAGED_EVENT_PASTE_BOARD_GET = 4, + MANAGED_EVENT_PASTE_BOARD_SET = 5, + MANAGED_EVENT_PASTE_SCREENSHOT = 6, + MANAGED_EVENT_SHARE_SCREEN_START = 7, + MANAGED_EVENT_SHARE_SCREEN_STOP = 8 } /** @@ -63,15 +72,14 @@ declare namespace enterpriseDeviceManager { * @param enterpriseInfo Indicates the enterprise information of the calling application. * @param type Indicates the type of administrator to set. * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if enables administrator success. * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN */ - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback): void; - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback): void; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; /** - * Disables a current normal administrator ability. + * Disables a current normal administrator ability. * * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. * @@ -79,25 +87,24 @@ declare namespace enterpriseDeviceManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @param admin Indicates the administrator ability information. * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if disables administrator success. * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN */ - function disableAdmin(admin: Want, callback: AsyncCallback): void; - function disableAdmin(admin: Want, userId: number, callback: AsyncCallback): void; - function disableAdmin(admin: Want, userId?: number): Promise; + function disableAdmin(admin: Want, callback: AsyncCallback): void; + function disableAdmin(admin: Want, userId: number, callback: AsyncCallback): void; + function disableAdmin(admin: Want, userId?: number): Promise; /** - * Disables a current super administrator ability. + * Disables a current super administrator ability. * * Only the administrator app or apps with the shell uid can call this method. * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @param bundleName Indicates the administrator bundle information. - * @return {@code true} if disables super administrator success. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN */ - function disableSuperAdmin(bundleName: String, callback: AsyncCallback): void; - function disableSuperAdmin(bundleName: String): Promise; + function disableSuperAdmin(bundleName: String, callback: AsyncCallback): void; + function disableSuperAdmin(bundleName: String): Promise; /** * Get whether the ability is enabled as device administrator. @@ -119,6 +126,7 @@ declare namespace enterpriseDeviceManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @param admin Indicates the administrator ability information. * @return Returns the enterprise information of the administrator. + * @permission ohos.permission.SET_ENTERPRISE_INFO */ function getEnterpriseInfo(admin: Want, callback: AsyncCallback): void; function getEnterpriseInfo(admin: Want): Promise; @@ -132,10 +140,10 @@ declare namespace enterpriseDeviceManager { * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @param admin Indicates the administrator ability information. * @param enterpriseInfo Indicates the enterprise information of the calling application. - * @return {@code true} if sets enterprise information success. + * @permission ohos.permission.SET_ENTERPRISE_INFO */ - function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback): void; - function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise; + function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback): void; + function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise; /** * Get whether the ability is enabled as super device administrator. @@ -149,15 +157,28 @@ declare namespace enterpriseDeviceManager { function isSuperAdmin(bundleName: String): Promise; /** - * Obtains the interface used to set device settings policy. + * Subscribes the managed event of admin. * + * @param admin Indicates the administrator ability information. + * @param managedEvents Indicates the managed events to subscribe. * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @return Returns the DeviceSettingsManager interface. + * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT */ - function getDeviceSettingsManager(callback: AsyncCallback): void; - function getDeviceSettingsManager(): Promise; + function subscribeManagedEvent(admin: Want, managedEvents: Array, callback: AsyncCallback): void; + function subscribeManagedEvent(admin: Want, managedEvents: Array): Promise; + /** + * Unsubscribes the managed event of admin. + * + * @param admin Indicates the administrator ability information. + * @param managedEvents Indicates the managed events to unsubscribe. + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT + */ + function unsubscribeManagedEvent(admin: Want, managedEvents: Array, callback: AsyncCallback): void; + function unsubscribeManagedEvent(admin: Want, managedEvents: Array): Promise; } -export default enterpriseDeviceManager; \ No newline at end of file +export default adminManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.applicationManager.d .ts b/api/@ohos.enterprise.applicationManager.d .ts new file mode 100644 index 0000000000..c3a53a1656 --- /dev/null +++ b/api/@ohos.enterprise.applicationManager.d .ts @@ -0,0 +1,71 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * @name Offers application management. + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + */ +declare namespace applicationManager { + /** + * Adds disallowed running list of applications. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param bundleNames List of applications that disallowed running. + * @param userId Indicates the user ID or do not pass user ID. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + */ + function addDisallowedRunningBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function addDisallowedRunningBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + function addDisallowedRunningBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Removes disallowed running list of applications. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param bundleNames List of applications that disallowed running. + * @param userId Indicates the user ID or do not pass user ID. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + */ + function removeDisallowedRunningBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function removeDisallowedRunningBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + function removeDisallowedRunningBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Gets disallowed running list of applications. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param userId Indicates the user ID or do not pass user ID. + * @return Returns the list of applications that disallowed running. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + */ + function getDisallowedRunningBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + function getDisallowedRunningBundles(admin: Want, callback: AsyncCallback>): void; + function getDisallowedRunningBundles(admin: Want, userId?: number): Promise>; +} + +export default applicationManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.bundleManager.d.ts b/api/@ohos.enterprise.bundleManager.d.ts new file mode 100644 index 0000000000..bc3a5139ab --- /dev/null +++ b/api/@ohos.enterprise.bundleManager.d.ts @@ -0,0 +1,116 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * @name Offers application management. + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + */ +declare namespace bundleManager { + /** + * Adds the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param bundleNames List of applications that disallowed uninstall. + * @param userId Indicates the user ID or do not pass user ID. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + */ + function addDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function addDisallowedUninstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + function addDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Removes the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param bundleNames List of applications that disallowed uninstall. + * @param userId Indicates the user ID or do not pass user ID. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + */ + function removeDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function removeDisallowedUninstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + function removeDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Gets the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param userId Indicates the user ID or do not pass user ID. + * @return Returns the list of applications that disallowed uninstall. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + */ + function getDisallowedUninstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + function getDisallowedUninstallBundles(admin: Want, callback: AsyncCallback>): void; + function getDisallowedUninstallBundles(admin: Want, userId?: number): Promise>; + + /** + * Adds the allowed install list of applications. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param bundleNames List of applications that allowed install. + * @param userId Indicates the user ID or do not pass user ID. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + */ + function addAllowedInstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function addAllowedInstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + function addAllowedInstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Removes allowed install list of applications. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param bundleNames List of applications that allowed install. + * @param userId Indicates the user ID or do not pass user ID. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + */ + function removeAllowedInstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function removeAllowedInstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + function removeAllowedInstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Gets allowed install list of applications. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param userId Indicates the user ID or do not pass user ID. + * @return Returns the list of applications that allowed install. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + */ + function getAllowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + function getAllowedInstallBundles(admin: Want, callback: AsyncCallback>): void; + function getAllowedInstallBundles(admin: Want, userId?: number): Promise>; +} + +export default bundleManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.datetimeManager.d.ts b/api/@ohos.enterprise.datetimeManager.d.ts new file mode 100644 index 0000000000..15fd18e6c0 --- /dev/null +++ b/api/@ohos.enterprise.datetimeManager.d.ts @@ -0,0 +1,65 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * @name Offers set restricted policies on the devices. + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + */ +declare namespace dateTimeManager { + /** + * Sets the system time. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param time Target time stamp (ms) + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + */ + function setDateTime(admin: Want, time: number, callback: AsyncCallback): void; + function setDateTime(admin: Want, time: number): Promise; + + /** + * Disallow the modificationing of date time. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param disallow True if set the modificationing of date time disabled, otherwise false. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + */ + function disallowModifyDateTime(admin: Want, disallow: boolean, callback: AsyncCallback): void; + function disallowModifyDateTime(admin: Want, disallow: boolean): Promise; + + /** + * Gets state of whether the modificationing of date time is disallowed. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @return {@code true} if disallowed. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + */ + function isModifyDateTimeDisallowed(admin: Want, callback: AsyncCallback): void; + function isModifyDateTimeDisallowed(admin: Want): Promise; +} + +export default dateTimeManager; \ No newline at end of file diff --git a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts b/api/@ohos.enterprise.deviceControl.d.ts similarity index 61% rename from api/enterpriseDeviceManager/DeviceSettingsManager.d.ts rename to api/@ohos.enterprise.deviceControl.d.ts index c29c0dda15..ee073066a9 100644 --- a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts +++ b/api/@ohos.enterprise.deviceControl.d.ts @@ -13,26 +13,26 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from "./../basic"; -import Want from "./../@ohos.application.Want"; +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; /** - * @name Offers set settings policies on the devices. + * @name Offers set control polices on the devices. * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager */ -export interface DeviceSettingsManager { - +declare namespace deviceControl { /** - * Sets the system time.This function can be called by a super administrator. + * Resets the device factory. + * This function can be called by a super administrator. * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @param admin Indicates the administrator ability information. - * @param time Target time stamp (ms) - * @return {@code true} if success. - * @permission ohos.permission.EDM_MANAGE_DATETIME + * @permission ohos.permission.ENTERPRISE_RESET_DEVICE */ - setDateTime(admin: Want, time: number, callback: AsyncCallback): void; - setDateTime(admin: Want, time: number): Promise; -} \ No newline at end of file + function resetFactory(admin: Want, callback: AsyncCallback): void; + function resetFactory(admin: Want): Promise; +} + +export default deviceControl; \ No newline at end of file diff --git a/api/@ohos.enterprise.deviceInfo.ts b/api/@ohos.enterprise.deviceInfo.ts new file mode 100644 index 0000000000..663e053ba4 --- /dev/null +++ b/api/@ohos.enterprise.deviceInfo.ts @@ -0,0 +1,78 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * @name Offers set or get device info policies on the devices. + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + */ +declare namespace deviceInfo { + /** + * Get the serial of the device. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @return Returns the device serial. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + */ + function getDeviceSerial(admin: Want, callback: AsyncCallback): void; + function getDeviceSerial(admin: Want): Promise; + + /** + * Get the display version of the device. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @return Returns the display version of the device. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + */ + function getDisplayVersion(admin: Want, callback: AsyncCallback): void; + function getDisplayVersion(admin: Want): Promise; + + /** + * Get the device name of the device. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @return Returns the device name of the device. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + */ + function getDeviceName(admin: Want, callback: AsyncCallback): void; + function getDeviceName(admin: Want): Promise; + + /** + * Get the hard disk serial of the device. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @return Returns the hard disk serial of the device. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + */ + function getHardDiskSerial(admin: Want, callback: AsyncCallback): void; + function getHardDiskSerial(admin: Want): Promise; +} + +export default deviceInfo; \ No newline at end of file diff --git a/api/@ohos.enterprise.deviceSettings.d.ts b/api/@ohos.enterprise.deviceSettings.d.ts new file mode 100644 index 0000000000..725bcf3ca7 --- /dev/null +++ b/api/@ohos.enterprise.deviceSettings.d.ts @@ -0,0 +1,53 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * @name Offers set settings policies on the devices. + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + */ +declare namespace deviceSettings { + /** + * Sets the screen off time. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param time Target time stamp (ms) + * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + */ + function setScreenOffTime(admin: Want, time: number, callback: AsyncCallback): void; + function setScreenOffTime(admin: Want, time: number): Promise; + + /** + * Gets the screen off time. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param time Target time stamp (ms) + * @return Returns the screen off time. + * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + */ + function getScreenOffTime(admin: Want, callback: AsyncCallback): void; + function getScreenOffTime(admin: Want): Promise; +} + +export default deviceSettings; \ No newline at end of file diff --git a/api/@ohos.enterprise.networkManager.ts b/api/@ohos.enterprise.networkManager.ts new file mode 100644 index 0000000000..5eb29505fe --- /dev/null +++ b/api/@ohos.enterprise.networkManager.ts @@ -0,0 +1,96 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * @name Offers set network policies on the devices. + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + */ +declare namespace networkManager { + + /** + * Gets all of the network interfaces of the device. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @return Returns the list of network interfaces. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + */ + function getAllNetworkInterfaces(admin: Want, callback: AsyncCallback>): void; + function getAllNetworkInterfaces(admin: Want): Promise>; + + /** + * Gets the ip address of the network interface. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param networkInterface Indicates the network interface to get ip address. + * @return Returns the list of ip address. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + */ + function getIpAddress(admin: Want, networkInterface: string, callback: AsyncCallback): void; + function getIpAddress(admin: Want, networkInterface: string): Promise; + + /** + * Gets the mac address of the network interface. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param networkInterface Indicates the network interface to get mac address. + * @return Returns the list of mac address. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + */ + function getMac(admin: Want, networkInterface: string, callback: AsyncCallback): void; + function getMac(admin: Want, networkInterface: string): Promise; + + /** + * Gets the status of the network interface. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param networkInterface Indicates the network interface to get status. + * @return {@code true} if the network interface is open. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + */ + function getNetworkInterfaceStatus(admin: Want, networkInterface: string, callback: AsyncCallback): void; + function getNetworkInterfaceStatus(admin: Want, networkInterface: string): Promise; + + /** + * Disables the network interfaces. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param networkInterface Indicates the network interface to get mac address. + * @param isDisabled True if disable the network interfaces, otherwise false. + * @permission ohos.permission.ENTERPRISE_SET_NETWORK + */ + function setNetworkInterfaceDisabled(admin: Want, networkInterface: string, isDisabled: boolean, callback: AsyncCallback): void; + function setNetworkInterfaceDisabled(admin: Want, networkInterface: string, isDisabled: boolean): Promise; +} + +export default networkManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.wifiManager.d.ts b/api/@ohos.enterprise.wifiManager.d.ts new file mode 100644 index 0000000000..421b233d65 --- /dev/null +++ b/api/@ohos.enterprise.wifiManager.d.ts @@ -0,0 +1,66 @@ +/* + * 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 Want from "./@ohos.application.Want"; +import wifi from "./@ohos.wifi"; + +/** + * @name Offers set wifi policies on the devices. + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + */ +declare namespace wifiManager { + + /** + * Disables the wifi of the device. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param isDisabled True if disable the wifi of the device, otherwise false. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + */ + function setWifiDisabled(admin: Want, isDisabled: boolean, callback: AsyncCallback): void; + function setWifiDisabled(admin: Want, isDisabled: boolean): Promise; + + /** + * Gets state of whether the wifi is disabled. + * This function can be called by a super administrator. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @return {@code true} if disabled. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + */ + function isWifiDisabled(admin: Want, callback: AsyncCallback): void; + function isWifiDisabled(admin: Want): Promise; + + /** + * Sets the wifi profile. + * + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param config Indicates the configuration of wifi. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + */ + function setWifiProfile(admin: Want, config: wifi.WifiDeviceConfig, callback: AsyncCallback): void; + function setWifiProfile(admin: Want, config: wifi.WifiDeviceConfig): Promise; +} + +export default wifiManager; \ No newline at end of file -- Gitee From 1a64622850f0c8a62a0c52786e7ec0088846e2d3 Mon Sep 17 00:00:00 2001 From: caiminggang Date: Tue, 13 Sep 2022 15:03:34 +0800 Subject: [PATCH 2/3] new api for enterprise device management Signed-off-by: caiminggang --- ...ohos.enterprise.AdminExtensionAbility.d.ts | 131 +++++ ...s => @ohos.enterprise.accountManager.d.ts} | 61 ++- api/@ohos.enterprise.adminManager.d.ts | 455 ++++++++++++++++++ api/@ohos.enterprise.applicationManager.d .ts | 119 +++++ api/@ohos.enterprise.bundleManager.d.ts | 207 ++++++++ api/@ohos.enterprise.datetimeManager.d.ts | 120 +++++ ...ts => @ohos.enterprise.deviceControl.d.ts} | 46 +- api/@ohos.enterprise.deviceInfo.ts | 128 +++++ api/@ohos.enterprise.deviceSettings.d.ts | 81 ++++ api/@ohos.enterprise.networkManager.ts | 165 +++++++ api/@ohos.enterprise.wifiManager.d.ts | 110 +++++ api/@ohos.enterpriseDeviceManager.d.ts | 163 ------- 12 files changed, 1585 insertions(+), 201 deletions(-) create mode 100644 api/@ohos.enterprise.AdminExtensionAbility.d.ts rename api/{@ohos.EnterpriseAdminExtensionAbility.d.ts => @ohos.enterprise.accountManager.d.ts} (30%) create mode 100644 api/@ohos.enterprise.adminManager.d.ts create mode 100644 api/@ohos.enterprise.applicationManager.d .ts create mode 100644 api/@ohos.enterprise.bundleManager.d.ts create mode 100644 api/@ohos.enterprise.datetimeManager.d.ts rename api/{enterpriseDeviceManager/DeviceSettingsManager.d.ts => @ohos.enterprise.deviceControl.d.ts} (40%) create mode 100644 api/@ohos.enterprise.deviceInfo.ts create mode 100644 api/@ohos.enterprise.deviceSettings.d.ts create mode 100644 api/@ohos.enterprise.networkManager.ts create mode 100644 api/@ohos.enterprise.wifiManager.d.ts delete mode 100644 api/@ohos.enterpriseDeviceManager.d.ts diff --git a/api/@ohos.enterprise.AdminExtensionAbility.d.ts b/api/@ohos.enterprise.AdminExtensionAbility.d.ts new file mode 100644 index 0000000000..0d2970446e --- /dev/null +++ b/api/@ohos.enterprise.AdminExtensionAbility.d.ts @@ -0,0 +1,131 @@ +/* + * 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 class of the enterprise admin extension ability. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +export default class AdminExtensionAbility { + /** + * Called back when an application is enabled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onAdminEnabled(): void; + + /** + * Called back when an application is disabled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onAdminDisabled(): void; + + /** + * Called back when a bundle is installed. + * @param { string } bundleName - bundleName indicates the name of the bundle installed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onBundleAdded(bundleName: string): void; + + /** + * Called back when a bundle is uninstalled. + * @param { string } bundleName - bundleName indicates the name of the bundle uninstalled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onBundleRemoved(bundleName: string): void; + + /** + * Called back when an application start. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onAppStart(bundleName: string): void; + + /** + * Called back when an application stop. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onAppStop(bundleName: string): void; + + /** + * Called back when an application get content on paste board. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onPasteBoardGet(bundleName: string): void; + + /** + * Called back when an application set content to paste board. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onPasteBoardSet(bundleName: string): void; + + /** + * Called back when an application screenshot. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onScreenshot(bundleName: string): void; + + /** + * Called back when an application start share screen. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onShareScreenStart(bundleName: string): void; + + /** + * Called back when an application stop share screen. + * @param { string } bundleName - bundleName indicates the bundle name of the application. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 9 + */ + onShareScreenStop(bundleName: string): void; +} \ No newline at end of file diff --git a/api/@ohos.EnterpriseAdminExtensionAbility.d.ts b/api/@ohos.enterprise.accountManager.d.ts similarity index 30% rename from api/@ohos.EnterpriseAdminExtensionAbility.d.ts rename to api/@ohos.enterprise.accountManager.d.ts index a290390863..9d546aa7d2 100644 --- a/api/@ohos.EnterpriseAdminExtensionAbility.d.ts +++ b/api/@ohos.enterprise.accountManager.d.ts @@ -13,29 +13,44 @@ * limitations under the License. */ +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; + /** - * Class of the enterprise admin extension ability. - * - * @since 9 + * This module offers set account policies on the devices. + * @namespace accountManager * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ -export default class EnterpriseAdminExtensionAbility { - /** - * Called back when an application is enabled. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @StageModelOnly - */ - onAdminEnabled(): void; - - /** - * Called back when an application is disabled. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @StageModelOnly - */ - onAdminDisabled(): void; -} \ No newline at end of file +declare namespace accountManager { + /** + * Disallow add local account. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_ACCOUNT_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } disallow - True if disallow add local account, otherwise false. + * @param { AsyncCallback } callback - the callback of disalloweAddLocalAccount. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disalloweAddLocalAccount(admin: Want, disallow: boolean, callback: AsyncCallback): void; + /** + * Disallow add local account. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_ACCOUNT_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } disallow - True if disallow add local account, otherwise false. + * @returns { Promise } the promise returned by the disalloweAddLocalAccount. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disalloweAddLocalAccount(admin: Want, disallow: boolean): Promise; +} + +export default accountManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.adminManager.d.ts b/api/@ohos.enterprise.adminManager.d.ts new file mode 100644 index 0000000000..fcd62bc5e4 --- /dev/null +++ b/api/@ohos.enterprise.adminManager.d.ts @@ -0,0 +1,455 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * The enterprise admin manager. + * @namespace adminManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace adminManager { + + /** + * @typedef EnterpriseInfo + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + export interface EnterpriseInfo { + /** + * The name of enterprise. + * @type { string } + * @since 9 + */ + name: string; + + /** + * The description of enterprise. + * @type { string } + * @since 9 + */ + description: string; + } + + /** + * Enum for admin type. + * @enum { number } + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + export enum AdminType { + /** + * The value of normal admin. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + ADMIN_TYPE_NORMAL = 0x00, + /** + * The value of super admin. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + ADMIN_TYPE_SUPER = 0x01 + } + + /** + * Enum for system event. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @enum { number } + * @since 9 + */ + export enum ManagedEvent { + /** + * The event of bundle added. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_BUNDLE_ADDED = 0, + /** + * The event of bundle removed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_BUNDLE_REMOVED = 1, + /** + * The event of app start. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_APP_START = 2, + /** + * The event of app stop. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_APP_STOP = 3, + /** + * The event of get paste board. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_PASTE_BOARD_GET = 4, + /** + * The event of set paste board. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_PASTE_BOARD_SET = 5, + /** + * The event of paste screenshot. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_PASTE_SCREENSHOT = 6, + /** + * The event of share screen start. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_SHARE_SCREEN_START = 7, + /** + * The event of share screen stop. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ + MANAGED_EVENT_SHARE_SCREEN_STOP = 8 + } + + /** + * Enables the given ability as a administrator of the device. + * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { Want } admin - admin indicates the administrator ability information. + * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. + * @param { AdminType } type - type indicates the type of administrator to set. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of enableAdmin. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200004 - failed to activate the adminstrator application of the device. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + * + */ + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback): void; + /** + * Enables the given ability as a administrator of the device. + * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { Want } admin - admin indicates the administrator ability information. + * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. + * @param { AdminType } type - type indicates the type of administrator to set. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the enableAdmin. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200004 - failed to activate the adminstrator application of the device. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + * + */ + function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; + + /** + * Disables a current normal administrator ability. + * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of disableAdmin. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disableAdmin(admin: Want, callback: AsyncCallback): void; + function disableAdmin(admin: Want, userId: number, callback: AsyncCallback): void; + /** + * Disables a current normal administrator ability. + * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the disableAdmin. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disableAdmin(admin: Want, userId?: number): Promise; + + /** + * Disables a current super administrator ability. + * Only the administrator app or apps with the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @param { AsyncCallback } callback - the callback of disableSuperAdmin. + * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disableSuperAdmin(bundleName: String, callback: AsyncCallback): void; + /** + * Disables a current super administrator ability. + * Only the administrator app or apps with the shell uid can call this method. + * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN + * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @returns { Promise } the promise returned by the disableSuperAdmin. + * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disableSuperAdmin(bundleName: String): Promise; + + /** + * Get whether the ability is enabled as device administrator. + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of isAdminEnabled. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isAdminEnabled(admin: Want, callback: AsyncCallback): void; + function isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback): void; + /** + * Get whether the ability is enabled as device administrator. + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by the isAdminEnabled. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200006 - the specified user ID is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isAdminEnabled(admin: Want, userId?: number): Promise; + + /** + * Get information of the administrator's enterprise. + * @permission ohos.permission.SET_ENTERPRISE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getEnterpriseInfo. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getEnterpriseInfo(admin: Want, callback: AsyncCallback): void; + /** + * Get information of the administrator's enterprise. + * @permission ohos.permission.SET_ENTERPRISE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by the getEnterpriseInfo. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getEnterpriseInfo(admin: Want): Promise; + + /** + * Set the information of the administrator's enterprise. + * Only the administrator app can call this method. + * @permission ohos.permission.SET_ENTERPRISE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. + * @param { AsyncCallback } callback - the callback of setEnterpriseInfo. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback): void; + /** + * Set the information of the administrator's enterprise. + * Only the administrator app can call this method. + * @permission ohos.permission.SET_ENTERPRISE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. + * @returns { Promise } the promise returned by the setEnterpriseInfo. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise; + + /** + * Get whether the ability is enabled as super device administrator. + * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @param { AsyncCallback } callback - the callback of isSuperAdmin. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isSuperAdmin(bundleName: String, callback: AsyncCallback): void; + /** + * Get whether the ability is enabled as super device administrator. + * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @returns { Promise } the promise returned by the isSuperAdmin. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isSuperAdmin(bundleName: String): Promise; + + /** + * Subscribes the managed event of admin. + * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } managedEvents - managedEvents indicates the managed events to subscribe. + * @param { AsyncCallback } callback - the callback of subscribeManagedEvent. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 9200008 - the specified system events enum is invalid. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function subscribeManagedEvent(admin: Want, managedEvents: Array, callback: AsyncCallback): void; + /** + * Subscribes the managed event of admin. + * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } managedEvents - managedEvents indicates the managed events to subscribe. + * @returns { Promise } the promise returned by the subscribeManagedEvent. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 9200008 - the specified system events enum is invalid. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function subscribeManagedEvent(admin: Want, managedEvents: Array): Promise; + + /** + * Unsubscribes the managed event of admin. + * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } managedEvents - managedEvents indicates the managed events to subscribe. + * @param { AsyncCallback } callback - the callback of unsubscribeManagedEvent. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 9200008 - the specified system events enum is invalid. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function unsubscribeManagedEvent(admin: Want, managedEvents: Array, callback: AsyncCallback): void; + /** + * Unsubscribes the managed event of admin. + * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } managedEvents - managedEvents indicates the managed events to subscribe. + * @returns { Promise } the promise returned by the unsubscribeManagedEvent. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 9200008 - the specified system events enum is invalid. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function unsubscribeManagedEvent(admin: Want, managedEvents: Array): Promise; +} + +export default adminManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.applicationManager.d .ts b/api/@ohos.enterprise.applicationManager.d .ts new file mode 100644 index 0000000000..01b801590c --- /dev/null +++ b/api/@ohos.enterprise.applicationManager.d .ts @@ -0,0 +1,119 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * This nodule offers application management. + * @namespace applicationManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace applicationManager { + /** + * Adds disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed running. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of addDisallowedRunningBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addDisallowedRunningBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function addDisallowedRunningBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Adds disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed running. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promiose returned by the addDisallowedRunningBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addDisallowedRunningBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Removes disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed running. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of removeDisallowedRunningBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeDisallowedRunningBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function removeDisallowedRunningBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Removes disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed running. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promiose returned by the removeDisallowedRunningBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeDisallowedRunningBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Gets disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @since 9 + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback> } callback - the callback of getDisallowedRunningBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisallowedRunningBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + function getDisallowedRunningBundles(admin: Want, callback: AsyncCallback>): void; + /** + * Gets disallowed running list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_APP_RUNNING_POLICY + * @since 9 + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise> } the promiose returned by the getDisallowedRunningBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisallowedRunningBundles(admin: Want, userId?: number): Promise>; +} + +export default applicationManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.bundleManager.d.ts b/api/@ohos.enterprise.bundleManager.d.ts new file mode 100644 index 0000000000..de09d13d6d --- /dev/null +++ b/api/@ohos.enterprise.bundleManager.d.ts @@ -0,0 +1,207 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * This module offers application management. + * @namespace bundleManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace bundleManager { + /** + * Adds the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of addDisallowedUninstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function addDisallowedUninstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Adds the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by addDisallowedUninstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Removes the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of removeDisallowedUninstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function removeDisallowedUninstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Removes the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by removeDisallowedUninstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeDisallowedUninstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Gets the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback> } callback - the callback of getDisallowedUninstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisallowedUninstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + function getDisallowedUninstallBundles(admin: Want, callback: AsyncCallback>): void; + /** + * Gets the disallowed uninstall list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise> } the promise returned by getDisallowedUninstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisallowedUninstallBundles(admin: Want, userId?: number): Promise>; + + /** + * Adds the allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of addAllowedInstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addAllowedInstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function addAllowedInstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Adds the allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by addAllowedInstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function addAllowedInstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Removes allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - the callback of removeAllowedInstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeAllowedInstallBundles(admin: Want, bundleNames: Array, userId: number, callback: AsyncCallback): void; + function removeAllowedInstallBundles(admin: Want, bundleNames: Array, callback: AsyncCallback): void; + /** + * Removes allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { Array } bundleNames - List of applications that disallowed uninstall. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @returns { Promise } the promise returned by removeAllowedInstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function removeAllowedInstallBundles(admin: Want, bundleNames: Array, userId?: number): Promise; + + /** + * Gets allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { AsyncCallback> } callback - the callback of getAllowedInstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getAllowedInstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + function getAllowedInstallBundles(admin: Want, callback: AsyncCallback>): void; + /** + * Gets allowed install list of applications. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } [userId] - userId indicates the user ID or do not pass user ID. + * @param { Promise> } the promise returned by getAllowedInstallBundles. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getAllowedInstallBundles(admin: Want, userId?: number): Promise>; +} + +export default bundleManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.datetimeManager.d.ts b/api/@ohos.enterprise.datetimeManager.d.ts new file mode 100644 index 0000000000..d95b842dce --- /dev/null +++ b/api/@ohos.enterprise.datetimeManager.d.ts @@ -0,0 +1,120 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * This module offers set restricted policies on the devices. + * @namespace dateTimeManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace dateTimeManager { + /** + * Sets the system time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } time - time indicates rhe target time stamp (ms). + * @param { AsyncCallback } callback - the callback of setDateTime. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator applicayion does not have permission to manage the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setDateTime(admin: Want, time: number, callback: AsyncCallback): void; + /** + * Sets the system time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } time - time indicates rhe target time stamp (ms). + * @returns { Promise } the promise returned by the setDateTime. + * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator applicayion does not have permission to manage the device. + * @throws { BusinessError } 9200003 - the administrator ability component is invalid. + * @throws { BusinessError } 9200007 - the system ability work abnormally. + * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setDateTime(admin: Want, time: number): Promise; + + /** + * Disallow the modificationing of date time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } disallow - True if set the modificationing of date time disabled, otherwise false. + * @param { AsyncCallback } callback - the callback of disallowModifyDateTime. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disallowModifyDateTime(admin: Want, disallow: boolean, callback: AsyncCallback): void; + /** + * Disallow the modificationing of date time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } disallow - True if set the modificationing of date time disabled, otherwise false. + * @returns { Promise } the promise returned by the disallowModifyDateTime. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function disallowModifyDateTime(admin: Want, disallow: boolean): Promise; + + /** + * Gets state of whether the modificationing of date time is disallowed. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of isModifyDateTimeDisallowed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isModifyDateTimeDisallowed(admin: Want, callback: AsyncCallback): void; + /** + * Gets state of whether the modificationing of date time is disallowed. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by the isModifyDateTimeDisallowed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isModifyDateTimeDisallowed(admin: Want): Promise; +} + +export default dateTimeManager; \ No newline at end of file diff --git a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts b/api/@ohos.enterprise.deviceControl.d.ts similarity index 40% rename from api/enterpriseDeviceManager/DeviceSettingsManager.d.ts rename to api/@ohos.enterprise.deviceControl.d.ts index c29c0dda15..5bff8625fb 100644 --- a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts +++ b/api/@ohos.enterprise.deviceControl.d.ts @@ -13,26 +13,42 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from "./../basic"; -import Want from "./../@ohos.application.Want"; +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.application.Want"; /** - * @name Offers set settings policies on the devices. - * @since 9 + * This module offers set control polices on the devices. + * @namespace deviceControl * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 */ -export interface DeviceSettingsManager { - +declare namespace deviceControl { /** - * Sets the system time.This function can be called by a super administrator. - * + * Resets the device factory. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_RESET_DEVICE + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of resetFactory. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly * @since 9 + */ + function resetFactory(admin: Want, callback: AsyncCallback): void; + /** + * Resets the device factory. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_RESET_DEVICE + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by resetFactory. * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param time Target time stamp (ms) - * @return {@code true} if success. - * @permission ohos.permission.EDM_MANAGE_DATETIME + * @systemapi + * @stagemodelonly + * @since 9 */ - setDateTime(admin: Want, time: number, callback: AsyncCallback): void; - setDateTime(admin: Want, time: number): Promise; -} \ No newline at end of file + function resetFactory(admin: Want): Promise; +} + +export default deviceControl; \ No newline at end of file diff --git a/api/@ohos.enterprise.deviceInfo.ts b/api/@ohos.enterprise.deviceInfo.ts new file mode 100644 index 0000000000..0b30ca4600 --- /dev/null +++ b/api/@ohos.enterprise.deviceInfo.ts @@ -0,0 +1,128 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * This module offers set or get device info policies on the devices. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace deviceInfo { + /** + * Get the serial of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getDeviceSerial. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDeviceSerial(admin: Want, callback: AsyncCallback): void; + /** + * Get the serial of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by getDeviceSerial. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDeviceSerial(admin: Want): Promise; + + /** + * Get the display version of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getDisplayVersion. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisplayVersion(admin: Want, callback: AsyncCallback): void; + /** + * Get the display version of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by getDisplayVersion. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDisplayVersion(admin: Want): Promise; + + /** + * Get the device name of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getDeviceName. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDeviceName(admin: Want, callback: AsyncCallback): void; + /** + * Get the device name of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by getDeviceName. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDeviceName(admin: Want): Promise; + + /** + * Get the hard disk serial of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getHardDiskSerial. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getHardDiskSerial(admin: Want, callback: AsyncCallback): void; + /** + * Get the hard disk serial of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by getHardDiskSerial. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getHardDiskSerial(admin: Want): Promise; +} + +export default deviceInfo; \ No newline at end of file diff --git a/api/@ohos.enterprise.deviceSettings.d.ts b/api/@ohos.enterprise.deviceSettings.d.ts new file mode 100644 index 0000000000..7caceade19 --- /dev/null +++ b/api/@ohos.enterprise.deviceSettings.d.ts @@ -0,0 +1,81 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * This module offers set settings policies on the devices. + * @namespace deviceSettings + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace deviceSettings { + /** + * Sets the screen off time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } time - time indicates rhe target time stamp (ms). + * @param { AsyncCallback } callback - the callback of setScreenOffTime. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setScreenOffTime(admin: Want, time: number, callback: AsyncCallback): void; + /** + * Sets the screen off time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } time - time indicates rhe target time stamp (ms). + * @returns { Promise } the promise returned by setScreenOffTime. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setScreenOffTime(admin: Want, time: number): Promise; + + /** + * Gets the screen off time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getScreenOffTime. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getScreenOffTime(admin: Want, callback: AsyncCallback): void; + /** + * Gets the screen off time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by getScreenOffTime. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getScreenOffTime(admin: Want): Promise; +} + +export default deviceSettings; \ No newline at end of file diff --git a/api/@ohos.enterprise.networkManager.ts b/api/@ohos.enterprise.networkManager.ts new file mode 100644 index 0000000000..ea4c6bb931 --- /dev/null +++ b/api/@ohos.enterprise.networkManager.ts @@ -0,0 +1,165 @@ +/* + * 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 Want from "./@ohos.application.Want"; + +/** + * This module offers set network policies on the devices. + * @namespace networkManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace networkManager { + + /** + * Gets all of the network interfaces of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback> } callback - the callback of getAllNetworkInterfaces. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getAllNetworkInterfaces(admin: Want, callback: AsyncCallback>): void; + /** + * Gets all of the network interfaces of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise> } the promise returned by getAllNetworkInterfaces. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getAllNetworkInterfaces(admin: Want): Promise>; + + /** + * Gets the ip address of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get ip address. + * @param { AsyncCallback } callback - the callback of getIpAddress. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getIpAddress(admin: Want, networkInterface: string, callback: AsyncCallback): void; + /** + * Gets the ip address of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get ip address. + * @returns { Promise } the promise returned by getIpAddress. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getIpAddress(admin: Want, networkInterface: string): Promise; + + /** + * Gets the mac address of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. + * @param { AsyncCallback } callback - the callback of getMac. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getMac(admin: Want, networkInterface: string, callback: AsyncCallback): void; + /** + * Gets the mac address of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. + * @returns { Promise } the promise returned by getMac. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getMac(admin: Want, networkInterface: string): Promise; + + /** + * Gets the status of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get status. + * @param { AsyncCallback } callback - the callback of getNetworkInterfaceStatus. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getNetworkInterfaceStatus(admin: Want, networkInterface: string, callback: AsyncCallback): void; + /** + * Gets the status of the network interface. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_NETWORK_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get status. + * @returns { Promise } the promise returned by getNetworkInterfaceStatus. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getNetworkInterfaceStatus(admin: Want, networkInterface: string): Promise; + + /** + * Disables the network interfaces. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_NETWORK + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. + * @param { boolean } isDisabled - True if disable the network interfaces, otherwise false. + * @param { AsyncCallback } callback - the callback of setNetworkInterfaceDisabled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setNetworkInterfaceDisabled(admin: Want, networkInterface: string, isDisabled: boolean, callback: AsyncCallback): void; + /** + * Disables the network interfaces. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_NETWORK + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } networkInterface - networkInterface indicates the network interface to get mac address. + * @param { boolean } isDisabled - True if disable the network interfaces, otherwise false. + * @returns { Promise } the promise returned setNetworkInterfaceDisabled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setNetworkInterfaceDisabled(admin: Want, networkInterface: string, isDisabled: boolean): Promise; +} + +export default networkManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.wifiManager.d.ts b/api/@ohos.enterprise.wifiManager.d.ts new file mode 100644 index 0000000000..8a62457e77 --- /dev/null +++ b/api/@ohos.enterprise.wifiManager.d.ts @@ -0,0 +1,110 @@ +/* + * 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 Want from "./@ohos.application.Want"; +import wifi from "./@ohos.wifi"; + +/** + * This module offers set wifi policies on the devices. + * @namespace wifiManager + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ +declare namespace wifiManager { + + /** + * Disables the wifi of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @since 9 + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } isDisabled - True if disable the wifi of the device, otherwise false. + * @param { AsyncCallback } callback - the callback of setWifiDisabled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setWifiDisabled(admin: Want, isDisabled: boolean, callback: AsyncCallback): void; + /** + * Disables the wifi of the device. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @since 9 + * @param { Want } admin - admin indicates the administrator ability information. + * @param { boolean } isDisabled - True if disable the wifi of the device, otherwise false. + * @returns { Promise } the promise returned by setWifiDisabled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setWifiDisabled(admin: Want, isDisabled: boolean): Promise; + + /** + * Gets state of whether the wifi is disabled. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of isWifiDisabled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isWifiDisabled(admin: Want, callback: AsyncCallback): void; + /** + * Gets state of whether the wifi is disabled. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by isWifiDisabled. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function isWifiDisabled(admin: Want): Promise; + + /** + * Sets the wifi profile. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @param { Want } admin - admin indicates the administrator ability information. + * @param { wifi.WifiDeviceConfig } config - config indicates the configuration of wifi. + * @param { AsyncCallback } callback - the callback of setWifiProfile. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setWifiProfile(admin: Want, config: wifi.WifiDeviceConfig, callback: AsyncCallback): void; + /** + * Sets the wifi profile. + * @permission ohos.permission.ENTERPRISE_SET_WIFI + * @param { Want } admin - admin indicates the administrator ability information. + * @param { wifi.WifiDeviceConfig } config - config indicates the configuration of wifi. + * @returns { Promise } the promise returned by setWifiProfile. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setWifiProfile(admin: Want, config: wifi.WifiDeviceConfig): Promise; +} + +export default wifiManager; \ No newline at end of file diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterpriseDeviceManager.d.ts deleted file mode 100644 index 273c97f117..0000000000 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ /dev/null @@ -1,163 +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, Callback } from "./basic"; -import { DeviceSettingsManager as _DeviceSettingsManager } from "./enterpriseDeviceManager/DeviceSettingsManager"; -import Want from "./@ohos.application.Want"; - -/** - * enterprise device manager. - * @name enterpriseDeviceManager - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ -declare namespace enterpriseDeviceManager { - - /** - * @name EnterpriseInfo - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ - export interface EnterpriseInfo { - name: string; - description: string; - } - - /** - * @name DeviceSettingsManager - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ - export type DeviceSettingsManager = _DeviceSettingsManager - - /** - * @name AdminType - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ - export enum AdminType { - ADMIN_TYPE_NORMAL = 0x00, - ADMIN_TYPE_SUPER = 0x01 - } - - /** - * Enables the given ability as a administrator of the device. - * - * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param enterpriseInfo Indicates the enterprise information of the calling application. - * @param type Indicates the type of administrator to set. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if enables administrator success. - * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN - */ - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback): void; - function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; - - /** - * Disables a current normal administrator ability. - * - * Only apps with the ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN permission or the shell uid can call this method. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if disables administrator success. - * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN - */ - function disableAdmin(admin: Want, callback: AsyncCallback): void; - function disableAdmin(admin: Want, userId: number, callback: AsyncCallback): void; - function disableAdmin(admin: Want, userId?: number): Promise; - - /** - * Disables a current super administrator ability. - * - * Only the administrator app or apps with the shell uid can call this method. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param bundleName Indicates the administrator bundle information. - * @return {@code true} if disables super administrator success. - */ - function disableSuperAdmin(bundleName: String, callback: AsyncCallback): void; - function disableSuperAdmin(bundleName: String): Promise; - - /** - * Get whether the ability is enabled as device administrator. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if the administrator is enabled. - */ - function isAdminEnabled(admin: Want, callback: AsyncCallback): void; - function isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback): void; - function isAdminEnabled(admin: Want, userId?: number): Promise; - - /** - * Get information of the administrator's enterprise. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @return Returns the enterprise information of the administrator. - */ - function getEnterpriseInfo(admin: Want, callback: AsyncCallback): void; - function getEnterpriseInfo(admin: Want): Promise; - - /** - * Set the information of the administrator's enterprise. - * - * Only the administrator app can call this method. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param enterpriseInfo Indicates the enterprise information of the calling application. - * @return {@code true} if sets enterprise information success. - */ - function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback): void; - function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise; - - /** - * Get whether the ability is enabled as super device administrator. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param bundleName Indicates the administrator bundle information. - * @return {@code true} if the administrator is enabled as super device administrator. - */ - function isSuperAdmin(bundleName: String, callback: AsyncCallback): void; - function isSuperAdmin(bundleName: String): Promise; - - /** - * Obtains the interface used to set device settings policy. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @return Returns the DeviceSettingsManager interface. - */ - function getDeviceSettingsManager(callback: AsyncCallback): void; - function getDeviceSettingsManager(): Promise; - -} - -export default enterpriseDeviceManager; \ No newline at end of file -- Gitee From 4eda56807c12de37e9ec4c5c93332b15b6a82332 Mon Sep 17 00:00:00 2001 From: fangyun Date: Thu, 29 Sep 2022 17:06:55 +0800 Subject: [PATCH 3/3] update jsdoc Signed-off-by: fangyun --- api/@ohos.enterprise.accountManager.d.ts | 4 +-- api/@ohos.enterprise.adminManager.d.ts | 28 +++++++++---------- api/@ohos.enterprise.applicationManager.d .ts | 12 ++++---- api/@ohos.enterprise.bundleManager.d.ts | 24 ++++++++-------- api/@ohos.enterprise.datetimeManager.d.ts | 12 ++++---- api/@ohos.enterprise.deviceControl.d.ts | 4 +-- api/@ohos.enterprise.deviceInfo.ts | 16 +++++------ api/@ohos.enterprise.deviceSettings.d.ts | 8 +++--- api/@ohos.enterprise.networkManager.ts | 20 ++++++------- api/@ohos.enterprise.wifiManager.d.ts | 12 ++++---- 10 files changed, 70 insertions(+), 70 deletions(-) diff --git a/api/@ohos.enterprise.accountManager.d.ts b/api/@ohos.enterprise.accountManager.d.ts index e13ae43fbd..a71fafd55d 100644 --- a/api/@ohos.enterprise.accountManager.d.ts +++ b/api/@ohos.enterprise.accountManager.d.ts @@ -35,7 +35,7 @@ declare namespace accountManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -53,7 +53,7 @@ declare namespace accountManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi diff --git a/api/@ohos.enterprise.adminManager.d.ts b/api/@ohos.enterprise.adminManager.d.ts index fcd62bc5e4..b60312f818 100644 --- a/api/@ohos.enterprise.adminManager.d.ts +++ b/api/@ohos.enterprise.adminManager.d.ts @@ -144,7 +144,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200004 - failed to activate the adminstrator application of the device. * @throws { BusinessError } 9200006 - the specified user ID is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -167,7 +167,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200004 - failed to activate the adminstrator application of the device. * @throws { BusinessError } 9200006 - the specified user ID is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -188,7 +188,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. * @throws { BusinessError } 9200006 - the specified user ID is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -208,7 +208,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. * @throws { BusinessError } 9200006 - the specified user ID is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -225,7 +225,7 @@ declare namespace adminManager { * @param { AsyncCallback } callback - the callback of disableSuperAdmin. * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -241,7 +241,7 @@ declare namespace adminManager { * @returns { Promise } the promise returned by the disableSuperAdmin. * @throws { BusinessError } 9200005 - failed to deactivate the administrator application of the device. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -290,7 +290,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -306,7 +306,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -325,7 +325,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -343,7 +343,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -387,7 +387,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. * @throws { BusinessError } 9200008 - the specified system events enum is invalid. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -405,7 +405,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. * @throws { BusinessError } 9200008 - the specified system events enum is invalid. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -424,7 +424,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. * @throws { BusinessError } 9200008 - the specified system events enum is invalid. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -442,7 +442,7 @@ declare namespace adminManager { * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. * @throws { BusinessError } 9200008 - the specified system events enum is invalid. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi diff --git a/api/@ohos.enterprise.applicationManager.d .ts b/api/@ohos.enterprise.applicationManager.d .ts index adfe334276..ba86294a71 100644 --- a/api/@ohos.enterprise.applicationManager.d .ts +++ b/api/@ohos.enterprise.applicationManager.d .ts @@ -36,7 +36,7 @@ declare namespace applicationManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -56,7 +56,7 @@ declare namespace applicationManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -76,7 +76,7 @@ declare namespace applicationManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter.s * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -96,7 +96,7 @@ declare namespace applicationManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -116,7 +116,7 @@ declare namespace applicationManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -136,7 +136,7 @@ declare namespace applicationManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi diff --git a/api/@ohos.enterprise.bundleManager.d.ts b/api/@ohos.enterprise.bundleManager.d.ts index 2288bc11eb..e801344b2c 100644 --- a/api/@ohos.enterprise.bundleManager.d.ts +++ b/api/@ohos.enterprise.bundleManager.d.ts @@ -36,7 +36,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -56,7 +56,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -77,7 +77,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -98,7 +98,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -117,7 +117,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -136,7 +136,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -156,7 +156,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -176,7 +176,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -196,7 +196,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -216,7 +216,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -235,7 +235,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -254,7 +254,7 @@ declare namespace bundleManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi diff --git a/api/@ohos.enterprise.datetimeManager.d.ts b/api/@ohos.enterprise.datetimeManager.d.ts index efcec7d832..51659119af 100644 --- a/api/@ohos.enterprise.datetimeManager.d.ts +++ b/api/@ohos.enterprise.datetimeManager.d.ts @@ -36,7 +36,7 @@ declare namespace dateTimeManager { * @throws { BusinessError } 9200002 - the administrator applicayion does not have permission to manage the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -55,7 +55,7 @@ declare namespace dateTimeManager { * @throws { BusinessError } 9200002 - the administrator applicayion does not have permission to manage the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -74,7 +74,7 @@ declare namespace dateTimeManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -92,7 +92,7 @@ declare namespace dateTimeManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -110,7 +110,7 @@ declare namespace dateTimeManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -127,7 +127,7 @@ declare namespace dateTimeManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi diff --git a/api/@ohos.enterprise.deviceControl.d.ts b/api/@ohos.enterprise.deviceControl.d.ts index 7b9b93e07c..8fc334a429 100644 --- a/api/@ohos.enterprise.deviceControl.d.ts +++ b/api/@ohos.enterprise.deviceControl.d.ts @@ -34,7 +34,7 @@ declare namespace deviceControl { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -51,7 +51,7 @@ declare namespace deviceControl { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi diff --git a/api/@ohos.enterprise.deviceInfo.ts b/api/@ohos.enterprise.deviceInfo.ts index de77edbe8a..7c2484230a 100644 --- a/api/@ohos.enterprise.deviceInfo.ts +++ b/api/@ohos.enterprise.deviceInfo.ts @@ -33,7 +33,7 @@ declare namespace deviceInfo { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -50,7 +50,7 @@ declare namespace deviceInfo { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -68,7 +68,7 @@ declare namespace deviceInfo { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -85,7 +85,7 @@ declare namespace deviceInfo { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -103,7 +103,7 @@ declare namespace deviceInfo { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -120,7 +120,7 @@ declare namespace deviceInfo { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -138,7 +138,7 @@ declare namespace deviceInfo { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -155,7 +155,7 @@ declare namespace deviceInfo { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi diff --git a/api/@ohos.enterprise.deviceSettings.d.ts b/api/@ohos.enterprise.deviceSettings.d.ts index 268ff145d2..b88d3ed2f6 100644 --- a/api/@ohos.enterprise.deviceSettings.d.ts +++ b/api/@ohos.enterprise.deviceSettings.d.ts @@ -35,7 +35,7 @@ declare namespace deviceSettings { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -53,7 +53,7 @@ declare namespace deviceSettings { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -71,7 +71,7 @@ declare namespace deviceSettings { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -88,7 +88,7 @@ declare namespace deviceSettings { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi diff --git a/api/@ohos.enterprise.networkManager.ts b/api/@ohos.enterprise.networkManager.ts index 3ae6ff223f..557ad00bae 100644 --- a/api/@ohos.enterprise.networkManager.ts +++ b/api/@ohos.enterprise.networkManager.ts @@ -35,7 +35,7 @@ declare namespace networkManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -52,7 +52,7 @@ declare namespace networkManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -71,7 +71,7 @@ declare namespace networkManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -89,7 +89,7 @@ declare namespace networkManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -108,7 +108,7 @@ declare namespace networkManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -126,7 +126,7 @@ declare namespace networkManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -145,7 +145,7 @@ declare namespace networkManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -163,7 +163,7 @@ declare namespace networkManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -183,7 +183,7 @@ declare namespace networkManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -202,7 +202,7 @@ declare namespace networkManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi diff --git a/api/@ohos.enterprise.wifiManager.d.ts b/api/@ohos.enterprise.wifiManager.d.ts index 16ff0e25f7..fd1ed6d9d7 100644 --- a/api/@ohos.enterprise.wifiManager.d.ts +++ b/api/@ohos.enterprise.wifiManager.d.ts @@ -38,7 +38,7 @@ declare namespace wifiManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -57,7 +57,7 @@ declare namespace wifiManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -75,7 +75,7 @@ declare namespace wifiManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -92,7 +92,7 @@ declare namespace wifiManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -110,7 +110,7 @@ declare namespace wifiManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -127,7 +127,7 @@ declare namespace wifiManager { * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. * @throws { BusinessError } 9200007 - the system ability work abnormally. - * @throws { BusinessError } 201 - the application does not have permission to use bundle service. + * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi -- Gitee