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

!9533 翻译完成:9031 修改WindowExtensionAbility的onConnect方法

Merge pull request !9533 from wusongqing/TR9031
...@@ -25,56 +25,25 @@ import WindowExtensionAbility from '@ohos.application.WindowExtensionAbility'; ...@@ -25,56 +25,25 @@ import WindowExtensionAbility from '@ohos.application.WindowExtensionAbility';
## WindowExtensionAbility.onConnect ## WindowExtensionAbility.onConnect
onConnect(want: Want): rpc.RemoteObject onConnect(want: Want): void
Called when this Window Extension ability is connected to an ability for the first time. Called when this Window Extension ability is connected to an ability for the first time.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information related to this Window Extension ability, including the ability name and bundle name. | | want | [Want](js-apis-application-Want.md) | Yes| Information related to this Window Extension ability, including the ability name and bundle name.|
**Return value**
| Type | Description |
| ----------------------------------------------- | -------------------- |
| [rpc.RemoteObject](js-apis-rpc.md#remoteobject) | Proxy of this Window Extension ability.|
**Example** **Example**
```ts ```ts
import rpc from '@ohos.rpc';
class StubTest extends rpc.RemoteObject {
constructor(des) {
super(des);
}
onRemoteRequest(code, data, reply, option) {
return true;
}
queryLocalInterface(descriptor) {
return null;
}
getInterfaceDescriptor() {
return "";
}
sendRequest(code, data, reply, options) {
return null;
}
getCallingPid() {
return 1;
}
getCallingUid() {
return 1;
}
attachLocalInterface(localInterface, descriptor){}
}
export default class MyWindowExtensionAbility extends WindowExtensionAbility { export default class MyWindowExtensionAbility extends WindowExtensionAbility {
onConnect(want): rpc.RemoteObject { onConnect(want) {
console.info('WindowExtAbility onConnect ' + want.abilityName); console.info('WindowExtAbility onConnect ' + want.abilityName);
return new StubTest("test");
} }
} }
...@@ -88,9 +57,11 @@ Called when this Window Extension ability is disconnected from all connected abi ...@@ -88,9 +57,11 @@ Called when this Window Extension ability is disconnected from all connected abi
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information related to this Window Extension ability, including the ability name and bundle name. | | want | [Want](js-apis-application-Want.md) | Yes| Information related to this Window Extension ability, including the ability name and bundle name.|
**Example** **Example**
...@@ -105,7 +76,6 @@ export default class MyWindowExtensionAbility extends WindowExtensionAbility { ...@@ -105,7 +76,6 @@ export default class MyWindowExtensionAbility extends WindowExtensionAbility {
} }
``` ```
## WindowExtensionAbility.onWindowReady ## WindowExtensionAbility.onWindowReady
onWindowReady(window: Window): void onWindowReady(window: Window): void
...@@ -114,6 +84,8 @@ Called when a window is ready. ...@@ -114,6 +84,8 @@ Called when a window is ready.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| window | [Window](js-apis-window.md) | Yes| Current **Window** instance.| | window | [Window](js-apis-window.md) | Yes| Current **Window** instance.|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册