• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2024 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_MAIN_THREAD_H
17 #define OHOS_ABILITY_RUNTIME_MAIN_THREAD_H
18 
19 #include <string>
20 #include <signal.h>
21 #include <mutex>
22 #include "event_handler.h"
23 #include "extension_config_mgr.h"
24 #include "idle_time.h"
25 #include "inner_event.h"
26 #include "app_scheduler_host.h"
27 #include "app_mgr_interface.h"
28 #include "ability_record_mgr.h"
29 #include "application_impl.h"
30 #include "assert_fault_task_thread.h"
31 #include "common_event_subscriber.h"
32 #include "resource_manager.h"
33 #include "foundation/ability/ability_runtime/interfaces/inner_api/runtime/include/runtime.h"
34 #include "ipc_singleton.h"
35 #ifdef CJ_FRONTEND
36 #include "cj_envsetup.h"
37 #endif
38 #include "js_runtime.h"
39 #include "native_engine/native_engine.h"
40 #include "overlay_event_subscriber.h"
41 #include "watchdog.h"
42 #include "app_malloc_info.h"
43 #include "app_jsheap_mem_info.h"
44 #define ABILITY_LIBRARY_LOADER
45 
46 #if defined(NWEB) && defined(NWEB_GRAPHIC)
47 #include "nweb_preload.h"
48 #include "ui/rs_surface_node.h"
49 #endif
50 
51 class Runtime;
52 namespace OHOS {
53 namespace AppExecFwk {
54 using namespace OHOS::Global;
55 using OHOS::AbilityRuntime::Runtime;
56 struct BaseSharedBundleInfo;
57 using HspList = std::vector<BaseSharedBundleInfo>;
58 enum class MainThreadState { INIT, ATTACH, READY, RUNNING };
59 struct BundleInfo;
60 class ContextDeal;
61 // class Global::Resource::ResourceManager;
62 class AppMgrDeathRecipient : public IRemoteObject::DeathRecipient {
63 public:
64     /**
65      *
66      * @brief Notify the AppMgrDeathRecipient that the remote is dead.
67      *
68      * @param remote The remote which is dead.
69      */
70     virtual void OnRemoteDied(const wptr<IRemoteObject> &remote) override;
71     AppMgrDeathRecipient() = default;
72     ~AppMgrDeathRecipient() override = default;
73 };
74 
75 class MainThread : public AppSchedulerHost {
76     DECLARE_DELAYED_IPCSINGLETON(MainThread);
77 
78 public:
79     /**
80      *
81      * @brief Get the current MainThreadState.
82      *
83      * @return Returns the current MainThreadState.
84      */
85     MainThreadState GetMainThreadState() const;
86 
87     /**
88      *
89      * @brief Get the runner state of mainthread.
90      *
91      * @return Returns the runner state of mainthread.
92      */
93     bool GetRunnerStarted() const;
94 
95     /**
96      *
97      * @brief Get the newThreadId.
98      *
99      * @return Returns the newThreadId.
100      */
101     int GetNewThreadId();
102 
103     /**
104      *
105      * @brief Get the application.
106      *
107      * @return Returns the application.
108      */
109     std::shared_ptr<OHOSApplication> GetApplication() const;
110 
111     /**
112      *
113      * @brief Get the applicationInfo.
114      *
115      * @return Returns the applicationInfo.
116      */
117     std::shared_ptr<ApplicationInfo> GetApplicationInfo() const;
118 
119     /**
120      *
121      * @brief Get the applicationImpl.
122      *
123      * @return Returns the applicationImpl.
124      */
125     std::shared_ptr<ApplicationImpl> GetApplicationImpl();
126 
127     /**
128      *
129      * @brief Get the eventHandler of mainthread.
130      *
131      * @return Returns the eventHandler of mainthread.
132      */
133     std::shared_ptr<EventHandler> GetMainHandler() const;
134 
135     /**
136      *
137      * @brief Schedule the foreground lifecycle of application.
138      *
139      */
140     bool ScheduleForegroundApplication() override;
141 
142     /**
143      *
144      * @brief Schedule the background lifecycle of application.
145      *
146      */
147     void ScheduleBackgroundApplication() override;
148 
149     /**
150      *
151      * @brief Schedule the terminate lifecycle of application.
152      *
153      * @param isLastProcess When it is the last application process, pass in true.
154      */
155     void ScheduleTerminateApplication(bool isLastProcess = false) override;
156 
157     /**
158      *
159      * @brief Shrink the memory which used by application.
160      *
161      * @param level Indicates the memory trim level, which shows the current memory usage status.
162      */
163     void ScheduleShrinkMemory(const int level) override;
164 
165     /**
166      *
167      * @brief Notify the current memory.
168      *
169      * @param level Indicates the memory trim level, which shows the current memory usage status.
170      */
171     void ScheduleMemoryLevel(const int level) override;
172 
173     /**
174      *
175      * @brief Get the application's memory allocation info.
176      *
177      * @param pid, pid input.
178      * @param mallocInfo, dynamic storage information output.
179      */
180     void ScheduleHeapMemory(const int32_t pid, OHOS::AppExecFwk::MallocInfo &mallocInfo) override;
181 
182     /**
183      *
184      * @brief triggerGC and dump the application's jsheap memory info.
185      *
186      * @param info, pid, tid, needGc, needSnapshot.
187      */
188     void ScheduleJsHeapMemory(OHOS::AppExecFwk::JsHeapDumpInfo &info) override;
189 
190     /**
191      *
192      * @brief Low the memory which used by application.
193      *
194      */
195     void ScheduleLowMemory() override;
196 
197     /**
198      *
199      * @brief Launch the application.
200      *
201      * @param data The launchdata of the application witch launced.
202      *
203      */
204     void ScheduleLaunchApplication(const AppLaunchData &data, const Configuration &config) override;
205 
206     /**
207      *
208      * @brief update the application info after new module installed.
209      *
210      * @param appInfo The latest application info obtained from bms for update abilityRuntimeContext.
211      *
212      */
213     void ScheduleUpdateApplicationInfoInstalled(const ApplicationInfo &appInfo) override;
214 
215     /**
216      * Notify application to launch ability stage.
217      *
218      * @param The resident process data value.
219      */
220     void ScheduleAbilityStage(const HapModuleInfo &abilityStage) override;
221 
222     void ScheduleLaunchAbility(const AbilityInfo &info, const sptr<IRemoteObject> &token,
223         const std::shared_ptr<AAFwk::Want> &want, int32_t abilityRecordId) override;
224 
225     /**
226      *
227      * @brief clean the ability by token.
228      *
229      * @param token The token belong to the ability which want to be cleaned.
230      *
231      */
232     void ScheduleCleanAbility(const sptr<IRemoteObject> &token, bool isCacheProcess = false) override;
233 
234     /**
235      *
236      * @brief send the new profile.
237      *
238      * @param profile The updated profile.
239      *
240      */
241     void ScheduleProfileChanged(const Profile &profile) override;
242 
243     /**
244      *
245      * @brief send the new config to the application.
246      *
247      * @param config The updated config.
248      *
249      */
250     void ScheduleConfigurationUpdated(const Configuration &config) override;
251 
252     /**
253      *
254      * @brief Starts the mainthread.
255      *
256      */
257     static void Start();
258 
259     static void StartChild(const std::map<std::string, int32_t> &fds);
260 
261     /**
262      *
263      * @brief Preload extensions in appspawn.
264      *
265      */
266     static void PreloadExtensionPlugin();
267 
268     /**
269      *
270      * @brief Schedule the application process exit safely.
271      *
272      */
273     void ScheduleProcessSecurityExit() override;
274 
275     void ScheduleAcceptWant(const AAFwk::Want &want, const std::string &moduleName) override;
276 
277     void ScheduleNewProcessRequest(const AAFwk::Want &want, const std::string &moduleName) override;
278 
279     /**
280      *
281      * @brief Check the App main thread state.
282      *
283      */
284     void CheckMainThreadIsAlive();
285 
286     int32_t ScheduleNotifyLoadRepairPatch(const std::string &bundleName, const sptr<IQuickFixCallback> &callback,
287         const int32_t recordId) override;
288 
289     int32_t ScheduleNotifyHotReloadPage(const sptr<IQuickFixCallback> &callback, const int32_t recordId) override;
290 
291     int32_t ScheduleNotifyUnLoadRepairPatch(const std::string &bundleName,
292         const sptr<IQuickFixCallback> &callback, const int32_t recordId) override;
293 
294     int32_t ScheduleNotifyAppFault(const FaultData &faultData) override;
295 #ifdef CJ_FRONTEND
296     CJUncaughtExceptionInfo CreateCjExceptionInfo(const std::string &bundleName, uint32_t versionCode,
297         const std::string &hapPath);
298 #endif
299     /**
300      * @brief Notify NativeEngine GC of status change.
301      *
302      * @param state GC state
303      *
304      * @return Is the status change completed.
305      */
306     int32_t ScheduleChangeAppGcState(int32_t state) override;
307 
308     void AttachAppDebug() override;
309     void DetachAppDebug() override;
310     bool NotifyDeviceDisConnect();
311 
312     void AssertFaultPauseMainThreadDetection();
313     void AssertFaultResumeMainThreadDetection();
314 
315     /**
316      * ScheduleDumpIpcStart, call ScheduleDumpIpcStart(std::string& result) through proxy project,
317      * Start querying the application's IPC payload info.
318      *
319      * @param result, start IPC dump result output.
320      *
321      * @return Returns 0 on success, error code on failure.
322      */
323     int32_t ScheduleDumpIpcStart(std::string& result) override;
324 
325     /**
326      * ScheduleDumpIpcStop, call ScheduleDumpIpcStop(std::string& result) through proxy project,
327      * Stop querying the application's IPC payload info.
328      *
329      * @param result, stop IPC dump result output.
330      *
331      * @return Returns 0 on success, error code on failure.
332      */
333     int32_t ScheduleDumpIpcStop(std::string& result) override;
334 
335     /**
336      * ScheduleDumpIpcStat, call ScheduleDumpIpcStat(std::string& result) through proxy project,
337      * Collect the application's IPC payload info.
338      *
339      * @param result, IPC payload result output.
340      *
341      * @return Returns 0 on success, error code on failure.
342      */
343     int32_t ScheduleDumpIpcStat(std::string& result) override;
344 
345     void ScheduleCacheProcess() override;
346     /**
347      * ScheduleDumpFfrt, call ScheduleDumpFfrt(std::string& result) through proxy project,
348      * Start querying the application's ffrt usage.
349      *
350      * @param result, ffrt dump result output.
351      *
352      * @return Returns 0 on success, error code on failure.
353      */
354     int32_t ScheduleDumpFfrt(std::string& result) override;
355 
356 private:
357     /**
358      *
359      * @brief Terminate the application but don't notify ams.
360      *
361      */
362     void HandleTerminateApplicationLocal();
363 
364     void HandleScheduleAcceptWant(const AAFwk::Want &want, const std::string &moduleName);
365 
366     void HandleScheduleNewProcessRequest(const AAFwk::Want &want, const std::string &moduleName);
367 
368     void HandleJsHeapMemory(const OHOS::AppExecFwk::JsHeapDumpInfo &info);
369 
370     /**
371      *
372      * @brief Schedule the application process exit safely.
373      *
374      */
375     void HandleProcessSecurityExit();
376 
377     /**
378      *
379      * @brief Clean the ability but don't notify ams.
380      *
381      * @param token The token which belongs to the ability launched.
382      *
383      */
384     void HandleCleanAbilityLocal(const sptr<IRemoteObject> &token);
385 
386     /**
387      *
388      * @brief Launch the application.
389      *
390      * @param appLaunchData The launchdata of the application witch launced.
391      *
392      */
393     void HandleLaunchApplication(const AppLaunchData &appLaunchData, const Configuration &config);
394 
395     /**
396      *
397      * @brief update the application info after new module installed.
398      *
399      * @param appInfo The latest application info obtained from bms for update abilityRuntimeContext.
400      *
401      */
402     void HandleUpdateApplicationInfoInstalled(const ApplicationInfo &appInfo);
403 
404     /**
405      *
406      * @brief Launch the application.
407      *
408      * @param appLaunchData The launchdata of the application witch launced.
409      *
410      */
411     void HandleAbilityStage(const HapModuleInfo &abilityStage);
412 
413     /**
414      *
415      * @brief Launch the ability.
416      *
417      * @param abilityRecord The abilityRecord which belongs to the ability launched.
418      *
419      */
420     void HandleLaunchAbility(const std::shared_ptr<AbilityLocalRecord> &abilityRecord);
421 
422     /**
423      *
424      * @brief Clean the ability.
425      *
426      * @param token The token which belongs to the ability launched.
427      *
428      */
429     void HandleCleanAbility(const sptr<IRemoteObject> &token, bool isCacheProcess = false);
430 
431     /**
432      *
433      * @brief Foreground the application.
434      *
435      */
436     void HandleForegroundApplication();
437 
438     /**
439      *
440      * @brief Background the application.
441      *
442      */
443     void HandleBackgroundApplication();
444 
445     /**
446      *
447      * @brief Terminate the application.
448      *
449      */
450     void HandleTerminateApplication(bool isLastProcess = false);
451 
452     /**
453      *
454      * @brief Shrink the memory which used by application.
455      *
456      * @param level Indicates the memory trim level, which shows the current memory usage status.
457      *
458      */
459     void HandleShrinkMemory(const int level);
460 
461     /**
462      *
463      * @brief Notify the memory.
464      *
465      * @param level Indicates the memory trim level, which shows the current memory usage status.
466      *
467      */
468     void HandleMemoryLevel(int level);
469 
470     /**
471      *
472      * @brief send the new config to the application.
473      *
474      * @param config The updated config.
475      *
476      */
477     void HandleConfigurationUpdated(const Configuration &config);
478 
479     /**
480      *
481      * @brief remove the deathRecipient from appMgr.
482      *
483      */
484     void RemoveAppMgrDeathRecipient();
485 
486     /**
487      *
488      * @brief Attach the mainthread to the AppMgr.
489      *
490      */
491     void Attach();
492 
493     /**
494      *
495      * @brief Set the runner state of mainthread.
496      *
497      * @param runnerStart whether the runner is started.
498      */
499     void SetRunnerStarted(bool runnerStart);
500 
501     /**
502      *
503      * @brief Connect the mainthread to the AppMgr.
504      *
505      */
506     bool ConnectToAppMgr();
507 
508     /**
509      *
510      * @brief Check whether the appLaunchData is legal.
511      *
512      * @param appLaunchData The appLaunchData should be checked.
513      *
514      * @return if the appLaunchData is legal, return true. else return false.
515      */
516     bool CheckLaunchApplicationParam(const AppLaunchData &appLaunchData) const;
517 
518     /**
519      *
520      * @brief Check whether the record is legal.
521      *
522      * @param record The record should be checked.
523      *
524      * @return if the record is legal, return true. else return false.
525      */
526     bool CheckAbilityItem(const std::shared_ptr<AbilityLocalRecord> &record) const;
527 
528     /**
529      *
530      * @brief Init the mainthread.
531      *
532      * @param runner the runner belong to the mainthread.
533      *
534      */
535     void Init(const std::shared_ptr<EventRunner> &runner);
536 
537     /**
538      *
539      * @brief Task in event handler timeout detected.
540      *
541      * @param runner the runner belong to the mainthread.
542      *
543      */
544     void TaskTimeoutDetected(const std::shared_ptr<EventRunner>& runner);
545 
546     /**
547      *
548      * @brief Check whether the OHOSApplication is ready.
549      *
550      * @return if the OHOSApplication is ready, return true. else return false.
551      *
552      */
553     bool IsApplicationReady() const;
554 
555     /**
556      * @brief Load all extension so
557      *
558      * @param nativeEngine nativeEngine instance
559      */
560     void LoadAllExtensions(NativeEngine &nativeEngine);
561 
562     /**
563      *
564      * @brief Ability Delegator Prepare.
565      *
566      * @param record User Test info.
567      *
568      */
569     bool PrepareAbilityDelegator(const std::shared_ptr<UserTestRecord> &record, bool isStageBased,
570         const AppExecFwk::HapModuleInfo &entryHapModuleInfo);
571 
572     /**
573      * @brief Set current process extension type
574      *
575      * @param abilityRecord current running ability record
576      */
577     void SetProcessExtensionType(const std::shared_ptr<AbilityLocalRecord> &abilityRecord);
578 
579     /**
580      * @brief Add Extension block item
581      *
582      * @param extensionName extension name
583      * @param type extension type
584      */
585     void AddExtensionBlockItem(const std::string &extensionName, int32_t type);
586 
587     /**
588      * @brief Update runtime module checker
589      *
590      * @param runtime runtime the ability runtime
591      */
592     void UpdateRuntimeModuleChecker(const std::unique_ptr<AbilityRuntime::Runtime> &runtime);
593 
594     static void HandleDumpHeapPrepare();
595     static void HandleDumpHeap(bool isPrivate);
596     static void DestroyHeapProfiler();
597     static void ForceFullGC();
598     static void HandleSignal(int signal, siginfo_t *siginfo, void *context);
599 
600     void NotifyAppFault(const FaultData &faultData);
601 
602     void OnOverlayChanged(const EventFwk::CommonEventData &data,
603         const std::shared_ptr<Global::Resource::ResourceManager> &resourceManager, const std::string &bundleName,
604         const std::string &moduleName, const std::string &loadPath);
605 
606     void HandleOnOverlayChanged(const EventFwk::CommonEventData &data,
607         const std::shared_ptr<Global::Resource::ResourceManager> &resourceManager, const std::string &bundleName,
608         const std::string &moduleName, const std::string &loadPath);
609 
610     int GetOverlayModuleInfos(const std::string &bundleName, const std::string &moduleName,
611         std::vector<OverlayModuleInfo> &overlayModuleInfos) const;
612 
613     std::vector<std::string> GetAddOverlayPaths(const std::vector<OverlayModuleInfo> &overlayModuleInfos);
614 
615     std::vector<std::string> GetRemoveOverlayPaths(const std::vector<OverlayModuleInfo> &overlayModuleInfos);
616 
617     int32_t ChangeAppGcState(int32_t state);
618 
619     void HandleCacheProcess();
620 
621     bool IsBgWorkingThread(const AbilityInfo &info);
622 
623     /**
624      * @brief parse app configuration params
625      *
626      * @param configuration input configuration
627      * @config the config of application
628      */
629     void ParseAppConfigurationParams(const std::string configuration, Configuration &config);
630 
631 #if defined(NWEB) && defined(NWEB_GRAPHIC)
632     void HandleNWebPreload();
633 #endif
634 
635     class MainHandler : public EventHandler {
636     public:
637         MainHandler(const std::shared_ptr<EventRunner> &runner, const sptr<MainThread> &thread);
638         virtual ~MainHandler() = default;
639 
640         /**
641          *
642          * @brief Process the event.
643          *
644          * @param event the event want to be processed.
645          *
646          */
647         void ProcessEvent(const OHOS::AppExecFwk::InnerEvent::Pointer &event) override;
648 
649     private:
650         wptr<MainThread> mainThreadObj_ = nullptr;
651     };
652 
653     bool isRunnerStarted_ = false;
654     int newThreadId_ = -1;
655     std::shared_ptr<ApplicationInfo> applicationInfo_ = nullptr;
656     std::shared_ptr<ProcessInfo> processInfo_ = nullptr;
657     std::shared_ptr<OHOSApplication> application_ = nullptr;
658     std::shared_ptr<ApplicationImpl> applicationImpl_ = nullptr;
659     static std::shared_ptr<MainHandler> mainHandler_;
660     std::shared_ptr<AbilityRecordMgr> abilityRecordMgr_ = nullptr;
661     std::shared_ptr<Watchdog> watchdog_ = nullptr;
662     std::unique_ptr<AbilityRuntime::ExtensionConfigMgr> extensionConfigMgr_ = nullptr;
663     MainThreadState mainThreadState_ = MainThreadState::INIT;
664     sptr<IAppMgr> appMgr_ = nullptr;  // appMgrService Handler
665     sptr<IRemoteObject::DeathRecipient> deathRecipient_ = nullptr;
666     std::string aceApplicationName_ = "AceApplication";
667     std::string pathSeparator_ = "/";
668     std::string abilityLibraryType_ = ".so";
669     static std::weak_ptr<OHOSApplication> applicationForDump_;
670     bool isDeveloperMode_ = false;
671 #if defined(NWEB) && defined(NWEB_GRAPHIC)
672     Rosen::RSSurfaceNode::SharedPtr preloadSurfaceNode_ = nullptr;
673     std::shared_ptr<NWeb::NWeb> preloadNWeb_ = nullptr;
674 #endif
675 
676 #ifdef ABILITY_LIBRARY_LOADER
677     /**
678      *
679      * @brief Load the ability library.
680      *
681      * @param libraryPaths the library paths.
682      *
683      */
684     void LoadAbilityLibrary(const std::vector<std::string> &libraryPaths);
685     void LoadAceAbilityLibrary();
686 
687     void CalcNativeLiabraryEntries(const BundleInfo &bundleInfo, std::string &nativeLibraryPath);
688     void LoadNativeLiabrary(const BundleInfo &bundleInfo, std::string &nativeLibraryPath);
689 
690     void LoadAppDetailAbilityLibrary(std::string &nativeLibraryPath);
691 
692     void LoadAppLibrary();
693 
694     void ChangeToLocalPath(const std::string &bundleName,
695         const std::vector<std::string> &sourceDirs, std::vector<std::string> &localPath);
696 
697     void ChangeToLocalPath(const std::string &bundleName,
698         const std::string &sourcDir, std::string &localPath);
699 
700     bool ScanDir(const std::string &dirPath, std::vector<std::string> &files);
701 
702     /**
703      *
704      * @brief Check the fileType.
705      *
706      * @param fileName The fileName of the lib.
707      * @param extensionName The extensionName of the lib.
708      *
709      * @return if the FileType is legal, return true. else return false.
710      *
711      */
712     bool CheckFileType(const std::string &fileName, const std::string &extensionName);
713 
714     bool InitCreate(std::shared_ptr<ContextDeal> &contextDeal, ApplicationInfo &appInfo, ProcessInfo &processInfo);
715     bool CheckForHandleLaunchApplication(const AppLaunchData &appLaunchData);
716     bool InitResourceManager(std::shared_ptr<Global::Resource::ResourceManager> &resourceManager,
717         const AppExecFwk::HapModuleInfo &entryHapModuleInfo, const std::string &bundleName,
718         bool multiProjects, const Configuration &config);
719     void OnStartAbility(const std::string& bundleName,
720         std::shared_ptr<Global::Resource::ResourceManager> &resourceManager,
721         const AppExecFwk::HapModuleInfo &entryHapModuleInfo);
722     std::vector<std::string> GetOverlayPaths(const std::string &bundleName,
723         const std::vector<OverlayModuleInfo> &overlayModuleInfos);
724     void SubscribeOverlayChange(const std::string &bundleName, const std::string &loadPath,
725         std::shared_ptr<Global::Resource::ResourceManager> &resourceManager,
726         const AppExecFwk::HapModuleInfo &entryHapModuleInfo);
727     void HandleInitAssertFaultTask(bool isDebugModule, bool isDebugApp);
728     void HandleCancelAssertFaultTask();
729 
730     bool GetHqfFileAndHapPath(const std::string &bundleName,
731         std::vector<std::pair<std::string, std::string>> &fileMap);
732     void GetNativeLibPath(const BundleInfo &bundleInfo, const HspList &hspList, AppLibPathMap &appLibPaths);
733     void SetAppDebug(uint32_t modeFlag, bool isDebug);
734 
735     std::vector<std::string> fileEntries_;
736     std::vector<std::string> nativeFileEntries_;
737     std::vector<void *> handleAbilityLib_;  // the handler of ACE Library.
738     std::shared_ptr<IdleTime> idleTime_ = nullptr;
739     std::vector<AppExecFwk::OverlayModuleInfo> overlayModuleInfos_;
740     std::weak_ptr<AbilityRuntime::AssertFaultTaskThread> assertThread_;
741 #endif                                      // ABILITY_LIBRARY_LOADER
742 #ifdef APPLICATION_LIBRARY_LOADER
743     void *handleAppLib_ = nullptr;  // the handler of ACE Library.
744     constexpr static std::string applicationLibraryPath = "/hos/lib/libapplication_native.z.so";
745 #endif  // APPLICATION_LIBRARY_LOADER
746     DISALLOW_COPY_AND_MOVE(MainThread);
747 };
748 }  // namespace AppExecFwk
749 }  // namespace OHOS
750 #endif  // OHOS_ABILITY_RUNTIME_MAIN_THREAD_H
751