1 /* 2 * Copyright (c) 2023-2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_PROXY_H 17 #define OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_PROXY_H 18 19 #include "ability_manager_interface.h" 20 #include "auto_startup_info.h" 21 #include "iremote_proxy.h" 22 #include "mission_info.h" 23 #include "intent_exemption_info.h" 24 25 namespace OHOS { 26 namespace AAFwk { 27 using AutoStartupInfo = AbilityRuntime::AutoStartupInfo; 28 /** 29 * @class AbilityManagerProxy 30 * AbilityManagerProxy. 31 */ 32 class AbilityManagerProxy : public IRemoteProxy<IAbilityManager> { 33 public: AbilityManagerProxy(const sptr<IRemoteObject> & impl)34 explicit AbilityManagerProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IAbilityManager>(impl) 35 {} 36 ~AbilityManagerProxy()37 virtual ~AbilityManagerProxy() 38 {} 39 40 /** 41 * StartSelfUIAbility with want, start self uiability only on 2-in-1 devices. 42 * 43 * @param want, the want of the ability to start. 44 * @return Returns ERR_OK on success, others on failure. 45 */ 46 virtual int StartSelfUIAbility(const Want &want) override; 47 48 /** 49 * StartSelfUIAbility with want and startOptions, start self uiability only on 2-in-1 devices. 50 * 51 * @param want, the want of the ability to start. 52 * @param options, the startOptions of the ability to start. 53 * @return Returns ERR_OK on success, others on failure. 54 */ 55 virtual int StartSelfUIAbilityWithStartOptions(const Want &want, 56 const StartOptions &options) override; 57 58 /** 59 * StartAbility with want, send want to ability manager service. 60 * 61 * @param want, the want of the ability to start. 62 * @param requestCode, Ability request code. 63 * @param userId, Designation User ID. 64 * @return Returns ERR_OK on success, others on failure. 65 */ 66 virtual int StartAbility( 67 const Want &want, 68 int32_t userId = DEFAULT_INVAL_VALUE, 69 int requestCode = DEFAULT_INVAL_VALUE) override; 70 71 /** 72 * StartAbility with want, send want to ability manager service. 73 * 74 * @param want, the want of the ability to start. 75 * @param callerToken, caller ability token. 76 * @param requestCode the resultCode of the ability to start. 77 * @param userId, Designation User ID. 78 * @return Returns ERR_OK on success, others on failure. 79 */ 80 virtual int StartAbility( 81 const Want &want, 82 const sptr<IRemoteObject> &callerToken, 83 int32_t userId = DEFAULT_INVAL_VALUE, 84 int requestCode = DEFAULT_INVAL_VALUE) override; 85 86 /** 87 * StartAbilityWithSpecifyTokenId with want and specialId, send want to ability manager service. 88 * 89 * @param want, the want of the ability to start. 90 * @param callerToken, caller ability token. 91 * @param specialId the caller Id. 92 * @param userId, Designation User ID. 93 * @param requestCode the resultCode of the ability to start. 94 * @return Returns ERR_OK on success, others on failure. 95 */ 96 virtual int StartAbilityWithSpecifyTokenId( 97 const Want &want, 98 const sptr<IRemoteObject> &callerToken, 99 uint32_t specifyTokenId, 100 int32_t userId = DEFAULT_INVAL_VALUE, 101 int requestCode = DEFAULT_INVAL_VALUE) override; 102 103 /** 104 * StartAbility by insight intent, send want to ability manager service. 105 * 106 * @param want Ability want. 107 * @param callerToken caller ability token. 108 * @param intentId insight intent id. 109 * @param userId userId of target ability. 110 * @return Returns ERR_OK on success, others on failure. 111 */ 112 int32_t StartAbilityByInsightIntent( 113 const Want &want, 114 const sptr<IRemoteObject> &callerToken, 115 uint64_t intentId, 116 int32_t userId = DEFAULT_INVAL_VALUE) override; 117 118 /** 119 * Starts a new ability with specific start settings. 120 * 121 * @param want Indicates the ability to start. 122 * @param callerToken caller ability token. 123 * @param abilityStartSetting Indicates the setting ability used to start. 124 * @param userId, Designation User ID. 125 * @return Returns ERR_OK on success, others on failure. 126 */ 127 virtual int StartAbility( 128 const Want &want, 129 const AbilityStartSetting &abilityStartSetting, 130 const sptr<IRemoteObject> &callerToken, 131 int32_t userId = DEFAULT_INVAL_VALUE, 132 int requestCode = DEFAULT_INVAL_VALUE) override; 133 134 /** 135 * Starts a new ability with specific start options. 136 * 137 * @param want, the want of the ability to start. 138 * @param startOptions Indicates the options used to start. 139 * @param callerToken, caller ability token. 140 * @param userId, Designation User ID. 141 * @param requestCode the resultCode of the ability to start. 142 * @return Returns ERR_OK on success, others on failure. 143 */ 144 virtual int StartAbility( 145 const Want &want, 146 const StartOptions &startOptions, 147 const sptr<IRemoteObject> &callerToken, 148 int32_t userId = DEFAULT_INVAL_VALUE, 149 int requestCode = DEFAULT_INVAL_VALUE) override; 150 151 /** 152 * Starts a new ability using the original caller information. 153 * 154 * @param want the want of the ability to start. 155 * @param callerToken current caller ability token. 156 * @param asCallerSourceToken source caller ability token. 157 * @param userId Designation User ID. 158 * @param requestCode the resultCode of the ability to start. 159 * @return Returns ERR_OK on success, others on failure. 160 */ 161 virtual int StartAbilityAsCaller( 162 const Want &want, 163 const sptr<IRemoteObject> &callerToken, 164 sptr<IRemoteObject> asCallerSourceToken, 165 int32_t userId = DEFAULT_INVAL_VALUE, 166 int requestCode = DEFAULT_INVAL_VALUE) override; 167 168 /** 169 * Starts a new ability using the original caller information. 170 * 171 * @param want the want of the ability to start. 172 * @param startOptions Indicates the options used to start. 173 * @param callerToken current caller ability token. 174 * @param asCallerSourceToken source caller ability token. 175 * @param userId Designation User ID. 176 * @param requestCode the resultCode of the ability to start. 177 * @return Returns ERR_OK on success, others on failure. 178 */ 179 virtual int StartAbilityAsCaller( 180 const Want &want, 181 const StartOptions &startOptions, 182 const sptr<IRemoteObject> &callerToken, 183 sptr<IRemoteObject> asCallerSourceToken, 184 int32_t userId = DEFAULT_INVAL_VALUE, 185 int requestCode = DEFAULT_INVAL_VALUE) override; 186 187 /** 188 * Starts a new ability for result using the original caller information. 189 * 190 * @param want the want of the ability to start. 191 * @param callerToken current caller ability token. 192 * @param requestCode the resultCode of the ability to start. 193 * @param userId Designation User ID. 194 * @return Returns ERR_OK on success, others on failure. 195 */ 196 int StartAbilityForResultAsCaller( 197 const Want &want, 198 const sptr<IRemoteObject> &callerToken, 199 int requestCode = DEFAULT_INVAL_VALUE, 200 int32_t userId = DEFAULT_INVAL_VALUE) override; 201 202 /** 203 * Starts a new ability for result using the original caller information. 204 * 205 * @param want the want of the ability to start. 206 * @param startOptions Indicates the options used to start. 207 * @param callerToken current caller ability token. 208 * @param requestCode the resultCode of the ability to start. 209 * @param userId Designation User ID. 210 * @return Returns ERR_OK on success, others on failure. 211 */ 212 int StartAbilityForResultAsCaller( 213 const Want &want, 214 const StartOptions &startOptions, 215 const sptr<IRemoteObject> &callerToken, 216 int requestCode = DEFAULT_INVAL_VALUE, 217 int32_t userId = DEFAULT_INVAL_VALUE) override; 218 219 /** 220 * Start UI abilities simultaneously. 221 * 222 * @param wantList a list of want to start UI abilities. 223 * @param requestKey, The unique key of this StartUIAbilities request. 224 * @param callerToken current caller ability token. 225 * @return Returns ERR_OK if success. 226 */ 227 ErrCode StartUIAbilities(const std::vector<AAFwk::Want> &wantList, 228 const std::string &requestKey, sptr<IRemoteObject> callerToken) override; 229 230 /** 231 * Start ui session ability with extension session info, send session info to ability manager service. 232 * 233 * @param want, the want of the ability to start. 234 * @param callerToken, caller ability token. 235 * @param sessionInfo the information of UIExtensionContentSession. 236 * @param userId, Designation User ID. 237 * @param requestCode, Ability request code. 238 * @return Returns ERR_OK on success, others on failure. 239 */ 240 virtual int StartAbilityByUIContentSession( 241 const Want &want, 242 const sptr<IRemoteObject> &callerToken, 243 const sptr<SessionInfo> &sessionInfo, 244 int32_t userId = DEFAULT_INVAL_VALUE, 245 int requestCode = DEFAULT_INVAL_VALUE) override; 246 247 /** 248 * Start ui session ability with extension session info, send session info to ability manager service. 249 * 250 * @param want, the want of the ability to start. 251 * @param startOptions Indicates the options used to start. 252 * @param callerToken, caller ability token. 253 * @param sessionInfo the information of UIExtensionContentSession. 254 * @param userId, Designation User ID. 255 * @param requestCode the resultCode of the ability to start. 256 * @return Returns ERR_OK on success, others on failure. 257 */ 258 virtual int StartAbilityByUIContentSession( 259 const Want &want, 260 const StartOptions &startOptions, 261 const sptr<IRemoteObject> &callerToken, 262 const sptr<SessionInfo> &sessionInfo, 263 int32_t userId = DEFAULT_INVAL_VALUE, 264 int requestCode = DEFAULT_INVAL_VALUE) override; 265 266 /** 267 * Start ui ability 268 * 269 * @param want the want of the ability to start. 270 * @param callerToken caller ability token. 271 * @param specifyTokenId The Caller ID. 272 * @return Returns ERR_OK on success, others on failure. 273 */ 274 virtual int StartAbilityOnlyUIAbility( 275 const Want &want, 276 const sptr<IRemoteObject> &callerToken, 277 uint32_t specifyTokenId) override; 278 279 /** 280 * Start extension ability with want, send want to ability manager service. 281 * 282 * @param want, the want of the ability to start. 283 * @param callerToken, caller ability token. 284 * @param userId, Designation User ID. 285 * @param extensionType If an ExtensionAbilityType is set, only extension of that type can be started. 286 * @return Returns ERR_OK on success, others on failure. 287 */ 288 virtual int32_t StartExtensionAbility( 289 const Want &want, 290 const sptr<IRemoteObject> &callerToken, 291 int32_t userId = DEFAULT_INVAL_VALUE, 292 AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED) override; 293 294 /** 295 * Create UIExtension with want, send want to ability manager service. 296 * 297 * @param want, the want of the ability to start. 298 * @return Returns ERR_OK on success, others on failure. 299 */ 300 int RequestModalUIExtension(const Want &want) override; 301 302 /** 303 * Preload UIExtension with want, send want to ability manager service. 304 * 305 * @param want, the want of the ability to start. 306 * @param hostBundleName, the caller application bundle name. 307 * @param userId, the extension runs in. 308 * @return Returns ERR_OK on success, others on failure. 309 */ 310 int PreloadUIExtensionAbility(const Want &want, std::string &hostBundleName, 311 int32_t userId = DEFAULT_INVAL_VALUE, int32_t hostPid = DEFAULT_INVAL_VALUE) override; 312 313 int ChangeAbilityVisibility(sptr<IRemoteObject> token, bool isShow) override; 314 315 int ChangeUIAbilityVisibilityBySCB(sptr<SessionInfo> sessionInfo, bool isShow) override; 316 /** 317 * Start ui extension ability with extension session info, send extension session info to ability manager service. 318 * 319 * @param extensionSessionInfo the extension session info of the ability to start. 320 * @param userId, Designation User ID. 321 * @return Returns ERR_OK on success, others on failure. 322 */ 323 virtual int StartUIExtensionAbility( 324 const sptr<SessionInfo> &extensionSessionInfo, 325 int32_t userId = DEFAULT_INVAL_VALUE) override; 326 327 /** 328 * Start ui ability with want, send want to ability manager service. 329 * 330 * @param sessionInfo the session info of the ability to start. 331 * @param isColdStart the session info of the ability is or not cold start. 332 * @return Returns ERR_OK on success, others on failure. 333 */ 334 virtual int StartUIAbilityBySCB(sptr<SessionInfo> sessionInfo, bool &isColdStart, uint32_t sceneFlag = 0) override; 335 336 /** 337 * Stop extension ability with want, send want to ability manager service. 338 * 339 * @param want, the want of the ability to stop. 340 * @param callerToken, caller ability token. 341 * @param userId, Designation User ID. 342 * @param extensionType If an ExtensionAbilityType is set, only extension of that type can be stopped. 343 * @return Returns ERR_OK on success, others on failure. 344 */ 345 virtual int StopExtensionAbility( 346 const Want& want, 347 const sptr<IRemoteObject>& callerToken, 348 int32_t userId = DEFAULT_INVAL_VALUE, 349 AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED) override; 350 /** 351 * TerminateAbility, terminate the special ability. 352 * 353 * @param token, the token of the ability to terminate. 354 * @param resultCode, the resultCode of the ability to terminate. 355 * @param resultWant, the Want of the ability to return. 356 * @return Returns ERR_OK on success, others on failure. 357 */ 358 virtual int TerminateAbility( 359 const sptr<IRemoteObject> &token, int resultCode, const Want *resultWant = nullptr) override; 360 361 /** 362 * BackToCallerAbilityWithResult, return to the caller ability. 363 * 364 * @param token, the token of the ability to terminate. 365 * @param resultCode, the resultCode of the ability to terminate. 366 * @param resultWant, the Want of the ability to return. 367 * @param callerRequestCode, the requestCode of caller ability. 368 * @return Returns ERR_OK on success, others on failure. 369 */ 370 virtual int BackToCallerAbilityWithResult(const sptr<IRemoteObject> &token, int resultCode, 371 const Want *resultWant, int64_t callerRequestCode) override; 372 373 /** 374 * TerminateUIServiceExtensionAbility, terminate UIServiceExtensionAbility. 375 * 376 * @param token, the token of the UIServiceExtensionAbility to terminate. 377 * @return Returns ERR_OK on success, others on failure. 378 */ 379 virtual int32_t TerminateUIServiceExtensionAbility(const sptr<IRemoteObject> &token) override; 380 381 /** 382 * TerminateUIExtensionAbility, terminate the special ui extension ability. 383 * 384 * @param extensionSessionInfo the extension session info of the ability to terminate. 385 * @param resultCode resultCode. 386 * @param Want Ability want returned. 387 * @return Returns ERR_OK on success, others on failure. 388 */ 389 virtual int TerminateUIExtensionAbility(const sptr<SessionInfo> &extensionSessionInfo, int resultCode, 390 const Want *resultWant) override; 391 392 /** 393 * CloseUIExtensionAbilityBySCB, terminate the specified ui extension ability by SCB. 394 * 395 * @param token the ability token. 396 * @return Returns ERR_OK on success, others on failure. 397 */ 398 int CloseUIExtensionAbilityBySCB(const sptr<IRemoteObject> token) override; 399 400 /** 401 * CloseUIAbilityBySCB, close the special ability by scb. 402 * 403 * @param sessionInfo the session info of the ability to terminate. 404 * @param sceneFlag the reason info of the ability to terminate. 405 * @return Returns ERR_OK on success, others on failure. 406 */ 407 virtual int CloseUIAbilityBySCB(const sptr<SessionInfo> &sessionInfo, bool isUserRequestedExit, 408 uint32_t sceneFlag = 0) override; 409 410 /** 411 * SendResultToAbility with want, return want from ability manager service.(Only used for dms) 412 * 413 * @param requestCode, request code. 414 * @param resultCode, resultCode to return. 415 * @param resultWant, the Want of the ability to return. 416 * @return Returns ERR_OK on success, others on failure. 417 */ 418 virtual int SendResultToAbility(int32_t requestCode, int32_t resultCode, Want& resultWant) override; 419 420 /** 421 * MoveAbilityToBackground. 422 * 423 * @param token, the token of the ability to move. 424 * @return Returns ERR_OK on success, others on failure. 425 */ 426 virtual int MoveAbilityToBackground(const sptr<IRemoteObject> &token) override; 427 428 /** 429 * Move the UIAbility to background, called by app self. 430 * 431 * @param token the token of the ability to move. 432 * @return Returns ERR_OK on success, others on failure. 433 */ 434 virtual int32_t MoveUIAbilityToBackground(const sptr<IRemoteObject> token) override; 435 436 /** 437 * CloseAbility, close the special ability. 438 * 439 * @param token, the token of the ability to terminate. 440 * @param resultCode, the resultCode of the ability to terminate. 441 * @param resultWant, the Want of the ability to return. 442 * @return Returns ERR_OK on success, others on failure. 443 */ 444 virtual int CloseAbility( 445 const sptr<IRemoteObject> &token, int resultCode, const Want *resultWant = nullptr) override; 446 447 /** 448 * MinimizeAbility, minimize the special ability. 449 * 450 * @param token, ability token. 451 * @param fromUser mark the minimize operation source. 452 * @return Returns ERR_OK on success, others on failure. 453 */ 454 virtual int MinimizeAbility(const sptr<IRemoteObject> &token, bool fromUser = false) override; 455 456 /** 457 * MinimizeUIExtensionAbility, minimize the special ui extension ability. 458 * 459 * @param extensionSessionInfo the extension session info of the ability to minimize. 460 * @param fromUser mark the minimize operation source. 461 * @return Returns ERR_OK on success, others on failure. 462 */ 463 virtual int MinimizeUIExtensionAbility(const sptr<SessionInfo> &extensionSessionInfo, 464 bool fromUser = false) override; 465 466 /** 467 * MinimizeUIAbilityBySCB, minimize the special ability by scb. 468 * 469 * @param sessionInfo the session info of the ability to minimize. 470 * @param fromUser, Whether form user. 471 * @return Returns ERR_OK on success, others on failure. 472 */ 473 virtual int MinimizeUIAbilityBySCB(const sptr<SessionInfo> &sessionInfo, bool fromUser = false, 474 uint32_t sceneFlag = 0) override; 475 476 /** 477 * ConnectAbility, connect session with service ability. 478 * 479 * @param want, Special want for service type's ability. 480 * @param connect, Callback used to notify caller the result of connecting or disconnecting. 481 * @param callerToken, caller ability token. 482 * @param userId, Designation User ID. 483 * @return Returns ERR_OK on success, others on failure. 484 */ 485 virtual int ConnectAbility( 486 const Want &want, 487 const sptr<IAbilityConnection> &connect, 488 const sptr<IRemoteObject> &callerToken, 489 int32_t userId = DEFAULT_INVAL_VALUE) override; 490 491 virtual int ConnectAbilityCommon( 492 const Want &want, 493 const sptr<IAbilityConnection> &connect, 494 const sptr<IRemoteObject> &callerToken, 495 AppExecFwk::ExtensionAbilityType extensionType, 496 int32_t userId = DEFAULT_INVAL_VALUE, 497 bool isQueryExtensionOnly = false) override; 498 499 virtual int ConnectUIExtensionAbility( 500 const Want &want, 501 const sptr<IAbilityConnection> &connect, 502 const sptr<SessionInfo> &sessionInfo, 503 int32_t userId = DEFAULT_INVAL_VALUE, 504 sptr<UIExtensionAbilityConnectInfo> connectInfo = nullptr) override; 505 506 /** 507 * DisconnectAbility, connect session with service ability. 508 * 509 * @param connect, Callback used to notify caller the result of connecting or disconnecting. 510 * @return Returns ERR_OK on success, others on failure. 511 */ 512 virtual int DisconnectAbility(sptr<IAbilityConnection> connect) override; 513 514 /** 515 * AcquireDataAbility, acquire a data ability by its authority, if it not existed, 516 * AMS loads it synchronously. 517 * 518 * @param uri, data ability uri. 519 * @param isKill, true: when a data ability is died, ams will kill this client, or do nothing. 520 * @param callerToken, specifies the caller ability token. 521 * @return returns the data ability ipc object, or nullptr for failed. 522 */ 523 virtual sptr<IAbilityScheduler> AcquireDataAbility( 524 const Uri &uri, bool isKill, const sptr<IRemoteObject> &callerToken) override; 525 526 /** 527 * ReleaseDataAbility, release the data ability that referenced by 'dataAbilityToken'. 528 * 529 * @param dataAbilityScheduler, specifies the data ability that will be released. 530 * @param callerToken, specifies the caller ability token. 531 * @return returns ERR_OK if succeeded, or error codes for failed. 532 */ 533 virtual int ReleaseDataAbility( 534 sptr<IAbilityScheduler> dataAbilityScheduler, const sptr<IRemoteObject> &callerToken) override; 535 536 /** 537 * AttachAbilityThread, ability call this interface after loaded. 538 * 539 * @param scheduler,.the interface handler of kit ability. 540 * @param token,.ability's token. 541 * @return Returns ERR_OK on success, others on failure. 542 */ 543 virtual int AttachAbilityThread( 544 const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token) override; 545 546 /** 547 * AbilityTransitionDone, ability call this interface after lift cycle was changed. 548 * 549 * @param token,.ability's token. 550 * @param state,.the state of ability lift cycle. 551 * @return Returns ERR_OK on success, others on failure. 552 */ 553 virtual int AbilityTransitionDone(const sptr<IRemoteObject> &token, int state, const PacMap &saveData) override; 554 555 /** 556 * AbilityWindowConfigTransitionDone, ability call this interface after lift cycle was changed. 557 * 558 * @param token,.ability's token. 559 * @return Returns ERR_OK on success, others on failure. 560 */ 561 virtual int AbilityWindowConfigTransitionDone( 562 const sptr<IRemoteObject> &token, const WindowConfig &windowConfig) override; 563 564 /** 565 * ScheduleConnectAbilityDone, service ability call this interface while session was connected. 566 * 567 * @param token,.service ability's token. 568 * @param remoteObject,.the session proxy of service ability. 569 * @return Returns ERR_OK on success, others on failure. 570 */ 571 virtual int ScheduleConnectAbilityDone( 572 const sptr<IRemoteObject> &token, const sptr<IRemoteObject> &remoteObject) override; 573 574 /** 575 * ScheduleDisconnectAbilityDone, service ability call this interface while session was disconnected. 576 * 577 * @param token,.service ability's token. 578 * @return Returns ERR_OK on success, others on failure. 579 */ 580 virtual int ScheduleDisconnectAbilityDone(const sptr<IRemoteObject> &token) override; 581 582 /** 583 * ScheduleCommandAbilityDone, service ability call this interface while session was commanded. 584 * 585 * @param token,.service ability's token. 586 * @return Returns ERR_OK on success, others on failure. 587 */ 588 virtual int ScheduleCommandAbilityDone(const sptr<IRemoteObject> &token) override; 589 590 virtual int ScheduleCommandAbilityWindowDone( 591 const sptr<IRemoteObject> &token, 592 const sptr<SessionInfo> &sessionInfo, 593 WindowCommand winCmd, 594 AbilityCommand abilityCmd) override; 595 596 /** 597 * dump ability stack info, about userID, mission stack info, 598 * mission record info and ability info. 599 * 600 * @param state Ability stack info. 601 * @return Returns ERR_OK on success, others on failure. 602 */ 603 virtual void DumpState(const std::string &args, std::vector<std::string> &state) override; 604 virtual void DumpSysState( 605 const std::string& args, std::vector<std::string>& state, bool isClient, bool isUserID, int UserID) override; 606 607 /** 608 * Destroys this Service ability by Want. 609 * 610 * @param want, Special want for service type's ability. 611 * @param token ability's token. 612 * @return Returns true if this Service ability will be destroyed; returns false otherwise. 613 */ 614 virtual int StopServiceAbility(const Want &want, int32_t userId = DEFAULT_INVAL_VALUE, 615 const sptr<IRemoteObject> &token = nullptr) override; 616 617 /** 618 * Get top ability. 619 * 620 * @param isNeedLocalDeviceId is need local device id. 621 * @return Returns front desk focus ability elementName. 622 */ 623 virtual AppExecFwk::ElementName GetTopAbility(bool isNeedLocalDeviceId = true) override; 624 625 /** 626 * Get element name by token. 627 * 628 * @param token ability's token. 629 * @param isNeedLocalDeviceId is need local device id. 630 * @return Returns front desk focus ability elementName by token. 631 */ 632 virtual AppExecFwk::ElementName GetElementNameByToken(sptr<IRemoteObject> token, 633 bool isNeedLocalDeviceId = true) override; 634 635 /** 636 * Kill the process immediately. 637 * 638 * @param bundleName. 639 * @return Returns ERR_OK on success, others on failure. 640 */ 641 virtual int KillProcess(const std::string &bundleName, bool clearPageStack = false, int32_t appIndex = 0) override; 642 643 #ifdef ABILITY_COMMAND_FOR_TEST 644 /** 645 * force timeout ability. 646 * 647 * @param abilityName. 648 * @param state. 649 * @return Returns ERR_OK on success, others on failure. 650 */ 651 virtual int ForceTimeoutForTest(const std::string &abilityName, const std::string &state) override; 652 #endif 653 654 /** 655 * Uninstall app 656 * 657 * @param bundleName bundle name of uninstalling app. 658 * @param uid uid of bundle. 659 * @return Returns ERR_OK on success, others on failure. 660 */ 661 virtual int UninstallApp(const std::string &bundleName, int32_t uid) override; 662 663 /** 664 * Uninstall app 665 * 666 * @param bundleName bundle name of uninstalling app. 667 * @param uid uid of bundle. 668 * @param appIndex the app index of app clone. 669 * @return Returns ERR_OK on success, others on failure. 670 */ 671 virtual int32_t UninstallApp(const std::string &bundleName, int32_t uid, int32_t appIndex) override; 672 673 /** 674 * Upgrade app, record exit reason and kill application 675 * 676 * @param bundleName bundle name of upgrading app. 677 * @param uid uid of bundle. 678 * @param exitMsg the exit reason message. 679 * @param appIndex the app index of app clone. 680 * @return Returns ERR_OK on success, others on failure. 681 */ 682 virtual int32_t UpgradeApp(const std::string &bundleName, const int32_t uid, const std::string &exitMsg, 683 int32_t appIndex = 0) override; 684 685 virtual sptr<IWantSender> GetWantSender( 686 const WantSenderInfo &wantSenderInfo, const sptr<IRemoteObject> &callerToken, int32_t uid = -1) override; 687 688 virtual int SendWantSender(sptr<IWantSender> target, SenderInfo &senderInfo) override; 689 690 virtual int SendLocalWantSender(const SenderInfo &senderInfo) override; 691 692 virtual void CancelWantSender(const sptr<IWantSender> &sender) override; 693 694 virtual int GetPendingWantUid(const sptr<IWantSender> &target) override; 695 696 virtual int GetPendingWantUserId(const sptr<IWantSender> &target) override; 697 698 virtual std::string GetPendingWantBundleName(const sptr<IWantSender> &target) override; 699 700 virtual int GetPendingWantCode(const sptr<IWantSender> &target) override; 701 702 virtual int GetPendingWantType(const sptr<IWantSender> &target) override; 703 704 virtual void RegisterCancelListener(const sptr<IWantSender> &sender, const sptr<IWantReceiver> &receiver) override; 705 706 virtual void UnregisterCancelListener( 707 const sptr<IWantSender> &sender, const sptr<IWantReceiver> &receiver) override; 708 709 virtual int GetPendingRequestWant(const sptr<IWantSender> &target, std::shared_ptr<Want> &want) override; 710 711 virtual int GetWantSenderInfo(const sptr<IWantSender> &target, std::shared_ptr<WantSenderInfo> &info) override; 712 713 virtual int GetAppMemorySize() override; 714 715 virtual bool IsRamConstrainedDevice() override; 716 virtual int ContinueMission(const std::string &srcDeviceId, const std::string &dstDeviceId, 717 int32_t missionId, const sptr<IRemoteObject> &callBack, AAFwk::WantParams &wantParams) override; 718 719 virtual int ContinueMission(AAFwk::ContinueMissionInfo continueMissionInfo, 720 const sptr<IRemoteObject> &callback) override; 721 722 virtual int ContinueAbility(const std::string &deviceId, int32_t missionId, uint32_t versionCode) override; 723 724 virtual int StartContinuation(const Want &want, const sptr<IRemoteObject> &abilityToken, int32_t status) override; 725 726 virtual void NotifyCompleteContinuation(const std::string &deviceId, int32_t sessionId, bool isSuccess) override; 727 728 virtual int NotifyContinuationResult(int32_t missionId, int32_t result) override; 729 730 virtual int StartSyncRemoteMissions(const std::string& devId, bool fixConflict, int64_t tag) override; 731 732 virtual int StopSyncRemoteMissions(const std::string& devId) override; 733 734 virtual int LockMissionForCleanup(int32_t missionId) override; 735 736 virtual int UnlockMissionForCleanup(int32_t missionId) override; 737 738 virtual void SetLockedState(int32_t sessionId, bool lockedState) override; 739 740 /** 741 * @brief Register mission listener to ability mgr. 742 * @param listener The handler of listener. 743 * 744 * @return Returns ERR_OK on success, others on failure. 745 */ 746 virtual int RegisterMissionListener(const sptr<IMissionListener> &listener) override; 747 748 /** 749 * @brief UnRegister mission listener from ability mgr. 750 * @param listener The handler of listener. 751 * 752 * @return Returns ERR_OK on success, others on failure. 753 */ 754 virtual int UnRegisterMissionListener(const sptr<IMissionListener> &listener) override; 755 756 /** 757 * @brief Get mission infos from ability mgr. 758 * @param deviceId local or remote deviceId. 759 * @param numMax max number of missions. 760 * @param missionInfos mission info result. 761 * 762 * @return Returns ERR_OK on success, others on failure. 763 */ 764 virtual int GetMissionInfos(const std::string& deviceId, int32_t numMax, 765 std::vector<MissionInfo> &missionInfos) override; 766 767 /** 768 * @brief Get mission info by id. 769 * @param deviceId local or remote deviceId. 770 * @param missionId Id of target mission. 771 * @param missionInfo mission info of target mission. 772 * 773 * @return Returns ERR_OK on success, others on failure. 774 */ 775 virtual int GetMissionInfo(const std::string& deviceId, int32_t missionId, 776 MissionInfo &missionInfos) override; 777 778 /** 779 * @brief Clean mission by id. 780 * @param missionId Id of target mission. 781 * 782 * @return Returns ERR_OK on success, others on failure. 783 */ 784 virtual int CleanMission(int32_t missionId) override; 785 786 /** 787 * @brief Clean all missions in system. 788 * 789 * @return Returns ERR_OK on success, others on failure. 790 */ 791 virtual int CleanAllMissions() override; 792 793 virtual int MoveMissionToFront(int32_t missionId) override; 794 795 /** 796 * @brief Move a mission to front. 797 * @param missionId Id of target mission. 798 * @param startOptions Special startOptions for target mission. 799 * 800 * @return Returns ERR_OK on success, others on failure. 801 */ 802 virtual int MoveMissionToFront(int32_t missionId, const StartOptions &startOptions) override; 803 804 /** 805 * Move missions to front 806 * @param missionIds Ids of target missions 807 * @param topMissionId Indicate which mission will be moved to top, if set to -1, missions' order won't change 808 * @return Returns ERR_OK on success, others on failure. 809 */ 810 virtual int MoveMissionsToForeground(const std::vector<int32_t>& missionIds, int32_t topMissionId) override; 811 812 /** 813 * Move missions to background 814 * @param missionIds Ids of target missions 815 * @param result The result of move missions to background, and the array is sorted by zOrder 816 * @return Returns ERR_OK on success, others on failure. 817 */ 818 virtual int MoveMissionsToBackground(const std::vector<int32_t>& missionIds, 819 std::vector<int32_t>& result) override; 820 821 /** 822 * Start Ability, connect session with common ability. 823 * 824 * @param want, Special want for service type's ability. 825 * @param connect, Callback used to notify caller the result of connecting or disconnecting. 826 * @param accountId Indicates the account to start. 827 * @return Returns ERR_OK on success, others on failure. 828 */ 829 virtual int StartAbilityByCall(const Want &want, const sptr<IAbilityConnection> &connect, 830 const sptr<IRemoteObject> &callerToken, int32_t accountId = DEFAULT_INVAL_VALUE, 831 bool isSilent = false) override; 832 833 virtual int StartAbilityByCallWithErrMsg(const Want &want, const sptr<IAbilityConnection> &connect, 834 const sptr<IRemoteObject> &callerToken, int32_t accountId, std::string &errMsg, 835 bool isSilent = false) override; 836 837 /** 838 * CallRequestDone, after invoke callRequest, ability will call this interface to return callee. 839 * 840 * @param token, ability's token. 841 * @param callStub, ability's callee. 842 */ 843 void CallRequestDone(const sptr<IRemoteObject> &token, const sptr<IRemoteObject> &callStub) override; 844 845 /** 846 * Release the call between Ability, disconnect session with common ability. 847 * 848 * @param connect, Callback used to notify caller the result of connecting or disconnecting. 849 * @param element, the element of target service. 850 * @return Returns ERR_OK on success, others on failure. 851 */ 852 virtual int ReleaseCall( 853 const sptr<IAbilityConnection> &connect, const AppExecFwk::ElementName &element) override; 854 855 /** 856 * @brief start user. 857 * @param accountId accountId. 858 * @param isAppRecovery is appRecovery or not. 859 * @return Returns ERR_OK on success, others on failure. 860 */ 861 virtual int StartUser(int userId, sptr<IUserCallback> callback, bool isAppRecovery = false) override; 862 863 /** 864 * @brief stop user. 865 * @param accountId accountId. 866 * @param callback callback. 867 * 868 * @return Returns ERR_OK on success, others on failure. 869 */ 870 virtual int StopUser(int userId, const sptr<IUserCallback> &callback) override; 871 872 /** 873 * @brief logout user. 874 * @param accountId accountId. 875 * 876 * @return Returns ERR_OK on success, others on failure. 877 */ 878 virtual int LogoutUser(int32_t userId, sptr<IUserCallback> callback) override; 879 880 virtual int SetMissionContinueState(const sptr<IRemoteObject> &token, const AAFwk::ContinueState &state) override; 881 882 #ifdef SUPPORT_SCREEN 883 virtual int SetMissionLabel(const sptr<IRemoteObject> &abilityToken, const std::string &label) override; 884 885 virtual int SetMissionIcon(const sptr<IRemoteObject> &token, 886 const std::shared_ptr<OHOS::Media::PixelMap> &icon) override; 887 888 virtual int RegisterWindowManagerServiceHandler(const sptr<IWindowManagerServiceHandler>& handler, 889 bool animationEnabled) override; 890 891 virtual void CompleteFirstFrameDrawing(const sptr<IRemoteObject> &abilityToken) override; 892 893 virtual void CompleteFirstFrameDrawing(int32_t sessionId) override; 894 895 virtual int PrepareTerminateAbility( 896 const sptr<IRemoteObject> &token, sptr<IPrepareTerminateCallback> &callback) override; 897 898 virtual int GetDialogSessionInfo(const std::string &dialogSessionId, sptr<DialogSessionInfo> &info) override; 899 900 virtual int SendDialogResult(const Want &want, const std::string &dialogSessionId, bool isAllow) override; 901 902 virtual int RegisterAbilityFirstFrameStateObserver(const sptr<IAbilityFirstFrameStateObserver> &observer, 903 const std::string &targetBundleName) override; 904 905 virtual int UnregisterAbilityFirstFrameStateObserver( 906 const sptr<IAbilityFirstFrameStateObserver> &observer) override; 907 #endif 908 /** 909 * @brief Get the ability running information. 910 * 911 * @param info Ability running information. 912 * @return Returns ERR_OK on success, others on failure. 913 */ 914 virtual int GetAbilityRunningInfos(std::vector<AbilityRunningInfo> &info) override; 915 916 /** 917 * @brief Get the extension running information. 918 * 919 * @param upperLimit The maximum limit of information wish to get. 920 * @param info Extension running information. 921 * @return Returns ERR_OK on success, others on failure. 922 */ 923 virtual int GetExtensionRunningInfos(int upperLimit, std::vector<ExtensionRunningInfo> &info) override; 924 925 /** 926 * @brief Get running process information. 927 * 928 * @param info Running process information. 929 * @return Returns ERR_OK on success, others on failure. 930 */ 931 virtual int GetProcessRunningInfos(std::vector<AppExecFwk::RunningProcessInfo> &info) override; 932 933 /** 934 * @brief Register mission listener to ability manager service. 935 * @param deviceId The remote device Id. 936 * @param listener The handler of listener. 937 * 938 * @return Returns ERR_OK on success, others on failure. 939 */ 940 virtual int RegisterMissionListener(const std::string &deviceId, 941 const sptr<IRemoteMissionListener> &listener) override; 942 943 virtual int RegisterOnListener(const std::string &type, 944 const sptr<IRemoteOnListener> &listener) override; 945 946 virtual int RegisterOffListener(const std::string &deviceId, 947 const sptr<IRemoteOnListener> &listener) override; 948 949 virtual int UnRegisterMissionListener(const std::string &deviceId, 950 const sptr<IRemoteMissionListener> &listener) override; 951 952 /** 953 * Set ability controller. 954 * 955 * @param abilityController, The ability controller. 956 * @return Returns ERR_OK on success, others on failure. 957 */ 958 virtual int SetAbilityController(const sptr<AppExecFwk::IAbilityController> &abilityController, 959 bool imAStabilityTest) override; 960 961 /** 962 * Is user a stability test. 963 * 964 * @return Returns true if user is a stability test. 965 */ 966 virtual bool IsRunningInStabilityTest() override; 967 968 /** 969 * @brief Register the snapshot handler 970 * @param handler snapshot handler 971 * @return ErrCode Returns ERR_OK on success, others on failure. 972 */ 973 virtual int RegisterSnapshotHandler(const sptr<ISnapshotHandler>& handler) override; 974 975 /** 976 * @brief Get the Mission Snapshot Info object 977 * @param deviceId local or remote deviceId. 978 * @param missionId Id of target mission. 979 * @param snapshot snapshot of target mission. 980 * @param isLowResolution get low resolution snapshot. 981 * @return Returns ERR_OK on success, others on failure. 982 */ 983 virtual int GetMissionSnapshot(const std::string& deviceId, int32_t missionId, 984 MissionSnapshot& snapshot, bool isLowResolution) override; 985 986 /** 987 * @brief start user test. 988 * @param want the want of the ability user test to start. 989 * @param observer test observer callback. 990 * 991 * @return Returns ERR_OK on success, others on failure. 992 */ 993 virtual int StartUserTest(const Want &want, const sptr<IRemoteObject> &observer) override; 994 995 /** 996 * @brief Finish user test. 997 * @param msg user test message. 998 * @param resultCode user test result Code. 999 * @param bundleName user test bundleName. 1000 * 1001 * @return Returns ERR_OK on success, others on failure. 1002 */ 1003 virtual int FinishUserTest( 1004 const std::string &msg, const int64_t &resultCode, const std::string &bundleName) override; 1005 1006 /** 1007 * GetTopAbility, get the token of top ability. 1008 * 1009 * @param token, the token of top ability. 1010 * @return Returns ERR_OK on success, others on failure. 1011 */ 1012 virtual int GetTopAbility(sptr<IRemoteObject> &token) override; 1013 1014 virtual int CheckUIExtensionIsFocused(uint32_t uiExtensionTokenId, bool& isFocused) override; 1015 1016 /** 1017 * The delegator calls this interface to move the ability to the foreground. 1018 * 1019 * @param token, ability's token. 1020 * @return Returns ERR_OK on success, others on failure. 1021 */ 1022 virtual int DelegatorDoAbilityForeground(const sptr<IRemoteObject> &token) override; 1023 1024 /** 1025 * The delegator calls this interface to move the ability to the background. 1026 * 1027 * @param token, ability's token. 1028 * @return Returns ERR_OK on success, others on failure. 1029 */ 1030 virtual int DelegatorDoAbilityBackground(const sptr<IRemoteObject> &token) override; 1031 1032 /** 1033 * Calls this interface to move the ability to the foreground. 1034 * 1035 * @param token, ability's token. 1036 * @param flag, use for lock or unlock flag and so on. 1037 * @return Returns ERR_OK on success, others on failure. 1038 */ 1039 virtual int DoAbilityForeground(const sptr<IRemoteObject> &token, uint32_t flag) override; 1040 1041 /** 1042 * Calls this interface to move the ability to the background. 1043 * 1044 * @param token, ability's token. 1045 * @param flag, use for lock or unlock flag and so on. 1046 * @return Returns ERR_OK on success, others on failure. 1047 */ 1048 virtual int DoAbilityBackground(const sptr<IRemoteObject> &token, uint32_t flag) override; 1049 1050 /** 1051 * Get mission id by ability token. 1052 * 1053 * @param token The token of ability. 1054 * @return Returns -1 if do not find mission, otherwise return mission id. 1055 */ 1056 virtual int32_t GetMissionIdByToken(const sptr<IRemoteObject> &token) override; 1057 1058 /** 1059 * Get ability token by connect. 1060 * 1061 * @param token The token of ability. 1062 * @param callStub The callee object. 1063 */ 1064 void GetAbilityTokenByCalleeObj(const sptr<IRemoteObject> &callStub, sptr<IRemoteObject> &token) override; 1065 1066 /** 1067 * Call free install from remote. 1068 * 1069 * @param want, the want of the ability to start. 1070 * @param userId, Designation User ID. 1071 * @param requestCode, Ability request code. 1072 * @param callback, Callback from remote. 1073 * @return Returns ERR_OK on success, others on failure. 1074 */ 1075 virtual int FreeInstallAbilityFromRemote(const Want &want, const sptr<IRemoteObject> &callback, 1076 int32_t userId, int requestCode = DEFAULT_INVAL_VALUE) override; 1077 1078 /** 1079 * Add FreeInstall Observer 1080 * 1081 * @param observer the observer of ability free install start. 1082 * @return Returns ERR_OK on success, others on failure. 1083 */ 1084 virtual int AddFreeInstallObserver(const sptr<IRemoteObject> &callerToken, 1085 const sptr<AbilityRuntime::IFreeInstallObserver> &observer) override; 1086 1087 /** 1088 * Called when client complete dump. 1089 * 1090 * @param infos The dump info. 1091 * @return Returns ERR_OK on success, others on failure. 1092 */ 1093 virtual int DumpAbilityInfoDone(std::vector<std::string> &infos, const sptr<IRemoteObject> &callerToken) override; 1094 1095 /** 1096 * Called to update mission snapshot. 1097 * @param token The target ability. 1098 * @param pixelMap The snapshot. 1099 */ 1100 #ifdef SUPPORT_SCREEN 1101 virtual void UpdateMissionSnapShot(const sptr<IRemoteObject> &token, 1102 const std::shared_ptr<Media::PixelMap> &pixelMap) override; 1103 #endif // SUPPORT_SCREEN 1104 virtual void EnableRecoverAbility(const sptr<IRemoteObject>& token) override; 1105 virtual void SubmitSaveRecoveryInfo(const sptr<IRemoteObject>& token) override; 1106 virtual void ScheduleRecoverAbility(const sptr<IRemoteObject> &token, int32_t reason, 1107 const Want *want = nullptr) override; 1108 1109 /** 1110 * @brief Schedule clear recovery page stack. 1111 * 1112 * @param bundleName application bundleName. 1113 */ 1114 virtual void ScheduleClearRecoveryPageStack() override; 1115 1116 /** 1117 * Called to verify that the MissionId is valid. 1118 * @param missionIds Query mission list. 1119 * @param results Output parameters, return results up to 20 query results. 1120 * @return Returns ERR_OK on success, others on failure. 1121 */ 1122 int32_t IsValidMissionIds( 1123 const std::vector<int32_t> &missionIds, std::vector<MissionValidResult> &results) override; 1124 1125 /** 1126 * Query whether the application of the specified PID and UID has been granted a certain permission 1127 * @param permission 1128 * @param pid Process id 1129 * @param uid 1130 * @return Returns ERR_OK if the current process has the permission, others on failure. 1131 */ 1132 virtual int VerifyPermission(const std::string &permission, int pid, int uid) override; 1133 1134 /** 1135 * Request dialog service with want, send want to ability manager service. 1136 * 1137 * @param want, the want of the dialog service to start. 1138 * @param callerToken, caller ability token. 1139 * @return Returns ERR_OK on success, others on failure. 1140 */ 1141 virtual int32_t RequestDialogService(const Want &want, const sptr<IRemoteObject> &callerToken) override; 1142 1143 int32_t ReportDrawnCompleted(const sptr<IRemoteObject> &callerToken) override; 1144 1145 virtual int32_t AcquireShareData( 1146 const int32_t &missionId, const sptr<IAcquireShareDataCallback> &shareData) override; 1147 virtual int32_t ShareDataDone(const sptr<IRemoteObject> &token, 1148 const int32_t &resultCode, const int32_t &uniqueId, WantParams &wantParam) override; 1149 1150 /** 1151 * Force app exit and record exit reason. 1152 * @param pid Process id . 1153 * @param exitReason The reason of app exit. 1154 * @return Returns ERR_OK on success, others on failure. 1155 */ 1156 virtual int32_t ForceExitApp(const int32_t pid, const ExitReason &exitReason) override; 1157 1158 /** 1159 * Record app exit reason. 1160 * @param exitReason The reason of app exit. 1161 * @return Returns ERR_OK on success, others on failure. 1162 */ 1163 virtual int32_t RecordAppExitReason(const ExitReason &exitReason) override; 1164 1165 /** 1166 * Record the process exit reason before the process being killed. 1167 * @param pid The process id. 1168 * @param exitReason The reason of process exit. 1169 * @return Returns ERR_OK on success, others on failure. 1170 */ 1171 virtual int32_t RecordProcessExitReason(const int32_t pid, const ExitReason &exitReason) override; 1172 1173 /** 1174 * Record the exit reason of a killed process. 1175 * @param pid The process id. 1176 * @param uid The process uid. 1177 * @param exitReason The reason of process exit. 1178 * @return Returns ERR_OK on success, others on failure. 1179 */ 1180 virtual int32_t RecordProcessExitReason(int32_t pid, int32_t uid, const ExitReason &exitReason) override; 1181 1182 /** 1183 * Set rootSceneSession by SCB. 1184 * 1185 * @param rootSceneSession Indicates root scene session of SCB. 1186 */ 1187 virtual void SetRootSceneSession(const sptr<IRemoteObject> &rootSceneSession) override; 1188 1189 /** 1190 * Call UIAbility by SCB. 1191 * 1192 * @param sessionInfo the session info of the ability to be called. 1193 * @param isColdStart the session of the ability is or not cold start. 1194 */ 1195 virtual void CallUIAbilityBySCB(const sptr<SessionInfo> &sessionInfo, bool &isColdStart) override; 1196 1197 int32_t StartSpecifiedAbilityBySCB(const Want &want) override; 1198 1199 /** 1200 * Notify sandbox app the result of saving file. 1201 * @param want Result of saving file, which contains the file's uri if success. 1202 * @param resultCode Indicates the action's result. 1203 * @param requestCode Pass the requestCode to match request. 1204 * @return Returns ERR_OK on success, others on failure. 1205 */ 1206 virtual int32_t NotifySaveAsResult(const Want &want, int resultCode, int requestCode) override; 1207 1208 /** 1209 * Set sessionManagerService 1210 * @param sessionManagerService the point of sessionManagerService. 1211 * 1212 * @return Returns ERR_OK on success, others on failure. 1213 */ 1214 virtual int32_t SetSessionManagerService(const sptr<IRemoteObject> &sessionManagerService) override; 1215 1216 /** 1217 * @brief Register collaborator. 1218 * @param type collaborator type. 1219 * @param impl collaborator. 1220 * @return 0 or else. 1221 */ 1222 virtual int32_t RegisterIAbilityManagerCollaborator( 1223 int32_t type, const sptr<IAbilityManagerCollaborator> &impl) override; 1224 1225 /** 1226 * @brief Unregister collaborator. 1227 * @param type collaborator type. 1228 * @return 0 or else. 1229 */ 1230 virtual int32_t UnregisterIAbilityManagerCollaborator(int32_t type) override; 1231 1232 virtual int32_t RegisterStatusBarDelegate(sptr<AbilityRuntime::IStatusBarDelegate> delegate) override; 1233 1234 /** 1235 * @brief get ability manager collaborator. 1236 * @return Returns object pointer on success, others on null. 1237 */ 1238 virtual sptr<IAbilityManagerCollaborator> GetAbilityManagerCollaborator() override; 1239 1240 virtual int32_t KillProcessWithPrepareTerminate(const std::vector<int32_t>& pids) override; 1241 1242 /** 1243 * @brief the process with reason 1244 * @param pid id of process. 1245 * @param reason, kill process reason. 1246 * @return Returns ERR_OK on success, others on failure. 1247 */ 1248 virtual int32_t KillProcessWithReason(int32_t pid, const ExitReason &reason) override; 1249 1250 /** 1251 * @brief Register auto start up callback for system api. 1252 * @param callback The point of JsAbilityAutoStartupCallBack. 1253 * @return Returns ERR_OK on success, others on failure. 1254 */ 1255 virtual int32_t RegisterAutoStartupSystemCallback(const sptr<IRemoteObject> &callback) override; 1256 1257 /** 1258 * @brief Unregister auto start up callback for system api. 1259 * @param callback The point of JsAbilityAutoStartupCallBack. 1260 * @return Returns ERR_OK on success, others on failure. 1261 */ 1262 virtual int32_t UnregisterAutoStartupSystemCallback(const sptr<IRemoteObject> &callback) override; 1263 1264 /** 1265 * @brief Set every application auto start up state. 1266 * @param info The auto startup info,include bundle name, module name, ability name. 1267 * @return Returns ERR_OK on success, others on failure. 1268 */ 1269 virtual int32_t SetApplicationAutoStartup(const AutoStartupInfo &info) override; 1270 1271 /** 1272 * @brief Cancel every application auto start up . 1273 * @param info The auto startup info,include bundle name, module name, ability name. 1274 * @return Returns ERR_OK on success, others on failure. 1275 */ 1276 virtual int32_t CancelApplicationAutoStartup(const AutoStartupInfo &info) override; 1277 1278 /** 1279 * @brief Query auto startup state all application. 1280 * @param infoList Output parameters, return auto startup info list. 1281 * @return Returns ERR_OK on success, others on failure. 1282 */ 1283 virtual int32_t QueryAllAutoStartupApplications(std::vector<AutoStartupInfo> &infoList) override; 1284 1285 /** 1286 * PrepareTerminateAbilityBySCB, prepare to terminate ability by scb. 1287 * 1288 * @param sessionInfo the session info of the ability to start. 1289 * @param isPrepareTerminate the result of ability onPrepareToTerminate. 1290 * @return Returns ERR_OK on success, others on failure. 1291 */ 1292 virtual int PrepareTerminateAbilityBySCB(const sptr<SessionInfo> &sessionInfo, bool &isPrepareTerminate) override; 1293 1294 /** 1295 * @brief Register session handler. 1296 * @param object The handler. 1297 * 1298 * @return Returns ERR_OK on success, others on failure. 1299 */ 1300 virtual int RegisterSessionHandler(const sptr<IRemoteObject> &object) override; 1301 1302 /** 1303 * @brief Register app debug listener. 1304 * @param listener App debug listener. 1305 * @return Returns ERR_OK on success, others on failure. 1306 */ 1307 int32_t RegisterAppDebugListener(sptr<AppExecFwk::IAppDebugListener> listener) override; 1308 1309 /** 1310 * @brief Unregister app debug listener. 1311 * @param listener App debug listener. 1312 * @return Returns ERR_OK on success, others on failure. 1313 */ 1314 int32_t UnregisterAppDebugListener(sptr<AppExecFwk::IAppDebugListener> listener) override; 1315 1316 /** 1317 * @brief Attach app debug. 1318 * @param bundleName The application bundle name. 1319 * @return Returns ERR_OK on success, others on failure. 1320 */ 1321 int32_t AttachAppDebug(const std::string &bundleName, bool isDebugFromLocal) override; 1322 1323 /** 1324 * @brief Detach app debug. 1325 * @param bundleName The application bundle name. 1326 * @return Returns ERR_OK on success, others on failure. 1327 */ 1328 int32_t DetachAppDebug(const std::string &bundleName, bool isDebugFromLocal) override; 1329 1330 /** 1331 * @brief Execute intent. 1332 * @param key The key of intent executing client. 1333 * @param callerToken Caller ability token. 1334 * @param param The Intent execute param. 1335 * @return Returns ERR_OK on success, others on failure. 1336 */ 1337 int32_t ExecuteIntent(uint64_t key, const sptr<IRemoteObject> &callerToken, 1338 const InsightIntentExecuteParam ¶m) override; 1339 1340 /** 1341 * @brief Check if ability controller can start. 1342 * @param want The want of ability to start. 1343 * @return Return true to allow ability to start, or false to reject. 1344 */ 1345 virtual bool IsAbilityControllerStart(const Want &want) override; 1346 1347 /** 1348 * @brief Called when insight intent execute finished. 1349 * 1350 * @param token ability's token. 1351 * @param intentId insight intent id. 1352 * @param result insight intent execute result. 1353 * @return Returns ERR_OK on success, others on failure. 1354 */ 1355 int32_t ExecuteInsightIntentDone(const sptr<IRemoteObject> &token, uint64_t intentId, 1356 const InsightIntentExecuteResult &result) override; 1357 1358 /** 1359 * @brief Set application auto start up state by EDM. 1360 * @param info The auto startup info, include bundle name, module name, ability name. 1361 * @param flag Indicate whether the application is prohibited from changing the auto start up state. 1362 * @return Returns ERR_OK on success, others on failure. 1363 */ 1364 int32_t SetApplicationAutoStartupByEDM(const AutoStartupInfo &info, bool flag) override; 1365 1366 /** 1367 * @brief Cancel application auto start up state by EDM. 1368 * @param info The auto startup info, include bundle name, module name, ability name. 1369 * @param flag Indicate whether the application is prohibited from changing the auto start up state. 1370 * @return Returns ERR_OK on success, others on failure. 1371 */ 1372 int32_t CancelApplicationAutoStartupByEDM(const AutoStartupInfo &info, bool flag) override; 1373 1374 /** 1375 * @brief Get foreground ui abilities. 1376 * @param list Foreground ui abilities. 1377 * @return Returns ERR_OK on success, others on failure. 1378 */ 1379 int32_t GetForegroundUIAbilities(std::vector<AppExecFwk::AbilityStateData> &list) override; 1380 1381 /** 1382 * @brief Open file by uri. 1383 * @param uri The file uri. 1384 * @param flag Want::FLAG_AUTH_READ_URI_PERMISSION or Want::FLAG_AUTH_WRITE_URI_PERMISSION. 1385 * @return int The file descriptor. 1386 */ 1387 virtual int32_t OpenFile(const Uri& uri, uint32_t flag) override; 1388 1389 /** 1390 * @brief Update session info. 1391 * @param sessionInfos The vector of session info. 1392 */ 1393 virtual int32_t UpdateSessionInfoBySCB(std::list<SessionInfo> &sessionInfos, int32_t userId, 1394 std::vector<int32_t> &sessionIds) override; 1395 1396 /** 1397 * @brief Restart app self. 1398 * @param want The ability type must be UIAbility. 1399 * @param isAppRecovery True indicates that the app is restarted because of recovery. 1400 * @return Returns ERR_OK on success, others on failure. 1401 */ 1402 int32_t RestartApp(const AAFwk::Want &want, bool isAppRecovery = false) override; 1403 1404 /** 1405 * @brief Get host info of root caller. 1406 * 1407 * @param token The ability token. 1408 * @param hostInfo The host info of root caller. 1409 * @param userId The user id. 1410 * @return int32_t Returns 0 on success, others on failure. 1411 */ 1412 int32_t GetUIExtensionRootHostInfo(const sptr<IRemoteObject> token, UIExtensionHostInfo &hostInfo, 1413 int32_t userId = DEFAULT_INVAL_VALUE) override; 1414 1415 /** 1416 * @brief Get ui extension session info 1417 * 1418 * @param token The ability token. 1419 * @param uiExtensionSessionInfo The ui extension session info. 1420 * @param userId The user id. 1421 * @return int32_t Returns ERR_OK on success, others on failure. 1422 */ 1423 int32_t GetUIExtensionSessionInfo(const sptr<IRemoteObject> token, UIExtensionSessionInfo &uiExtensionSessionInfo, 1424 int32_t userId = DEFAULT_INVAL_VALUE) override; 1425 1426 /** 1427 * @brief Pop-up launch of full-screen atomic service. 1428 * @param want The want with parameters. 1429 * @param callerToken caller ability token. 1430 * @param requestCode Ability request code. 1431 * @param userId The User ID. 1432 * @return Returns ERR_OK on success, others on failure. 1433 */ 1434 virtual int32_t OpenAtomicService(Want& want, const StartOptions &options, sptr<IRemoteObject> callerToken, 1435 int32_t requestCode = DEFAULT_INVAL_VALUE, int32_t userId = DEFAULT_INVAL_VALUE) override; 1436 1437 /** 1438 * @brief Querying whether to allow embedded startup of atomic service. 1439 * 1440 * @param token The caller UIAbility token. 1441 * @param appId The ID of the application to which this bundle belongs. 1442 * @return Returns true to allow ability to start, or false to reject. 1443 */ 1444 virtual bool IsEmbeddedOpenAllowed(sptr<IRemoteObject> callerToken, const std::string &appId) override; 1445 1446 /** 1447 * Set the enable status for starting and stopping resident processes. 1448 * The caller application can only set the resident status of the configured process. 1449 * @param bundleName The bundle name of the resident process. 1450 * @param enable Set resident process enable status. 1451 * @return Returns ERR_OK on success, others on failure. 1452 */ 1453 int32_t SetResidentProcessEnabled(const std::string &bundleName, bool enable) override; 1454 1455 /** 1456 * @brief Request to display assert fault dialog. 1457 * @param callback Listen for user operation callbacks. 1458 * @param wantParams Assert dialog box display information. 1459 * @return Returns ERR_OK on success, others on failure. 1460 */ 1461 virtual int32_t RequestAssertFaultDialog( 1462 const sptr<IRemoteObject> &callback, const AAFwk::WantParams &wantParams) override; 1463 1464 /** 1465 * @brief Notify the operation status of the user. 1466 * @param assertFaultSessionId Indicates the request ID of AssertFault. 1467 * @param userStatus Operation status of the user. 1468 * @return Returns ERR_OK on success, others on failure. 1469 */ 1470 virtual int32_t NotifyDebugAssertResult(uint64_t assertFaultSessionId, AAFwk::UserStatus userStatus) override; 1471 1472 /** 1473 * Starts a new ability with specific start options. 1474 * 1475 * @param want, the want of the ability to start. 1476 * @param startOptions Indicates the options used to start. 1477 * @return Returns ERR_OK on success, others on failure. 1478 */ 1479 virtual int32_t StartShortcut(const Want &want, const StartOptions &startOptions) override; 1480 1481 /** 1482 * Get ability state by persistent id. 1483 * 1484 * @param persistentId, the persistentId of the session. 1485 * @param state Indicates the ability state. 1486 * @return Returns ERR_OK on success, others on failure. 1487 */ 1488 virtual int32_t GetAbilityStateByPersistentId(int32_t persistentId, bool &state) override; 1489 1490 /** 1491 * Transfer resultCode & want to ability manager service. 1492 * 1493 * @param callerToken caller ability token. 1494 * @param requestCode the resultCode of the ability to start. 1495 * @param want Indicates the ability to start. 1496 * @return Returns ERR_OK on success, others on failure. 1497 */ 1498 virtual int32_t TransferAbilityResultForExtension(const sptr<IRemoteObject> &callerToken, int32_t resultCode, 1499 const Want &want) override; 1500 1501 /** 1502 * Notify ability manager service frozen process. 1503 * 1504 * @param pidList, the pid list of the frozen process. 1505 * @param uid, the uid of the frozen process. 1506 */ 1507 virtual void NotifyFrozenProcessByRSS(const std::vector<int32_t> &pidList, int32_t uid) override; 1508 1509 /** 1510 * Open atomic service window prior to finishing free install. 1511 * 1512 * @param bundleName, the bundle name of the atomic service. 1513 * @param moduleName, the module name of the atomic service. 1514 * @param abilityName, the ability name of the atomic service. 1515 * @param startTime, the starting time of the free install task. 1516 * @return Returns ERR_OK on success, others on failure. 1517 */ 1518 virtual int32_t PreStartMission(const std::string& bundleName, const std::string& moduleName, 1519 const std::string& abilityName, const std::string& startTime) override; 1520 1521 /** 1522 * Request to clean UIAbility from user. 1523 * 1524 * @param sessionInfo the session info of the ability to clean. 1525 * @param sceneFlag the reason info of the ability to terminate. 1526 * @return Returns ERR_OK on success, others on failure. 1527 */ 1528 virtual int32_t CleanUIAbilityBySCB(const sptr<SessionInfo> &sessionInfo, bool isUserRequestedExit, 1529 uint32_t sceneFlag = 0) override; 1530 1531 /** 1532 * Open link of ability and atomic service. 1533 * 1534 * @param want Ability want. 1535 * @param callerToken Caller ability token. 1536 * @param userId User ID. 1537 * @param requestCode Ability request code. 1538 * @return Returns ERR_OK on success, others on failure. 1539 */ 1540 virtual int32_t OpenLink(const Want& want, sptr<IRemoteObject> callerToken, 1541 int32_t userId = DEFAULT_INVAL_VALUE, int requestCode = DEFAULT_INVAL_VALUE) override; 1542 1543 /** 1544 * Terminate the mission. 1545 * 1546 * @param missionId, The mission id of the UIAbility need to be terminated. 1547 * @return Returns ERR_OK on success, others on failure. 1548 */ 1549 virtual int32_t TerminateMission(int32_t missionId) override; 1550 1551 /** 1552 * Notify ability manager to set the flag to block all apps from starting. 1553 * Needs to apply for ohos.permission.BLOCK_ALL_APP_START. 1554 * @param flag, The flag to block all apps from starting 1555 * @return Returns ERR_OK on success, others on failure. 1556 */ 1557 virtual int32_t BlockAllAppStart(bool flag) override; 1558 1559 /** 1560 * update associate config list by rss. 1561 * 1562 * @param configs The rss config info. 1563 * @param exportConfigs The rss export config info. 1564 * @param flag UPDATE_CONFIG_FLAG_COVER is cover config, UPDATE_CONFIG_FLAG_APPEND is append config. 1565 */ 1566 virtual int32_t UpdateAssociateConfigList(const std::map<std::string, std::list<std::string>>& configs, 1567 const std::list<std::string>& exportConfigs, int32_t flag) override; 1568 1569 /** 1570 * Set keep-alive flag for application under a specific user. 1571 * @param bundleName Bundle name. 1572 * @param userId User Id. 1573 * @param flag Keep-alive flag. 1574 * @return Returns ERR_OK on success, others on failure. 1575 */ 1576 virtual int32_t SetApplicationKeepAlive(const std::string &bundleName, int32_t userId, bool flag) override; 1577 1578 /** 1579 * Get keep-alive applications. 1580 * @param appType Application type. 1581 * @param userId User Id. 1582 * @param list List of Keep-alive information. 1583 * @return Returns ERR_OK on success, others on failure. 1584 */ 1585 virtual int32_t QueryKeepAliveApplications(int32_t appType, int32_t userId, 1586 std::vector<KeepAliveInfo> &list) override; 1587 1588 /** 1589 * Set keep-alive flag for application under a specific user by EDM. 1590 * @param bundleName Bundle name. 1591 * @param userId User Id. 1592 * @param flag Keep-alive flag. 1593 * @return Returns ERR_OK on success, others on failure. 1594 */ 1595 virtual int32_t SetApplicationKeepAliveByEDM(const std::string &bundleName, int32_t userId, 1596 bool flag, bool isAllowUserToCancel = false) override; 1597 1598 /** 1599 * Get keep-alive applications by EDM. 1600 * @param appType Application type. 1601 * @param userId User Id. 1602 * @param list List of Keep-alive information. 1603 * @return Returns ERR_OK on success, others on failure. 1604 */ 1605 virtual int32_t QueryKeepAliveApplicationsByEDM(int32_t appType, int32_t userId, 1606 std::vector<KeepAliveInfo> &list) override; 1607 1608 /** 1609 * Get intent exemption info. 1610 * @param list List of intent exemption info. 1611 * @return Returns ERR_OK on success, others on failure. 1612 */ 1613 virtual int32_t GetAllIntentExemptionInfo(std::vector<AppExecFwk::IntentExemptionInfo> &info) override; 1614 1615 /** 1616 * Add query ERMS observer. 1617 * 1618 * @param callerToken, The caller ability token. 1619 * @param observer, The observer of the ability to query ERMS. 1620 * @return Returns ERR_OK on success, others on failure. 1621 */ 1622 virtual int32_t AddQueryERMSObserver(sptr<IRemoteObject> callerToken, 1623 sptr<AbilityRuntime::IQueryERMSObserver> observer) override; 1624 1625 /** 1626 * Query atomic service ERMS rule. 1627 * 1628 * @param callerToken, The caller ability token. 1629 * @param appId, The appId of the atomic service. 1630 * @param startTime, The startTime of the query. 1631 * @param rule, The returned ERMS rule. 1632 * @return Returns ERR_OK on success, others on failure. 1633 */ 1634 virtual int32_t QueryAtomicServiceStartupRule(sptr<IRemoteObject> callerToken, 1635 const std::string &appId, const std::string &startTime, AtomicServiceStartupRule &rule) override; 1636 1637 /** 1638 * Restart atomic service. 1639 * 1640 * @param callerToken, The caller ability token. 1641 * @return Returns ERR_OK on success, others on failure. 1642 */ 1643 virtual int32_t RestartSelfAtomicService(sptr<IRemoteObject> callerToken) override; 1644 1645 /** 1646 * PrepareTerminateAbilityDone, called when PrepareTerminateAbility call is done. 1647 * 1648 * @param token, the token of the ability to terminate. 1649 * @param callback callback. 1650 */ 1651 virtual void PrepareTerminateAbilityDone(const sptr<IRemoteObject> &token, bool isTerminate) override; 1652 1653 /** 1654 * KillProcessWithPrepareTerminateDone, called when KillProcessWithPrepareTerminate call is done. 1655 * 1656 * @param moduleName, the module name of the application. 1657 * @param prepareTermination, the result of prepareTermination call of the module. 1658 * @param isExist, whether the prepareTerminate functions are implemented. 1659 */ 1660 virtual void KillProcessWithPrepareTerminateDone(const std::string &moduleName, 1661 int32_t prepareTermination, bool isExist) override; 1662 1663 /** 1664 * KillProcessForPermissionUpdate 1665 * force kill the application by accessTokenId, notify exception to SCB. 1666 * 1667 * @param accessTokenId, accessTokenId. 1668 * @return ERR_OK, return back success, others fail. 1669 */ 1670 virtual ErrCode KillProcessForPermissionUpdate(uint32_t accessTokenId) override; 1671 1672 /** 1673 * Register hidden start observer. 1674 * @param observer, ability token. 1675 * @return Returns ERR_OK on success, others on failure. 1676 */ 1677 virtual int32_t RegisterHiddenStartObserver(const sptr<IHiddenStartObserver> &observer) override; 1678 1679 /** 1680 * Unregister hidden start observer. 1681 * @param observer, ability token. 1682 * @return Returns ERR_OK on success, others on failure. 1683 */ 1684 virtual int32_t UnregisterHiddenStartObserver(const sptr<IHiddenStartObserver> &observer) override; 1685 1686 /** 1687 * Query preload uiextension record. 1688 * 1689 * @param element, The uiextension ElementName. 1690 * @param moduleName, The uiextension moduleName. 1691 * @param hostBundleName, The uiextension caller hostBundleName. 1692 * @param recordNum, The returned count of uiextension. 1693 * @param userId, The User Id. 1694 * @return Returns ERR_OK on success, others on failure. 1695 */ 1696 virtual int32_t QueryPreLoadUIExtensionRecord(const AppExecFwk::ElementName &element, 1697 const std::string &moduleName, 1698 const std::string &hostBundleName, 1699 int32_t &recordNum, 1700 int32_t userId = DEFAULT_INVAL_VALUE) override; 1701 1702 /** 1703 * Revoke delegator. 1704 * 1705 * @param token, ability token. 1706 * @return Returns ERR_OK on success, others on failure. 1707 */ 1708 virtual int32_t RevokeDelegator(sptr<IRemoteObject> token) override; 1709 int32_t StartAbilityWithWait(Want &want, sptr<IAbilityStartWithWaitObserver> &observer) override; 1710 1711 /** 1712 * Get all insight intent infos. 1713 * @param flag, the get type. 1714 * @param infos, the insight intent infos. 1715 * @return Returns ERR_OK on success, others on failure. 1716 */ 1717 virtual int32_t GetAllInsightIntentInfo( 1718 AbilityRuntime::GetInsightIntentFlag flag, 1719 std::vector<InsightIntentInfoForQuery> &infos) override; 1720 1721 /** 1722 * Get specified bundleName insight intent infos. 1723 * @param flag, the get type. 1724 * @param infos, the insight intent infos. 1725 * @param bundleName, The get insightIntent bundleName. 1726 * @return Returns ERR_OK on success, others on failure. 1727 */ 1728 virtual int32_t GetInsightIntentInfoByBundleName( 1729 AbilityRuntime::GetInsightIntentFlag flag, 1730 const std::string &bundleName, 1731 std::vector<InsightIntentInfoForQuery> &infos) override; 1732 1733 /** 1734 * Get specified intentName insight intent infos. 1735 * @param flag, the get type. 1736 * @param infos, the insight intent infos. 1737 * @param bundleName, The get insightIntent bundleName. 1738 * @param moduleName, The get insightIntent moduleName. 1739 * @param intentName, The get intent name. 1740 * @return Returns ERR_OK on success, others on failure. 1741 */ 1742 virtual int32_t GetInsightIntentInfoByIntentName( 1743 AbilityRuntime::GetInsightIntentFlag flag, 1744 const std::string &bundleName, 1745 const std::string &moduleName, 1746 const std::string &intentName, 1747 InsightIntentInfoForQuery &info) override; 1748 1749 int32_t UpdateKioskApplicationList(const std::vector<std::string> &appList) override; 1750 1751 int32_t EnterKioskMode(sptr<IRemoteObject> callerToken) override; 1752 1753 int32_t ExitKioskMode(sptr<IRemoteObject> callerToken) override; 1754 1755 int32_t GetKioskStatus(AAFwk::KioskStatus &kioskStatus) override; 1756 1757 /** 1758 * Register sa interceptor. 1759 * @param interceptor, The sa interceptor. 1760 * @return Returns ERR_OK on success, others on failure. 1761 */ 1762 virtual ErrCode RegisterSAInterceptor(sptr<AbilityRuntime::ISAInterceptor> interceptor) override; 1763 1764 /** 1765 * Set keep-alive flag for app service extension under u1 user. 1766 * @param bundleName Bundle name. 1767 * @param flag Keep-alive flag. 1768 * @return Returns ERR_OK on success, others on failure. 1769 */ 1770 virtual int32_t SetAppServiceExtensionKeepAlive(const std::string &bundleName, bool flag) override; 1771 1772 /** 1773 * Get keep-alive app service extensions. 1774 * @param list List of Keep-alive information. 1775 * @return Returns ERR_OK on success, others on failure. 1776 */ 1777 virtual int32_t QueryKeepAliveAppServiceExtensions(std::vector<KeepAliveInfo> &list) override; 1778 1779 /** 1780 * SuspendExtensionAbility, suspend session with service ability. 1781 * 1782 * @param connect, Callback used to notify caller the result of suspend or resume. 1783 * @return Returns ERR_OK on success, others on failure. 1784 */ 1785 virtual int32_t SuspendExtensionAbility(sptr<IAbilityConnection> connect) override; 1786 1787 /** 1788 * ResumeExtensionAbility, resume session with service ability. 1789 * 1790 * @param connect, Callback used to notify caller the result of suspend or resume. 1791 * @return Returns ERR_OK on success, others on failure. 1792 */ 1793 virtual int32_t ResumeExtensionAbility(sptr<IAbilityConnection> connect) override; 1794 1795 virtual int32_t SetOnNewWantSkipScenarios(sptr<IRemoteObject> callerToken, int32_t scenarios) override; 1796 1797 virtual int32_t NotifyStartupExceptionBySCB(int32_t requestId) override; 1798 1799 /** 1800 * Preload application. 1801 * @param bundleName Name of the application. 1802 * @param userId user id. 1803 * @param appIndex app clone index. Reserved field, only appIndex=0 is supported. 1804 * @return Returns ERR_OK on success, others on failure. 1805 */ 1806 virtual int32_t PreloadApplication(const std::string &bundleName, int32_t userId, int32_t appIndex) override; 1807 1808 private: 1809 template <typename T> 1810 int GetParcelableInfos(MessageParcel &reply, std::vector<T> &parcelableInfos); 1811 bool WriteInterfaceToken(MessageParcel &data); 1812 // flag = true : terminate; flag = false : close 1813 int TerminateAbility(const sptr<IRemoteObject> &token, int resultCode, const Want *resultWant, bool flag); 1814 ErrCode SendRequest(AbilityManagerInterfaceCode code, MessageParcel &data, MessageParcel &reply, 1815 MessageOption& option); 1816 int CheckUISessionParams(MessageParcel &data, const sptr<IRemoteObject> &callerToken, 1817 const sptr<SessionInfo> &sessionInfo, int32_t userId, int requestCode); 1818 bool UpdateAssociateConfigInner(const std::map<std::string, std::list<std::string>>& configs, 1819 MessageParcel& data); 1820 bool ExtendMaxIpcCapacityForWant(const Want &want, MessageParcel &data); 1821 1822 private: 1823 static inline BrokerDelegator<AbilityManagerProxy> delegator_; 1824 }; 1825 } // namespace AAFwk 1826 } // namespace OHOS 1827 #endif 1828