US 11,947,974 B2
Application start method and electronic device
Wenyong Sun, Shenzhen (CN); Yulin Ren, Shenzhen (CN); Feng Han, Shenzhen (CN); and FeiFei Cheng, Shenzhen (CN)
Assigned to Honor Device Co., Ltd., Shenzhen (CN)
Appl. No. 17/635,606
Filed by Honor Device Co., Ltd., Shenzhen (CN)
PCT Filed Sep. 17, 2020, PCT No. PCT/CN2020/116009
§ 371(c)(1), (2) Date Feb. 15, 2022,
PCT Pub. No. WO2021/052437, PCT Pub. Date Mar. 25, 2021.
Claims priority of application No. 201910889425.5 (CN), filed on Sep. 19, 2019.
Prior Publication US 2022/0308899 A1, Sep. 29, 2022
Int. Cl. G06F 9/44 (2018.01); G06F 9/4401 (2018.01); G06F 9/445 (2018.01); G06F 9/48 (2006.01)
CPC G06F 9/44521 (2013.01) [G06F 9/44 (2013.01); G06F 9/4401 (2013.01); G06F 9/44505 (2013.01); G06F 9/48 (2013.01); G06F 9/4881 (2013.01)] 14 Claims
OG exemplary drawing
 
1. An application start method, comprising:
obtaining, by a SystemServer process running in an electronic device, a start message of a first application, wherein obtaining the start message comprises obtaining, in response to an operation that a user clicks on a start icon of the first application, the start message of the first application sent by a launcher;
sending, by the SystemServer process running in the electronic device, a creation request for an application process for the first application to a daemon process in response to the start message, wherein the creation request comprises application information of the first application, wherein the application information of the first application is obtained from a directory created by the SystemServer process for the first application when the application is installed on the electronic device, and wherein the application information of the first application records an identification of one or more class loaders required for the first application;
creating, by the daemon process in the electronic device, the application process for the first application in response to the creation request, wherein the application process comprises a first thread and a second thread;
executing, by the application process of the first application, the first thread and the second thread in parallel, wherein the first thread executes initialization of a main thread of the first application, and the second thread creates a first class loader according to the application information to load a class file of the first application, and executing the first thread and the second thread in parallel comprises creating the first class loader and loading the class file of the first application using the second thread without waiting for completion of initialization of and execution of a main function of the main thread; and
after executing the first thread and the second thread in parallel, starting, by the application process of the first application, to run code of the first application, and displaying an application interface of the first application.