js-apis-application-ability.md 17.2 KB
Newer Older
W
wusongqing 已提交
1 2
# Ability

3
> **NOTE**<br>
W
wusongqing 已提交
4
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
W
wusongqing 已提交
5 6 7 8 9 10 11 12 13 14 15

Manages the ability lifecycle and context.

## Modules to Import

```
import Ability from '@ohos.application.Ability';
```

## Attributes

W
wusongqing 已提交
16 17
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

W
wusongqing 已提交
18 19 20 21 22
| Name| Type| Readable| Writable| Description| 
| -------- | -------- | -------- | -------- | -------- |
| context | [AbilityContext](js-apis-ability-context.md) | Yes| No| Context of an ability.| 
| launchWant | [Want](js-apis-application-Want.md) | Yes| No| Parameters for starting the ability.| 
| lastRequestWant | [Want](js-apis-application-Want.md) | Yes| No| Parameters used when the ability was started last time.| 
W
wusongqing 已提交
23 24


W
wusongqing 已提交
25
## Ability.onCreate
W
wusongqing 已提交
26

W
wusongqing 已提交
27
onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
W
wusongqing 已提交
28 29 30

Called to initialize the service logic when an ability is created.

W
wusongqing 已提交
31 32 33 34
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
35 36 37 38
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | want | [Want](js-apis-application-Want.md) | Yes| Information related to this ability, including the ability name and bundle name.| 
  | param | AbilityConstant.LaunchParam | Yes| Parameters for starting the ability, and the reason for the last abnormal exit.| 
W
wusongqing 已提交
39

W
wusongqing 已提交
40
**Example**
W
wusongqing 已提交
41
    
W
wusongqing 已提交
42
  ```js
W
wusongqing 已提交
43 44 45 46 47 48 49 50
  class myAbility extends Ability {
      onCreate(want, param) {
          console.log('onCreate, want:' + want.abilityName);
      }
  }
  ```


W
wusongqing 已提交
51
## Ability.onWindowStageCreate
W
wusongqing 已提交
52 53 54 55 56

onWindowStageCreate(windowStage: window.WindowStage): void

Called when a **WindowStage** is created for this ability.

W
wusongqing 已提交
57 58 59 60
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
61 62 63
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | windowStage | window.WindowStage | Yes| **WindowStage** information.| 
W
wusongqing 已提交
64

W
wusongqing 已提交
65
**Example**
W
wusongqing 已提交
66
    
W
wusongqing 已提交
67
  ```js
W
wusongqing 已提交
68 69 70 71 72 73 74 75
  class myAbility extends Ability {
      onWindowStageCreate(windowStage) {
          console.log('onWindowStageCreate');
      }
  }
  ```


W
wusongqing 已提交
76
## Ability.onWindowStageDestroy
W
wusongqing 已提交
77 78 79 80 81

onWindowStageDestroy(): void

Called when the **WindowStage** is destroyed for this ability.

W
wusongqing 已提交
82 83 84
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Example**
W
wusongqing 已提交
85
    
W
wusongqing 已提交
86
  ```js
W
wusongqing 已提交
87 88 89 90 91 92 93 94
  class myAbility extends Ability {
      onWindowStageDestroy() {
          console.log('onWindowStageDestroy');
      }
  }
  ```


W
wusongqing 已提交
95
## Ability.onWindowStageRestore
W
wusongqing 已提交
96 97 98 99 100

onWindowStageRestore(windowStage: window.WindowStage): void

Called when the **WindowStage** is restored during the migration of this ability, which is a multi-instance ability.

W
wusongqing 已提交
101 102 103 104
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
105 106 107
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | windowStage | window.WindowStage | Yes| **WindowStage** information.| 
W
wusongqing 已提交
108

W
wusongqing 已提交
109
**Example**
W
wusongqing 已提交
110
    
W
wusongqing 已提交
111
  ```js
W
wusongqing 已提交
112 113 114 115 116 117 118 119
  class myAbility extends Ability {
      onWindowStageRestore(windowStage) {
          console.log('onWindowStageRestore');
      }
  }
  ```


W
wusongqing 已提交
120
## Ability.onDestroy
W
wusongqing 已提交
121 122 123 124 125

onDestroy(): void;

Called when this ability is destroyed to clear resources.

W
wusongqing 已提交
126 127 128
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Example**
W
wusongqing 已提交
129
    
W
wusongqing 已提交
130
  ```js
W
wusongqing 已提交
131 132 133 134 135 136 137 138
  class myAbility extends Ability {
      onDestroy() {
          console.log('onDestroy');
      }
  }
  ```


W
wusongqing 已提交
139
## Ability.onForeground
W
wusongqing 已提交
140 141 142

onForeground(): void;

W
wusongqing 已提交
143
Called when this ability is switched from the background to the foreground.
W
wusongqing 已提交
144

W
wusongqing 已提交
145 146 147
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Example**
W
wusongqing 已提交
148
    
W
wusongqing 已提交
149
  ```js
W
wusongqing 已提交
150 151 152 153 154 155 156 157
  class myAbility extends Ability {
      onForeground() {
          console.log('onForeground');
      }
  }
  ```


W
wusongqing 已提交
158
## Ability.onBackground
W
wusongqing 已提交
159 160 161

onBackground(): void;

W
wusongqing 已提交
162
Called when this ability is switched from the foreground to the background.
W
wusongqing 已提交
163

W
wusongqing 已提交
164 165 166
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Example**
W
wusongqing 已提交
167
    
W
wusongqing 已提交
168
  ```js
W
wusongqing 已提交
169 170 171 172 173 174 175 176
  class myAbility extends Ability {
      onBackground() {
          console.log('onBackground');
      }
  }
  ```


W
wusongqing 已提交
177
## Ability.onContinue
W
wusongqing 已提交
178

W
wusongqing 已提交
179
onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult;
W
wusongqing 已提交
180 181 182

Called to save data during the ability migration preparation process.

W
wusongqing 已提交
183 184 185 186
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
187 188 189
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | wantParam | {[key:&nbsp;string]:&nbsp;any} | Yes| **want** parameter.| 
W
wusongqing 已提交
190

W
wusongqing 已提交
191 192
**Return value**

W
wusongqing 已提交
193 194 195
  | Type| Description| 
  | -------- | -------- |
  | AbilityConstant.OnContinueResult | Continuation result.| 
W
wusongqing 已提交
196

W
wusongqing 已提交
197
**Example**
W
wusongqing 已提交
198
    
W
wusongqing 已提交
199
  ```js
W
wusongqing 已提交
200
  import AbilityConstant from "@ohos.application.AbilityConstant"
W
wusongqing 已提交
201 202 203 204
  class myAbility extends Ability {
      onContinue(wantParams) {
          console.log('onContinue');
          wantParams["myData"] = "my1234567";
W
wusongqing 已提交
205
          return AbilityConstant.OnContinueResult.AGREE;
W
wusongqing 已提交
206 207 208 209 210
      }
  }
  ```


W
wusongqing 已提交
211
## Ability.onNewWant
W
wusongqing 已提交
212 213 214 215 216

onNewWant(want: Want): void;

Called when the ability startup mode is set to singleton.

W
wusongqing 已提交
217 218 219 220
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
221 222 223
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | want | [Want](js-apis-application-Want.md) | Yes| Want parameters, such as the ability name and bundle name.| 
W
wusongqing 已提交
224

W
wusongqing 已提交
225
**Example**
W
wusongqing 已提交
226
    
W
wusongqing 已提交
227
  ```js
W
wusongqing 已提交
228 229 230 231 232 233 234 235
  class myAbility extends Ability {
      onNewWant(want) {
          console.log('onNewWant, want:' + want.abilityName);
      }
  }
  ```


W
wusongqing 已提交
236
## Ability.onConfigurationUpdated
W
wusongqing 已提交
237 238 239 240 241

onConfigurationUpdated(config: Configuration): void;

Called when the configuration of the environment where the ability is running is updated.

W
wusongqing 已提交
242 243 244 245
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
246 247 248
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | config | [Configuration](js-apis-configuration.md) | Yes| New configuration.| 
W
wusongqing 已提交
249

W
wusongqing 已提交
250
**Example**
W
wusongqing 已提交
251
    
W
wusongqing 已提交
252
  ```js
W
wusongqing 已提交
253 254 255 256 257 258 259
  class myAbility extends Ability {
      onConfigurationUpdated(config) {
          console.log('onConfigurationUpdated, config:' + JSON.stringify(config));
      }
  }
  ```

W
wusongqing 已提交
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
## Ability.dump

dump(params: Array\<string>): Array\<string>;

Called when the client information is dumped.

**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | params | Array\<string> | Yes| Parameters in the form of a command.| 

**Example**
    
  ```js
  class myAbility extends Ability {
      dump(params) {
          console.log('dump, params:' + JSON.stringify(params));
          return ["params"]
      }
  }
  ```


W
wusongqing 已提交
286 287 288 289 290 291

## Caller

Implements sending of sequenceable data to the target ability when an ability (caller) invokes the target ability (callee).


W
wusongqing 已提交
292
## Caller.call
W
wusongqing 已提交
293

W
wusongqing 已提交
294
call(method: string, data: rpc.Sequenceable): Promise&lt;void&gt;;
W
wusongqing 已提交
295 296 297

Sends sequenceable data to the target ability.

W
wusongqing 已提交
298 299 300 301
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
302 303 304 305
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | method | string | Yes| Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data.| 
  | data | rpc.Sequenceable | Yes| Sequenceable data. You need to customize the data.| 
W
wusongqing 已提交
306

W
wusongqing 已提交
307 308
**Return value**

W
wusongqing 已提交
309 310 311
  | Type| Description| 
  | -------- | -------- |
  | Promise&lt;void&gt; | Promise used to return a response.| 
W
wusongqing 已提交
312

W
wusongqing 已提交
313
**Example**
W
wusongqing 已提交
314
    
W
wusongqing 已提交
315
  ```js
W
wusongqing 已提交
316 317
  import Ability from '@ohos.application.Ability';
  class MyMessageAble{ // Custom sequenceable data structure
W
wusongqing 已提交
318 319 320
      name:""
      str:""
      num: 1
W
wusongqing 已提交
321 322 323 324
      constructor(name, str) {
        this.name = name;
        this.str = str;
      }
W
wusongqing 已提交
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
      marshalling(messageParcel) {
          messageParcel.writeInt(this.num);
          messageParcel.writeString(this.str);
          console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']');
          return true;
      }
      unmarshalling(messageParcel) {
          this.num = messageParcel.readInt();
          this.str = messageParcel.readString();
          console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']');
          return true;
      }
  };
  var method = 'call_Function'; // Notification message string negotiated by the two abilities
  var caller;
  export default class MainAbility extends Ability {
      onWindowStageCreate(windowStage) {
W
wusongqing 已提交
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358
        this.context.startAbilityByCall({
            bundleName: "com.example.myservice",
            abilityName: "com.example.myservice.MainAbility",
            deviceId: ""
        }).then((obj) => {
            caller = obj;
            let msg = new MyMessageAble(1, "world"); // See the definition of Sequenceable.
            caller.call(method, msg)
                .then(() => {
                    console.log('Caller call() called');
                }).catch((e) => {
                console.log('Caller call() catch error ' + e);
            });
            console.log('Caller GetCaller Get ' + caller);
        }).catch((e) => {
            console.log('Caller GetCaller error ' + e);
        });
W
wusongqing 已提交
359
      }
W
wusongqing 已提交
360
      
W
wusongqing 已提交
361 362 363 364
  }
  ```


W
wusongqing 已提交
365
## Caller.callWithResult
W
wusongqing 已提交
366

W
wusongqing 已提交
367
callWithResult(method: string, data: rpc.Sequenceable): Promise&lt;rpc.MessageParcel&gt;;
W
wusongqing 已提交
368 369 370

Sends sequenceable data to the target ability and obtains the sequenceable data returned by the target ability.

W
wusongqing 已提交
371 372 373 374
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
375 376 377 378
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | method | string | Yes| Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data.| 
  | data | rpc.Sequenceable | Yes| Sequenceable data. You need to customize the data.| 
W
wusongqing 已提交
379

W
wusongqing 已提交
380 381
**Return value**

W
wusongqing 已提交
382 383 384
  | Type| Description| 
  | -------- | -------- |
  | Promise&lt;rpc.MessageParcel&gt; | Promise used to return the sequenceable data from the target ability.| 
W
wusongqing 已提交
385

W
wusongqing 已提交
386
**Example**
W
wusongqing 已提交
387
    
W
wusongqing 已提交
388
  ```js
W
wusongqing 已提交
389 390
  import Ability from '@ohos.application.Ability';
  class MyMessageAble{
W
wusongqing 已提交
391 392 393
      name:""
      str:""
      num: 1
W
wusongqing 已提交
394 395 396 397
      constructor(name, str) {
        this.name = name;
        this.str = str;
      }
W
wusongqing 已提交
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413
      marshalling(messageParcel) {
          messageParcel.writeInt(this.num);
          messageParcel.writeString(this.str);
          console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']');
          return true;
      }
      unmarshalling(messageParcel) {
          this.num = messageParcel.readInt();
          this.str = messageParcel.readString();
          console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']');
          return true;
      }
  };
  var method = 'call_Function';
  var caller;
  export default class MainAbility extends Ability {
W
wusongqing 已提交
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
      onWindowStageCreate(windowStage) {
        this.context.startAbilityByCall({
            bundleName: "com.example.myservice",
            abilityName: "com.example.myservice.MainAbility",
            deviceId: ""
        }).then((obj) => {
            caller = obj;
            let msg = new MyMessageAble(1, "world");
            caller.callWithResult(method, msg)
                .then((data) => {
                    console.log('Caller callWithResult() called');
                    let retmsg = new MyMessageAble(0, "");
                    data.readSequenceable(retmsg);
                }).catch((e) => {
                console.log('Caller callWithResult() catch error ' + e);
            });
            console.log('Caller GetCaller Get ' + caller);
        }).catch((e) => {
            console.log('Caller GetCaller error ' + e);
        });
W
wusongqing 已提交
434 435 436 437 438
      }
  }
  ```


W
wusongqing 已提交
439
## Caller.release
W
wusongqing 已提交
440 441 442 443 444

release(): void;

Releases the caller interface of the target ability.

W
wusongqing 已提交
445 446 447
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Example**
W
wusongqing 已提交
448
    
W
wusongqing 已提交
449
  ```js
W
wusongqing 已提交
450 451 452 453
  import Ability from '@ohos.application.Ability';
  var caller;
  export default class MainAbility extends Ability {
      onWindowStageCreate(windowStage) {
W
wusongqing 已提交
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468
        this.context.startAbilityByCall({
            bundleName: "com.example.myservice",
            abilityName: "com.example.myservice.MainAbility",
            deviceId: ""
        }).then((obj) => {
            caller = obj;
            try {
                caller.release();
            } catch (e) {
                console.log('Caller Release error ' + e);
            }
            console.log('Caller GetCaller Get ' + caller);
        }).catch((e) => {
            console.log('Caller GetCaller error ' + e);
        });
W
wusongqing 已提交
469 470 471 472 473
      }
  }
  ```


W
wusongqing 已提交
474
## Caller.onRelease
W
wusongqing 已提交
475

W
wusongqing 已提交
476
onRelease(callback: OnReleaseCallBack): void;
W
wusongqing 已提交
477 478 479

Registers a callback that is invoked when the Stub on the target ability is disconnected.

W
wusongqing 已提交
480 481 482 483
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
484 485 486
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | callback | OnReleaseCallBack | Yes| Callback used for the **onRelease** API.| 
W
wusongqing 已提交
487

W
wusongqing 已提交
488
**Example**
W
wusongqing 已提交
489
    
W
wusongqing 已提交
490
  ```js
W
wusongqing 已提交
491 492 493 494
  import Ability from '@ohos.application.Ability';
  var caller;
  export default class MainAbility extends Ability {
      onWindowStageCreate(windowStage) {
W
wusongqing 已提交
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511
        this.context.startAbilityByCall({
            bundleName: "com.example.myservice",
            abilityName: "com.example.myservice.MainAbility",
            deviceId: ""
        }).then((obj) => {
            caller = obj;
            try {
                caller.onRelease((str) => {
                    console.log(' Caller OnRelease CallBack is called ' + str);
                });
            } catch (e) {
                console.log('Caller Release error ' + e);
            }
            console.log('Caller GetCaller Get ' + caller);
        }).catch((e) => {
            console.log('Caller GetCaller error ' + e);
        });
W
wusongqing 已提交
512 513 514 515 516 517 518
      }
  }
  ```


## Callee

W
wusongqing 已提交
519
Implements callbacks for caller notification registration and deregistration.
W
wusongqing 已提交
520 521


W
wusongqing 已提交
522
## Callee.on
W
wusongqing 已提交
523

W
wusongqing 已提交
524
on(method: string, callback: CaleeCallBack): void;
W
wusongqing 已提交
525 526 527

Registers a caller notification callback, which is invoked when the target ability registers a function.

W
wusongqing 已提交
528 529 530 531
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
532 533 534 535
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | method | string | Yes| Notification message string negotiated between the two abilities.| 
  | callback | CaleeCallBack | Yes| JS notification synchronization callback of the **rpc.MessageParcel** type. The callback must return at least one empty **rpc.Sequenceable** object. Otherwise, the function execution fails.| 
W
wusongqing 已提交
536

W
wusongqing 已提交
537
**Example**
W
wusongqing 已提交
538
    
W
wusongqing 已提交
539
  ```js
W
wusongqing 已提交
540 541
  import Ability from '@ohos.application.Ability';
  class MyMessageAble{
W
wusongqing 已提交
542 543 544
      name:""
      str:""
      num: 1
W
wusongqing 已提交
545 546 547 548
      constructor(name, str) {
        this.name = name;
        this.str = str;
      }
W
wusongqing 已提交
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577
      marshalling(messageParcel) {
          messageParcel.writeInt(this.num);
          messageParcel.writeString(this.str);
          console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']');
          return true;
      }
      unmarshalling(messageParcel) {
          this.num = messageParcel.readInt();
          this.str = messageParcel.readString();
          console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']');
          return true;
      }
  };
  var method = 'call_Function';
  function funcCallBack(pdata) {
      console.log('Callee funcCallBack is called ' + pdata);
      let msg = new MyMessageAble(0, "");
      pdata.readSequenceable(msg);
      return new MyMessageAble(10, "Callee test");
  }
  export default class MainAbility extends Ability {
      onCreate(want, launchParam) {
          console.log('Callee onCreate is called');
          this.callee.on(method, funcCallBack);
      }
  }
  ```


W
wusongqing 已提交
578
## Callee.off
W
wusongqing 已提交
579 580 581

off(method: string): void;

W
wusongqing 已提交
582
Deregisters a caller notification callback, which is invoked when the target ability registers a function.
W
wusongqing 已提交
583

W
wusongqing 已提交
584 585 586 587
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

**Parameters**

W
wusongqing 已提交
588 589 590
  | Name| Type| Mandatory| Description| 
  | -------- | -------- | -------- | -------- |
  | method | string | Yes| Registered notification message string.| 
W
wusongqing 已提交
591

W
wusongqing 已提交
592
**Example**
W
wusongqing 已提交
593
    
W
wusongqing 已提交
594
  ```js
W
wusongqing 已提交
595 596 597 598 599 600 601 602 603
  import Ability from '@ohos.application.Ability';
  var method = 'call_Function';
  export default class MainAbility extends Ability {
      onCreate(want, launchParam) {
          console.log('Callee onCreate is called');
          this.callee.off(method);
      }
  }
  ```
W
wusongqing 已提交
604 605 606 607 608

## OnReleaseCallBack

(msg: string): void;

W
wusongqing 已提交
609 610
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

W
wusongqing 已提交
611 612 613
| Name| Type| Readable| Writable| Description| 
| -------- | -------- | -------- | -------- | -------- |
| (msg: string) | function | Yes| No| Prototype of the listener function interface registered by the caller.| 
W
wusongqing 已提交
614 615 616 617 618 619
 

 ## CaleeCallBack

(indata: rpc.MessageParcel): rpc.Sequenceable;

W
wusongqing 已提交
620 621
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore

W
wusongqing 已提交
622 623 624
| Name| Type| Readable| Writable| Description| 
| -------- | -------- | -------- | -------- | -------- |
| (indata: rpc.MessageParcel) | rpc.Sequenceable | Yes| No| Prototype of the message listener function interface registered by the callee.|