diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets index fbc7f9b3f0f6cfeb6e07f8e129434c1601d0e0c1..c33356ab86a123a37783994d713c0dad8d33f449 100644 --- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets +++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets @@ -315,7 +315,7 @@ export default function ApiCoverTest() { try { let info: appManager.ProcessRunningInfo; let stageContext: common.AbilityStageContext = globalThis.stageContext; - let abilityContext: common.AbilityContext = globalThis.abilityContext; + let abilityContext: common.UIAbilityContext = globalThis.abilityContext; let appContext: common.ApplicationContext = abilityContext.getApplicationContext(); let baseContext: common.BaseContext = stageContext; let context: common.Context = stageContext; @@ -340,18 +340,7 @@ export default function ApiCoverTest() { abilityDelegator.addAbilityMonitor(abilityMonitor, (err, data) => { console.log(`printMsg, err: ${JSON.stringify(err)}, data: ${JSON.stringify(data)}`); }) - abilityDelegator.printMsg(undefined); - abilityDelegator.printMsg(undefined, (err, data) => { - console.log(`printMsg, err: ${JSON.stringify(err)}, data: ${JSON.stringify(data)}`); - }); let shellCmdResult: abilityDelegatorRegistry.ShellCmdResult; - shellCmdResult = await abilityDelegator.executeShellCmd(undefined); - abilityDelegator.executeShellCmd(undefined, 0, (err, data) => { - console.log(`executeShellCmd, err: ${JSON.stringify(err)}, data: ${JSON.stringify(data)}`); - }); - abilityDelegator.executeShellCmd(undefined, (err, data) => { - console.log(`executeShellCmd, err: ${JSON.stringify(err)}, data: ${JSON.stringify(data)}`); - }); } catch (err) { console.log(`catch code: ${err.code}, message: ${err.message}`); } diff --git a/ability/ability_runtime/apicover/formmodule/entry/src/main/ets/ModuleAbility/ModuleAbility.ts b/ability/ability_runtime/apicover/formmodule/entry/src/main/ets/ModuleAbility/ModuleAbility.ts index 169bca1f8fcad76c3f19b7dc4ca83463ec1c0efe..f681e8972e0b12074cfa3f458616fd719176e6e6 100644 --- a/ability/ability_runtime/apicover/formmodule/entry/src/main/ets/ModuleAbility/ModuleAbility.ts +++ b/ability/ability_runtime/apicover/formmodule/entry/src/main/ets/ModuleAbility/ModuleAbility.ts @@ -1,8 +1,7 @@ -import Ability from '@ohos.app.ability.Ability' -import AbilityConstant - from "../../../../../../../../../../../../interface/sdk-js/api/@ohos.app.ability.AbilityConstant"; +import UIAbility from '@ohos.app.ability.UIAbility' +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; -export default class ModuleAbility extends Ability { +export default class ModuleAbility extends UIAbility { onCreate(want, launchParam) { console.log("[Demo] MainAbility onCreate") globalThis.abilityWant = want; @@ -53,5 +52,4 @@ export default class ModuleAbility extends Ability { console.log("[Demo] MainAbility onDump: " + JSON.stringify(param)) return ["MainAbility"] } - };