From 22f9c35c6f60a6e261d639fa361bd6d02326476c Mon Sep 17 00:00:00 2001 From: guolongfei Date: Wed, 27 Aug 2025 10:54:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E3=80=90=E6=96=B0=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E3=80=91=E6=96=B0=E5=A2=9E=E2=80=9C=E7=A6=81=E6=AD=A2=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=88=86=E8=BA=AB=E7=AD=96=E7=95=A5=E2=80=9D=EF=BC=8C?= =?UTF-8?q?feature=E5=90=8D=E7=A7=B0=E4=B8=BAappClone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: guolongfei --- api/@ohos.enterprise.restrictions.d.ts | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/api/@ohos.enterprise.restrictions.d.ts b/api/@ohos.enterprise.restrictions.d.ts index c86ec62490..9706c443e2 100644 --- a/api/@ohos.enterprise.restrictions.d.ts +++ b/api/@ohos.enterprise.restrictions.d.ts @@ -336,6 +336,25 @@ declare namespace restrictions { * @stagemodelonly * @since 20 */ + /** + * Disallows the specific feature of the device. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * The admin must have the corresponding permission. + * @param { string } feature - feature indicates the specific feature to be disallowed or allowed, + * the supported device features are as follows: + * modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb, wifi, tethering, inactiveUserFreeze, camera, mtpClient, mtpServer, + * globalDrag, externalSdCard, backupAndRestore, notification, mms, sms, remoteDiagnosis, remoteDesk, nfc, privateSpace, vpn, airplaneMode, + * mobileData, maintenanceMode, sambaClient, sambaServer, appClone. + * @param { boolean } disallow - true if disallow the specific feature of device, otherwise false. + * @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 setDisallowedPolicy(admin: Want, feature: string, disallow: boolean): void; /** @@ -393,6 +412,25 @@ declare namespace restrictions { * @stagemodelonly * @since 20 */ + /** + * Queries whether the specific feature of the device is disallowed. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS + * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * If the admin is not empty, it must have the corresponding permission. + * @param { string } feature - feature indicates the specific feature to be queried, + * the supported device features are as follows: + * modifyDateTime, bluetooth, printer, hdc, microphone, fingerprint, usb, wifi, tethering, inactiveUserFreeze, camera, mtpClient, mtpServer, + * globalDrag, externalSdCard, backupAndRestore, notification, mms, sms, remoteDiagnosis, remoteDesk, nfc, privateSpace, vpn, airplaneMode, + * mobileData, maintenanceMode, sambaClient, sambaServer, appClone. + * @returns { boolean } true if the specific feature of device is disallowed, otherwise false. + * @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 getDisallowedPolicy(admin: Want, feature: string): boolean; /** -- Gitee From 6036bc2d9be32cb9b0b801e38ce847ece48b5e54 Mon Sep 17 00:00:00 2001 From: guolongfei Date: Wed, 27 Aug 2025 15:39:23 +0800 Subject: [PATCH 2/3] bugfix Signed-off-by: guolongfei --- api/@ohos.enterprise.restrictions.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.enterprise.restrictions.d.ts b/api/@ohos.enterprise.restrictions.d.ts index 9706c443e2..b1886e584a 100644 --- a/api/@ohos.enterprise.restrictions.d.ts +++ b/api/@ohos.enterprise.restrictions.d.ts @@ -340,7 +340,7 @@ declare namespace restrictions { * Disallows the specific feature of the device. * * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS - * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * @param { Want | null } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. * @param { string } feature - feature indicates the specific feature to be disallowed or allowed, * the supported device features are as follows: @@ -355,7 +355,7 @@ declare namespace restrictions { * @stagemodelonly * @since 21 */ - function setDisallowedPolicy(admin: Want, feature: string, disallow: boolean): void; + function setDisallowedPolicy(admin: Want | null, feature: string, disallow: boolean): void; /** * Queries whether the specific feature of the device is disallowed. @@ -416,7 +416,7 @@ declare namespace restrictions { * Queries whether the specific feature of the device is disallowed. * * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS - * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * @param { Want | null } admin - admin indicates the enterprise admin extension ability information. * If the admin is not empty, it must have the corresponding permission. * @param { string } feature - feature indicates the specific feature to be queried, * the supported device features are as follows: @@ -431,7 +431,7 @@ declare namespace restrictions { * @stagemodelonly * @since 21 */ - function getDisallowedPolicy(admin: Want, feature: string): boolean; + function getDisallowedPolicy(admin: Want | null, feature: string): boolean; /** * Disallows the specific feature of the device for the specified account. -- Gitee From f41f085e91184add241619f8a656f54500690773 Mon Sep 17 00:00:00 2001 From: guolongfei Date: Wed, 27 Aug 2025 16:07:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=85=8D=E5=A5=97=E9=B8=BF=E8=92=99?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=9E=B6=E6=9E=84=E5=B9=B3=E5=8F=B0=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: guolongfei --- api/@ohos.enterprise.restrictions.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.enterprise.restrictions.d.ts b/api/@ohos.enterprise.restrictions.d.ts index b1886e584a..b5a01c8ab4 100644 --- a/api/@ohos.enterprise.restrictions.d.ts +++ b/api/@ohos.enterprise.restrictions.d.ts @@ -317,11 +317,11 @@ declare namespace restrictions { * @stagemodelonly * @since 15 */ - /** + /** * Disallows the specific feature of the device. * * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS - * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * @param { Want | null } admin - admin indicates the enterprise admin extension ability information. * The admin must have the corresponding permission. * @param { string } feature - feature indicates the specific feature to be disallowed or allowed, * the supported device features are as follows: @@ -393,11 +393,11 @@ declare namespace restrictions { * @stagemodelonly * @since 15 */ - /** + /** * Queries whether the specific feature of the device is disallowed. * * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS or ohos.permission.PERSONAL_MANAGE_RESTRICTIONS - * @param { Want } admin - admin indicates the enterprise admin extension ability information. + * @param { Want | null } admin - admin indicates the enterprise admin extension ability information. * If the admin is not empty, it must have the corresponding permission. * @param { string } feature - feature indicates the specific feature to be queried, * the supported device features are as follows: -- Gitee