From f7c86d23362ec26ad9644b5b4dfbe310447396b3 Mon Sep 17 00:00:00 2001 From: caiminggang Date: Thu, 17 Nov 2022 11:50:26 +0800 Subject: [PATCH] =?UTF-8?q?Edm=E6=8E=A5=E5=8F=A3=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E5=9B=9E=E5=90=88release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: caiminggang --- ...rise.EnterpriseAdminExtensionAbility.d.ts} | 5 +- ....ts => @ohos.enterprise.adminManager.d.ts} | 126 ++++++++++-------- ... => @ohos.enterprise.dateTimeManager.d.ts} | 45 +++++-- 3 files changed, 108 insertions(+), 68 deletions(-) rename api/{@ohos.EnterpriseAdminExtensionAbility.d.ts => @ohos.enterprise.EnterpriseAdminExtensionAbility.d.ts} (97%) rename api/{@ohos.enterpriseDeviceManager.d.ts => @ohos.enterprise.adminManager.d.ts} (91%) rename api/{enterpriseDeviceManager/DeviceSettingsManager.d.ts => @ohos.enterprise.dateTimeManager.d.ts} (47%) diff --git a/api/@ohos.EnterpriseAdminExtensionAbility.d.ts b/api/@ohos.enterprise.EnterpriseAdminExtensionAbility.d.ts similarity index 97% rename from api/@ohos.EnterpriseAdminExtensionAbility.d.ts rename to api/@ohos.enterprise.EnterpriseAdminExtensionAbility.d.ts index e968d3ff4b..6cd8d1a83f 100644 --- a/api/@ohos.EnterpriseAdminExtensionAbility.d.ts +++ b/api/@ohos.enterprise.EnterpriseAdminExtensionAbility.d.ts @@ -18,6 +18,7 @@ * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi * @StageModelOnly */ export default class EnterpriseAdminExtensionAbility { @@ -26,15 +27,17 @@ export default class EnterpriseAdminExtensionAbility { * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi * @StageModelOnly */ onAdminEnabled(): void; - + /** * Called back when an application is disabled. * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi * @StageModelOnly */ onAdminDisabled(): void; diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterprise.adminManager.d.ts similarity index 91% rename from api/@ohos.enterpriseDeviceManager.d.ts rename to api/@ohos.enterprise.adminManager.d.ts index 08f6c2cb53..8458d5afcb 100644 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ b/api/@ohos.enterprise.adminManager.d.ts @@ -14,44 +14,70 @@ */ import { AsyncCallback, Callback } from "./basic"; -import { DeviceSettingsManager as _DeviceSettingsManager } from "./enterpriseDeviceManager/DeviceSettingsManager"; -import Want from "./@ohos.application.Want"; +import Want from "./@ohos.app.ability.Want"; /** - * enterprise device manager. - * @name enterpriseDeviceManager - * @since 9 + * This module provides the capability to manage the administrator of the enterprise devices. + * @namespace adminManager * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @since 9 */ -declare namespace enterpriseDeviceManager { +declare namespace adminManager { /** - * @name EnterpriseInfo - * @since 9 + * Provides the enterprise information. + * @typedef EnterpriseInfo * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @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; } /** - * @name DeviceSettingsManager - * @since 9 + * Enum for type of administrator. + * @enum {number} * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ - export type DeviceSettingsManager = _DeviceSettingsManager - - /** - * @name AdminType + * @systemapi * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager */ export enum AdminType { + /** + * The value of normal administrator. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ ADMIN_TYPE_NORMAL = 0x00, + + /** + * The value of super administrator. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ ADMIN_TYPE_SUPER = 0x01 } + /** + * Enum for managed event + * @enum {number} + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @since 9 + */ export enum ManagedEvent { /** @@ -78,13 +104,13 @@ declare namespace enterpriseDeviceManager { * @param { AdminType } type - type indicates the type of administrator to set. * @param { AsyncCallback } callback - the callback of enableAdmin. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. - * @throws { BusinessError } 9200004 - failed to enable the adminstrator application of the device. + * @throws { BusinessError } 9200004 - failed to enable the administrator application of the device. * @throws { BusinessError } 9200007 - the system ability work abnormally. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; @@ -99,13 +125,13 @@ declare namespace enterpriseDeviceManager { * @param { number } userId - userId indicates the user ID. * @param { AsyncCallback } callback - the callback of enableAdmin. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. - * @throws { BusinessError } 9200004 - failed to enable the adminstrator application of the device. + * @throws { BusinessError } 9200004 - failed to enable the administrator application of the device. * @throws { BusinessError } 9200007 - the system ability work abnormally. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback): void; @@ -120,13 +146,13 @@ declare namespace enterpriseDeviceManager { * @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 enable the adminstrator application of the device. + * @throws { BusinessError } 9200004 - failed to enable the administrator application of the device. * @throws { BusinessError } 9200007 - the system ability work abnormally. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; @@ -142,7 +168,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function disableAdmin(admin: Want, callback: AsyncCallback): void; @@ -159,7 +185,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function disableAdmin(admin: Want, userId: number, callback: AsyncCallback): void; @@ -176,7 +202,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function disableAdmin(admin: Want, userId?: number): Promise; @@ -192,7 +218,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function disableSuperAdmin(bundleName: String, callback: AsyncCallback): void; @@ -208,7 +234,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function disableSuperAdmin(bundleName: String): Promise; @@ -220,7 +246,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function isAdminEnabled(admin: Want, callback: AsyncCallback): void; @@ -233,7 +259,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback): void; @@ -246,7 +272,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function isAdminEnabled(admin: Want, userId?: number): Promise; @@ -255,11 +281,11 @@ declare namespace enterpriseDeviceManager { * Get information of the administrator's enterprise. * @param { Want } admin - admin indicates the administrator ability information. * @param { AsyncCallback } callback - callback contained the enterprise info of administrator. - * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function getEnterpriseInfo(admin: Want, callback: AsyncCallback): void; @@ -268,11 +294,11 @@ declare namespace enterpriseDeviceManager { * Get information of the administrator's enterprise. * @param { Want } admin - admin indicates the administrator ability information. * @returns { Promise } promise contained the enterprise info of administrator. - * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function getEnterpriseInfo(admin: Want): Promise; @@ -284,12 +310,12 @@ declare namespace enterpriseDeviceManager { * @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 } 9200001 - the application is not an administrator of the device. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback): void; @@ -301,12 +327,12 @@ declare namespace enterpriseDeviceManager { * @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 } 9200001 - the application is not an administrator of the device. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise; @@ -318,7 +344,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function isSuperAdmin(bundleName: String, callback: AsyncCallback): void; @@ -330,21 +356,11 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ 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; - /** * Subscribes the managed event of admin. * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT @@ -357,7 +373,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function subscribeManagedEvent(admin: Want, managedEvents: Array, callback: AsyncCallback): void; @@ -374,7 +390,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function subscribeManagedEvent(admin: Want, managedEvents: Array): Promise; @@ -391,7 +407,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function unsubscribeManagedEvent(admin: Want, managedEvents: Array, callback: AsyncCallback): void; @@ -408,10 +424,10 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ 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/enterpriseDeviceManager/DeviceSettingsManager.d.ts b/api/@ohos.enterprise.dateTimeManager.d.ts similarity index 47% rename from api/enterpriseDeviceManager/DeviceSettingsManager.d.ts rename to api/@ohos.enterprise.dateTimeManager.d.ts index b8c6467071..2a7da62ded 100644 --- a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts +++ b/api/@ohos.enterprise.dateTimeManager.d.ts @@ -13,32 +13,53 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from "./../basic"; -import Want from "./../@ohos.application.Want"; +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.app.ability.Want"; /** - * @name Offers set settings policies on the devices. - * @since 9 + * This module provides the capability to manage the datetime of the enterprise devices. + * @namespace dateTimeManager. * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @since 9 */ -export interface DeviceSettingsManager { +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 { number } time - time indicates the target time stamp (ms). + * @param { AsyncCallback } callback - the callback of setDateTime. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @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 the 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 } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ - setDateTime(admin: Want, time: number, callback: AsyncCallback): void; - setDateTime(admin: Want, time: number): Promise; -} \ No newline at end of file + function setDateTime(admin: Want, time: number): Promise; +} + +export default dateTimeManager; \ No newline at end of file -- Gitee