• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_ABILITY_RUNTIME_APP_SCHEDULER_H
17 #define OHOS_ABILITY_RUNTIME_APP_SCHEDULER_H
18 
19 #include <memory>
20 #include <unordered_set>
21 
22 #include "ability_debug_response_interface.h"
23 #include "ability_info.h"
24 #include "ability_manager_client.h"
25 #include "app_debug_listener_interface.h"
26 #include "application_info.h"
27 #include "appmgr/app_mgr_client.h"
28 #include "appmgr/app_state_callback_host.h"
29 #include "appmgr/start_specified_ability_response_stub.h"
30 #include "bundle_info.h"
31 #include "fault_data.h"
32 #include "iremote_object.h"
33 #include "refbase.h"
34 #include "running_process_info.h"
35 #include "singleton.h"
36 #include "system_memory_attr.h"
37 #include "want.h"
38 
39 namespace OHOS {
40 namespace AppExecFwk {
41 class Configuration;
42 }
43 namespace AbilityRuntime {
44 struct LoadParam;
45 }
46 namespace AAFwk {
47 /**
48  * @enum AppAbilityState
49  * AppAbilityState defines the life cycle state of app ability.
50  */
51 enum class AppAbilityState {
52     ABILITY_STATE_UNDEFINED = 0,
53     ABILITY_STATE_FOREGROUND,
54     ABILITY_STATE_BACKGROUND,
55     ABILITY_STATE_END,
56 };
57 
58 enum class AppState {
59     BEGIN = 0,
60     READY,
61     FOREGROUND,
62     FOCUS,
63     BACKGROUND,
64     TERMINATED,
65     END,
66     SUSPENDED,
67     COLD_START = 99,
68 };
69 
70 struct AppData {
71     std::string appName;
72     int32_t uid;
73 };
74 
75 struct AppInfo {
76     std::vector<AppData> appData;
77     std::string processName;
78     AppState state;
79     pid_t pid = 0;
80     int32_t appIndex = 0;
81     std::string instanceKey = "";
82     std::string bundleName = "";
83 };
84 /**
85  * @class AppStateCallback
86  * AppStateCallback.
87  */
88 class AppStateCallback {
89 public:
AppStateCallback()90     AppStateCallback()
91     {}
~AppStateCallback()92     virtual ~AppStateCallback()
93     {}
94 
95     virtual void OnAbilityRequestDone(const sptr<IRemoteObject> &token, const int32_t state) = 0;
96 
97     virtual void OnAppStateChanged(const AppInfo &info) = 0;
98 
NotifyConfigurationChange(const AppExecFwk::Configuration & config,int32_t userId)99     virtual void NotifyConfigurationChange(const AppExecFwk::Configuration &config, int32_t userId) {}
100 
NotifyStartResidentProcess(std::vector<AppExecFwk::BundleInfo> & bundleInfos)101     virtual void NotifyStartResidentProcess(std::vector<AppExecFwk::BundleInfo> &bundleInfos) {}
102 
NotifyStartKeepAliveProcess(std::vector<AppExecFwk::BundleInfo> & bundleInfos)103     virtual void NotifyStartKeepAliveProcess(std::vector<AppExecFwk::BundleInfo> &bundleInfos) {}
104 
105     /**
106      * @brief Notify abilityms app process pre cache
107      * @param pid process pid.
108      * @param userId userId Designation User ID.
109      */
NotifyAppPreCache(int32_t pid,int32_t userId)110     virtual void NotifyAppPreCache(int32_t pid, int32_t userId) {}
111 
112     /**
113      * @brief Notify abilityms app process OnRemoteDied
114      * @param abilityTokens abilities in died process.
115      */
OnAppRemoteDied(const std::vector<sptr<IRemoteObject>> & abilityTokens)116     virtual void OnAppRemoteDied(const std::vector<sptr<IRemoteObject>> &abilityTokens) {}
117 
OnStartProcessFailed(const std::vector<sptr<IRemoteObject>> & abilityTokens)118     virtual void OnStartProcessFailed(const std::vector<sptr<IRemoteObject>> &abilityTokens) {}
119 
OnCacheExitInfo(uint32_t accessTokenId,const AppExecFwk::RunningProcessInfo & exitInfo,const std::string & bundleName,const std::vector<std::string> & abilityNames,const std::vector<std::string> & uiExtensionNames)120     virtual void OnCacheExitInfo(uint32_t accessTokenId, const AppExecFwk::RunningProcessInfo &exitInfo,
121         const std::string &bundleName, const std::vector<std::string> &abilityNames,
122         const std::vector<std::string> &uiExtensionNames) {}
123 };
124 
125 class StartSpecifiedAbilityResponse : public AppExecFwk::StartSpecifiedAbilityResponseStub {
126 public:
127     StartSpecifiedAbilityResponse() = default;
128     virtual ~StartSpecifiedAbilityResponse() = default;
129 
130     virtual void OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag,
131         int32_t requestId) override;
132     virtual void OnTimeoutResponse(int32_t requestId) override;
133 
134     virtual void OnNewProcessRequestResponse(const std::string &flag, int32_t requestId,
135         const std::string &callerProcessName = "") override;
136     virtual void OnNewProcessRequestTimeoutResponse(int32_t requestId) override;
137 
138     virtual void OnStartSpecifiedFailed(int32_t requestId) override;
139 };
140 
141 /**
142  * @class AppScheduler
143  * AppScheduler , access app manager service.
144  */
145 class AppScheduler : virtual RefBase, public AppExecFwk::AppStateCallbackHost {
146     DECLARE_DELAYED_SINGLETON(AppScheduler)
147 public:
148     /**
149      * init app scheduler.
150      * @param callback, app state call back.
151      * @return true on success ,false on failure.
152      */
153     bool Init(const std::weak_ptr<AppStateCallback> &callback);
154 
155     /**
156      * load ability with token, ability info and application info.
157      *
158      * @param loadParam, the loadParam of ability.
159      * @param abilityInfo, ability info.
160      * @param applicationInfo, application info.
161      * @param want ability want
162      * @return true on success ,false on failure.
163      */
164     int LoadAbility(const AbilityRuntime::LoadParam &loadParam, const AppExecFwk::AbilityInfo &abilityInfo,
165         const AppExecFwk::ApplicationInfo &applicationInfo, const Want &want);
166 
167     /**
168      * terminate ability with token.
169      *
170      * @param token, the token of ability.
171      * @param clearMissionFlag, indicates whether terminate the ability when clearMission.
172      * @return true on success ,false on failure.
173      */
174     int TerminateAbility(const sptr<IRemoteObject> &token, bool clearMissionFlag);
175 
176     /**
177      * Prepare terminate application
178      *
179      * @param pid Process ID
180      * @param moduleName Module name
181      */
182     void PrepareTerminateApp(const pid_t pid, const std::string &moduleName);
183 
184     /**
185      * move ability to foreground.
186      *
187      * @param token, the token of ability.
188      */
189     void MoveToForeground(const sptr<IRemoteObject> &token);
190 
191     /**
192      * move ability to background.
193      *
194      * @param token, the token of ability.
195      */
196     void MoveToBackground(const sptr<IRemoteObject> &token);
197 
198     /**
199      * Update ability state.
200      *
201      * @param token, the token of ability.
202      * @param state, ability state.
203      */
204     void UpdateAbilityState(const sptr<IRemoteObject> &token, const AppExecFwk::AbilityState state);
205 
206     /**
207      * UpdateExtensionState, call UpdateExtensionState() through the proxy object, update the extension status.
208      *
209      * @param token, the unique identification to update the extension.
210      * @param state, extension status that needs to be updated.
211      * @return
212      */
213     void UpdateExtensionState(const sptr<IRemoteObject> &token, const AppExecFwk::ExtensionState state);
214 
215     /**
216      * KillProcessByAbilityToken, call KillProcessByAbilityToken() through proxy object,
217      * kill the process by ability token.
218      *
219      * @param token, the unique identification to the ability.
220      */
221     void KillProcessByAbilityToken(const sptr<IRemoteObject> &token);
222 
223     /**
224      * KillProcessesByUserId, call KillProcessesByUserId() through proxy object,
225      * kill the process by user id.
226      * Send appSpawn uninstall debug hap message.
227      *
228      * @param userId, the user id.
229      * @param isNeedSendAppSpawnMsg, true send appSpawn message otherwise not send.
230      */
231     void KillProcessesByUserId(int32_t userId, bool isNeedSendAppSpawnMsg = false,
232         sptr<AAFwk::IUserCallback> callback = nullptr);
233 
234     /**
235      * KillProcessesByPids, only in process call is allowed,
236      * kill the processes by pid list given.
237      *
238      * @param pids, the pid list of processes are going to be killed.
239      * @param reason, the reason to kill the processes.
240      * @param subProcess, kill SubProcess or not.
241      * @return ERR_OK, return back success, others fail.
242      */
243     int32_t KillProcessesByPids(const std::vector<int32_t> &pids,
244         const std::string &reason = "KillProcessesByPids", bool subProcess = false, bool isKillPrecedeStart = false);
245 
246     /**
247      * Set child and parent relationship
248      * @param token child process
249      * @param callerToken parent process
250      */
251     void AttachPidToParent(const sptr<IRemoteObject> &token, const sptr<IRemoteObject> &callerToken);
252 
253     /**
254      * convert ability state to app ability state.
255      *
256      * @param state, the state of ability.
257      */
258     AppAbilityState ConvertToAppAbilityState(const int32_t state);
259 
260     /**
261      * get ability state.
262      *
263      * @return state, the state of app ability.
264      */
265     AppAbilityState GetAbilityState() const;
266 
267     /**
268      * kill the application
269      *
270      * @param bundleName.
271      */
272     int KillApplication(const std::string &bundleName, bool clearPageStack = false, int32_t appIndex = 0);
273 
274     /**
275      * ForceKillApplication, force kill the application.
276      *
277      * @param  bundleName, bundle name in Application record.
278      * @param  userId, userId.
279      * @param  appIndex, appIndex.
280      * @return ERR_OK, return back success, others fail.
281      */
282     int ForceKillApplication(const std::string &bundleName, const int userId = -1,
283         const int appIndex = 0);
284 
285     /**
286      * KillProcessesByAccessTokenId.
287      *
288      * @param  accessTokenId, accessTokenId.
289      * @return ERR_OK, return back success, others fail.
290      */
291     int KillProcessesByAccessTokenId(const uint32_t accessTokenId);
292 
293     /**
294      * kill the application by uid
295      *
296      * @param bundleName name of bundle.
297      * @param uid uid of bundle.
298      * @param  reason, caller function name.
299      * @return 0 if success.
300      */
301     int KillApplicationByUid(const std::string &bundleName, int32_t uid,
302         const std::string& reason = "KillApplicationByUid");
303 
304     int NotifyUninstallOrUpgradeApp(const std::string &bundleName, int32_t uid, bool isUpgrade);
305 
306     /**
307      * update the application info after new module installed.
308      *
309      * @param bundleName, bundle name in Application record.
310      * @param  uid, uid.
311      * @return 0 if success.
312      */
313     int UpdateApplicationInfoInstalled(const std::string &bundleName, const int32_t uid, const std::string &moduleName,
314         bool isPlugin);
315 
316     /**
317      * Ability attach timeout. If start ability encounter failure, attach timeout to terminate.
318      *
319      * @param token Ability identify.
320      */
321     void AttachTimeOut(const sptr<IRemoteObject> &token);
322 
323     /**
324      * Prepare terminate.
325      *
326      * @param token Ability identify.
327      * @param clearMissionFlag Clear mission flag.
328      */
329     void PrepareTerminate(const sptr<IRemoteObject> &token, bool clearMissionFlag = false);
330 
331     /**
332      * Get running process information by ability token.
333      *
334      * @param token Ability identify.
335      * @param info Running process info.
336      */
337     void GetRunningProcessInfoByToken(const sptr<IRemoteObject> &token, AppExecFwk::RunningProcessInfo &info);
338 
339     /**
340      * Get running process information by pid.
341      *
342      * @param pid process id.
343      * @param info Output parameters, return runningProcessInfo.
344      * @return Returns ERR_OK on success, others on failure.
345      */
346     void GetRunningProcessInfoByPid(const pid_t pid, OHOS::AppExecFwk::RunningProcessInfo &info) const;
347 
348     /**
349      * Get running process information by child process pid.
350      *
351      * @param childPid child process id.
352      * @param info Output parameters, return runningProcessInfo.
353      * @return Returns ERR_OK on success, others on failure.
354      */
355     void GetRunningProcessInfoByChildProcessPid(const pid_t childPid,
356         OHOS::AppExecFwk::RunningProcessInfo &info) const;
357 
358     /**
359      * Set AbilityForegroundingFlag of an app-record to true.
360      *
361      * @param pid, pid.
362      *
363      */
364     void SetAbilityForegroundingFlagToAppRecord(const pid_t pid) const;
365 
366     /**
367      * Start a resident process
368      */
369     void StartupResidentProcess(const std::vector<AppExecFwk::BundleInfo> &bundleInfos);
370 
371     /**
372      * Start specified ability.
373      *
374      * @param want Want contains information of the ability to start.
375      * @param abilityInfo Ability information.
376      * @param requestId request id to callback
377      */
378     void StartSpecifiedAbility(const AAFwk::Want &want, const AppExecFwk::AbilityInfo &abilityInfo,
379         int32_t requestId = 0);
380 
381     /**
382      * @brief Get running process information.
383      *
384      * @param info Running process information.
385      * @return Returns ERR_OK on success, others on failure.
386      */
387     int GetProcessRunningInfos(std::vector<AppExecFwk::RunningProcessInfo> &info);
388 
389     /**
390      * Start specified process.
391      *
392      * @param want Want contains information wish to start.
393      * @param abilityInfo Ability information.
394      * @param requestId for callback
395      */
396     void StartSpecifiedProcess(const AAFwk::Want &want, const AppExecFwk::AbilityInfo &abilityInfo,
397         int32_t requestId = 0, const std::string &customProcess = "");
398 
399     /**
400      * Start a user test
401      */
402     int StartUserTest(const Want &want, const sptr<IRemoteObject> &observer, const AppExecFwk::BundleInfo &bundleInfo,
403         int32_t userId);
404 
405     /**
406      * @brief Finish user test.
407      * @param msg user test message.
408      * @param resultCode user test result Code.
409      * @param bundleName user test bundleName.
410      *
411      * @return Returns ERR_OK on success, others on failure.
412      */
413     int FinishUserTest(const std::string &msg, const int64_t &resultCode, const std::string &bundleName);
414 
415     /**
416      * GetProcessRunningInfosByUserId, call GetProcessRunningInfosByUserId() through proxy project.
417      * Obtains information about application processes that are running on the device.
418      *
419      * @param info, app name in Application record.
420      * @param userId, user Id in Application record.
421      * @return ERR_OK ,return back success,others fail.
422      */
423     int GetProcessRunningInfosByUserId(std::vector<AppExecFwk::RunningProcessInfo> &info, int32_t userId);
424     std::string ConvertAppState(const AppState &state);
425 
426     /**
427      *  ANotify application update system environment changes.
428      *
429      * @param config System environment change parameters.
430      * @return Returns ERR_OK on success, others on failure.
431      */
432     int UpdateConfiguration(const AppExecFwk::Configuration &config);
433 
434     /**
435      * GetConfiguration
436      *
437      * @param info to retrieve configuration data.
438      * @return ERR_OK ,return back success,others fail.
439      */
440     int GetConfiguration(AppExecFwk::Configuration &config);
441 
442     /**
443      *  Get the token of ability records by process ID.
444      *
445      * @param pid The process id.
446      * @param tokens The token of ability records.
447      * @return Returns ERR_OK on success, others on failure.
448      */
449     int GetAbilityRecordsByProcessID(const int pid, std::vector<sptr<IRemoteObject>> &tokens);
450 
451     /**
452      *  Get the application info by process ID.
453      *
454      * @param pid The process id.
455      * @param application The application info.
456      * @param debug The app is or not debug.
457      * @return Returns ERR_OK on success, others on failure.
458      */
459     int GetApplicationInfoByProcessID(const int pid, AppExecFwk::ApplicationInfo &application, bool &debug);
460 
461     /**
462      *  Set the process cache status by process ID.
463      *
464      * @param pid The process id.
465      * @param isSupport The process is support cache.
466      * @return Returns ERR_OK on success, others on failure.
467      */
468     void SetProcessCacheStatus(int32_t pid, bool isSupport);
469 
470     /**
471      * Record process exit reason to appRunningRecord
472      * @param pid pid
473      * @param reason reason enum
474      * @param exitMsg exitMsg
475      * @return Returns ERR_OK on success, others on failure.
476      */
477     virtual int32_t NotifyAppMgrRecordExitReason(int32_t pid, int32_t reason, const std::string &exitMsg);
478 
479     /**
480      * Set the current userId of appMgr, only used by abilityMgr.
481      *
482      * @param userId the user id.
483      *
484      * @return
485      */
486     void SetCurrentUserId(int32_t userId);
487 
488     /**
489      * Set enable start process flag by userId
490      * @param userId the user id.
491      * @param enableStartProcess enable start process.
492      * @return
493      */
494     void SetEnableStartProcessFlagByUserId(int32_t userId, bool enableStartProcess);
495 
496     /**
497      * Get bundleName by pid.
498      *
499      * @param pid process id.
500      * @param bundleName Output parameters, return bundleName.
501      * @param uid Output parameters, return userId.
502      * @return Returns ERR_OK on success, others on failure.
503      */
504     int32_t GetBundleNameByPid(const int pid, std::string &bundleName, int32_t &uid);
505 
506     /**
507      * Notify Fault Data
508      *
509      * @param faultData the fault data.
510      * @return Returns ERR_OK on success, others on failure.
511      */
512     int32_t NotifyFault(const AppExecFwk::FaultData &faultData);
513 
514     /**
515      * @brief Register app debug listener.
516      * @param listener App debug listener.
517      * @return Returns ERR_OK on success, others on failure.
518      */
519     int32_t RegisterAppDebugListener(const sptr<AppExecFwk::IAppDebugListener> &listener);
520 
521     /**
522      * @brief Unregister app debug listener.
523      * @param listener App debug listener.
524      * @return Returns ERR_OK on success, others on failure.
525      */
526     int32_t UnregisterAppDebugListener(const sptr<AppExecFwk::IAppDebugListener> &listener);
527 
528     /**
529      * @brief Attach app debug.
530      * @param bundleName The application bundle name.
531      * @return Returns ERR_OK on success, others on failure.
532      */
533     int32_t AttachAppDebug(const std::string &bundleName, bool isDebugFromLocal);
534 
535     /**
536      * @brief Detach app debug.
537      * @param bundleName The application bundle name.
538      * @return Returns ERR_OK on success, others on failure.
539      */
540     int32_t DetachAppDebug(const std::string &bundleName);
541 
542     /**
543      * @brief Register ability debug response to set debug mode.
544      * @param bundleName The application bundle name.
545      * @return Returns ERR_OK on success, others on failure.
546      */
547     int32_t RegisterAbilityDebugResponse(const sptr<AppExecFwk::IAbilityDebugResponse> &response);
548 
549     /**
550      * @brief Determine whether it is an attachment debug application based on the bundle name.
551      * @param bundleName The application bundle name.
552      * @return Returns true if it is an attach debug application, otherwise it returns false.
553      */
554     bool IsAttachDebug(const std::string &bundleName);
555 
556     /**
557      * To clear the process by ability token.
558      *
559      * @param token the unique identification to the ability.
560      */
561     void ClearProcessByToken(sptr<IRemoteObject> token) const;
562 
563     /**
564      * whether memory size is sufficient.
565      * @return Returns true is sufficient memory size, others return false.
566      */
567     virtual bool IsMemorySizeSufficent() const;
568 
569     /**
570      * whether or not requier a big memory
571      * @return Returens true is no big memory, others return false.
572      */
573     virtual bool IsNoRequireBigMemory() const;
574 
575     /**
576      * Notifies that one ability is attached to status bar.
577      *
578      * @param token the token of the abilityRecord that is attached to status bar.
579      */
580     void AttachedToStatusBar(const sptr<IRemoteObject> &token);
581 
582      /**
583      * Temporarily block the process cache feature.
584      *
585      * @param pids the pids of the processes that should be blocked.
586      */
587     void BlockProcessCacheByPids(const std::vector<int32_t>& pids);
588 
589     /**
590      * Request to clean uiability from user.
591      *
592      * @param token the token of ability.
593      * @return Returns true if clean success, others return false.
594      */
595     bool CleanAbilityByUserRequest(const sptr<IRemoteObject> &token);
596 
597     /**
598      * whether killed for upgrade web.
599      *
600      * @param bundleName the bundle name is killed for upgrade web.
601      * @return Returns true is killed for upgrade web, others return false.
602      */
603     bool IsKilledForUpgradeWeb(const std::string &bundleName);
604 
605     /**
606      * whether the abilities of process specified by pid type only UIAbility.
607      * @return Returns true is only UIAbility, otherwise return false
608      */
609     bool IsProcessContainsOnlyUIAbility(const pid_t pid);
610 
611     bool IsProcessAttached(sptr<IRemoteObject> token) const;
612 
613     bool IsCallerKilling(const std::string& callerKey) const;
614 
615     int32_t PreloadApplicationByPhase(const std::string &bundleName, int32_t userId, int32_t appIndex,
616         AppExecFwk::PreloadPhase preloadPhase);
617 
618     int32_t NotifyPreloadAbilityStateChanged(sptr<IRemoteObject> token, bool isPreForeground);
619 
620     int32_t CheckPreloadAppRecordExist(const std::string &bundleName, int32_t userId, int32_t appIndex, bool &isExist);
621 
622     int32_t VerifyKillProcessPermission(const std::string &bundleName) const;
623 protected:
624     /**
625      * OnAbilityRequestDone, app manager service call this interface after ability request done.
626      *
627      * @param token,ability's token.
628      * @param state,the state of ability lift cycle.
629      */
630     virtual void OnAbilityRequestDone(const sptr<IRemoteObject> &token, const AppExecFwk::AbilityState state) override;
631 
632     /**
633      * Application state changed callback.
634      *
635      * @param appProcessData Process data
636      */
637     virtual void OnAppStateChanged(const AppExecFwk::AppProcessData &appData) override;
638 
639     /**
640      * @brief Notify application update system environment changes.
641      * @param config System environment change parameters.
642      * @param userId userId Designation User ID.
643      */
644     virtual void NotifyConfigurationChange(const AppExecFwk::Configuration &config, int32_t userId) override;
645 
646     /**
647      * @brief Notify abilityms start resident process.
648      * @param bundleInfos resident process bundle infos.
649      */
650     virtual void NotifyStartResidentProcess(std::vector<AppExecFwk::BundleInfo> &bundleInfos) override;
651 
652     /**
653      * @brief Notify abilityms start keep-alive process.
654      * @param bundleInfos resident process bundle infos.
655      */
656     virtual void NotifyStartKeepAliveProcess(std::vector<AppExecFwk::BundleInfo> &bundleInfos) override;
657 
658     /**
659      * @brief Notify abilityms app process OnRemoteDied
660      * @param abilityTokens abilities in died process.
661      */
662     virtual void OnAppRemoteDied(const std::vector<sptr<IRemoteObject>> &abilityTokens) override;
663 
664     virtual void OnStartProcessFailed(const std::vector<sptr<IRemoteObject>> &abilityTokens) override;
665     /**
666      * @brief Notify abilityms app process pre cache
667      * @param pid process pid.
668      * @param userId userId Designation User ID.
669      */
670     virtual void NotifyAppPreCache(int32_t pid, int32_t userId) override;
671 
672     /**
673      * @brief Notify abilityms exit info
674      * @param accessTokenId accessTokenId.
675      * @param exitInfo exit info before app died.
676      * @param bundleName app bundleName.
677      * @param abilityNames abilityNames in app.
678      * @param uiExtensionNames uiExtensionNames in app.
679      */
680     virtual void OnCacheExitInfo(uint32_t accessTokenId, const AppExecFwk::RunningProcessInfo &exitInfo,
681         const std::string &bundleName, const std::vector<std::string> &abilityNames,
682         const std::vector<std::string> &uiExtensionNames) override;
683 
684 private:
685     bool isInit_  {false};
686     AppAbilityState appAbilityState_ = AppAbilityState::ABILITY_STATE_UNDEFINED;
687     std::weak_ptr<AppStateCallback> callback_;
688     std::unique_ptr<AppExecFwk::AppMgrClient> appMgrClient_;
689     sptr<StartSpecifiedAbilityResponse> startSpecifiedAbilityResponse_;
690     std::mutex lock_;
691 };
692 }  // namespace AAFwk
693 }  // namespace OHOS
694 #endif  // OHOS_ABILITY_RUNTIME_APP_SCHEDULER_H
695