openharmony 鸿蒙 js-apis-enterprise-common

2026-08-25 浏览 (1)

@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

NameValueDescription
DEFAULT0Default policy with no restrictions applied.
DISALLOW1Policy that disallows extensions from external sources to run.
FORCE_OPEN2Policy 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

NameTypeRead-OnlyOptionalDescription
appIdentifierstringNoNoUnique identifier of an application. You can call the bundleManager.getBundleInfo API to obtain bundleInfo.signatureInfo.appIdentifier.
accountIdnumberNoNoAccount ID. The value is an integer greater than or equal to 0.
You can obtain the account ID by calling the getOsAccountLocalId API.
appIndexnumberNoNoIndex 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

NameTypeRead-OnlyOptionalDescription
resultResultNoNoApplication installation result.
messagestringNoNoApplication installation result message.

Result

Enumerates application installation results.

System capability: SystemCapability.Customization.EnterpriseDeviceManager

NameValueDescription
SUCCESS0The application is installed successfully.
FAIL-1The 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.

TypeDescription
_EnterpriseAdminExtensionContext.defaultContext 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.

NameValueDescription
USER_SETUP0A 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.
OTA1The OTA upgrade is complete.
DEVICE_PROVISION2The 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

openharmony 鸿蒙 js-apis-enterprise-deviceControl

openharmony 鸿蒙 js-apis-EnterpriseAdminExtensionAbility

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/P3eKKcIo