@ohos.enterprise.common (Common Module)
The module provides pure type definitions for common capabilities within MDM Kit, including enum types and data structs. It exports type declarations only and does not include any implementation logic or executable code.
NOTE
The initial APIs of this module are supported since API version 22. 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
import { common } from '@kit.MDMKit';
ManagedPolicy
Enumerates enterprise device management policies.
System capability: SystemCapability.Customization.EnterpriseDeviceManager
| Name | Value | Description |
|---|---|---|
| DEFAULT | 0 | Default policy with no restrictions applied. |
| DISALLOW | 1 | Policy that disallows extensions from external sources to run. |
| FORCE_OPEN | 2 | Policy that forcibly enables extensions from external sources to run. |
ApplicationInstance
Defines application instance data.
It is used as an input parameter in the addUserNonStopApps, removeUserNonStopApps, addFreezeExemptedApps, and removeFreezeExemptedApps APIs.
System capability: SystemCapability.Customization.EnterpriseDeviceManager
| Name | Type | Read-Only | Optional | Description |
|---|---|---|---|---|
| appIdentifier | string | No | No | Unique identifier of an application. You can call the bundleManager.getBundleInfo API to obtain bundleInfo.signatureInfo.appIdentifier. |
| accountId | number | No | No | Account ID. The value is an integer greater than or equal to 0. You can obtain the account ID by calling the getOsAccountLocalId API. |
| appIndex | number | No | No | Index of the application clone. The value is an integer greater than or equal to 0. You can obtain the index by calling the getAppCloneIdentity API. |
InstallationResult
An object that holds the application installation result.
This object is used as a callback parameter in EnterpriseAdminExtensionAbility.onMarketAppInstallResult.
System capability: SystemCapability.Customization.EnterpriseDeviceManager
| Name | Type | Read-Only | Optional | Description |
|---|---|---|---|---|
| result | Result | No | No | Application installation result. |
| message | string | No | No | Application installation result message. |
Result
Enumerates application installation results.
System capability: SystemCapability.Customization.EnterpriseDeviceManager
| Name | Value | Description |
|---|---|---|
| SUCCESS | 0 | The application is installed successfully. |
| FAIL | -1 | The application fails to be installed. |
EnterpriseAdminExtensionContext23+
type EnterpriseAdminExtensionContext = _EnterpriseAdminExtensionContext.default
EnterpriseAdminExtensionContext is the context of EnterpriseAdminExtensionAbility and inherits from ExtensionContext.
System capability: SystemCapability.Customization.EnterpriseDeviceManager
Model restriction: This API can be used only in the stage model.
| Type | Description |
|---|---|
| _EnterpriseAdminExtensionContext.default | Context of the EnterpriseAdminExtensionAbility component. |
StartupScene24+
Startup wizard completion scenario. When the initial switch to a sub-user (only on PCs), OTA upgrade, and first-time startup wizard are complete, the device system calls the onStartupGuideCompleted API to notify the device administrator application.
System capability: SystemCapability.Customization.EnterpriseDeviceManager
Model restriction: This API can be used only in the stage model.
| Name | Value | Description |
|---|---|---|
| USER_SETUP | 0 | A sub-user is switched to for the first time and the startup wizard for the sub-user is complete (only on PCs). The callback will not be triggered when the sub-user is switched again. |
| OTA | 1 | The OTA upgrade is complete. |
| DEVICE_PROVISION | 2 | The initial startup wizard is complete. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 js-apis-enterprise-accountManager-sys
openharmony 鸿蒙 js-apis-enterprise-deviceControl-sys
openharmony 鸿蒙 js-apis-enterprise-systemManager
openharmony 鸿蒙 js-apis-enterprise-restrictions-sys
openharmony 鸿蒙 js-apis-enterprise-telephonyManager
openharmony 鸿蒙 js-apis-enterprise-bundleManager
openharmony 鸿蒙 js-apis-enterprise-applicationManager
openharmony 鸿蒙 js-apis-enterprise-bluetoothManager