From f5fa860cb5ad12014829fbc95a28964b4613deeb Mon Sep 17 00:00:00 2001 From: hanKF Date: Tue, 17 Jun 2025 08:17:48 +0000 Subject: [PATCH 1/2] =?UTF-8?q?mdm=E8=87=AA=E5=90=AF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hanKF --- api/@ohos.enterprise.applicationManager.d.ts | 84 ++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/api/@ohos.enterprise.applicationManager.d.ts b/api/@ohos.enterprise.applicationManager.d.ts index 612c6d0cce..5917e736dd 100644 --- a/api/@ohos.enterprise.applicationManager.d.ts +++ b/api/@ohos.enterprise.applicationManager.d.ts @@ -319,6 +319,28 @@ declare namespace applicationManager { */ function addAutoStartApps(admin: Want, autoStartApps: Array): void; + /** + * Adds auto start applications which are not allowed to modify their auto start settings. + * 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 } autoStartApps - autoStartApps indicates the information of auto start app ability. + * The bundleName and abilityName of the want cannot be non-exist. + * The size of the array after setting cannot be greater than 10. + * @param { number } accountId - accountId indicates the local ID of the OS account. + * @param { boolean } disallowModify - disallowModify specifies whether the applications are + * disallowed to modify their auto start setting. + * @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 20 + */ + function addAutoStartApps(admin: Want, autoStartApps: Array, accountId: number, disallowModify: boolean): void; + /** * Removes auto start applications. * This function can be called by a super administrator. @@ -340,6 +362,28 @@ declare namespace applicationManager { */ function removeAutoStartApps(admin: Want, autoStartApps: Array): void; + /** + * Removes auto start applications. + * 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 } autoStartApps - autoStartApps indicates the information of auto start app ability. + * The bundleName and abilityName of the want cannot be non-exist. + * The size of the array after setting cannot be greater 10. + * @param { number } accountId - accountId indicates the local ID of the OS account. + * @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. + * @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 20 + */ + function removeAutoStartApps(admin: Want, autoStartApps: Array, accountId: number): void; + /** * Gets information of auto start applications. * This function can be called by a super administrator. @@ -359,6 +403,46 @@ declare namespace applicationManager { */ function getAutoStartApps(admin: Want): Array; + /** + * Gets information of auto start applications. + * 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 local ID of the OS account. + * @returns { Array } the information of auto start applications. + * @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. + * @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 20 + */ + function getAutoStartApps(admin: Want, accountId: number): Array; + + /** + * Checks whether the specified application is allowed to modify its auto start setting. + * 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 { Want } autoStartApp - autoStartApp indicates the information of auto start app ability to be checked. + * The bundleName and abilityName of the want cannot be non-exist. + * @param { number } accountId - accountId indicates the local ID of the OS account. + * @returns { boolean } true indicates the application is not allowed to modify its auto start setting. + * @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 20 + */ + function isModifyAutoStartAppsDisallowed(admin: Want, autoStartApp: Want, accountId: number): boolean; + /** * Adds the keep alive applications. * This function can be called by a super administrator. -- Gitee From ca38a0c6773356c6b6d53f942fa096f47691f423 Mon Sep 17 00:00:00 2001 From: hanKF Date: Wed, 18 Jun 2025 02:56:16 +0000 Subject: [PATCH 2/2] update api/@ohos.enterprise.applicationManager.d.ts. Signed-off-by: hanKF --- api/@ohos.enterprise.applicationManager.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/api/@ohos.enterprise.applicationManager.d.ts b/api/@ohos.enterprise.applicationManager.d.ts index 5917e736dd..b35e84490d 100644 --- a/api/@ohos.enterprise.applicationManager.d.ts +++ b/api/@ohos.enterprise.applicationManager.d.ts @@ -376,8 +376,6 @@ declare namespace applicationManager { * @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. - * @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 20 @@ -415,8 +413,6 @@ declare namespace applicationManager { * @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. - * @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 20 -- Gitee