未验证 提交 0bd4d08b 编写于 作者: O openharmony_ci 提交者: Gitee

!7154 xts-签名文件修改

Merge pull request !7154 from chengxingzhen/master
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import ServiceExtension from '@ohos.app.ability.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent";
import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc';
export default class ServiceAbility extends ServiceExtension {
onCreate(want:Want) {
globalThis.abilityWant = want;
globalThis.serviceContext = this.context
let direction = this.context.config.direction
let pointerDervice = this.context.config.hasPointerDevice
let AbilityInfo = this.context.extensionAbilityInfo.bundleName
console.log('ServiceAbility onCreate, want: ' + want.abilityName);
var CommonEventPublishData = {
parameters: {
"config": direction,
"poniterDevices": pointerDervice,
"AbilityInfo":AbilityInfo
}
}
commonEvent.publish("ExtensionConext_StartAbility", CommonEventPublishData, (err) => {
console.info("ExtensionConext_StartAbility onCreate");
});
}
onRequest(want, startId) {
console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId);
console.log('ServiceAbility registerApplicationStateObserver begin');
setTimeout(()=>{
this.context.terminateSelf().then((data) => {
console.info("terminateSelf data = " + JSON.stringify(data));
}).catch((err) => {
console.info("terminateSelf err = " + JSON.stringify(err));
});
}, 3000)
}
onConnect(want) {
console.log('ServiceAbility onConnect, want:' + want.abilityName);
return null;
}
onDisconnect(want) {
console.log('ServiceAbility onDisconnect, want:' + want.abilityName);
}
onDestroy() {
console.log('ServiceAbility onDestroy');
}
}
\ No newline at end of file
......@@ -568,57 +568,6 @@ export default function ApiCoverTest() {
})
})
/*
* @tc.number SUB_AA_FMS_AbilityStage_0200
* @tc.name Start Service and get config.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_FMS_AbilityStage_0200', 0, async function (done) {
let subscriber = null
let subscribeInfo = {
events: ["ExtensionConext_StartAbility"]
}
function UnSubscribeInfoCallback(err, data) {
console.info("SUB_AA_FMS_AbilityStage_0200===UnSubscribeInfoCallback===")
}
async function SubscribeInfoCallback(err, data) {
console.info("SUB_AA_FMS_AbilityStage_0200===SubscribeInfoCallback===" + JSON.stringify(data))
console.info("SUB_AA_FMS_AbilityStage_0200===serviceContext===" + JSON.stringify(globalThis.serviceContext))
console.info("SUB_AA_FMS_AbilityStage_0200===config===" + JSON.stringify(globalThis.serviceContext.config))
expect(data.parameters["config"]).assertLess(2)
expect(data.parameters["poniterDevices"]).assertFalse()
expect(data.parameters["AbilityInfo"]).assertEqual("com.example.apicoverhaptest")
let direction = globalThis.serviceContext.config.direction
let pointerDervice = globalThis.serviceContext.config.hasPointerDevice
let AbilityInfo = globalThis.serviceContext.extensionAbilityInfo.bundleName
expect(direction).assertLess(2)
expect(pointerDervice).assertFalse()
expect(AbilityInfo).assertEqual("com.example.apicoverhaptest")
commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
await sleep(4000)
done()
}
commonEvent.createSubscriber(subscribeInfo, (err, data) => {
console.info("SUB_AA_FMS_AbilityStage_0200===CreateSubscriberCallback===")
subscriber = data
commonEvent.subscribe(subscriber, SubscribeInfoCallback)
})
let formWant ={
deviceId:"",
bundleName:"com.example.apicoverhaptest",
abilityName:"ServiceAbility",
}
globalThis.abilityContext.startAbility(formWant, (err, data)=>{
if(err.code == 0){
console.info("SUB_AA_FMS_AbilityStage_0200===abilityContext startAbility success===")
}else{
expect().assertFail()
done()
}
})
})
/*
* @tc.number SUB_AA_FMS_AcquireForm_0100
* @tc.name Test startAbility in FormExtensionContext.
......
......@@ -82,34 +82,24 @@
"resource": "$profile:form_config"
}
]
},
{
"name": "ServiceAbility",
"srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts",
"label": "$string:MainAbility_label",
"description": "$string:MainAbility_desc",
"type": "service",
"visible": true
}
],
"requestPermissions":[
{
"name":"ohos.permission.GET_RUNNING_INFO"
},
{
"name":"ohos.permission.REQUIRE_FORM"
},
"requestPermissions": [
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND"
"name": "ohos.permission.REQUIRE_FORM",
"reason": "need use ohos.permission.REQUIRE_FORM"
},
{
"name":"ohos.permission.START_INVISIBLE_ABILITY"
"name": "ohos.permission.UPDATE_CONFIGURATION",
"reason": "need use ohos.permission.UPDATE_CONFIGURATION"
},
{
"name":"ohos.permission.UPDATE_CONFIGURATION"
"name": "ohos.permission.GET_RUNNING_INFO",
"reason": "need use ohos.permission.GET_RUNNING_INFO"
}
]
}
......
[ZoneTransfer]
ZoneId=0
ReferrerUrl=vscode-file://vscode-app/d:/Software/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html
HostUrl=file:///d%3A/OpenHarmony/Xts/xts_acts-master/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b
......@@ -81,26 +81,11 @@
}
],
"requestPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO"
},
{
"name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name":"ohos.permission.REMOVE_CACHE_FILES"
},
{
"name":"ohos.permission.LISTEN_BUNDLE_CHANGE"
},
{
"name":"ohos.permission.INSTALL_BUNDLE"
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
}
]
}
......
[ZoneTransfer]
ZoneId=0
ReferrerUrl=vscode-file://vscode-app/d:/Software/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html
HostUrl=file:///d%3A/OpenHarmony/Xts/xts_acts-master/aafwk/aafwk_standard/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b
......@@ -27,7 +27,7 @@ describe('CoverApiTest', function () {
*/
it('SUB_AA_OpenHarmony_CoverApi_0500', 0, async function (done) {
console.log("------------start SUB_AA_OpenHarmony_CoverApi_0500-------------");
appManager.isRunningInStabilityTest()
await appManager.isRunningInStabilityTest()
.then((data) => {
console.info('SUB_AA_OpenHarmony_CoverApi_0500 successful. data: ' + JSON.stringify(data));
expect(data == false).assertTrue();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册