From 74442631108222650a69cb811fb33256f794f3db Mon Sep 17 00:00:00 2001 From: caiminggang Date: Thu, 10 Nov 2022 19:19:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8Denterprise=20dev?= =?UTF-8?q?ice=20management=E6=8E=A5=E5=8F=A3?= 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} | 78 +++++++++++-------- ... => @ohos.enterprise.datetimeManager.d.ts} | 41 +++++++--- api/@ohos.enterprise.deviceInfo.d.ts | 63 +++++++++++++++ 4 files changed, 145 insertions(+), 42 deletions(-) rename api/{@ohos.EnterpriseAdminExtensionAbility.d.ts => @ohos.enterprise.EnterpriseAdminExtensionAbility.d.ts} (97%) rename api/{@ohos.enterpriseDeviceManager.d.ts => @ohos.enterprise.adminManager.d.ts} (94%) rename api/{enterpriseDeviceManager/DeviceSettingsManager.d.ts => @ohos.enterprise.datetimeManager.d.ts} (50%) create mode 100644 api/@ohos.enterprise.deviceInfo.d.ts 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 94% rename from api/@ohos.enterpriseDeviceManager.d.ts rename to api/@ohos.enterprise.adminManager.d.ts index 08f6c2cb53..52fded9d16 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 { /** @@ -255,7 +281,7 @@ 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 @@ -268,7 +294,7 @@ 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 @@ -284,7 +310,7 @@ 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 @@ -301,7 +327,7 @@ 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 @@ -335,16 +361,6 @@ declare namespace enterpriseDeviceManager { */ 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 @@ -414,4 +430,4 @@ declare namespace enterpriseDeviceManager { 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 50% rename from api/enterpriseDeviceManager/DeviceSettingsManager.d.ts rename to api/@ohos.enterprise.datetimeManager.d.ts index b8c6467071..c9186257c5 100644 --- a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts +++ b/api/@ohos.enterprise.datetimeManager.d.ts @@ -13,15 +13,35 @@ * 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 { 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. @@ -30,8 +50,8 @@ export interface DeviceSettingsManager { * @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 } 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 @@ -39,6 +59,7 @@ export interface DeviceSettingsManager { * @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 diff --git a/api/@ohos.enterprise.deviceInfo.d.ts b/api/@ohos.enterprise.deviceInfo.d.ts new file mode 100644 index 0000000000..b1ebb9170a --- /dev/null +++ b/api/@ohos.enterprise.deviceInfo.d.ts @@ -0,0 +1,63 @@ +/* + * 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.app.ability.Want"; + +/** + * This module provides the capability to manage the device info of the enterprise devices. + * @namespace deviceInfo. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @since 9 + */ +declare namespace deviceInfo { + + /** + * Gets the device serial. + * 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. + * @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 getDeviceSerial(admin: Want, callback: AsyncCallback): void; + + /** + * Gets the device serial. + * 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 the getDeviceSerial. + * @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 getDeviceSerial(admin: Want): Promise; +} + +export default deviceInfo; \ No newline at end of file -- Gitee From ab5a24193fea9dd798e3d975b4c24d2d317b3235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E6=98=8E=E6=B8=AF?= Date: Fri, 11 Nov 2022 10:23:42 +0000 Subject: [PATCH 2/2] rename api/@ohos.enterprise.datetimeManager.d.ts to api/@ohos.enterprise.dateTimeManager.d.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡明港 --- ...datetimeManager.d.ts => @ohos.enterprise.dateTimeManager.d.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename api/{@ohos.enterprise.datetimeManager.d.ts => @ohos.enterprise.dateTimeManager.d.ts} (100%) diff --git a/api/@ohos.enterprise.datetimeManager.d.ts b/api/@ohos.enterprise.dateTimeManager.d.ts similarity index 100% rename from api/@ohos.enterprise.datetimeManager.d.ts rename to api/@ohos.enterprise.dateTimeManager.d.ts -- Gitee