From 09f790818675cddf0621314615d6d3e79a7e30c5 Mon Sep 17 00:00:00 2001 From: fangyun Date: Thu, 28 Jul 2022 10:54:27 +0800 Subject: [PATCH 1/2] add application management interface Signed-off-by: fangyun --- .../ApplicationManager.d.ts | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 api/enterpriseDeviceManager/ApplicationManager.d.ts diff --git a/api/enterpriseDeviceManager/ApplicationManager.d.ts b/api/enterpriseDeviceManager/ApplicationManager.d.ts new file mode 100644 index 0000000000..36961745f8 --- /dev/null +++ b/api/enterpriseDeviceManager/ApplicationManager.d.ts @@ -0,0 +1,158 @@ +/* + * 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 Want from "./../@ohos.application.want"; + +/** + * @name Offers application software management. + * @since + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + */ +export interface ApplicationManager { + + /** + * Add the disallowed uninstall list of applications. + * + * @since + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param bundles Array of disallowed uninstall applications. + * @param userId Indicates the user ID or do not pass user ID. + * @return {@code true} if add the application to the disallowed uninstall list successfully. + * @permission ohos.permission.EDM_MANAGE_APPLICATION + */ + addDisallowedUninstallBundles(admin: Want, bundles: Array, userId: number, callback: AsyncCallback): void; + addDisallowedUninstallBundles(admin: Want, bundles: Array, callback: AsyncCallback): void; + addDisallowedUninstallBundles(admin: Want, bundles: Array, userId?: number): Promise; + + /** + * Remove the disallowed uninstall list of applications. + * + * @since + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param bundles Array of disallowed uninstall applications. + * @param userId Indicates the user ID or do not pass user ID. + * @return {@code true} if remove the application from the the disallowed uninstall successfully. + * @permission ohos.permission.EDM_MANAGE_APPLICATION + */ + removeDisallowedUninstallBundles(admin: Want, bundles: Array, userId: number, callback: AsyncCallback): void; + removeDisallowedUninstallBundles(admin: Want, bundles: Array, callback: AsyncCallback): void; + removeDisallowedUninstallBundles(admin: Want, bundles: Array, userId?: number): Promise; + + /** + * Get the disallowed uninstall list of applications. + * + * @since + * @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 get the disallowed uninstall list of applications successfully. + * @permission ohos.permission.EDM_MANAGE_APPLICATION + */ + getDisallowedUninstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + getDisallowedUninstallBundles(admin: Want, callback: AsyncCallback>): void; + getDisallowedUninstallBundles(admin: Want, userId?: number): Promise>; + + /** + * Add the allowed install list of applications. + * + * @since + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param packages Array of allowed install applications. + * @param userId Indicates the user ID or do not pass user ID. + * @return {@code true} if add application to the allowed install list successfully. + * @permission ohos.permission.EDM_MANAGE_APPLICATION + */ + addAllowedInstallPackages(admin: Want, packages: Array, userId: number, callback: AsyncCallback): void; + addAllowedInstallPackages(admin: Want, packages: Array, callback: AsyncCallback): void; + addAllowedInstallPackages(admin: Want, packages: Array, userId?: number): Promise; + + /** + * Remove allowed install list of applications. + * + * @since + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param packages Array of allowed install packages. + * @param userId Indicates the user ID or do not pass user ID. + * @return {@code true} if remove the allowed install package successfully. + * @permission ohos.permission.EDM_MANAGE_APPLICATION + */ + removeAllowedInstallPackages(admin: Want, packages: Array, userId: number, callback: AsyncCallback): void; + removeAllowedInstallPackages(admin: Want, packages: Array, callback: AsyncCallback): void; + removeAllowedInstallPackages(admin: Want, packages: Array, userId?: number): Promise; + + /** + * Get allowed install list of applications. + * + * @since + * @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 get the allowed install package successfully. + * @permission ohos.permission.EDM_MANAGE_APPLICATION + */ + getAllowedInstallPackages(admin: Want, userId: number, callback: AsyncCallback>): void; + getAllowedInstallPackages(admin: Want, callback: AsyncCallback>): void; + getAllowedInstallPackages(admin: Want, userId?: number): Promise>; + + /** + * Add stop and disallowed running list of applications. + * + * @since + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param bundles Array of stop and disallowed running applications. + * @param userId Indicates the user ID or do not pass user ID. + * @return {@code true} if add the stop and disallowed running application successfully. + * @permission ohos.permission.EDM_MANAGE_APPLICATION + */ + addStopAndDisallowedRunningBundles(admin: Want, bundles: Array, userId: number, callback: AsyncCallback): void; + addStopAndDisallowedRunningBundles(admin: Want, bundles: Array, callback: AsyncCallback): void; + addStopAndDisallowedRunningBundles(admin: Want, bundles: Array, userId?: number): Promise; + + /** + * Remove stop and disallowed running list of applications. + * + * @since + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @param admin Indicates the administrator ability information. + * @param bundles Array of stop and disallowed running applications. + * @param userId Indicates the user ID or do not pass user ID. + * @return {@code true} if remove the stop and disallowed running application successfully. + * @permission ohos.permission.EDM_MANAGE_APPLICATION + */ + removeStopAndDisallowedRunningBundles(admin: Want, bundles: Array, userId: number, callback: AsyncCallback): void; + removeStopAndDisallowedRunningBundles(admin: Want, bundles: Array, callback: AsyncCallback): void; + removeStopAndDisallowedRunningBundles(admin: Want, bundles: Array, userId?: number): Promise; + + /** + * Get stop and disallowed running list of applications. + * + * @since + * @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 get the stop and disallowed running application successfully. + * @permission ohos.permission.EDM_MANAGE_APPLICATION + */ + getStopAndDisallowedRunningBundles(admin: Want, userId: number, callback: AsyncCallback>): void; + getStopAndDisallowedRunningBundles(admin: Want, callback: AsyncCallback>): void; + getStopAndDisallowedRunningBundles(admin: Want, userId?: number): Promise>; + +} \ No newline at end of file -- Gitee From 9ded5abb088dfd6df5dedc1bcc8badaf1789bd26 Mon Sep 17 00:00:00 2001 From: fangyun Date: Wed, 24 Aug 2022 16:27:58 +0800 Subject: [PATCH 2/2] export second level interface Signed-off-by: fangyun --- api/@ohos.enterpriseDeviceManager.d.ts | 9 +- .../ApplicationManager.d.ts | 158 ------------------ 2 files changed, 8 insertions(+), 159 deletions(-) delete mode 100644 api/enterpriseDeviceManager/ApplicationManager.d.ts diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterpriseDeviceManager.d.ts index db9a787976..48b9ac5a8a 100644 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ b/api/@ohos.enterpriseDeviceManager.d.ts @@ -14,7 +14,7 @@ */ import { AsyncCallback, Callback } from "./basic"; -import { DeviceSettingsManager } from "./enterpriseDeviceManager/DeviceSettingsManager"; +import { DeviceSettingsManager as _DeviceSettingsManager } from "./enterpriseDeviceManager/DeviceSettingsManager"; import Want from "./@ohos.application.want"; /** @@ -35,6 +35,13 @@ declare namespace enterpriseDeviceManager { description: string; } + /** + * @name DeviceSettingsManager + * @since 9 + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + */ + export type DeviceSettingsManager = _DeviceSettingsManager + /** * @name AdminType * @since 9 diff --git a/api/enterpriseDeviceManager/ApplicationManager.d.ts b/api/enterpriseDeviceManager/ApplicationManager.d.ts deleted file mode 100644 index 36961745f8..0000000000 --- a/api/enterpriseDeviceManager/ApplicationManager.d.ts +++ /dev/null @@ -1,158 +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 Want from "./../@ohos.application.want"; - -/** - * @name Offers application software management. - * @since - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ -export interface ApplicationManager { - - /** - * Add the disallowed uninstall list of applications. - * - * @since - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param bundles Array of disallowed uninstall applications. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if add the application to the disallowed uninstall list successfully. - * @permission ohos.permission.EDM_MANAGE_APPLICATION - */ - addDisallowedUninstallBundles(admin: Want, bundles: Array, userId: number, callback: AsyncCallback): void; - addDisallowedUninstallBundles(admin: Want, bundles: Array, callback: AsyncCallback): void; - addDisallowedUninstallBundles(admin: Want, bundles: Array, userId?: number): Promise; - - /** - * Remove the disallowed uninstall list of applications. - * - * @since - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param bundles Array of disallowed uninstall applications. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if remove the application from the the disallowed uninstall successfully. - * @permission ohos.permission.EDM_MANAGE_APPLICATION - */ - removeDisallowedUninstallBundles(admin: Want, bundles: Array, userId: number, callback: AsyncCallback): void; - removeDisallowedUninstallBundles(admin: Want, bundles: Array, callback: AsyncCallback): void; - removeDisallowedUninstallBundles(admin: Want, bundles: Array, userId?: number): Promise; - - /** - * Get the disallowed uninstall list of applications. - * - * @since - * @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 get the disallowed uninstall list of applications successfully. - * @permission ohos.permission.EDM_MANAGE_APPLICATION - */ - getDisallowedUninstallBundles(admin: Want, userId: number, callback: AsyncCallback>): void; - getDisallowedUninstallBundles(admin: Want, callback: AsyncCallback>): void; - getDisallowedUninstallBundles(admin: Want, userId?: number): Promise>; - - /** - * Add the allowed install list of applications. - * - * @since - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param packages Array of allowed install applications. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if add application to the allowed install list successfully. - * @permission ohos.permission.EDM_MANAGE_APPLICATION - */ - addAllowedInstallPackages(admin: Want, packages: Array, userId: number, callback: AsyncCallback): void; - addAllowedInstallPackages(admin: Want, packages: Array, callback: AsyncCallback): void; - addAllowedInstallPackages(admin: Want, packages: Array, userId?: number): Promise; - - /** - * Remove allowed install list of applications. - * - * @since - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param packages Array of allowed install packages. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if remove the allowed install package successfully. - * @permission ohos.permission.EDM_MANAGE_APPLICATION - */ - removeAllowedInstallPackages(admin: Want, packages: Array, userId: number, callback: AsyncCallback): void; - removeAllowedInstallPackages(admin: Want, packages: Array, callback: AsyncCallback): void; - removeAllowedInstallPackages(admin: Want, packages: Array, userId?: number): Promise; - - /** - * Get allowed install list of applications. - * - * @since - * @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 get the allowed install package successfully. - * @permission ohos.permission.EDM_MANAGE_APPLICATION - */ - getAllowedInstallPackages(admin: Want, userId: number, callback: AsyncCallback>): void; - getAllowedInstallPackages(admin: Want, callback: AsyncCallback>): void; - getAllowedInstallPackages(admin: Want, userId?: number): Promise>; - - /** - * Add stop and disallowed running list of applications. - * - * @since - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param bundles Array of stop and disallowed running applications. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if add the stop and disallowed running application successfully. - * @permission ohos.permission.EDM_MANAGE_APPLICATION - */ - addStopAndDisallowedRunningBundles(admin: Want, bundles: Array, userId: number, callback: AsyncCallback): void; - addStopAndDisallowedRunningBundles(admin: Want, bundles: Array, callback: AsyncCallback): void; - addStopAndDisallowedRunningBundles(admin: Want, bundles: Array, userId?: number): Promise; - - /** - * Remove stop and disallowed running list of applications. - * - * @since - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @param admin Indicates the administrator ability information. - * @param bundles Array of stop and disallowed running applications. - * @param userId Indicates the user ID or do not pass user ID. - * @return {@code true} if remove the stop and disallowed running application successfully. - * @permission ohos.permission.EDM_MANAGE_APPLICATION - */ - removeStopAndDisallowedRunningBundles(admin: Want, bundles: Array, userId: number, callback: AsyncCallback): void; - removeStopAndDisallowedRunningBundles(admin: Want, bundles: Array, callback: AsyncCallback): void; - removeStopAndDisallowedRunningBundles(admin: Want, bundles: Array, userId?: number): Promise; - - /** - * Get stop and disallowed running list of applications. - * - * @since - * @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 get the stop and disallowed running application successfully. - * @permission ohos.permission.EDM_MANAGE_APPLICATION - */ - getStopAndDisallowedRunningBundles(admin: Want, userId: number, callback: AsyncCallback>): void; - getStopAndDisallowedRunningBundles(admin: Want, callback: AsyncCallback>): void; - getStopAndDisallowedRunningBundles(admin: Want, userId?: number): Promise>; - -} \ No newline at end of file -- Gitee