提交 9dccfc21 编写于 作者: G Gloria

Update docs against

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 586c4467
...@@ -226,7 +226,7 @@ A system application uses the [startServiceExtensionAbility()](../reference/apis ...@@ -226,7 +226,7 @@ A system application uses the [startServiceExtensionAbility()](../reference/apis
"abilityName": "ServiceExtAbility" "abilityName": "ServiceExtAbility"
}; };
context.stopServiceExtensionAbility(want).then(() => { context.stopServiceExtensionAbility(want).then(() => {
console.info('Succeeded in stoping ServiceExtensionAbility.'); console.info('Succeeded in stopping ServiceExtensionAbility.');
}).catch((err) => { }).catch((err) => {
console.error(`Failed to stop ServiceExtensionAbility. Code is ${err.code}, message is ${err.message}`); console.error(`Failed to stop ServiceExtensionAbility. Code is ${err.code}, message is ${err.message}`);
}) })
...@@ -267,7 +267,7 @@ The ServiceExtensionAbility returns an IRemoteObject in the **onConnect()** call ...@@ -267,7 +267,7 @@ The ServiceExtensionAbility returns an IRemoteObject in the **onConnect()** call
}; };
let options = { let options = {
onConnect(elementName, remote) { onConnect(elementName, remote) {
/* The input parameter remote is the object returned by the ServiceExtensionAbility in the onConnect lifecycle callback. /* remote is the object returned by the ServiceExtensionAbility in the onConnect lifecycle callback.
* This object is used for communication with the ServiceExtensionAbility. For details, see the section below. * This object is used for communication with the ServiceExtensionAbility. For details, see the section below.
*/ */
console.info('onConnect callback'); console.info('onConnect callback');
...@@ -346,7 +346,9 @@ After obtaining the [rpc.RemoteObject](../reference/apis/js-apis-rpc.md#iremoteo ...@@ -346,7 +346,9 @@ After obtaining the [rpc.RemoteObject](../reference/apis/js-apis-rpc.md#iremoteo
console.info(`onConnect remote is null`); console.info(`onConnect remote is null`);
return; return;
} }
// Directly call the RPC interface to send messages to the server. The client needs to serialize the input parameters and deserialize the return values. The process is complex. /* Directly call the RPC interface to send messages to the server.
* The client needs to serialize the input parameters and deserialize the return values. The process is complex.
*/
let option = new rpc.MessageOption(); let option = new rpc.MessageOption();
let data = new rpc.MessageSequence(); let data = new rpc.MessageSequence();
let reply = new rpc.MessageSequence(); let reply = new rpc.MessageSequence();
...@@ -440,7 +442,9 @@ When a ServiceExtensionAbility is used to provide sensitive services, the client ...@@ -440,7 +442,9 @@ When a ServiceExtensionAbility is used to provide sensitive services, the client
let callerTokenId = rpc.IPCSkeleton.getCallingTokenId(); let callerTokenId = rpc.IPCSkeleton.getCallingTokenId();
let accessManger = abilityAccessCtrl.createAtManager(); let accessManger = abilityAccessCtrl.createAtManager();
// The permission to be verified varies depending on the service requirements. ohos.permission.SET_WALLPAPER is only an example. /* The permission to be verified varies depending on the service requirements.
* ohos.permission.SET_WALLPAPER is only an example.
*/
let grantStatus = let grantStatus =
accessManger.verifyAccessTokenSync(callerTokenId, "ohos.permission.SET_WALLPAPER"); accessManger.verifyAccessTokenSync(callerTokenId, "ohos.permission.SET_WALLPAPER");
if (grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_DENIED) { if (grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_DENIED) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册