# @ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility) The **EnterpriseAdminExtensionAbility** module provides extended enterprise device management capabilities. To have the capabilities provided by this module, for example, to receive a notification when a device administrator application is enabled or disabled, you need to create an **EnterpriseAdminExtensionAbility** instance for the enterprise administrator application and overload related APIs. > **NOTE** > > 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. > > The APIs of this module can be used only in the stage model. ## Modules to Import ```ts import EnterpriseAdminExtensionAbility from '@ohos.enterprise.EnterpriseAdminExtensionAbility' ``` ## EnterpriseAdminExtensionAbility.onAdminEnabled onAdminEnabled(): void Called when a device administrator application is enabled. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager **System API**: This is a system API. **Example** ```ts export default class EnterpriseAdminAbility extends EnterpriseAdminExtensionAbility { onAdminEnabled() { } }; ``` ## EnterpriseAdminExtensionAbility.onAdminDisabled onAdminDisabled(): void Called when a device administrator application is disabled. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager **System API**: This is a system API. **Example** ```ts export default class EnterpriseAdminAbility extends EnterpriseAdminExtensionAbility { onAdminDisabled() { } }; ``` ## EnterpriseAdminExtensionAbility.onBundleAdded onBundleAdded(bundleName: string): void Called when a bundle is added. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager **System API**: This is a system API. **Parameters** | Name | Type | Mandatory | Description | | ----- | ----------------------------------- | ---- | ------- | | bundleName | string | Yes | Name of the bundle added.| **Example** ```ts export default class EnterpriseAdminAbility extends EnterpriseAdminExtensionAbility { onBundleAdded(bundleName: string) { console.info(`Succeeded in calling onBundleAdded callback, added bundle name : ${bundleName}`); } }; ``` ## EnterpriseAdminExtensionAbility.onBundleRemoved onBundleRemoved(bundleName: string): void Called when a bundle is removed. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager **System API**: This is a system API. **Parameters** | Name | Type | Mandatory | Description | | ----- | ----------------------------------- | ---- | ------- | | bundleName | string | Yes | Name of the bundle removed.| **Example** ```ts export default class EnterpriseAdminAbility extends EnterpriseAdminExtensionAbility { onBundleRemoved(bundleName: string) { console.info(`Succeeded in calling onBundleRemoved callback, removed bundle name : ${bundleName}`); } }; ``` ## EnterpriseAdminExtensionAbility.onAppStart10+ onAppStart(bundleName: string): void Called when an application is started. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager **System API**: This is a system API. **Parameters** | Name | Type | Mandatory | Description | | ----- | ----------------------------------- | ---- | ------- | | bundleName | string | Yes | Bundle name of the application started.| **Example** ```ts export default class EnterpriseAdminAbility extends EnterpriseAdminExtensionAbility { onAppStart(bundleName: string) { console.info(`Succeeded in calling onAppStart callback, started bundle name : ${bundleName}`); } }; ``` ## EnterpriseAdminExtensionAbility.onAppStop10+ onAppStop(bundleName: string): void Called when an application is stopped. **System capability**: SystemCapability.Customization.EnterpriseDeviceManager **System API**: This is a system API. **Parameters** | Name | Type | Mandatory | Description | | ----- | ----------------------------------- | ---- | ------- | | bundleName | string | Yes | Bundle name of the application stopped.| **Example** ```ts export default class EnterpriseAdminAbility extends EnterpriseAdminExtensionAbility { onAppStop(bundleName: string) { console.info(`Succeeded in calling onAppStop callback, stopped bundle name : ${bundleName}`); } }; ```