@ohos.enterprise.bundleManager(包管理)
本模块提供包管理能力,包括添加包安装允许名单、获取包安装允许名单、移除包安装允许名单等。
说明:
本模块首批接口从API version 12开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
本模块接口仅可在Stage模型下使用。
本模块接口仅对设备管理应用开放,且调用接口前需激活设备管理应用,具体请参考MDM Kit开发指南。
导入模块
import { bundleManager } from '@kit.MDMKit';
bundleManager.addAllowedInstallBundlesSync
addAllowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void
添加应用至应用程序包安装允许名单,添加至允许名单的应用允许在当前/指定用户下安装,其它非允许名单应用不允许安装。
需要权限: ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| appIds | Array<string> | 是 | 应用ID数组。 |
| accountId | number | 否 | 用户ID,取值范围:大于等于0。 accountId可以通过@ohos.account.osAccount中的getOsAccountLocalId等接口来获取。 - 调用接口时,若传入accountId,表示指定用户。 - 调用接口时,若未传入accountId,表示当前用户。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
// 需根据实际情况进行替换
let appIds: Array<string> = ['com.example.******_******/******5t5CoBM='];
try {
bundleManager.addAllowedInstallBundlesSync(wantTemp, appIds, 100);
console.info('Succeeded in adding allowed install bundles.');
} catch (err) {
console.error(`Failed to add allowed install bundles. Code is ${err.code}, message is ${err.message}`);
}
bundleManager.removeAllowedInstallBundlesSync
removeAllowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void
在应用程序包安装允许名单中移除应用,在允许名单存在的情况下,不在应用程序包安装允许名单中的应用不允许在当前/指定用户下安装。
需要权限: ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| appIds | Array<string> | 是 | 应用ID数组。 |
| accountId | number | 否 | 用户ID,取值范围:大于等于0。 accountId可以通过@ohos.account.osAccount中的getOsAccountLocalId等接口来获取。 - 调用接口时,若传入accountId,表示指定用户。 - 调用接口时,若未传入accountId,表示当前用户。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
// 需根据实际情况进行替换
let appIds: Array<string> = ['com.example.******_******/******5t5CoBM='];
try {
bundleManager.removeAllowedInstallBundlesSync(wantTemp, appIds, 100);
console.info('Succeeded in removing allowed install bundles.');
} catch (err) {
console.error(`Failed to remove allowed install bundles. Code is ${err.code}, message is ${err.message}`);
}
bundleManager.getAllowedInstallBundlesSync
getAllowedInstallBundlesSync(admin: Want, accountId?: number): Array<string>
获取当前/指定用户下的应用程序包安装允许名单。
需要权限: ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| accountId | number | 否 | 用户ID,取值范围:大于等于0。 accountId可以通过@ohos.account.osAccount中的getOsAccountLocalId等接口来获取。 - 调用接口时,若传入accountId,表示指定用户。 - 调用接口时,若未传入accountId,表示当前用户。 |
返回值:
| 类型 | 说明 |
|---|---|
| Array<string> | 返回当前用户下的应用程序包安装允许名单。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
try {
let result: Array<string> = bundleManager.getAllowedInstallBundlesSync(wantTemp, 100);
console.info(`Succeeded in getting allowed install bundles, result : ${JSON.stringify(result)}`);
} catch (err) {
console.error(`Failed to get allowed install bundles. Code is ${err.code}, message is ${err.message}`);
}
bundleManager.addDisallowedInstallBundlesSync
addDisallowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void
添加应用至应用程序包安装禁止名单,添加至禁止名单的应用不允许在当前/指定用户下安装。
需要权限: ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| appIds | Array<string> | 是 | 应用ID数组。 |
| accountId | number | 否 | 用户ID,取值范围:大于等于0。 accountId可以通过@ohos.account.osAccount中的getOsAccountLocalId等接口来获取。 - 调用接口时,若传入accountId,表示指定用户。 - 调用接口时,若未传入accountId,表示当前用户。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
// 需根据实际情况进行替换
let appIds: Array<string> = ['com.example.******_******/******5t5CoBM='];
try {
bundleManager.addDisallowedInstallBundlesSync(wantTemp, appIds, 100);
console.info('Succeeded in adding disallowed install bundles.');
} catch (err) {
console.error(`Failed to add disallowed install bundles. Code is ${err.code}, message is ${err.message}`);
}
bundleManager.removeDisallowedInstallBundlesSync
removeDisallowedInstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void
在应用程序包安装禁止名单中移除应用,在禁止名单存在的情况下,在应用程序包安装禁止名单中的应用不允许在当前/指定用户下安装。
需要权限: ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| appIds | Array<string> | 是 | 应用ID数组。 |
| accountId | number | 否 | 用户ID,取值范围:大于等于0。 accountId可以通过@ohos.account.osAccount中的getOsAccountLocalId等接口来获取。 - 调用接口时,若传入accountId,表示指定用户。 - 调用接口时,若未传入accountId,表示当前用户。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
// 需根据实际情况进行替换
let appIds: Array<string> = ['com.example.******_******/******5t5CoBM='];
try {
bundleManager.removeDisallowedInstallBundlesSync(wantTemp, appIds, 100)
console.info('Succeeded in removing disallowed install bundles.');
} catch (err) {
console.error(`Failed to remove disallowed install bundles. Code is ${err.code}, message is ${err.message}`);
}
bundleManager.getDisallowedInstallBundlesSync
getDisallowedInstallBundlesSync(admin: Want, accountId?: number): Array<string>
获取当前/指定用户下的应用程序包安装禁止名单。
需要权限: ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| accountId | number | 否 | 用户ID,取值范围:大于等于0。 accountId可以通过@ohos.account.osAccount中的getOsAccountLocalId等接口来获取。 - 调用接口时,若传入accountId,表示指定用户。 - 调用接口时,若未传入accountId,表示当前用户。 |
返回值:
| 类型 | 说明 |
|---|---|
| Array<string> | 返回当前用户下的应用程序包安装禁止名单。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
try {
// 参数需根据实际情况进行替换
let result: Array<string> = bundleManager.getDisallowedInstallBundlesSync(wantTemp, 100);
console.info(`Succeeded in getting disallowed install bundles, result : ${JSON.stringify(result)}`);
} catch (err) {
console.error(`Failed to get disallowed install bundles. Code is ${err.code}, message is ${err.message}`);
}
bundleManager.addDisallowedUninstallBundlesSync
addDisallowedUninstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void
添加应用至包卸载禁止名单,添加至禁止名单的应用不允许在当前/指定用户下卸载。
需要权限: ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| appIds | Array<string> | 是 | 应用ID数组。 |
| accountId | number | 否 | 用户ID,取值范围:大于等于0。 accountId可以通过@ohos.account.osAccount中的getOsAccountLocalId等接口来获取。 - 调用接口时,若传入accountId,表示指定用户。 - 调用接口时,若未传入accountId,表示当前用户。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
// 需根据实际情况进行替换
let appIds: Array<string> = ['com.example.******_******/******5t5CoBM='];
try {
// 参数需根据实际情况进行替换
bundleManager.addDisallowedUninstallBundlesSync(wantTemp, appIds, 100);
console.info('Succeeded in adding disallowed uninstall bundles.');
} catch (err) {
console.error(`Failed to add disallowed uninstall bundles. Code is ${err.code}, message is ${err.message}`);
}
bundleManager.removeDisallowedUninstallBundlesSync
removeDisallowedUninstallBundlesSync(admin: Want, appIds: Array<string>, accountId?: number): void
在包卸载禁止名单中移除应用。在禁止名单存在的情况下,在包卸载禁止名单中的应用不允许在当前/指定用户下卸载。
需要权限: ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| appIds | Array<string> | 是 | 应用ID数组。 |
| accountId | number | 否 | 用户ID,取值范围:大于等于0。 accountId可以通过@ohos.account.osAccount中的getOsAccountLocalId等接口来获取。 - 调用接口时,若传入accountId,表示指定用户。 - 调用接口时,若未传入accountId,表示当前用户。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
// 需根据实际情况进行替换
let appIds: Array<string> = ['com.example.******_******/******5t5CoBM='];
try {
// 参数需根据实际情况进行替换
bundleManager.removeDisallowedUninstallBundlesSync(wantTemp, appIds, 100);
console.info('Succeeded in removing disallowed uninstall bundles.');
} catch (err) {
console.error(`Failed to remove disallowed uninstall bundles. Code is ${err.code}, message is ${err.message}`);
}
bundleManager.getDisallowedUninstallBundlesSync
getDisallowedUninstallBundlesSync(admin: Want, accountId?: number): Array<string>
获取当前/指定用户下包卸载禁止名单。
需要权限: ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| accountId | number | 否 | 用户ID,取值范围:大于等于0。 accountId可以通过@ohos.account.osAccount中的getOsAccountLocalId等接口来获取。 - 调用接口时,若传入accountId,表示指定用户。 - 调用接口时,若未传入accountId,表示当前用户。 |
返回值:
| 类型 | 说明 |
|---|---|
| Array<string> | 返回当前用户下的包卸载禁止名单。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
try {
// 参数需根据实际情况进行替换
let result: Array<String> = bundleManager.getDisallowedUninstallBundlesSync(wantTemp, 100);
console.info(`Succeeded in getting disallowed uninstall bundles, result : ${JSON.stringify(result)}`);
} catch (err) {
console.error(`Failed to get disallowed uninstall bundles. Code is ${err.code}, message is ${err.message}`);
}
bundleManager.uninstall
uninstall(admin: Want, bundleName: string, userId?: number, isKeepData?: boolean): Promise<void>
卸载当前/指定用户下的指定包接口,选择是否保留包数据(由isKeepData指定)。使用promise异步回调。
需要权限: ohos.permission.ENTERPRISE_INSTALL_BUNDLE
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| bundleName | string | 是 | 应用程序包名。 |
| userId | number | 否 | 用户ID,取值范围:大于等于0。 - 调用接口时,若传入userId,表示指定用户。 - 调用接口时,若未传入userId,表示当前用户。 |
| isKeepData | boolean | 否 | 是否保留包数据,true表示保留,false表示不保留。 |
返回值:
| 类型 | 说明 |
|---|---|
| Promise<void> | 无返回结果的Promise对象。当包卸载失败时抛出错误对象。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
// 参数需根据实际情况进行替换
bundleManager.uninstall(wantTemp, 'bundleName', 100, true).then(() => {
console.info('Succeeded in uninstalling bundles.');
}).catch((err: BusinessError) => {
console.error(`Failed to uninstall bundles. Code is ${err.code}, message is ${err.message}`);
});
bundleManager.install
install(admin: Want, hapFilePaths: Array<string>, installParam?: InstallParam): Promise<void>
安装指定路径下的应用包。使用promise异步回调。
此接口只能安装分发类型为enterprise_mdm(MDM应用)和enterprise_normal(普通企业应用)类型的应用,可以通过getBundleInfoForSelf接口查询应用自身的BundleInfo,其中BundleInfo.appInfo.appDistributionType为应用的分发类型。
需要权限: ohos.permission.ENTERPRISE_INSTALL_BUNDLE
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
模型约束: 此接口仅可在Stage模型下使用。
参数:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| admin | Want | 是 | 企业设备管理扩展组件。 |
| hapFilePaths | Array<string> | 是 | 待安装应用包路径数组。 |
| installParam | InstallParam | 否 | 应用包安装参数。 |
返回值:
| 类型 | 说明 |
|---|---|
| Promise<void> | 无返回结果的Promise对象。当应用程序包安装失败时,抛出错误对象。 |
错误码:
| 错误码ID | 错误信息 |
|---|---|
| 9200001 | The application is not an administrator application of the device. |
| 9200002 | The administrator application does not have permission to manage the device. |
| 9201002 | Failed to install the application. |
| 201 | Permission verification failed. The application does not have the permission required to call the API. |
| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. |
示例:
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
// 为当前用户安装应用
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
// 需根据实际情况进行替换
let hapFilePaths: Array<string> = ['/data/storage/el2/base/haps/entry/testinstall/ExtensionTest.hap'];
bundleManager.install(wantTemp, hapFilePaths).then(() => {
console.info('Succeeded in installing bundles.');
}).catch((err: BusinessError) => {
console.error(`Failed to install bundles. Code is ${err.code}, message is ${err.message}`);
});
import { bundleManager } from '@kit.MDMKit';
import { Want } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
// 为所有用户安装应用
let wantTemp: Want = {
// 需根据实际情况进行替换
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
// 需根据实际情况进行替换
let hapFilePaths: Array<string> = ['/data/storage/el2/base/haps/entry/testinstall/ExtensionTest.hap'];
const params: Record<string, string> = {
'ohos.bms.param.enterpriseForAllUser': 'true'
};
let installParam: bundleManager.InstallParam = {
// 需根据实际情况进行替换
userId: 100,
installFlag: 0,
parameters: params
};
bundleManager.install(wantTemp, hapFilePaths, installParam).then(() => {
console.info('Succeeded in installing bundles.');
}).catch((err: BusinessError) => {
console.error(`Failed to install bundles. Code is ${err.code}, message is ${err.message}`);
});
InstallParam
应用包安装需指定的参数信息。
系统能力: SystemCapability.Customization.EnterpriseDeviceManager
| 名称 | 类型 | 只读 | 可选 | 说明 |
|---|---|---|---|---|
| userId | number | 否 | 是 | 指示用户id,默认值:调用方所在用户,取值范围:大于等于0。 |
| installFlag | number | 否 | 是 | 安装标志。枚举值:0:应用初次安装,1:应用覆盖安装,2:应用免安装,默认值为应用初次安装。 |
| parameters19+ | Record<string, string> | 否 | 是 | 扩展参数,默认值为空。key取值支持"ohos.bms.param.enterpriseForAllUser",若对应的value值为"true",表示为所有用户安装应用。 |