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