From 3b63db3f579f71d184435e0e0f14259f359e3d35 Mon Sep 17 00:00:00 2001 From: hwyaobaohua Date: Tue, 19 Aug 2025 15:35:12 +0800 Subject: [PATCH] allowed running sdk Signed-off-by: hwyaobaohua --- api/@ohos.enterprise.applicationManager.d.ts | 147 +++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/api/@ohos.enterprise.applicationManager.d.ts b/api/@ohos.enterprise.applicationManager.d.ts index b34897a51b..413eb5a191 100644 --- a/api/@ohos.enterprise.applicationManager.d.ts +++ b/api/@ohos.enterprise.applicationManager.d.ts @@ -78,6 +78,28 @@ declare namespace applicationManager { * @StageModelOnly * @since 10 */ + /** + * Add appid list of bundles that is disallowed to run in the device. + * This function can be called by a super administrator. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle are disallowed to run. The size of the array after setting + * cannot be greater than 200. + * @param { AsyncCallback } callback - the callback of addDisallowedRunningBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 9200010 - A conflict policy has been configured. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 21 + */ function addDisallowedRunningBundles(admin: Want, appIds: Array, callback: AsyncCallback): void; /** @@ -102,6 +124,29 @@ declare namespace applicationManager { * @StageModelOnly * @since 10 */ + /** + * Add appid list of bundles that is disallowed to run in the device. + * This function can be called by a super administrator. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle are disallowed to run. The size of the array after setting + * cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @param { AsyncCallback } callback - the callback of addDisallowedRunningBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 9200010 - A conflict policy has been configured. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 21 + */ function addDisallowedRunningBundles(admin: Want, appIds: Array, userId: number, callback: AsyncCallback): void; /** @@ -125,6 +170,29 @@ declare namespace applicationManager { * @systemapi * @StageModelOnly * @since 10 + */ + /** + * Add appid list of bundles that is disallowed to run in the device. + * This function can be called by a super administrator. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle are disallowed to run. The size of the array after setting + * cannot be greater than 200. + * @param { number } userId - userId indicates the user ID. + * @returns { Promise } the promise returned by the addDisallowedRunningBundles. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 9200010 - A conflict policy has been configured. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 21 */ function addDisallowedRunningBundles(admin: Want, appIds: Array, userId?: number): Promise; @@ -147,6 +215,26 @@ declare namespace applicationManager { * @StageModelOnly * @since 12 */ + /** + * Add appid list of bundles that is disallowed to run in the device. + * This function can be called by a super administrator. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIds - ids of the bundle are disallowed to run. The size of the array after setting + * cannot be greater than 200. + * @param { number } [accountId] - accountId indicates the account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 9200010 - A conflict policy has been configured. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 21 + */ function addDisallowedRunningBundlesSync(admin: Want, appIds: Array, accountId?: number): void; /** @@ -662,6 +750,65 @@ declare namespace applicationManager { * @since 20 */ function setKioskFeatures(admin: Want, features: Array): void; + + /** + * Add appidentify list of bundles that is allowed to run in the device. + * This function can be called by a super administrator. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIdentifiers - appIdentifiers of the bundle are allowed to run. + * The size of the array after setting cannot be greater than 200. + * @param { number } accountId - accountId indicates the account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 9200010 - A conflict policy has been configured. + * @throws { BusinessError } 9200012 - Parameter verification failed. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 21 + */ + function addAllowedRunningBundles(admin: Want, appIdentifiers: Array, accountId: number): void; + + /** + * Remove appidentify list of bundles that is allowed to run in the device. + * This function can be called by a super administrator. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { Array } appIdentifiers - appIdentifiers of the bundle are allowed to run. + * The size of the array after setting cannot be greater than 200. + * @param { number } accountId - accountId indicates the account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 9200012 - Parameter verification failed. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 21 + */ + function removeAllowedRunningBundles(admin: Want, appIdentifiers: Array, accountId: number): void; + + /** + * Get appIdentify list of bundles that is allowed to run in the device. + * This function can be called by a super administrator. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_APPLICATION + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { number } accountId - accountId indicates the account ID. + * @returns { Array } appIdentifiers of the bundle are allowed to run. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 21 + */ + function getAllowedRunningBundles(admin: Want, accountId: number): Array; } export default applicationManager; \ No newline at end of file -- Gitee