harmony 鸿蒙元能力子系统ChangeLog

  • 2023-02-03
  • 浏览 (534)

元能力子系统ChangeLog

cl.ability.1 SystemAPI使用规则变更

目前元能力提供的system-api在调用时未做系统应用校验,三方应用使用Full版本的SDK就可以使用这些system-api,存在安全隐患,因此在OpenHarmony 4.0.2.1版本开始增加应用身份校验。

变更影响

只有系统应用允许使用system-api,三方应用使用system-api将返回202错误,返回202错误的方式有两种:1.抛异常;2.异步回调

关键接口/组件变更

system-api列表如下所示。

模块名 方法 返回错误码方式
@ohos.app.ability.abilityManager.d.ts updateConfiguration(config: Configuration, callback: AsyncCallback): void 异步回调
@ohos.app.ability.abilityManager.d.ts updateConfiguration(config: Configuration): Promise 异步回调
@ohos.app.ability.abilityManager.d.ts getAbilityRunningInfos(): Promise> 异步回调
@ohos.app.ability.abilityManager.d.ts getAbilityRunningInfos(callback: AsyncCallback>): void 异步回调
@ohos.app.ability.abilityManager.d.ts getExtensionRunningInfos(upperLimit: number): Promise> 异步回调
@ohos.app.ability.abilityManager.d.ts getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void 异步回调
@ohos.app.ability.abilityManager.d.ts getTopAbility(): Promise 抛异常
@ohos.app.ability.abilityManager.d.ts getTopAbility(callback: AsyncCallback): void 抛异常
@ohos.app.ability.appManager.d.ts on(type: “applicationState”, observer: ApplicationStateObserver): number 异步回调
@ohos.app.ability.appManager.d.ts on(type: “applicationState”, observer: ApplicationStateObserver, bundleNameList: Array): number 异步回调
@ohos.app.ability.appManager.d.ts off(type: “applicationState”, observerId: number, callback: AsyncCallback): void 异步回调
@ohos.app.ability.appManager.d.ts off(type: “applicationState”, observerId: number): Promise 异步回调
@ohos.app.ability.appManager.d.ts getForegroundApplications(callback: AsyncCallback>): void 异步回调
@ohos.app.ability.appManager.d.ts getForegroundApplications(): Promise> 异步回调
@ohos.app.ability.appManager.d.ts killProcessWithAccount(bundleName: string, accountId: number): Promise 异步回调
@ohos.app.ability.appManager.d.ts killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void 异步回调
@ohos.app.ability.appManager.d.ts killProcessesByBundleName(bundleName: string): Promise 异步回调
@ohos.app.ability.appManager.d.ts killProcessesByBundleName(bundleName: string, callback: AsyncCallback) 异步回调
@ohos.app.ability.appManager.d.ts clearUpApplicationData(bundleName: string): Promise 异步回调
@ohos.app.ability.appManager.d.ts clearUpApplicationData(bundleName: string, callback: AsyncCallback) 异步回调
@ohos.app.ability.missionManager.d.ts on(type: “mission”, listener: MissionListener): number 异步回调
@ohos.app.ability.missionManager.d.ts off(type: “mission”, listenerId: number, callback: AsyncCallback): void 异步回调
@ohos.app.ability.missionManager.d.ts off(type: “mission”, listenerId: number): Promise 异步回调
@ohos.app.ability.missionManager.d.ts getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void 异步回调
@ohos.app.ability.missionManager.d.ts getMissionInfo(deviceId: string, missionId: number): Promise 异步回调
@ohos.app.ability.missionManager.d.ts getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void 异步回调
@ohos.app.ability.missionManager.d.ts getMissionInfos(deviceId: string, numMax: number): Promise> 异步回调
@ohos.app.ability.missionManager.d.ts getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void 异步回调
@ohos.app.ability.missionManager.d.ts getMissionSnapShot(deviceId: string, missionId: number): Promise 异步回调
@ohos.app.ability.missionManager.d.ts getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void 异步回调
@ohos.app.ability.missionManager.d.ts getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise 异步回调
@ohos.app.ability.missionManager.d.ts lockMission(missionId: number, callback: AsyncCallback): void 异步回调
@ohos.app.ability.missionManager.d.ts lockMission(missionId: number): Promise 异步回调
@ohos.app.ability.missionManager.d.ts unlockMission(missionId: number, callback: AsyncCallback): void 异步回调
@ohos.app.ability.missionManager.d.ts unlockMission(missionId: number): Promise 异步回调
@ohos.app.ability.missionManager.d.ts clearMission(missionId: number, callback: AsyncCallback): void 异步回调
@ohos.app.ability.missionManager.d.ts clearMission(missionId: number): Promise 异步回调
@ohos.app.ability.missionManager.d.ts clearAllMissions(callback: AsyncCallback): void 异步回调
@ohos.app.ability.missionManager.d.ts clearAllMissions(): Promise 异步回调
@ohos.app.ability.missionManager.d.ts moveMissionToFront(missionId: number, callback: AsyncCallback): void 异步回调
@ohos.app.ability.missionManager.d.ts moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback): void 异步回调
@ohos.app.ability.missionManager.d.ts moveMissionToFront(missionId: number, options?: StartOptions): Promise 异步回调
@ohos.app.ability.quickFixManager.d.ts applyQuickFix(hapModuleQuickFixFiles: Array, callback: AsyncCallback): void 异步回调
@ohos.app.ability.quickFixManager.d.ts applyQuickFix(hapModuleQuickFixFiles: Array): Promise 异步回调
@ohos.app.ability.quickFixManager.d.ts getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void 异步回调
@ohos.app.ability.quickFixManager.d.ts getApplicationQuickFixInfo(bundleName: string): Promise 异步回调
@ohos.app.ability.wantAgent.d.ts getWant(agent: WantAgent, callback: AsyncCallback): void 异步回调
@ohos.app.ability.wantAgent.d.ts getWant(agent: WantAgent): Promise 异步回调
@ohos.app.form.formHost.d.ts deleteForm(formId: string, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts deleteForm(formId: string): Promise 异步回调
@ohos.app.form.formHost.d.ts releaseForm(formId: string, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts releaseForm(formId: string, isReleaseCache?: boolean): Promise 异步回调
@ohos.app.form.formHost.d.ts requestForm(formId: string, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts requestForm(formId: string): Promise 异步回调
@ohos.app.form.formHost.d.ts castToNormalForm(formId: string, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts castToNormalForm(formId: string): Promise 异步回调
@ohos.app.form.formHost.d.ts notifyVisibleForms(formIds: Array, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts notifyVisibleForms(formIds: Array): Promise 异步回调
@ohos.app.form.formHost.d.ts notifyInvisibleForms(formIds: Array, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts notifyInvisibleForms(formIds: Array): Promise 异步回调
@ohos.app.form.formHost.d.ts enableFormsUpdate(formIds: Array, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts enableFormsUpdate(formIds: Array): Promise 异步回调
@ohos.app.form.formHost.d.ts disableFormsUpdate(formIds: Array, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts disableFormsUpdate(formIds: Array): Promise 异步回调
@ohos.app.form.formHost.d.ts isSystemReady(callback: AsyncCallback): void 抛异常
@ohos.app.form.formHost.d.ts isSystemReady(): Promise 抛异常
@ohos.app.form.formHost.d.ts getAllFormsInfo(callback: AsyncCallback>): void 异步回调
@ohos.app.form.formHost.d.ts getAllFormsInfo(): Promise> 异步回调
@ohos.app.form.formHost.d.ts getFormsInfo(bundleName: string, callback: AsyncCallback>): void 异步回调
@ohos.app.form.formHost.d.ts getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback>): void 异步回调
@ohos.app.form.formHost.d.ts getFormsInfo(bundleName: string, moduleName?: string): Promise> 异步回调
@ohos.app.form.formHost.d.ts deleteInvalidForms(formIds: Array, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts deleteInvalidForms(formIds: Array): Promise 异步回调
@ohos.app.form.formHost.d.ts acquireFormState(want: Want, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts acquireFormState(want: Want): Promise 异步回调
@ohos.app.form.formHost.d.ts on(type: “formUninstall”, callback: Callback): void 抛异常
@ohos.app.form.formHost.d.ts off(type: “formUninstall”, callback?: Callback): void 抛异常
@ohos.app.form.formHost.d.ts notifyFormsVisible(formIds: Array, isVisible: boolean, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts notifyFormsVisible(formIds: Array, isVisible: boolean): Promise 异步回调
@ohos.app.form.formHost.d.ts notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean): Promise 异步回调
@ohos.app.form.formHost.d.ts shareForm(formId: string, deviceId: string, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts shareForm(formId: string, deviceId: string): Promise 异步回调
@ohos.app.form.formHost.d.ts notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean, callback: AsyncCallback): void 异步回调
@ohos.app.form.formHost.d.ts notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean): Promise 异步回调
@ohos.app.form.formProvider.d.ts requestPublishForm(want: Want, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void 异步回调
@ohos.app.form.formProvider.d.ts requestPublishForm(want: Want, callback: AsyncCallback): void 异步回调
@ohos.app.form.formProvider.d.ts requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData): Promise 异步回调
@ohos.app.form.formProvider.d.ts isRequestPublishFormSupported(callback: AsyncCallback): void 抛异常
@ohos.app.form.formProvider.d.ts isRequestPublishFormSupported(): Promise 抛异常
UIAbilityContext.d.ts startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void 异步回调
UIAbilityContext.d.ts startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void 异步回调
UIAbilityContext.d.ts startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise 异步回调
UIAbilityContext.d.ts startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void 抛异常
UIAbilityContext.d.ts startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void 抛异常
UIAbilityContext.d.ts startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise 抛异常
UIAbilityContext.d.ts startServiceExtensionAbility(want: Want, callback: AsyncCallback): void 异步回调
UIAbilityContext.d.ts startServiceExtensionAbility(want: Want): Promise 异步回调
UIAbilityContext.d.ts startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void 异步回调
UIAbilityContext.d.ts startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise 异步回调
UIAbilityContext.d.ts stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void 异步回调
UIAbilityContext.d.ts stopServiceExtensionAbility(want: Want): Promise 异步回调
UIAbilityContext.d.ts stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void 异步回调
UIAbilityContext.d.ts stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise 异步回调
UIAbilityContext.d.ts connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number 异步回调
UIAbilityContext.d.ts setMissionIcon(icon: image.PixelMap, callback: AsyncCallback): void 异步回调
UIAbilityContext.d.ts setMissionIcon(icon: image.PixelMap): Promise 异步回调
ServiceExtensionContext.d.ts startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void 异步回调
ServiceExtensionContext.d.ts startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void 异步回调
ServiceExtensionContext.d.ts startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise 异步回调
ServiceExtensionContext.d.ts startServiceExtensionAbility(want: Want, callback: AsyncCallback): void 异步回调
ServiceExtensionContext.d.ts startServiceExtensionAbility(want: Want): Promise 异步回调
ServiceExtensionContext.d.ts startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void 异步回调
ServiceExtensionContext.d.ts startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise 异步回调
ServiceExtensionContext.d.ts stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void 异步回调
ServiceExtensionContext.d.ts stopServiceExtensionAbility(want: Want): Promise 异步回调
ServiceExtensionContext.d.ts stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void 异步回调
ServiceExtensionContext.d.ts stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise 异步回调
ServiceExtensionContext.d.ts connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number 异步回调
Context.d.ts createBundleContext(bundleName: string): Context 抛异常
Context.d.ts createModuleContext(bundleName: string, moduleName: string): Context 抛异常
FormExtensionContext.d.ts startAbility(want: Want, callback: AsyncCallback): void 异步回调
FormExtensionContext.d.ts startAbility(want: Want): Promise 异步回调

你可能感兴趣的鸿蒙文章

harmony 鸿蒙web子系统ChangeLog

harmony 鸿蒙蓝牙服务子系统ChangeLog

harmony 鸿蒙分布式数据管理子系统JS API变更Changelog

harmony 鸿蒙文件管理子系统ChangeLog

harmony 鸿蒙全球化子系统ChangeLog

harmony 鸿蒙媒体子系统ChangeLog

harmony 鸿蒙测试子系统ChangeLog

harmony 鸿蒙USB服务子系统ChangeLog

0  赞