1e41f4b71Sopenharmony_ci# @ohos.enterprise.adminManager (Enterprise Device Management) (System API) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **adminManager** module provides enterprise device management capabilities so that devices have the custom capabilities required in enterprise settings. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci> 9e41f4b71Sopenharmony_ci> - The APIs of this module are available only to [device administrator applications](../../mdm/mdm-kit-guide.md#introduction). 10e41f4b71Sopenharmony_ci> 11e41f4b71Sopenharmony_ci> - This topic describes only the system APIs provided by the module. For details about its public APIs, see [@ohos.enterprise.adminManager](js-apis-enterprise-adminManager.md). 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci## Modules to Import 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci```ts 16e41f4b71Sopenharmony_ciimport { adminManager } from '@kit.MDMKit'; 17e41f4b71Sopenharmony_ci``` 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci## adminManager.enableAdmin 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_cienableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback\<void>): void 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ciEnables a device administrator application for the current user. The super device administrator application can be activated only by the administrator. This API uses an asynchronous callback to return the result. 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci**Parameters** 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 36e41f4b71Sopenharmony_ci| -------------- | ----------------------------------- | ---- | ------------------ | 37e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application to enable. | 38e41f4b71Sopenharmony_ci| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information of the device administrator application. | 39e41f4b71Sopenharmony_ci| type | [AdminType](#admintype) | Yes | Type of the device administrator application to enable. | 40e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci**Error codes** 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci| ID| Error Message | 47e41f4b71Sopenharmony_ci| ------- | --------------------------------------------------------------- | 48e41f4b71Sopenharmony_ci| 9200003 | The administrator ability component is invalid. | 49e41f4b71Sopenharmony_ci| 9200004 | Failed to activate the administrator application of the device. | 50e41f4b71Sopenharmony_ci| 9200007 | The system ability works abnormally. | 51e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 52e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 53e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci**Example** 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ci```ts 58e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 59e41f4b71Sopenharmony_cilet wantTemp: Want = { 60e41f4b71Sopenharmony_ci bundleName: 'com.example.myapplication', 61e41f4b71Sopenharmony_ci abilityName: 'EntryAbility', 62e41f4b71Sopenharmony_ci}; 63e41f4b71Sopenharmony_cilet enterpriseInfo: adminManager.EnterpriseInfo = { 64e41f4b71Sopenharmony_ci name: 'enterprise name', 65e41f4b71Sopenharmony_ci description: 'enterprise description' 66e41f4b71Sopenharmony_ci} 67e41f4b71Sopenharmony_ci 68e41f4b71Sopenharmony_ciadminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_TYPE_SUPER, (err) => { 69e41f4b71Sopenharmony_ci if (err) { 70e41f4b71Sopenharmony_ci console.error(`Failed to enable admin. Code: ${err.code}, message: ${err.message}`); 71e41f4b71Sopenharmony_ci return; 72e41f4b71Sopenharmony_ci } 73e41f4b71Sopenharmony_ci console.info('Succeeded in enabling admin'); 74e41f4b71Sopenharmony_ci}); 75e41f4b71Sopenharmony_ci``` 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ci## adminManager.enableAdmin 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_cienableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback\<void>): void 80e41f4b71Sopenharmony_ci 81e41f4b71Sopenharmony_ciEnables a device administrator application for the specified user. The super device administrator application can be activated only by the administrator. This API uses an asynchronous callback to return the result. 82e41f4b71Sopenharmony_ci 83e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ci**Parameters** 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 94e41f4b71Sopenharmony_ci| -------------- | ----------------------------------- | ---- | ---------------------------- | 95e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application to enable. | 96e41f4b71Sopenharmony_ci| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information of the device administrator application. | 97e41f4b71Sopenharmony_ci| type | [AdminType](#admintype) | Yes | Type of the device administrator application to enable. | 98e41f4b71Sopenharmony_ci| userId | number | Yes | User ID, which must be greater than or equal to 0.<br>The default value is the user ID of the caller. | 99e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. | 100e41f4b71Sopenharmony_ci 101e41f4b71Sopenharmony_ci**Error codes** 102e41f4b71Sopenharmony_ci 103e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 104e41f4b71Sopenharmony_ci 105e41f4b71Sopenharmony_ci| ID| Error Message | 106e41f4b71Sopenharmony_ci| ------- | --------------------------------------------------------------- | 107e41f4b71Sopenharmony_ci| 9200003 | The administrator ability component is invalid. | 108e41f4b71Sopenharmony_ci| 9200004 | Failed to activate the administrator application of the device. | 109e41f4b71Sopenharmony_ci| 9200007 | The system ability works abnormally. | 110e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 111e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 112e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_ci**Example** 115e41f4b71Sopenharmony_ci 116e41f4b71Sopenharmony_ci```ts 117e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 118e41f4b71Sopenharmony_cilet wantTemp: Want = { 119e41f4b71Sopenharmony_ci bundleName: 'com.example.myapplication', 120e41f4b71Sopenharmony_ci abilityName: 'EntryAbility', 121e41f4b71Sopenharmony_ci}; 122e41f4b71Sopenharmony_cilet enterpriseInfo: adminManager.EnterpriseInfo = { 123e41f4b71Sopenharmony_ci name: 'enterprise name', 124e41f4b71Sopenharmony_ci description: 'enterprise description' 125e41f4b71Sopenharmony_ci} 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ciadminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_TYPE_NORMAL, 100, (err) => { 128e41f4b71Sopenharmony_ci if (err) { 129e41f4b71Sopenharmony_ci console.error(`Failed to enable admin. Code: ${err.code}, message: ${err.message}`); 130e41f4b71Sopenharmony_ci return; 131e41f4b71Sopenharmony_ci } 132e41f4b71Sopenharmony_ci console.info('Succeeded in enabling admin'); 133e41f4b71Sopenharmony_ci}); 134e41f4b71Sopenharmony_ci``` 135e41f4b71Sopenharmony_ci 136e41f4b71Sopenharmony_ci## adminManager.enableAdmin 137e41f4b71Sopenharmony_ci 138e41f4b71Sopenharmony_cienableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise\<void> 139e41f4b71Sopenharmony_ci 140e41f4b71Sopenharmony_ciEnables a device administrator application for the current or specified user. The super device administrator application can be activated only by the administrator. This API uses a promise to return the result. 141e41f4b71Sopenharmony_ci 142e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 143e41f4b71Sopenharmony_ci 144e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 145e41f4b71Sopenharmony_ci 146e41f4b71Sopenharmony_ci 147e41f4b71Sopenharmony_ci 148e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 149e41f4b71Sopenharmony_ci 150e41f4b71Sopenharmony_ci**Parameters** 151e41f4b71Sopenharmony_ci 152e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 153e41f4b71Sopenharmony_ci| -------------- | ----------------------------------- | ---- | ---------------------------- | 154e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application to enable. | 155e41f4b71Sopenharmony_ci| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information of the device administrator application. | 156e41f4b71Sopenharmony_ci| type | [AdminType](#admintype) | Yes | Type of the device administrator application to enable. | 157e41f4b71Sopenharmony_ci| userId | number | No | User ID, which must be greater than or equal to 0.<br>- If **userId** is passed in, this API applies to the specified user.<br>- If **userId** is not passed in, this API applies to the current user.| 158e41f4b71Sopenharmony_ci 159e41f4b71Sopenharmony_ci**Return value** 160e41f4b71Sopenharmony_ci 161e41f4b71Sopenharmony_ci| Type | Description | 162e41f4b71Sopenharmony_ci| ----------------- | ----------------- | 163e41f4b71Sopenharmony_ci| Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.| 164e41f4b71Sopenharmony_ci 165e41f4b71Sopenharmony_ci**Error codes** 166e41f4b71Sopenharmony_ci 167e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 168e41f4b71Sopenharmony_ci 169e41f4b71Sopenharmony_ci| ID| Error Message | 170e41f4b71Sopenharmony_ci| ------- | --------------------------------------------------------------- | 171e41f4b71Sopenharmony_ci| 9200003 | The administrator ability component is invalid. | 172e41f4b71Sopenharmony_ci| 9200004 | Failed to activate the administrator application of the device. | 173e41f4b71Sopenharmony_ci| 9200007 | The system ability works abnormally. | 174e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 175e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 176e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 177e41f4b71Sopenharmony_ci 178e41f4b71Sopenharmony_ci**Example** 179e41f4b71Sopenharmony_ci 180e41f4b71Sopenharmony_ci```ts 181e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 182e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 183e41f4b71Sopenharmony_cilet wantTemp: Want = { 184e41f4b71Sopenharmony_ci bundleName: 'com.example.myapplication', 185e41f4b71Sopenharmony_ci abilityName: 'EntryAbility', 186e41f4b71Sopenharmony_ci}; 187e41f4b71Sopenharmony_cilet enterpriseInfo: adminManager.EnterpriseInfo = { 188e41f4b71Sopenharmony_ci name: 'enterprise name', 189e41f4b71Sopenharmony_ci description: 'enterprise description' 190e41f4b71Sopenharmony_ci} 191e41f4b71Sopenharmony_ci 192e41f4b71Sopenharmony_ciadminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_TYPE_NORMAL, 100).catch( 193e41f4b71Sopenharmony_ci (err: BusinessError) => { 194e41f4b71Sopenharmony_ci console.error(`Failed to enable admin. Code: ${err.code}, message: ${err.message}`); 195e41f4b71Sopenharmony_ci }); 196e41f4b71Sopenharmony_ci``` 197e41f4b71Sopenharmony_ci 198e41f4b71Sopenharmony_ci## adminManager.disableAdmin 199e41f4b71Sopenharmony_ci 200e41f4b71Sopenharmony_cidisableAdmin(admin: Want, callback: AsyncCallback\<void>): void 201e41f4b71Sopenharmony_ci 202e41f4b71Sopenharmony_ciDisables a common administrator application for the current user. This API uses an asynchronous callback to return the result. 203e41f4b71Sopenharmony_ci 204e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 205e41f4b71Sopenharmony_ci 206e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 207e41f4b71Sopenharmony_ci 208e41f4b71Sopenharmony_ci 209e41f4b71Sopenharmony_ci 210e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 211e41f4b71Sopenharmony_ci 212e41f4b71Sopenharmony_ci**Parameters** 213e41f4b71Sopenharmony_ci 214e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 215e41f4b71Sopenharmony_ci| -------- | ----------------------------------- | ---- | ------------------- | 216e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Common administrator application to disable. | 217e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_ci**Error codes** 220e41f4b71Sopenharmony_ci 221e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 222e41f4b71Sopenharmony_ci 223e41f4b71Sopenharmony_ci| ID| Error Message | 224e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------------------- | 225e41f4b71Sopenharmony_ci| 9200005 | Failed to deactivate the administrator application of the device. | 226e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 227e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 228e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 229e41f4b71Sopenharmony_ci 230e41f4b71Sopenharmony_ci**Example** 231e41f4b71Sopenharmony_ci 232e41f4b71Sopenharmony_ci```ts 233e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 234e41f4b71Sopenharmony_cilet wantTemp: Want = { 235e41f4b71Sopenharmony_ci bundleName: 'bundleName', 236e41f4b71Sopenharmony_ci abilityName: 'abilityName', 237e41f4b71Sopenharmony_ci}; 238e41f4b71Sopenharmony_ci 239e41f4b71Sopenharmony_ciadminManager.disableAdmin(wantTemp, (err) => { 240e41f4b71Sopenharmony_ci if (err) { 241e41f4b71Sopenharmony_ci console.error(`Failed to disable admin. Code: ${err.code}, message: ${err.message}`); 242e41f4b71Sopenharmony_ci return; 243e41f4b71Sopenharmony_ci } 244e41f4b71Sopenharmony_ci console.info('Succeeded in disabling admin'); 245e41f4b71Sopenharmony_ci}); 246e41f4b71Sopenharmony_ci``` 247e41f4b71Sopenharmony_ci 248e41f4b71Sopenharmony_ci## adminManager.disableAdmin 249e41f4b71Sopenharmony_ci 250e41f4b71Sopenharmony_cidisableAdmin(admin: Want, userId: number, callback: AsyncCallback\<void>): void 251e41f4b71Sopenharmony_ci 252e41f4b71Sopenharmony_ciDisables a common administrator application for the specified user. This API uses an asynchronous callback to return the result. 253e41f4b71Sopenharmony_ci 254e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 255e41f4b71Sopenharmony_ci 256e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 257e41f4b71Sopenharmony_ci 258e41f4b71Sopenharmony_ci 259e41f4b71Sopenharmony_ci 260e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 261e41f4b71Sopenharmony_ci 262e41f4b71Sopenharmony_ci**Parameters** 263e41f4b71Sopenharmony_ci 264e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 265e41f4b71Sopenharmony_ci| -------- | ----------------------------------- | ---- | ---------------------------- | 266e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Common administrator application to disable. | 267e41f4b71Sopenharmony_ci| userId | number | Yes | User ID, which must be greater than or equal to 0.<br>The default value is the user ID of the caller. | 268e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. | 269e41f4b71Sopenharmony_ci 270e41f4b71Sopenharmony_ci**Error codes** 271e41f4b71Sopenharmony_ci 272e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 273e41f4b71Sopenharmony_ci 274e41f4b71Sopenharmony_ci| ID| Error Message | 275e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------------------- | 276e41f4b71Sopenharmony_ci| 9200005 | Failed to deactivate the administrator application of the device. | 277e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 278e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 279e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 280e41f4b71Sopenharmony_ci 281e41f4b71Sopenharmony_ci**Example** 282e41f4b71Sopenharmony_ci 283e41f4b71Sopenharmony_ci```ts 284e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 285e41f4b71Sopenharmony_cilet wantTemp: Want = { 286e41f4b71Sopenharmony_ci bundleName: 'bundleName', 287e41f4b71Sopenharmony_ci abilityName: 'abilityName', 288e41f4b71Sopenharmony_ci}; 289e41f4b71Sopenharmony_ci 290e41f4b71Sopenharmony_ciadminManager.disableAdmin(wantTemp, 100, (err) => { 291e41f4b71Sopenharmony_ci if (err) { 292e41f4b71Sopenharmony_ci console.error(`Failed to disable admin. Code: ${err.code}, message: ${err.message}`); 293e41f4b71Sopenharmony_ci return; 294e41f4b71Sopenharmony_ci } 295e41f4b71Sopenharmony_ci console.info('Succeeded in disabling admin'); 296e41f4b71Sopenharmony_ci}); 297e41f4b71Sopenharmony_ci``` 298e41f4b71Sopenharmony_ci 299e41f4b71Sopenharmony_ci## adminManager.disableSuperAdmin 300e41f4b71Sopenharmony_ci 301e41f4b71Sopenharmony_cidisableSuperAdmin(bundleName: String, callback: AsyncCallback\<void>): void 302e41f4b71Sopenharmony_ci 303e41f4b71Sopenharmony_ciDisables a super administrator application for the administrator based on **bundleName**. This API uses an asynchronous callback to return the result. 304e41f4b71Sopenharmony_ci 305e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 306e41f4b71Sopenharmony_ci 307e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 308e41f4b71Sopenharmony_ci 309e41f4b71Sopenharmony_ci 310e41f4b71Sopenharmony_ci 311e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 312e41f4b71Sopenharmony_ci 313e41f4b71Sopenharmony_ci**Parameters** 314e41f4b71Sopenharmony_ci 315e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 316e41f4b71Sopenharmony_ci| ---------- | ----------------------- | ---- | ------------------- | 317e41f4b71Sopenharmony_ci| bundleName | String | Yes | Bundle name of the super administrator application to disable. | 318e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| 319e41f4b71Sopenharmony_ci 320e41f4b71Sopenharmony_ci**Error codes** 321e41f4b71Sopenharmony_ci 322e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 323e41f4b71Sopenharmony_ci 324e41f4b71Sopenharmony_ci| ID| Error Message | 325e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------------------- | 326e41f4b71Sopenharmony_ci| 9200005 | Failed to deactivate the administrator application of the device. | 327e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 328e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 329e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 330e41f4b71Sopenharmony_ci 331e41f4b71Sopenharmony_ci**Example** 332e41f4b71Sopenharmony_ci 333e41f4b71Sopenharmony_ci```ts 334e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 335e41f4b71Sopenharmony_cilet bundleName: string = 'com.example.myapplication'; 336e41f4b71Sopenharmony_ci 337e41f4b71Sopenharmony_ciadminManager.disableSuperAdmin(bundleName, (err) => { 338e41f4b71Sopenharmony_ci if (err) { 339e41f4b71Sopenharmony_ci console.error(`Failed to disable super admin. Code: ${err.code}, message: ${err.message}`); 340e41f4b71Sopenharmony_ci return; 341e41f4b71Sopenharmony_ci } 342e41f4b71Sopenharmony_ci console.info('Succeeded in disabling super admin'); 343e41f4b71Sopenharmony_ci}); 344e41f4b71Sopenharmony_ci``` 345e41f4b71Sopenharmony_ci 346e41f4b71Sopenharmony_ci## adminManager.disableSuperAdmin 347e41f4b71Sopenharmony_ci 348e41f4b71Sopenharmony_cidisableSuperAdmin(bundleName: String): Promise\<void> 349e41f4b71Sopenharmony_ci 350e41f4b71Sopenharmony_ciDisables a super administrator application for the administrator based on **bundleName**. This API uses a promise to return the result. 351e41f4b71Sopenharmony_ci 352e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 353e41f4b71Sopenharmony_ci 354e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 355e41f4b71Sopenharmony_ci 356e41f4b71Sopenharmony_ci 357e41f4b71Sopenharmony_ci 358e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 359e41f4b71Sopenharmony_ci 360e41f4b71Sopenharmony_ci**Parameters** 361e41f4b71Sopenharmony_ci 362e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 363e41f4b71Sopenharmony_ci| ---------- | ------ | ---- | ------------ | 364e41f4b71Sopenharmony_ci| bundleName | String | Yes | Bundle name of the super administrator application to disable.| 365e41f4b71Sopenharmony_ci 366e41f4b71Sopenharmony_ci**Return value** 367e41f4b71Sopenharmony_ci 368e41f4b71Sopenharmony_ci| Type | Description | 369e41f4b71Sopenharmony_ci| ----------------- | ----------------- | 370e41f4b71Sopenharmony_ci| Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.| 371e41f4b71Sopenharmony_ci 372e41f4b71Sopenharmony_ci**Error codes** 373e41f4b71Sopenharmony_ci 374e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 375e41f4b71Sopenharmony_ci 376e41f4b71Sopenharmony_ci| ID| Error Message | 377e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------------------- | 378e41f4b71Sopenharmony_ci| 9200005 | Failed to deactivate the administrator application of the device. | 379e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 380e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 381e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 382e41f4b71Sopenharmony_ci 383e41f4b71Sopenharmony_ci**Example** 384e41f4b71Sopenharmony_ci 385e41f4b71Sopenharmony_ci```ts 386e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 387e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 388e41f4b71Sopenharmony_cilet bundleName: string = 'com.example.myapplication'; 389e41f4b71Sopenharmony_ci 390e41f4b71Sopenharmony_ciadminManager.disableSuperAdmin(bundleName).catch((err: BusinessError) => { 391e41f4b71Sopenharmony_ci console.error(`Failed to disable super admin. Code: ${err.code}, message: ${err.message}`); 392e41f4b71Sopenharmony_ci}); 393e41f4b71Sopenharmony_ci``` 394e41f4b71Sopenharmony_ci 395e41f4b71Sopenharmony_ci## adminManager.isAdminEnabled 396e41f4b71Sopenharmony_ci 397e41f4b71Sopenharmony_ciisAdminEnabled(admin: Want, callback: AsyncCallback\<boolean>): void 398e41f4b71Sopenharmony_ci 399e41f4b71Sopenharmony_ciChecks whether a device administrator application of the current user is enabled. This API uses an asynchronous callback to return the result. 400e41f4b71Sopenharmony_ci 401e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 402e41f4b71Sopenharmony_ci 403e41f4b71Sopenharmony_ci 404e41f4b71Sopenharmony_ci 405e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 406e41f4b71Sopenharmony_ci 407e41f4b71Sopenharmony_ci**Parameters** 408e41f4b71Sopenharmony_ci 409e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 410e41f4b71Sopenharmony_ci| -------- | ----------------------------------- | ---- | -------------------- | 411e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application to check. | 412e41f4b71Sopenharmony_ci| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is a Boolean value (**true** means that the device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object.| 413e41f4b71Sopenharmony_ci 414e41f4b71Sopenharmony_ci**Error codes** 415e41f4b71Sopenharmony_ci 416e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 417e41f4b71Sopenharmony_ci 418e41f4b71Sopenharmony_ci| ID| Error Message | 419e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | 420e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 421e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. | 422e41f4b71Sopenharmony_ci 423e41f4b71Sopenharmony_ci**Example** 424e41f4b71Sopenharmony_ci 425e41f4b71Sopenharmony_ci```ts 426e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 427e41f4b71Sopenharmony_cilet wantTemp: Want = { 428e41f4b71Sopenharmony_ci bundleName: 'bundleName', 429e41f4b71Sopenharmony_ci abilityName: 'abilityName', 430e41f4b71Sopenharmony_ci}; 431e41f4b71Sopenharmony_ci 432e41f4b71Sopenharmony_ciadminManager.isAdminEnabled(wantTemp, (err, result) => { 433e41f4b71Sopenharmony_ci if (err) { 434e41f4b71Sopenharmony_ci console.error(`Failed to query admin is enabled or not. Code: ${err.code}, message: ${err.message}`); 435e41f4b71Sopenharmony_ci return; 436e41f4b71Sopenharmony_ci } 437e41f4b71Sopenharmony_ci console.info(`Succeeded in querying admin is enabled or not, result : ${result}`); 438e41f4b71Sopenharmony_ci}); 439e41f4b71Sopenharmony_ci``` 440e41f4b71Sopenharmony_ci 441e41f4b71Sopenharmony_ci## adminManager.isAdminEnabled 442e41f4b71Sopenharmony_ci 443e41f4b71Sopenharmony_ciisAdminEnabled(admin: Want, userId: number, callback: AsyncCallback\<boolean>): void 444e41f4b71Sopenharmony_ci 445e41f4b71Sopenharmony_ciChecks whether a device administrator application of the specified user is enabled. This API uses an asynchronous callback to return the result. 446e41f4b71Sopenharmony_ci 447e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 448e41f4b71Sopenharmony_ci 449e41f4b71Sopenharmony_ci 450e41f4b71Sopenharmony_ci 451e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 452e41f4b71Sopenharmony_ci 453e41f4b71Sopenharmony_ci**Parameters** 454e41f4b71Sopenharmony_ci 455e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 456e41f4b71Sopenharmony_ci| -------- | ----------------------------------- | ---- | ---------------------------- | 457e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application to check. | 458e41f4b71Sopenharmony_ci| userId | number | Yes | User ID, which must be greater than or equal to 0.<br>The default value is the user ID of the caller. | 459e41f4b71Sopenharmony_ci| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is a Boolean value (**true** means that the device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object. | 460e41f4b71Sopenharmony_ci 461e41f4b71Sopenharmony_ci**Error codes** 462e41f4b71Sopenharmony_ci 463e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 464e41f4b71Sopenharmony_ci 465e41f4b71Sopenharmony_ci| ID| Error Message | 466e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | 467e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 468e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. | 469e41f4b71Sopenharmony_ci 470e41f4b71Sopenharmony_ci**Example** 471e41f4b71Sopenharmony_ci 472e41f4b71Sopenharmony_ci```ts 473e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 474e41f4b71Sopenharmony_cilet wantTemp: Want = { 475e41f4b71Sopenharmony_ci bundleName: 'bundleName', 476e41f4b71Sopenharmony_ci abilityName: 'abilityName', 477e41f4b71Sopenharmony_ci}; 478e41f4b71Sopenharmony_ci 479e41f4b71Sopenharmony_ciadminManager.isAdminEnabled(wantTemp, 100, (err, result) => { 480e41f4b71Sopenharmony_ci if (err) { 481e41f4b71Sopenharmony_ci console.error(`Failed to query admin is enabled. Code: ${err.code}, message: ${err.message}`); 482e41f4b71Sopenharmony_ci return; 483e41f4b71Sopenharmony_ci } 484e41f4b71Sopenharmony_ci console.info(`Succeeded in querying admin is enabled or not, result : ${result}`); 485e41f4b71Sopenharmony_ci}); 486e41f4b71Sopenharmony_ci``` 487e41f4b71Sopenharmony_ci 488e41f4b71Sopenharmony_ci## adminManager.isAdminEnabled 489e41f4b71Sopenharmony_ci 490e41f4b71Sopenharmony_ciisAdminEnabled(admin: Want, userId?: number): Promise\<boolean> 491e41f4b71Sopenharmony_ci 492e41f4b71Sopenharmony_ciChecks whether a device administrator application of the current or specified user is enabled. This API uses a promise to return the result. 493e41f4b71Sopenharmony_ci 494e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 495e41f4b71Sopenharmony_ci 496e41f4b71Sopenharmony_ci 497e41f4b71Sopenharmony_ci 498e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 499e41f4b71Sopenharmony_ci 500e41f4b71Sopenharmony_ci**Parameters** 501e41f4b71Sopenharmony_ci 502e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 503e41f4b71Sopenharmony_ci| ------ | ----------------------------------- | ---- | ---------------------------- | 504e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application to check. | 505e41f4b71Sopenharmony_ci| userId | number | No | User ID, which must be greater than or equal to 0.<br>- If **userId** is passed in, this API applies to the specified user.<br>- If **userId** is not passed in, this API applies to the current user.| 506e41f4b71Sopenharmony_ci 507e41f4b71Sopenharmony_ci**Return value** 508e41f4b71Sopenharmony_ci 509e41f4b71Sopenharmony_ci| Type | Description | 510e41f4b71Sopenharmony_ci| ----------------- | ------------------- | 511e41f4b71Sopenharmony_ci| Promise\<boolean> | Promise used to return the result. The value **true** means the device administrator application is enabled; the value **false** means the opposite.| 512e41f4b71Sopenharmony_ci 513e41f4b71Sopenharmony_ci**Error codes** 514e41f4b71Sopenharmony_ci 515e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 516e41f4b71Sopenharmony_ci 517e41f4b71Sopenharmony_ci| ID| Error Message | 518e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | 519e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 520e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. | 521e41f4b71Sopenharmony_ci 522e41f4b71Sopenharmony_ci**Example** 523e41f4b71Sopenharmony_ci 524e41f4b71Sopenharmony_ci```ts 525e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 526e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 527e41f4b71Sopenharmony_cilet wantTemp: Want = { 528e41f4b71Sopenharmony_ci bundleName: 'bundleName', 529e41f4b71Sopenharmony_ci abilityName: 'abilityName', 530e41f4b71Sopenharmony_ci}; 531e41f4b71Sopenharmony_ci 532e41f4b71Sopenharmony_ciadminManager.isAdminEnabled(wantTemp, 100).then((result) => { 533e41f4b71Sopenharmony_ci console.info(`Succeeded in querying admin is enabled or not, result : ${result}`); 534e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 535e41f4b71Sopenharmony_ci console.error(`Failed to query admin is enabled or not. Code: ${err.code}, message: ${err.message}`); 536e41f4b71Sopenharmony_ci}); 537e41f4b71Sopenharmony_ci``` 538e41f4b71Sopenharmony_ci 539e41f4b71Sopenharmony_ci## adminManager.isSuperAdmin 540e41f4b71Sopenharmony_ci 541e41f4b71Sopenharmony_ciisSuperAdmin(bundleName: String, callback: AsyncCallback\<boolean>): void 542e41f4b71Sopenharmony_ci 543e41f4b71Sopenharmony_ciChecks whether a super administrator application of the administrator is enabled based on **bundleName**. This API uses an asynchronous callback to return the result. 544e41f4b71Sopenharmony_ci 545e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 546e41f4b71Sopenharmony_ci 547e41f4b71Sopenharmony_ci 548e41f4b71Sopenharmony_ci 549e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 550e41f4b71Sopenharmony_ci 551e41f4b71Sopenharmony_ci**Parameters** 552e41f4b71Sopenharmony_ci 553e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 554e41f4b71Sopenharmony_ci| ---------- | ----------------------- | ---- | -------------------- | 555e41f4b71Sopenharmony_ci| bundleName | String | Yes | Super administrator application to check. | 556e41f4b71Sopenharmony_ci| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is a Boolean value (**true** means that the device administrator application is enabled; and **false** means the opposite). If the operation fails, **err** is an error object.| 557e41f4b71Sopenharmony_ci 558e41f4b71Sopenharmony_ci**Error codes** 559e41f4b71Sopenharmony_ci 560e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 561e41f4b71Sopenharmony_ci 562e41f4b71Sopenharmony_ci| ID| Error Message | 563e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | 564e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 565e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. | 566e41f4b71Sopenharmony_ci 567e41f4b71Sopenharmony_ci**Example** 568e41f4b71Sopenharmony_ci 569e41f4b71Sopenharmony_ci```ts 570e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 571e41f4b71Sopenharmony_cilet bundleName: string = 'com.example.myapplication'; 572e41f4b71Sopenharmony_ci 573e41f4b71Sopenharmony_ciadminManager.isSuperAdmin(bundleName, (err, result) => { 574e41f4b71Sopenharmony_ci if (err) { 575e41f4b71Sopenharmony_ci console.error(`Failed to query admin is super admin or not. Code: ${err.code}, message: ${err.message}`); 576e41f4b71Sopenharmony_ci return; 577e41f4b71Sopenharmony_ci } 578e41f4b71Sopenharmony_ci console.info(`Succeeded in querying admin is super admin or not, result : ${result}`); 579e41f4b71Sopenharmony_ci}); 580e41f4b71Sopenharmony_ci``` 581e41f4b71Sopenharmony_ci 582e41f4b71Sopenharmony_ci## adminManager.isSuperAdmin 583e41f4b71Sopenharmony_ci 584e41f4b71Sopenharmony_ciisSuperAdmin(bundleName: String): Promise\<boolean> 585e41f4b71Sopenharmony_ci 586e41f4b71Sopenharmony_ciChecks whether a super administrator application of the administrator is enabled based on **bundleName**. This API uses a promise to return the result. 587e41f4b71Sopenharmony_ci 588e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 589e41f4b71Sopenharmony_ci 590e41f4b71Sopenharmony_ci 591e41f4b71Sopenharmony_ci 592e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 593e41f4b71Sopenharmony_ci 594e41f4b71Sopenharmony_ci**Parameters** 595e41f4b71Sopenharmony_ci 596e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 597e41f4b71Sopenharmony_ci| ---------- | ------ | ---- | --------- | 598e41f4b71Sopenharmony_ci| bundleName | String | Yes | Super administrator application to check.| 599e41f4b71Sopenharmony_ci 600e41f4b71Sopenharmony_ci**Return value** 601e41f4b71Sopenharmony_ci 602e41f4b71Sopenharmony_ci| ID | Error Message | 603e41f4b71Sopenharmony_ci| ----------------- | ------------------- | 604e41f4b71Sopenharmony_ci| Promise\<boolean> | Promise used to return the result. The value **true** means the super administrator application is enabled; the value **false** means the opposite. | 605e41f4b71Sopenharmony_ci 606e41f4b71Sopenharmony_ci**Error codes** 607e41f4b71Sopenharmony_ci 608e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 609e41f4b71Sopenharmony_ci 610e41f4b71Sopenharmony_ci| ID| Error Message | 611e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | 612e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 613e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. | 614e41f4b71Sopenharmony_ci 615e41f4b71Sopenharmony_ci**Example** 616e41f4b71Sopenharmony_ci 617e41f4b71Sopenharmony_ci```ts 618e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 619e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 620e41f4b71Sopenharmony_cilet bundleName: string = 'com.example.myapplication'; 621e41f4b71Sopenharmony_ci 622e41f4b71Sopenharmony_ciadminManager.isSuperAdmin(bundleName).then((result) => { 623e41f4b71Sopenharmony_ci console.info(`Succeeded in querying admin is super admin or not, result : ${result}`); 624e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 625e41f4b71Sopenharmony_ci console.error(`Failed to query admin is super admin or not. Code: ${err.code}, message: ${err.message}`); 626e41f4b71Sopenharmony_ci}); 627e41f4b71Sopenharmony_ci``` 628e41f4b71Sopenharmony_ci 629e41f4b71Sopenharmony_ci## adminManager.getSuperAdmin<sup>12+</sup> 630e41f4b71Sopenharmony_ci 631e41f4b71Sopenharmony_cigetSuperAdmin(): Promise\<Want> 632e41f4b71Sopenharmony_ci 633e41f4b71Sopenharmony_ciObtains the super device administrator application of this administrator. This API uses a promise to return the result. 634e41f4b71Sopenharmony_ci 635e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 636e41f4b71Sopenharmony_ci 637e41f4b71Sopenharmony_ci 638e41f4b71Sopenharmony_ci 639e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 640e41f4b71Sopenharmony_ci 641e41f4b71Sopenharmony_ci**Return value** 642e41f4b71Sopenharmony_ci 643e41f4b71Sopenharmony_ci| Type | Description | 644e41f4b71Sopenharmony_ci| ------------------------------------------------------------ | ------------------------------------------------------------ | 645e41f4b71Sopenharmony_ci| Promise\<[Want](../apis-ability-kit/js-apis-app-ability-want.md)> | Promise used to return the super device administrator application obtained. If no super device administrator application is activated on the device, **bundleName** and **abilityName** in **Want** returned are empty strings.| 646e41f4b71Sopenharmony_ci 647e41f4b71Sopenharmony_ci**Error codes** 648e41f4b71Sopenharmony_ci 649e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 650e41f4b71Sopenharmony_ci 651e41f4b71Sopenharmony_ci| ID| Error Message | 652e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | 653e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 654e41f4b71Sopenharmony_ci 655e41f4b71Sopenharmony_ci**Example** 656e41f4b71Sopenharmony_ci 657e41f4b71Sopenharmony_ci```ts 658e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 659e41f4b71Sopenharmony_ci 660e41f4b71Sopenharmony_ciadminManager.getSuperAdmin().then((result) => { 661e41f4b71Sopenharmony_ci console.info(`Succeeded in getting super admin :${JSON.stringify(result)}`); 662e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 663e41f4b71Sopenharmony_ci console.error(`Failed to get super admin. Code: ${err.code}, message: ${err.message}`); 664e41f4b71Sopenharmony_ci}) 665e41f4b71Sopenharmony_ci``` 666e41f4b71Sopenharmony_ci 667e41f4b71Sopenharmony_ci## adminManager.setEnterpriseInfo 668e41f4b71Sopenharmony_ci 669e41f4b71Sopenharmony_cisetEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback\<void>): void 670e41f4b71Sopenharmony_ci 671e41f4b71Sopenharmony_ciSets enterprise information for a device administrator application. This API uses an asynchronous callback to return the result. 672e41f4b71Sopenharmony_ci 673e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.SET_ENTERPRISE_INFO 674e41f4b71Sopenharmony_ci 675e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 676e41f4b71Sopenharmony_ci 677e41f4b71Sopenharmony_ci 678e41f4b71Sopenharmony_ci 679e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 680e41f4b71Sopenharmony_ci 681e41f4b71Sopenharmony_ci**Parameters** 682e41f4b71Sopenharmony_ci 683e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 684e41f4b71Sopenharmony_ci| -------------- | ----------------------------------- | ---- | ---------------------- | 685e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application. | 686e41f4b71Sopenharmony_ci| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information to set. | 687e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void> | Yes | Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| 688e41f4b71Sopenharmony_ci 689e41f4b71Sopenharmony_ci**Error codes** 690e41f4b71Sopenharmony_ci 691e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 692e41f4b71Sopenharmony_ci 693e41f4b71Sopenharmony_ci| ID| Error Message | 694e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------- | 695e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 696e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 697e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 698e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 699e41f4b71Sopenharmony_ci 700e41f4b71Sopenharmony_ci**Example** 701e41f4b71Sopenharmony_ci 702e41f4b71Sopenharmony_ci```ts 703e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 704e41f4b71Sopenharmony_cilet wantTemp: Want = { 705e41f4b71Sopenharmony_ci bundleName: 'com.example.myapplication', 706e41f4b71Sopenharmony_ci abilityName: 'EntryAbility', 707e41f4b71Sopenharmony_ci}; 708e41f4b71Sopenharmony_cilet enterpriseInfo: adminManager.EnterpriseInfo = { 709e41f4b71Sopenharmony_ci name: 'enterprise name', 710e41f4b71Sopenharmony_ci description: 'enterprise description' 711e41f4b71Sopenharmony_ci} 712e41f4b71Sopenharmony_ci 713e41f4b71Sopenharmony_ciadminManager.setEnterpriseInfo(wantTemp, enterpriseInfo, (err) => { 714e41f4b71Sopenharmony_ci if (err) { 715e41f4b71Sopenharmony_ci console.error(`Failed to set enterprise info. Code: ${err.code}, message: ${err.message}`); 716e41f4b71Sopenharmony_ci return; 717e41f4b71Sopenharmony_ci } 718e41f4b71Sopenharmony_ci console.info('Succeeded in setting enterprise info'); 719e41f4b71Sopenharmony_ci}); 720e41f4b71Sopenharmony_ci``` 721e41f4b71Sopenharmony_ci 722e41f4b71Sopenharmony_ci## adminManager.setEnterpriseInfo 723e41f4b71Sopenharmony_ci 724e41f4b71Sopenharmony_cisetEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise\<void> 725e41f4b71Sopenharmony_ci 726e41f4b71Sopenharmony_ciSets enterprise information for a device administrator application. This API uses a promise to return the result. 727e41f4b71Sopenharmony_ci 728e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.SET_ENTERPRISE_INFO 729e41f4b71Sopenharmony_ci 730e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 731e41f4b71Sopenharmony_ci 732e41f4b71Sopenharmony_ci 733e41f4b71Sopenharmony_ci 734e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 735e41f4b71Sopenharmony_ci 736e41f4b71Sopenharmony_ci**Parameters** 737e41f4b71Sopenharmony_ci 738e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 739e41f4b71Sopenharmony_ci| -------------- | ----------------------------------- | ---- | ------------ | 740e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application. | 741e41f4b71Sopenharmony_ci| enterpriseInfo | [EnterpriseInfo](#enterpriseinfo) | Yes | Enterprise information to set.| 742e41f4b71Sopenharmony_ci 743e41f4b71Sopenharmony_ci**Return value** 744e41f4b71Sopenharmony_ci 745e41f4b71Sopenharmony_ci| Type | Description | 746e41f4b71Sopenharmony_ci| ----------------- | --------------------- | 747e41f4b71Sopenharmony_ci| Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.| 748e41f4b71Sopenharmony_ci 749e41f4b71Sopenharmony_ci**Error codes** 750e41f4b71Sopenharmony_ci 751e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 752e41f4b71Sopenharmony_ci 753e41f4b71Sopenharmony_ci| ID| Error Message | 754e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------- | 755e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 756e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 757e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 758e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 759e41f4b71Sopenharmony_ci 760e41f4b71Sopenharmony_ci**Example** 761e41f4b71Sopenharmony_ci 762e41f4b71Sopenharmony_ci```ts 763e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 764e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 765e41f4b71Sopenharmony_cilet wantTemp: Want = { 766e41f4b71Sopenharmony_ci bundleName: 'com.example.myapplication', 767e41f4b71Sopenharmony_ci abilityName: 'EntryAbility', 768e41f4b71Sopenharmony_ci}; 769e41f4b71Sopenharmony_cilet enterpriseInfo: adminManager.EnterpriseInfo = { 770e41f4b71Sopenharmony_ci name: 'enterprise name', 771e41f4b71Sopenharmony_ci description: 'enterprise description' 772e41f4b71Sopenharmony_ci} 773e41f4b71Sopenharmony_ci 774e41f4b71Sopenharmony_ciadminManager.setEnterpriseInfo(wantTemp, enterpriseInfo).catch((err: BusinessError) => { 775e41f4b71Sopenharmony_ci console.error(`Failed to set enterprise info. Code: ${err.code}, message: ${err.message}`); 776e41f4b71Sopenharmony_ci}); 777e41f4b71Sopenharmony_ci``` 778e41f4b71Sopenharmony_ci 779e41f4b71Sopenharmony_ci## adminManager.getEnterpriseInfo 780e41f4b71Sopenharmony_ci 781e41f4b71Sopenharmony_cigetEnterpriseInfo(admin: Want, callback: AsyncCallback<EnterpriseInfo>): void 782e41f4b71Sopenharmony_ci 783e41f4b71Sopenharmony_ciObtains the enterprise information of a device administrator application. This API uses an asynchronous callback to return the result. 784e41f4b71Sopenharmony_ci 785e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 786e41f4b71Sopenharmony_ci 787e41f4b71Sopenharmony_ci 788e41f4b71Sopenharmony_ci 789e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 790e41f4b71Sopenharmony_ci 791e41f4b71Sopenharmony_ci**Parameters** 792e41f4b71Sopenharmony_ci 793e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 794e41f4b71Sopenharmony_ci| -------- | ---------------------------------------- | ---- | ------------------------ | 795e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application. | 796e41f4b71Sopenharmony_ci| callback | AsyncCallback<[EnterpriseInfo](#enterpriseinfo)> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the enterprise information of the device administrator application obtained. If the operation fails, **err** is an error object.| 797e41f4b71Sopenharmony_ci 798e41f4b71Sopenharmony_ci**Error codes** 799e41f4b71Sopenharmony_ci 800e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 801e41f4b71Sopenharmony_ci 802e41f4b71Sopenharmony_ci| ID| Error Message | 803e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------- | 804e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 805e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 806e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 807e41f4b71Sopenharmony_ci 808e41f4b71Sopenharmony_ci**Example** 809e41f4b71Sopenharmony_ci 810e41f4b71Sopenharmony_ci```ts 811e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 812e41f4b71Sopenharmony_cilet wantTemp: Want = { 813e41f4b71Sopenharmony_ci bundleName: 'com.example.myapplication', 814e41f4b71Sopenharmony_ci abilityName: 'EntryAbility', 815e41f4b71Sopenharmony_ci}; 816e41f4b71Sopenharmony_ci 817e41f4b71Sopenharmony_ciadminManager.getEnterpriseInfo(wantTemp, (err, result) => { 818e41f4b71Sopenharmony_ci if (err) { 819e41f4b71Sopenharmony_ci console.error(`Failed to get enterprise info. Code: ${err.code}, message: ${err.message}`); 820e41f4b71Sopenharmony_ci return; 821e41f4b71Sopenharmony_ci } 822e41f4b71Sopenharmony_ci console.info(`Succeeded in getting enterprise info, enterprise name : ${result.name}, enterprise description : ${result.description}`); 823e41f4b71Sopenharmony_ci}); 824e41f4b71Sopenharmony_ci``` 825e41f4b71Sopenharmony_ci 826e41f4b71Sopenharmony_ci## adminManager.getEnterpriseInfo 827e41f4b71Sopenharmony_ci 828e41f4b71Sopenharmony_cigetEnterpriseInfo(admin: Want): Promise<EnterpriseInfo> 829e41f4b71Sopenharmony_ci 830e41f4b71Sopenharmony_ciObtains the enterprise information of a device administrator application. This API uses a promise to return the result. 831e41f4b71Sopenharmony_ci 832e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 833e41f4b71Sopenharmony_ci 834e41f4b71Sopenharmony_ci 835e41f4b71Sopenharmony_ci 836e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 837e41f4b71Sopenharmony_ci 838e41f4b71Sopenharmony_ci**Parameters** 839e41f4b71Sopenharmony_ci 840e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 841e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | ---- | ------- | 842e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application.| 843e41f4b71Sopenharmony_ci 844e41f4b71Sopenharmony_ci**Return value** 845e41f4b71Sopenharmony_ci 846e41f4b71Sopenharmony_ci| Type | Description | 847e41f4b71Sopenharmony_ci| ---------------------------------------- | ------------------------- | 848e41f4b71Sopenharmony_ci| Promise<[EnterpriseInfo](#enterpriseinfo)> | Promise used to return the enterprise information obtained.| 849e41f4b71Sopenharmony_ci 850e41f4b71Sopenharmony_ci**Error codes** 851e41f4b71Sopenharmony_ci 852e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 853e41f4b71Sopenharmony_ci 854e41f4b71Sopenharmony_ci| ID| Error Message | 855e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------- | 856e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 857e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 858e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 859e41f4b71Sopenharmony_ci 860e41f4b71Sopenharmony_ci**Example** 861e41f4b71Sopenharmony_ci 862e41f4b71Sopenharmony_ci```ts 863e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 864e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 865e41f4b71Sopenharmony_cilet wantTemp: Want = { 866e41f4b71Sopenharmony_ci bundleName: 'com.example.myapplication', 867e41f4b71Sopenharmony_ci abilityName: 'EntryAbility', 868e41f4b71Sopenharmony_ci}; 869e41f4b71Sopenharmony_ci 870e41f4b71Sopenharmony_ciadminManager.getEnterpriseInfo(wantTemp).then((result) => { 871e41f4b71Sopenharmony_ci console.info(`Succeeded in getting enterprise info, enterprise name : ${result.name}, enterprise description : ${result.description}`); 872e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 873e41f4b71Sopenharmony_ci console.error(`Failed to get enterprise info. Code: ${err.code}, message: ${err.message}`); 874e41f4b71Sopenharmony_ci}); 875e41f4b71Sopenharmony_ci``` 876e41f4b71Sopenharmony_ci 877e41f4b71Sopenharmony_ci## adminManager.subscribeManagedEvent 878e41f4b71Sopenharmony_ci 879e41f4b71Sopenharmony_cisubscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>, callback: AsyncCallback\<void>): void 880e41f4b71Sopenharmony_ci 881e41f4b71Sopenharmony_ciSubscribes to system management events of a device administrator application. This API uses an asynchronous callback to return the result. 882e41f4b71Sopenharmony_ci 883e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT 884e41f4b71Sopenharmony_ci 885e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 886e41f4b71Sopenharmony_ci 887e41f4b71Sopenharmony_ci 888e41f4b71Sopenharmony_ci 889e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 890e41f4b71Sopenharmony_ci 891e41f4b71Sopenharmony_ci**Parameters** 892e41f4b71Sopenharmony_ci 893e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 894e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | ---- | ------- | 895e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application.| 896e41f4b71Sopenharmony_ci| managedEvents | Array\<[ManagedEvent](js-apis-enterprise-adminManager.md#managedevent)> | Yes| Array of events to subscribe to.| 897e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void> | Yes| Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| 898e41f4b71Sopenharmony_ci 899e41f4b71Sopenharmony_ci**Error codes** 900e41f4b71Sopenharmony_ci 901e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 902e41f4b71Sopenharmony_ci 903e41f4b71Sopenharmony_ci| ID| Error Message | 904e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | 905e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 906e41f4b71Sopenharmony_ci| 9200008 | The specified system event is invalid. | 907e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 908e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 909e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 910e41f4b71Sopenharmony_ci 911e41f4b71Sopenharmony_ci**Example** 912e41f4b71Sopenharmony_ci 913e41f4b71Sopenharmony_ci```ts 914e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 915e41f4b71Sopenharmony_cilet wantTemp: Want = { 916e41f4b71Sopenharmony_ci bundleName: 'bundleName', 917e41f4b71Sopenharmony_ci abilityName: 'abilityName', 918e41f4b71Sopenharmony_ci}; 919e41f4b71Sopenharmony_cilet events: Array<adminManager.ManagedEvent> = [adminManager.ManagedEvent.MANAGED_EVENT_BUNDLE_ADDED, adminManager.ManagedEvent.MANAGED_EVENT_BUNDLE_REMOVED]; 920e41f4b71Sopenharmony_ci 921e41f4b71Sopenharmony_ciadminManager.subscribeManagedEvent(wantTemp, events, (err) => { 922e41f4b71Sopenharmony_ci if (err) { 923e41f4b71Sopenharmony_ci console.error(`Failed to subscribe managed event. Code: ${err.code}, message: ${err.message}`); 924e41f4b71Sopenharmony_ci return; 925e41f4b71Sopenharmony_ci } 926e41f4b71Sopenharmony_ci console.info('Succeeded in subscribe managed event'); 927e41f4b71Sopenharmony_ci}); 928e41f4b71Sopenharmony_ci``` 929e41f4b71Sopenharmony_ci 930e41f4b71Sopenharmony_ci## adminManager.subscribeManagedEvent 931e41f4b71Sopenharmony_ci 932e41f4b71Sopenharmony_cisubscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>): Promise\<void> 933e41f4b71Sopenharmony_ci 934e41f4b71Sopenharmony_ciSubscribes to system management events of a device administrator application. This API uses a promise to return the result. 935e41f4b71Sopenharmony_ci 936e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT 937e41f4b71Sopenharmony_ci 938e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 939e41f4b71Sopenharmony_ci 940e41f4b71Sopenharmony_ci 941e41f4b71Sopenharmony_ci 942e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 943e41f4b71Sopenharmony_ci 944e41f4b71Sopenharmony_ci**Parameters** 945e41f4b71Sopenharmony_ci 946e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 947e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | ---- | ------- | 948e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application.| 949e41f4b71Sopenharmony_ci| managedEvents | Array\<[ManagedEvent](js-apis-enterprise-adminManager.md#managedevent)> | Yes| Array of events to subscribe to.| 950e41f4b71Sopenharmony_ci 951e41f4b71Sopenharmony_ci**Return value** 952e41f4b71Sopenharmony_ci 953e41f4b71Sopenharmony_ci| Type | Description | 954e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | 955e41f4b71Sopenharmony_ci| Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.| 956e41f4b71Sopenharmony_ci 957e41f4b71Sopenharmony_ci**Error codes** 958e41f4b71Sopenharmony_ci 959e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 960e41f4b71Sopenharmony_ci 961e41f4b71Sopenharmony_ci| ID| Error Message | 962e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------- | 963e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 964e41f4b71Sopenharmony_ci| 9200008 | The specified system event is invalid. | 965e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 966e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 967e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 968e41f4b71Sopenharmony_ci 969e41f4b71Sopenharmony_ci**Example** 970e41f4b71Sopenharmony_ci 971e41f4b71Sopenharmony_ci```ts 972e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 973e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 974e41f4b71Sopenharmony_cilet wantTemp: Want = { 975e41f4b71Sopenharmony_ci bundleName: 'bundleName', 976e41f4b71Sopenharmony_ci abilityName: 'abilityName', 977e41f4b71Sopenharmony_ci}; 978e41f4b71Sopenharmony_cilet events: Array<adminManager.ManagedEvent> = [adminManager.ManagedEvent.MANAGED_EVENT_BUNDLE_ADDED, adminManager.ManagedEvent.MANAGED_EVENT_BUNDLE_REMOVED]; 979e41f4b71Sopenharmony_ci 980e41f4b71Sopenharmony_ciadminManager.subscribeManagedEvent(wantTemp, events).then(() => { 981e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 982e41f4b71Sopenharmony_ci console.error(`Failed to subscribe managed event. Code: ${err.code}, message: ${err.message}`); 983e41f4b71Sopenharmony_ci}) 984e41f4b71Sopenharmony_ci``` 985e41f4b71Sopenharmony_ci 986e41f4b71Sopenharmony_ci## adminManager.unsubscribeManagedEvent 987e41f4b71Sopenharmony_ci 988e41f4b71Sopenharmony_ciunsubscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>, callback: AsyncCallback\<void>): void 989e41f4b71Sopenharmony_ci 990e41f4b71Sopenharmony_ciUnsubscribes from system management events of a device administrator application. This API uses an asynchronous callback to return the result. 991e41f4b71Sopenharmony_ci 992e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT 993e41f4b71Sopenharmony_ci 994e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 995e41f4b71Sopenharmony_ci 996e41f4b71Sopenharmony_ci 997e41f4b71Sopenharmony_ci 998e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 999e41f4b71Sopenharmony_ci 1000e41f4b71Sopenharmony_ci**Parameters** 1001e41f4b71Sopenharmony_ci 1002e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 1003e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | ---- | ------- | 1004e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application.| 1005e41f4b71Sopenharmony_ci| managedEvents | Array\<[ManagedEvent](js-apis-enterprise-adminManager.md#managedevent)> | Yes| Array of events to unsubscribe from.| 1006e41f4b71Sopenharmony_ci| callback | AsyncCallback\<void> | Yes| Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| 1007e41f4b71Sopenharmony_ci 1008e41f4b71Sopenharmony_ci**Error codes** 1009e41f4b71Sopenharmony_ci 1010e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 1011e41f4b71Sopenharmony_ci 1012e41f4b71Sopenharmony_ci| ID| Error Message | 1013e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------- | 1014e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 1015e41f4b71Sopenharmony_ci| 9200008 | The specified system event is invalid. | 1016e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 1017e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 1018e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 1019e41f4b71Sopenharmony_ci 1020e41f4b71Sopenharmony_ci**Example** 1021e41f4b71Sopenharmony_ci 1022e41f4b71Sopenharmony_ci```ts 1023e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 1024e41f4b71Sopenharmony_cilet wantTemp: Want = { 1025e41f4b71Sopenharmony_ci bundleName: 'bundleName', 1026e41f4b71Sopenharmony_ci abilityName: 'abilityName', 1027e41f4b71Sopenharmony_ci}; 1028e41f4b71Sopenharmony_cilet events: Array<adminManager.ManagedEvent> = [adminManager.ManagedEvent.MANAGED_EVENT_BUNDLE_ADDED, adminManager.ManagedEvent.MANAGED_EVENT_BUNDLE_REMOVED]; 1029e41f4b71Sopenharmony_ci 1030e41f4b71Sopenharmony_ciadminManager.unsubscribeManagedEvent(wantTemp, events, (err) => { 1031e41f4b71Sopenharmony_ci if (err) { 1032e41f4b71Sopenharmony_ci console.error(`Failed to unsubscribe managed event. Code: ${err.code}, message: ${err.message}`); 1033e41f4b71Sopenharmony_ci return; 1034e41f4b71Sopenharmony_ci } 1035e41f4b71Sopenharmony_ci console.info('Succeeded in unsubscribe managed event'); 1036e41f4b71Sopenharmony_ci}); 1037e41f4b71Sopenharmony_ci``` 1038e41f4b71Sopenharmony_ci 1039e41f4b71Sopenharmony_ci## adminManager.unsubscribeManagedEvent 1040e41f4b71Sopenharmony_ci 1041e41f4b71Sopenharmony_ciunsubscribeManagedEvent(admin: Want, managedEvents: Array\<ManagedEvent>): Promise\<void> 1042e41f4b71Sopenharmony_ci 1043e41f4b71Sopenharmony_ciUnsubscribes from system management events of a device administrator application. This API uses a promise to return the result. 1044e41f4b71Sopenharmony_ci 1045e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT 1046e41f4b71Sopenharmony_ci 1047e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 1048e41f4b71Sopenharmony_ci 1049e41f4b71Sopenharmony_ci 1050e41f4b71Sopenharmony_ci 1051e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 1052e41f4b71Sopenharmony_ci 1053e41f4b71Sopenharmony_ci**Parameters** 1054e41f4b71Sopenharmony_ci 1055e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 1056e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | ---- | ------- | 1057e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application.| 1058e41f4b71Sopenharmony_ci| managedEvents | Array\<[ManagedEvent](js-apis-enterprise-adminManager.md#managedevent)> | Yes| Array of events to unsubscribe from.| 1059e41f4b71Sopenharmony_ci 1060e41f4b71Sopenharmony_ci**Return value** 1061e41f4b71Sopenharmony_ci 1062e41f4b71Sopenharmony_ci| Type | Description | 1063e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | 1064e41f4b71Sopenharmony_ci| Promise\<void> | Promise that returns no value. If the operation fails, an error object will be thrown.| 1065e41f4b71Sopenharmony_ci 1066e41f4b71Sopenharmony_ci**Error codes** 1067e41f4b71Sopenharmony_ci 1068e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 1069e41f4b71Sopenharmony_ci 1070e41f4b71Sopenharmony_ci| ID| Error Message | 1071e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------- | 1072e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 1073e41f4b71Sopenharmony_ci| 9200008 | The specified system event is invalid. | 1074e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 1075e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 1076e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 1077e41f4b71Sopenharmony_ci 1078e41f4b71Sopenharmony_ci**Example** 1079e41f4b71Sopenharmony_ci 1080e41f4b71Sopenharmony_ci```ts 1081e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 1082e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1083e41f4b71Sopenharmony_cilet wantTemp: Want = { 1084e41f4b71Sopenharmony_ci bundleName: 'bundleName', 1085e41f4b71Sopenharmony_ci abilityName: 'abilityName', 1086e41f4b71Sopenharmony_ci}; 1087e41f4b71Sopenharmony_cilet events: Array<adminManager.ManagedEvent> = [adminManager.ManagedEvent.MANAGED_EVENT_BUNDLE_ADDED, adminManager.ManagedEvent.MANAGED_EVENT_BUNDLE_REMOVED]; 1088e41f4b71Sopenharmony_ci 1089e41f4b71Sopenharmony_ciadminManager.unsubscribeManagedEvent(wantTemp, events).then(() => { 1090e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1091e41f4b71Sopenharmony_ci console.error(`Failed to unsubscribe managed event. Code: ${err.code}, message: ${err.message}`); 1092e41f4b71Sopenharmony_ci}) 1093e41f4b71Sopenharmony_ci``` 1094e41f4b71Sopenharmony_ci 1095e41f4b71Sopenharmony_ci## adminManager.authorizeAdmin<sup>10+</sup> 1096e41f4b71Sopenharmony_ci 1097e41f4b71Sopenharmony_ciauthorizeAdmin(admin: Want, bundleName: string, callback: AsyncCallback<void>): void 1098e41f4b71Sopenharmony_ci 1099e41f4b71Sopenharmony_ciAuthorizes the administrator rights to an application through the specified device administrator application. This API uses an asynchronous callback to return the result. 1100e41f4b71Sopenharmony_ci 1101e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 1102e41f4b71Sopenharmony_ci 1103e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 1104e41f4b71Sopenharmony_ci 1105e41f4b71Sopenharmony_ci 1106e41f4b71Sopenharmony_ci 1107e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 1108e41f4b71Sopenharmony_ci 1109e41f4b71Sopenharmony_ci**Parameters** 1110e41f4b71Sopenharmony_ci 1111e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 1112e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | ---- | ------- | 1113e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application.| 1114e41f4b71Sopenharmony_ci| bundleName | string | Yes| Bundle name of the application to be authorized with the administrator rights.| 1115e41f4b71Sopenharmony_ci| callback | AsyncCallback<void> | Yes| Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| 1116e41f4b71Sopenharmony_ci 1117e41f4b71Sopenharmony_ci**Error codes** 1118e41f4b71Sopenharmony_ci 1119e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 1120e41f4b71Sopenharmony_ci 1121e41f4b71Sopenharmony_ci| ID| Error Message | 1122e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------- | 1123e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 1124e41f4b71Sopenharmony_ci| 9200002 | The administrator application does not have permission to manage the device. | 1125e41f4b71Sopenharmony_ci| 9200009 | Failed to grant the permission to the application. | 1126e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 1127e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 1128e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 1129e41f4b71Sopenharmony_ci 1130e41f4b71Sopenharmony_ci**Example** 1131e41f4b71Sopenharmony_ci 1132e41f4b71Sopenharmony_ci```ts 1133e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 1134e41f4b71Sopenharmony_cilet wantTemp: Want = { 1135e41f4b71Sopenharmony_ci bundleName: 'bundleName', 1136e41f4b71Sopenharmony_ci abilityName: 'abilityName', 1137e41f4b71Sopenharmony_ci}; 1138e41f4b71Sopenharmony_cilet bundleName: string = "com.example.application"; 1139e41f4b71Sopenharmony_ci 1140e41f4b71Sopenharmony_ciadminManager.authorizeAdmin(wantTemp, bundleName, (err) => { 1141e41f4b71Sopenharmony_ci if (err) { 1142e41f4b71Sopenharmony_ci console.error(`Failed to authorize permission to the application. Code: ${err.code}, message: ${err.message}`); 1143e41f4b71Sopenharmony_ci return; 1144e41f4b71Sopenharmony_ci } 1145e41f4b71Sopenharmony_ci console.info('Successfully authorized permission to the application'); 1146e41f4b71Sopenharmony_ci}); 1147e41f4b71Sopenharmony_ci``` 1148e41f4b71Sopenharmony_ci 1149e41f4b71Sopenharmony_ci## adminManager.authorizeAdmin<sup>10+</sup> 1150e41f4b71Sopenharmony_ci 1151e41f4b71Sopenharmony_ciauthorizeAdmin(admin: Want, bundleName: string): Promise<void> 1152e41f4b71Sopenharmony_ci 1153e41f4b71Sopenharmony_ciAuthorizes the administrator rights to an application through the specified device administrator application. This API uses a promise to return the result. 1154e41f4b71Sopenharmony_ci 1155e41f4b71Sopenharmony_ci**Required permissions**: ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN 1156e41f4b71Sopenharmony_ci 1157e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 1158e41f4b71Sopenharmony_ci 1159e41f4b71Sopenharmony_ci 1160e41f4b71Sopenharmony_ci 1161e41f4b71Sopenharmony_ci**Model restriction**: This API can be used only in the stage model. 1162e41f4b71Sopenharmony_ci 1163e41f4b71Sopenharmony_ci**Parameters** 1164e41f4b71Sopenharmony_ci 1165e41f4b71Sopenharmony_ci| Name | Type | Mandatory | Description | 1166e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | ---- | ------- | 1167e41f4b71Sopenharmony_ci| admin | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | Device administrator application.| 1168e41f4b71Sopenharmony_ci| bundleName | string | Yes| Bundle name of the application to be authorized with the administrator rights.| 1169e41f4b71Sopenharmony_ci 1170e41f4b71Sopenharmony_ci**Return value** 1171e41f4b71Sopenharmony_ci 1172e41f4b71Sopenharmony_ci| Type | Description | 1173e41f4b71Sopenharmony_ci| ----- | ----------------------------------- | 1174e41f4b71Sopenharmony_ci| Promise<void> | Promise that returns no value. If the operation fails, an error object will be thrown.| 1175e41f4b71Sopenharmony_ci 1176e41f4b71Sopenharmony_ci**Error codes** 1177e41f4b71Sopenharmony_ci 1178e41f4b71Sopenharmony_ciFor details about the error codes, see [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) and [Universal Error Codes](../errorcode-universal.md). 1179e41f4b71Sopenharmony_ci 1180e41f4b71Sopenharmony_ci| ID| Error Message | 1181e41f4b71Sopenharmony_ci| ------- | ----------------------------------------------------- | 1182e41f4b71Sopenharmony_ci| 9200001 | The application is not an administrator application of the device. | 1183e41f4b71Sopenharmony_ci| 9200002 | The administrator application does not have permission to manage the device. | 1184e41f4b71Sopenharmony_ci| 9200009 | Failed to grant the permission to the application. | 1185e41f4b71Sopenharmony_ci| 201 | Permission verification failed. The application does not have the permission required to call the API. | 1186e41f4b71Sopenharmony_ci| 202 | Permission verification failed. A non-system application calls a system API. | 1187e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. | 1188e41f4b71Sopenharmony_ci 1189e41f4b71Sopenharmony_ci**Example** 1190e41f4b71Sopenharmony_ci 1191e41f4b71Sopenharmony_ci```ts 1192e41f4b71Sopenharmony_ciimport { Want } from '@kit.AbilityKit'; 1193e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1194e41f4b71Sopenharmony_cilet wantTemp: Want = { 1195e41f4b71Sopenharmony_ci bundleName: 'bundleName', 1196e41f4b71Sopenharmony_ci abilityName: 'abilityName', 1197e41f4b71Sopenharmony_ci}; 1198e41f4b71Sopenharmony_cilet bundleName: string = "com.example.application"; 1199e41f4b71Sopenharmony_ci 1200e41f4b71Sopenharmony_ciadminManager.authorizeAdmin(wantTemp, bundleName).then(() => { 1201e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1202e41f4b71Sopenharmony_ci console.error(`Failed to authorize permission to the application. Code: ${err.code}, message: ${err.message}`); 1203e41f4b71Sopenharmony_ci}) 1204e41f4b71Sopenharmony_ci``` 1205e41f4b71Sopenharmony_ci 1206e41f4b71Sopenharmony_ci## EnterpriseInfo 1207e41f4b71Sopenharmony_ci 1208e41f4b71Sopenharmony_ciRepresents the enterprise information of a device administrator application. 1209e41f4b71Sopenharmony_ci 1210e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 1211e41f4b71Sopenharmony_ci 1212e41f4b71Sopenharmony_ci 1213e41f4b71Sopenharmony_ci 1214e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1215e41f4b71Sopenharmony_ci| ----------- | --------| ---- | ------------------------------- | 1216e41f4b71Sopenharmony_ci| name | string | Yes | Name of the enterprise.| 1217e41f4b71Sopenharmony_ci| description | string | Yes | Description of the enterprise.| 1218e41f4b71Sopenharmony_ci 1219e41f4b71Sopenharmony_ci## AdminType 1220e41f4b71Sopenharmony_ci 1221e41f4b71Sopenharmony_ciEnumerates the types of device administrator applications. 1222e41f4b71Sopenharmony_ci 1223e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Customization.EnterpriseDeviceManager 1224e41f4b71Sopenharmony_ci 1225e41f4b71Sopenharmony_ci 1226e41f4b71Sopenharmony_ci 1227e41f4b71Sopenharmony_ci| Name | Value | Description | 1228e41f4b71Sopenharmony_ci| ----------------- | ---- | ----- | 1229e41f4b71Sopenharmony_ci| ADMIN_TYPE_NORMAL | 0x00 | Common administrator application.| 1230e41f4b71Sopenharmony_ci| ADMIN_TYPE_SUPER | 0x01 | Super administrator application.| 1231