Application starting method and electronic equipment

By adding a startup window in advance for the first activity and in parallel with the application activity loading in the shortcut startup scenario, the problem of long response time for quick startup is solved and the user experience is improved.

CN120276782APending Publication Date: 2025-07-08HONOR DEVICE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311867730.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

During the quick start application process, the existing technology has the problem of long response time, which affects the user experience.

Method used

In the quick startup scenario, add a startup window for the first activity in advance and display a transition page, and execute it in parallel with the application's activity loading process, avoiding dependence on the activity life cycle and optimizing the display process of the transition page.

Benefits of technology

This greatly shortens the response time of the application, improves the user experience, ensures that the transition page can be displayed early and synchronized with the activity load, and reduces user waiting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276782A_ABST
    Figure CN120276782A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an application starting method and electronic equipment, the method is applied to the electronic equipment, the electronic equipment comprises a system service process, a system interface process and a desktop process, and the method comprises the steps that in response to a first operation of a user, the desktop process sends a starting message to the system service process, the starting message indicates that a first function of the first application is started through the shortcut, and an interface corresponding to the first function is an interface displayed after the first application loads n activities in sequence; in response to the starting message, the system service process starts a first activity in the n activities and creates a first transition component, and in the process of starting the first activity, the system interface process adds and draws a first starting window for the first activity; in response to that the first transition component is ready, the system interface process notifies the desktop process to execute the first transition component; the desktop process executes the first transition component. The method can improve the response speed when the application is started.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technologies, and particularly to an application startup method and an electronic device. Background Art

[0002] With the development of electronic devices, the types of application programs (applications, APPs for short) that can be installed on electronic devices are increasing, and the functions in the applications are becoming more and more abundant.

[0003] Users can start an application by clicking on the desktop icon. In order to provide a one-step access effect for users, some applications provide a quick startup method. For example, when the user long-presses the application icon on the desktop, some function options of the application can be displayed on the desktop. By clicking on the function option, the function of the application can be directly opened. This process is the quick startup of the application.

[0004] However, in the process of quick startup of some applications, there is a problem of slow startup response, which affects the user experience. Summary of the Invention

[0005] This application provides an application startup method and an electronic device, which can shorten the response time of the quick startup of the application and improve the user experience.

[0006] In a first aspect, this application provides an application startup method, which is applied to an electronic device. The electronic device includes a system service process, a system interface process, and a desktop process. The method includes: in response to a first operation of the user, the desktop process sends a startup message to the system service process, where the startup message is used to indicate starting a first function of a first application through a shortcut, and the interface corresponding to the first function is the interface displayed after the first application sequentially loads n activities, and n is an integer greater than 1; in response to the startup message, the system service process starts the first activity among the n activities and creates a first transition component, where during the process of starting the first activity, the system interface process adds and draws a first startup window for the first activity; in response to the first transition component being ready, the system interface process notifies the desktop process to execute the first transition component; in response to the notification of the system interface process, the desktop process executes the first transition component.

[0007] Optionally, the transition component being ready can be implemented through the onTransactionReady() function, also known as transitionReady.

[0008] The application startup method provided in the first aspect of this application adds and draws the first startup window for the first activity by the system interface process during the startup of the first activity. And the system service process creates the first transition component. After being processed by the system interface process and the desktop process, the first transition component is finally executed to display the transition page. The entire process of adding the first startup window and displaying the transition page is synchronized with the life cycle of the process execution activity of the first application, without relying on the life cycle of the first application, greatly shortening the response time. Moreover, in this solution, the first startup window is added earlier, so the transition component starts to execute earlier, and the execution of the transition component can be concurrent with the process of the life cycle of the execution activity of the first application. Therefore, the transition component can be executed and completed earlier. When the activity of the application is loaded and the interface starts to be displayed, it can respond to user operations without the user waiting, improving the user experience.

[0009] In a possible implementation, the moment when the first transition component is ready is between the first moment and the second moment. The first moment is the moment when the first startup window is added, and the second moment is the moment when the drawing of the first startup window is completed.

[0010] That is to say, the readiness of the first transition component does not have to be triggered by the completion of the drawing (finishDrawing) of the first startup window, but the readiness of the first transition component (onTransactionReady) can be triggered during the drawing process of the first startup window. In this way, advancing the moment when the first transition component is ready can further advance the time for displaying the transition page, further shortening the response time of application startup and further improving the user experience.

[0011] In a possible implementation, the system interface process adds and draws the first startup window for the first activity, including: the system interface process calls the addStartingWindow() function to add the first startup window; the system interface process calls the doFrame() function to draw the frame of the first startup window; after the frame of the first startup window is drawn, the system interface process requests the system service process to add the display for the first startup window; the system service process calls the addToDisplay() function to add the display for the first startup window; after the addition of the display for the first startup window is completed, the system service process triggers the readiness of the first transition component.

[0012] In this implementation, after the system service process finishes executing addToDisplay(), that is, after the addition of the display for the first startup window is completed, it triggers the readiness of the first transition component, thereby advancing the moment when the first transition component is ready and advancing the time for displaying the transition page, further shortening the response time of application startup and further improving the user experience.

[0013] In a possible implementation, the start message carries information about the first application. Before the system service process starts the first of the n activities, the method further includes: if it is determined that the start message carries the first information, the system service process determines whether the first application meets a preset condition according to the information about the first application; the first information is used to indicate starting the first function through a shortcut; if it is determined that the first application meets the preset condition, the system service process sets a first identifier, and the first identifier is used to indicate that the current scenario is a quick start scenario and the currently started activity is the first activity of the application.

[0014] The first identifier can be, for example, a quick function ID.

[0015] In this implementation, before starting the first activity, it is judged whether the first application meets the preset condition to determine whether it conforms to the quick start scenario. If the preset condition is met, it indicates that the current scenario is a quick start scenario, and the first identifier is set. Moreover, this solution can set the first identifier only before starting the first activity. Therefore, the first identifier can also indicate that the activity to be started currently is the first activity. By setting the first identifier, it is convenient to quickly and accurately identify the quick start scenario and the first activity according to the first identifier subsequently, so that the subsequent processes of this solution can be executed more accurately, improving the operation efficiency and accuracy of the system.

[0016] In a possible implementation, the preset condition includes one or more of the following: the type of the first application is in the preset application whitelist; the package of the first application is not in the preset package blacklist; the first information is not in the function blacklist.

[0017] In this implementation, by setting the application type whitelist and the package blacklist, applications that are not applicable to the process of this solution can be filtered out, preventing these applications from entering the process of this solution and being unable to execute, and further preventing the application from starting up failed. That is to say, this method improves the reliability and stability of the system operation.

[0018] In a possible implementation, the first identifier is the first information.

[0019] That is to say, it is possible to directly use the first information carried in the start message to identify that the current scenario is a quick start scenario and the currently started activity is the first activity of the application. In this way, the number of identifiers can be reduced, the algorithm can be simplified, and the system operation efficiency can be improved.

[0020] In a possible implementation, before the system interface process adds and draws a first start window for the first activity, the method further includes: the system service process determines that there is a first identifier.

[0021] That is to say, the system service process reads the first identifier. If the first identifier is read, it indicates that the current is a quick start scenario and the currently started activity is the first activity of the application. Therefore, the system interface process adds and draws the first startup window for the first activity. In this way, it is possible to further limit the addition and drawing of the first startup window to the startup process of the first activity in the quick start scenario, improve the accuracy of adding the startup window, and further improve the accuracy and stability of the application startup.

[0022] In a possible implementation, the method further includes: after the system interface process starts to add the first startup window for the first activity, the system service process determines whether the type parameter of the first startup window is the first type and determines whether there is a first identifier. The first type represents that no startup window is added; if the type parameter of the first startup window is the first type and there is a first identifier, the system service process sets a second identifier for the first startup window; if the type parameter of the first startup window is not the first type and there is a first identifier, the system service process determines whether there is a first result, and the first result represents that the addition of the startup window fails; if there is a first result, the system service process sets a second identifier; if there is no first result, the system service process clears the first identifier.

[0023] The first type can be, for example, NONE.

[0024] That is to say, if the type parameter indicates that no startup window is added, it means that the native process of the system has not added a startup window. Further, if there is a first identifier, it means that the startup window is added by the process of this solution (i.e., the optimized process). Then, the system service process sets a second identifier to identify that the first startup window is the startup window added by the process of this solution. This facilitates the subsequent quick and accurate identification of the startup window, ensures the accurate management of the subsequent startup window, and improves the accuracy, reliability, and stability of the solution. Moreover, when the startup window is added by the process of this solution, the first identifier is cleared. In this way, the subsequent process enters the native process of the system, preventing the application from starting incorrectly, improving the accuracy of the execution of the process of this solution, and further improving the stability of the system operation.

[0025] In a possible implementation, the method further includes: if the type parameter of the first startup window is the first type and there is a first identifier, modify the type parameter of the first startup window to the splash type.

[0026] In this implementation, the type parameter of the startup window is corrected to the splash type, improving the accuracy of the subsequent process execution. Moreover, the startup window of the splash type can be applicable not only to warm startups but also to cold startups, expanding the applicable range of this solution.

[0027] In a possible implementation, the method further includes: during the process of starting the first activity, if it is determined that there is a first identifier, the system service process creates a first source record corresponding to the first activity, uses the activity record of the first activity as the value of the first source record, and adds the first source record to the source record set.

[0028] The existence of the first identifier indicates that the current scenario is a quick start scenario and the currently started activity is the first activity. In this case, a first source record corresponding to the first activity is created, the first source record is assigned a value and added to the source record set. The source record represents the source activity that starts the activity, and can be used as a basis for subsequent identification of whether the activity is the first activity or other activities other than the first activity, and as a basis for subsequent window transfer, improving the accuracy and convenience of the execution of the solution process.

[0029] In a possible implementation, the electronic device further includes a process of the first application, and the method further includes: during the process of executing the life cycle of the first activity, the process of the first application determines whether the interface corresponding to the first activity is a visual interface; if the interface corresponding to the first activity is a visual interface, the system service process sets the value of the visual identifier of the first activity to a first value.

[0030] The first value can be, for example, "yes" or "true".

[0031] In a possible implementation, the method further includes: during the activity layout stage of the first activity, if it is determined that the custom interface includes a view, or if it is determined that there is a background layout and the transparency is not 0, the process of the first application determines that the interface corresponding to the first activity is a visual interface.

[0032] In a possible implementation, the method further includes: after receiving a first completion indication from the process of the first application, the system service process determines whether a delay removal condition is satisfied, and the first completion indication is used to indicate that the first activity has completed drawing; if the delay removal condition is satisfied, the system service process delays removing the first startup window; if the delay removal condition is not satisfied, the system service process removes the first startup window.

[0033] Optionally, the first application process can indicate the system service process through the finishDrawing() function with the first completion indication.

[0034] In a possible implementation, the delay removal condition includes: the value of the visual identifier of the first activity is the first value, and there is a second identifier.

[0035] In the above several implementation manners, it is determined whether to delay removing the window by identifying whether the interface corresponding to the activity is a visual interface. If the value of the visual identifier is not the first value and there is a second identifier, it indicates that the interface corresponding to the current activity is an interface that cannot be perceived by the user, and the first startup window is the startup window added to the process of this solution, then the startup window does not need to be removed, so the removal of the startup window is delayed. If the value of the visual identifier is the first value, or there is no second identifier, it indicates that the interface corresponding to the current activity is an interface that can be perceived by the user, or the first startup window is not the startup window added to the process of this solution, then the startup window is removed. In this way, when the first application needs to display the interface, the startup window can be removed in time, preventing the normal startup logic of the application from being disrupted and preventing the user experience from being affected. Moreover, for the startup window added by the native process, it can be removed normally, preventing the normal execution logic of the native process from being disrupted and improving the stability and reliability of the system. In addition, whether it is a visual interface can be accurately and quickly determined through the value of the visual identifier, improving the speed and accuracy of the execution of the process of this solution.

[0036] In a possible implementation manner, the delay removal condition further includes one or more of the following: the startup window held by the first activity has not been removed; the current delay removal times threshold is greater than 0; there is a source record in the source record set.

[0037] The delay removal condition in this implementation manner can prevent the startup window of the same activity from being delayed and removed multiple times, that is, prevent the process from being stuck at the same activity all the time, causing startup jams and improving the user experience.

[0038] In a possible implementation manner, after removing the first startup window, the method further includes: clearing the first identifier, the second identifier, the source record set, and the first value.

[0039] In this implementation manner, after removing the startup window, clearing various identifiers added to the process of this solution can prevent the process from being disordered during subsequent operations and improve the stability and reliability of the system. In addition, clearing various identifiers added to the process of this solution can also prevent errors when quickly starting the first function of the first application next time, improving the reliability of system operation.

[0040] In a possible implementation manner, the first transition component has an animation attribute.

[0041] If the first transition component has an animation attribute, the first transition component will be displayed with an animation effect, which can improve the vividness of the interface display and the visual experience of the user.

[0042] In a possible implementation, the animation effect corresponding to the first transition component is an icon magnification animation effect. The method further includes: before submitting the first transition component to the system interface process, when it is determined that the first transition component is the transition component corresponding to the first active activity, the system service process cancels the transparency attribute of the first transition component.

[0043] In this implementation, before submitting the first transition component to the system interface process, the transparency attribute of the first transition component corresponding to the first active activity is cancelled, enabling the desktop process to execute the icon magnification animation effect, improving the animation effect and enhancing the user's visual experience.

[0044] In a possible implementation, the method further includes: during the process of starting the first active activity, the system service process determines that the first transition component is the transition component corresponding to the first active activity according to the activity record collected in the first transition component corresponding to the first active activity.

[0045] In this implementation, through the activity record, it is possible to simply and quickly determine whether the transition component is the transition component corresponding to the first active activity. Specifically, if the activity record recorded in the activity record collected by the transition component is the record of the first active activity, it indicates that the transition component is the transition component corresponding to the first active activity.

[0046] In a possible implementation, the electronic device further includes a process of the first application. The method further includes: in response to the system service process starting the first active activity, the process of the first application executes the life cycle of the first active activity; during the process of executing the life cycle of the first active activity, the process of the first application requests the system service process to start the second active activity among the n active activities; in response to the request of the first application process, the system service process starts the second active activity and creates a second transition component; during the process of starting the second active activity, the system service process transfers the first startup window to the second active activity.

[0047] In this implementation, when the second active activity is started, the first startup window is transferred from the first active activity to the second active activity, enabling the transition page to be continuously displayed without the phenomenon of screen flashing, and enhancing the user's visual experience.

[0048] In a possible implementation, the start time of the second active activity is after the time when the first transition component is ready.

[0049] In this implementation, it is specified that the start time of the second active activity is after the first transition component is ready, so as to prevent the second active activity from affecting the loading of the first transition component, preventing the display of the transition page from being affected, and further preventing the delay in the startup response.

[0050] In a possible implementation, the start time of the second active activity is after the completion time of the layer display of the first startup window.

[0051] The completion moment of the layer display is also the moment when the showSurface() function is executed and completed.

[0052] In this implementation, the start moment of the second activity is restricted to be after the completion moment of the layer display of the first startup window, so as to prevent the second activity from affecting the drawing and display of the startup window, prevent the display of the transition page from being affected, and further prevent the startup response from being delayed.

[0053] In a possible implementation, the method further includes: during the process of starting the first activity, the system service process sets a conditional variable, and the conditional variable includes: the first transition component has been submitted to the system interface process, and the layer display of the first startup window has been completed; the system service process starts the second activity, including: when it is determined that the conditional variable has been unlocked, the system service process starts the second activity.

[0054] In this implementation, by setting the conditional variable, the start timing of the second activity can be accurately restricted, further preventing the display of the transition page from being affected.

[0055] In a possible implementation, the method further includes: during the process of starting the first activity, the system service process sets a valid duration; if the conditional variable is satisfied within the valid duration starting from the moment when the conditional variable is set, the system service process determines that the conditional variable has been unlocked; if the conditional variable is still not satisfied after the valid duration starting from the moment when the conditional variable is set, the system service process unlocks the conditional variable.

[0056] In this implementation, by setting the valid duration, when the conditional variable is still not satisfied after exceeding the valid duration, the conditional variable is automatically unlocked. This can prevent the situation that the conditional variable cannot be unlocked due to abnormal process execution, and further prevent the subsequent activities from being unable to start all the time, improving the system stability.

[0057] In a possible implementation, before the system service process passes the first startup window to the second activity, the method further includes: during the process of starting the second activity, when it is determined that there is a source record in the source record set, the system service process sets a second source record corresponding to the second activity and assigns a value to the second source record; the source record is used to represent the previous activity that starts the third activity, and the third activity is any one of the n activities; the second source record is added to the source record set.

[0058] In this implementation, by setting the second source record, it is convenient to quickly and accurately determine whether the activity is the first activity or other activities subsequently.

[0059] In a possible implementation, assigning a value to the second source record includes: the system service process passing the value of the first source record to the second source record, where the first source record is the source record corresponding to the first activity; if the passed value is empty, the system service process uses the activity record of the fourth activity as the value of the second source record, and the fourth activity is the activity currently holding the first startup window.

[0060] In this implementation, when the passed value is empty, the source record of the activity holding the startup window in the source record set is used as the value of the source record of the new activity. Therefore, in any case, the activity corresponding to the value of the source record in the process of the solution of this application holds the startup window. Therefore, the activity currently holding the startup window can be accurately obtained through the source record, so as to accurately pass the startup window to the new activity, improving the accuracy of startup window transfer and the reliability of the optimization process.

[0061] In a possible implementation, the system service process passing the first startup window to the second activity includes: obtaining the second source record from the source record set; and according to the value of the second source record, passing the first startup window from the first activity to the second activity.

[0062] In this implementation, passing the startup window based on the source record can quickly and accurately pass the startup window to the current activity.

[0063] In a possible implementation, the method further includes: before submitting the second transition component to the system interface process, when it is determined that the second transition component is an other transition component, the system service process cancels the animation effect attribute of the second transition component, where the other transition component refers to the activities other than the first activity among the n activities.

[0064] That is to say, the transition component corresponding to the first activity has the animation effect attribute, and the transition components corresponding to the activities after the first activity do not have the animation effect attribute. This can prevent the screen flashing caused by frequent switching of animation effects when starting an activity across task stacks, improving the display effect. In addition, only the first transition component has the animation effect attribute, and the animation effect execution time is short, so there will be no situation where the animation effect has not been completed while the activity of the application has been loaded, thus preventing the phenomenon that the interface of the application cannot respond to user operations and improving the user experience.

[0065] In a possible implementation, the method further includes: during the process of starting the second activity, the system service process determines that the second transition component is an other transition component according to the activity record corresponding to the second activity collected in the second transition component.

[0066] In this implementation manner, through the activity record, it is possible to simply and quickly determine whether the transition component is another transition component corresponding to another activity. Specifically, if the activity record collected by the transition component is a record of another activity, it indicates that the transition component is a transition component corresponding to another activity.

[0067] In a possible implementation manner, after the system service process passes the first startup window to the second activity, the method further includes: during the process of starting the second activity, if the first activity and the second activity do not belong to the same task stack, the system service process increases the layer level of the first startup window by one layer.

[0068] In this implementation manner, in the scenario of starting an activity across task stacks, the layer level of the first startup window is increased by one layer. In this way, when the native process successfully adds the startup window, it can prevent the startup window added by the native process from covering the first startup window added by the process of this solution, that is, prevent the first startup window from being blocked, prevent the effect of the transition page from being affected, and improve the user experience.

[0069] In a possible implementation manner, the method further includes: during the process of executing the life cycle of the second activity, the process of the first application determines whether the interface corresponding to the second activity is a visual interface; if the interface corresponding to the second activity is a visual interface, the system service process sets the value of the visual identifier of the second activity to the first value.

[0070] In a possible implementation manner, the method further includes: after receiving the second completion indication, the system service process determines whether the delayed removal condition is satisfied, and the second completion indication is used to indicate that the second activity has completed drawing; if the delayed removal condition is satisfied, the system service process delays the removal of the first startup window; if the delayed removal condition is not satisfied, the system service process removes the first startup window.

[0071] Optionally, the second completion indication can be used by the process of the first application to instruct the system service process through the finishDrawing() function.

[0072] Regarding the specific process of identifying whether the interface corresponding to the second activity is a visual interface, and triggering the delayed removal judgment when the second activity is drawn, it is similar to that of the first activity, and the beneficial effects are also similar, so it will not be elaborated here.

[0073] The subsequent third activity, fourth activity... are similar to the process of the second activity. The main difference is that the third activity and subsequent activities do not need to determine whether to unlock the condition variable.

[0074] In a second aspect, the present application provides a device which is included in an electronic device and has a function of implementing the behavior of the electronic device in the above first aspect and the possible implementation manners of the above first aspect. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above function. For example, a receiving module or unit, a processing module or unit, etc.

[0075] In a third aspect, the present application provides an electronic device, which includes: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other to enable the electronic device to execute any one of the methods in the technical solution of the first aspect.

[0076] In a fourth aspect, the present application provides a chip, which includes a processor. The processor is configured to read and execute a computer program stored in a memory to execute the methods in the first aspect and any possible implementation manners thereof.

[0077] Optionally, the chip further includes a memory, and the memory is connected to the processor through a circuit or a wire.

[0078] Further optionally, the chip further includes a communication interface.

[0079] In a fifth aspect, the present application provides a computer-readable storage medium in which a computer program is stored. When the computer program is executed by a processor, the processor is enabled to execute any one of the methods in the technical solution of the first aspect.

[0080] In a sixth aspect, the present application provides a computer program product, which includes: computer program code. When the computer program code runs on an electronic device, the electronic device is enabled to execute any one of the methods in the technical solution of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] Figure 1 is a schematic diagram of an application scenario of an application startup method provided by an embodiment of the present application;

[0082] Figure 2 is another schematic diagram of an application scenario of an application startup method provided by an embodiment of the present application;

[0083] Figure 3 is a schematic diagram of the structure of an electronic device 100 provided by an embodiment of the present application;

[0084] Figure 4 is a software structure block diagram of an electronic device 100 provided by an embodiment of the present application;

[0085] Figure 5 is a timing schematic diagram of an application startup method provided by an embodiment of the present application;

[0086] Figure 6 It is a schematic diagram of the software architecture of another example of an electronic device provided by an embodiment of the present application;

[0087] Figure 7 It is a timing schematic diagram of an example of an application startup method provided by an embodiment of the present application;

[0088] Figure 8 It is a schematic diagram for comparing response times provided by an embodiment of the present application;

[0089] Figure 9 It is a timing schematic diagram of another example of an application startup method provided by an embodiment of the present application;

[0090] Figure 10 It is a flowchart schematic diagram of an example of an application startup method provided by an embodiment of the present application;

[0091] Figure 11 It is a flowchart schematic diagram of another example of an application startup method provided by an embodiment of the present application;

[0092] Figure 12 It is a timing schematic diagram of yet another example of an application startup method provided by an embodiment of the present application;

[0093] Figure 13 It is a flowchart schematic diagram of yet another example of an application startup method provided by an embodiment of the present application;

[0094] Figure 14 It is a schematic diagram of an interface change provided by an embodiment of the present application;

[0095] Figure 15 It is a schematic diagram for comparing interfaces of quickly starting an application based on an optimized process and a native process provided by an embodiment of the present application;

[0096] Figure 16 It is a schematic diagram for comparing interfaces of quickly starting an application based on an optimized process and a native process provided by an embodiment of the present application;

[0097] Figure 17 It is a timing schematic diagram of yet another example of an application startup method provided by an embodiment of the present application. Detailed implementation manners

[0098] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B. The "and / or" herein is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality of" means two or more than two.

[0099] Hereinafter, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first", "second", and "third" may explicitly or implicitly include one or more of such features.

[0100] The reference to "one embodiment" or "some embodiments" etc. described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in the specification of the present application do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0101] To better understand the embodiments of the present application, the following explains the terms or concepts that may be involved in the embodiments.

[0102] 1. Interface, activity, and window

[0103] An electronic device can install and run applications. When the electronic device runs any application in the foreground, such as application A, the display screen of the electronic device displays the interface (also called a page) of application A, and the user of the electronic device can perform interactive operations on the interface of application A. When the electronic device runs application A in the background, the electronic device no longer displays the interface of application A, and the user of the electronic device cannot perform interactive operations on the interface of application A.

[0104] After receiving an instruction to start an application, the electronic device will create a process corresponding to the application. After that, based on the application's process, it will load the activity. The activity is responsible for presenting the application interface, as well as interacting with the user and handling business logic. It can be understood that when the application is running, there is a unique process corresponding to the application in the system. However, during the running of the process, according to user operations or different display logics preset by the application, multiple processes can be loaded in sequence. Different activities can correspond to different interfaces.

[0105] The interface is composed of views. During the process of the activity presenting the interface and interacting with the user, it can internally hold a window object to help the activity manage the views. When starting the application, the system will create a window for the activity to display the views in the interface. Therefore, from another perspective, the window is the carrier and container of the views.

[0106] 2. Task Stack

[0107] The task stack, also simply referred to as a task, is a container used to place activity instances. When starting an application, the system will create a corresponding task stack for the application. In other words, one application corresponds to one task stack.

[0108] In practical applications, during the startup or running of an application, there may be some interface jumps. These interfaces can be implemented through activities of other applications, that is, the display of the interface requires loading activities across task stacks. For example, when application A starts, it needs to jump from interface a1 to interface b1, and then to interface c1. Among them, the activities corresponding to interfaces a1 and b1 are in the task stack of application A, while the activity corresponding to interface c1 is in the task stack of application B. Therefore, during the jump from interface b1 to interface c1, it is necessary to load the activity across the task stack.

[0109] 3. Transition Page

[0110] It can be understood that during the application startup process, that is, from the moment when the user executes the operation to start the application until a target interface to be displayed in the application (hereinafter referred to as the target interface) is displayed on the screen, the terminal device needs to go through a series of processing operations, and the user needs to wait for a certain period of time. To reduce the user waiting time and improve the user's visual experience, the electronic device can display some transitional interfaces during this period, and these interfaces are called transitional pages (or transition pages, startup pages, animation pages, or startup animations). Optionally, the transitional page can be an icon page, an advertisement page, a blank page, a Logo page, a snapshot page, etc. Optionally, the animation attributes of the transitional page can be set as needed. If the animation attribute is set to "yes" (for example, true), the transitional page presents an animation effect (abbreviated as animation). If the animation attribute is set to "no" (for example, false), the transitional page presents a static effect. That is to say, the transitional page can be a static display interface or an animation interface. The animations displayed in the animation interface can be, for example, the icon gradually enlarging, or the text appearing in sequence, etc.

[0111] The system can trigger the execution of the transition component by adding a startup window to implement the display of the transitional page. Transition, hereinafter simply referred to as transition, is used to implement the display of the transition effect in the window. For example, it is used to implement the display of the animation effect.

[0112] 4. Cold startup, warm startup, and hot startup

[0113] It can be understood that after the application is started, the application process runs continuously in the background, and the activities of the application are also placed in the task stack. However, after the application runs from the foreground to the background, the application process may be destroyed and the activities may be recycled, that is, the application process does not exist in the system background.

[0114] According to whether the application process exists in the system background and whether the activity of the application exists when the application is started, the startup of the application can be divided into cold startup, warm startup, and hot startup.

[0115] When the user clicks the icon of the application to start the application, the application process does not exist in the system background. The system needs to create and start a process for the application. Then, after the process is successfully started, the activity of the application is loaded through this process until the activity is successfully loaded and the interface of the application is displayed. This startup process can be called cold startup.

[0116] After the application is launched, it can run in the foreground and then enter the background. After entering the background, the process of the application can still exist in the system. If the user clicks on the application icon to bring the application back to the foreground, since the process of the application exists in the background of the system, the system no longer needs to create and start a process for the application. If the activity of the application still exists in the system memory, the application does not need to reload the activity, but instead displays the interface corresponding to the activity in the task stack of the application in the foreground. This startup process can be called a warm start.

[0117] After the application runs in the foreground and enters the background, the process of the application may be killed in the background (for example, the process of the application is destroyed), the activity is recycled, and the process of the application does not exist in the background of the system. However, after the process is killed, the application may still have a self-start behavior, that is, the application can request the system to create and start a process for the application in the background. If the process of the application is successfully created and started in the background of the system, when the user clicks on the application icon to bring the application back to the foreground, since the process of the application exists in the background of the system, the system no longer needs to create and start a process for the application. However, since the activity of the application has been recycled, the system needs to load the activity of the application through the process of the application until the activity is successfully loaded and then display the interface of the application. This startup process can be called a warm start.

[0118] 5. Starting an activity, executing the activity lifecycle, and loading an activity

[0119] In the embodiments of the present application, starting an activity means that the system service (systemserver) process processes the start request or start transaction of the activity, that is, the process of controlling the start of the activity. Starting an activity can be implemented through the startActivity() function.

[0120] Executing the activity lifecycle means that the process of the application executes processes such as activity start (activityStart), loading the activity layout (activityResume), drawing a frame, and finishing drawing (finishDrawing). That is to say, the start of the activity is controlled by systemserver, but the actual start action is executed by the process of the application.

[0121] In the embodiments of the present application, loading an activity refers to the process from starting the activity to the completion of the execution of the activity lifecycle.

[0122] The application scenarios and technical problems of the present application will be described below.

[0123] To facilitate users to launch applications, the system of the electronic device provides a mechanism for applications to be launched through shortcuts (i.e., quick launch). An application can design quick launches with different functions according to its own needs, so that users can directly display the interface of the required function in one step.

[0124] Exemplarily, Figure 1 FIG. is a schematic diagram of an application scenario of an application launch method provided in an embodiment of the present application. In this embodiment, the user can quickly launch a certain function of the application by long-pressing the application icon on the desktop and directly display the interface of the function. Specifically, taking the electronic device as a mobile phone as an example, as Figure 1 shown in FIG. (a) therein, there are icons of multiple applications displayed on the desktop of the mobile phone. Taking the payment application as an example, the user can long-press the icon 101 of the payment application. In response to the user's operation, function options of the payment application are displayed on the desktop, for example, including: more settings function option 1011, receive money function option 1012, pay money function option 1013, and scan code function option 1014, as Figure 1 shown in FIG. (b) therein. When the user clicks on a certain function option, the function is launched and the interface corresponding to the function is displayed. For example, when the user clicks on the receive money function option 1012, in response to the user's operation, the receive money function of the payment application is launched, and the payment code interface 102 is displayed, as Figure 1 shown in FIG. (c) therein.

[0125] Exemplarily, Figure 2 FIG. is a schematic diagram of another application scenario of an application launch method provided in an embodiment of the present application. In this embodiment, the user can launch a certain function of the application through the shortcut icon of the application on the desktop and display the interface of the function. As Figure 2 shown in FIG. (a) therein, continuing with the payment application as an example, the desktop includes the icon of the payment application. The user can long-press the icon of the payment application. In response to the user's operation, function options of the payment application are displayed on the desktop, for example, including more settings function option 1011, receive money function option 1012, pay money function option 1013, and scan code function option 1014, as Figure 2 shown in FIG. (b) therein. The user can long-press a certain function option and drag it to the desktop to form a shortcut icon on the desktop. Continuing with the receive money 1012 function option as an example, the user long-presses and drags the receive money function option 1012 to a certain position on the desktop and then raises the hand. After the user raises the hand, the shortcut icon 201 corresponding to the receive money function option 1012 is displayed in the interface, as Figure 2 shown in FIG. (c) therein.

[0126] The user clicks on the quick icon 201. In response to the user's operation, the mobile phone launches the money collection function of the payment application and displays the payment code interface 102, as shown in Figure 2 Figure (d) in

[0127] It should be noted that the above two application scenarios are described by taking the quick launch of an application from the desktop as an example. In actual use, the application can also be launched through a shortcut from other entrances. For example, the application can also be launched through a shortcut on the negative first screen. The embodiments of the present application do not make any limitations on the specific entrance of the quick launch, the specific triggering method of the quick launch, etc. It can be understood that no matter which quick launch method is used, the process of the electronic device launching the application is the same or similar.

[0128] The inventor found that in the related art, for some functions of some applications during the quick launch process, there is a problem that the response time of the application is relatively long, that is, the response is slow. The response time of the application is also called the response delay or the startup time, which refers to the time from when the user performs the operation of launching the application (such as clicking on the function option or the quick icon in the above embodiments) to when the first frame related to the application is displayed on the screen. Among them, the first frame related to the application can be the interface of the application itself or the transition page of the application.

[0129] Specifically, in the related art, some functions of some applications do not have a transition page during the quick launch process, which not only leads to a relatively long application startup response time, but also a poor visual effect for the user. There are also some functions of some applications that have a transition page during the quick launch process, but the response time is also relatively long, resulting in a poor experience for the user. For example, when launching the payment function through a shortcut, the response time is about 621 milliseconds (ms); when launching the scan function through a shortcut, the response time is about 447 ms; when launching the payment and collection function through a shortcut, the response time is about 600 ms; when launching the scan function through a shortcut, the response time is about 155 ms.

[0130] In view of this, the embodiments of the present application provide an application launch method, which can identify the quick launch scenario, and in the quick launch scenario, add a launch window to the first activity of the application when loading, display the transition page, and pass the launch window to the subsequent activities. In this way, not only can the response time be greatly shortened, but also the transition page can bring a better visual experience to the user. In short, this method can improve the user experience.

[0131] Next, the hardware structure and software architecture of the electronic device to which this method is applicable will be introduced with reference to the accompanying drawings.

[0132] The application startup method provided by the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs) that can install application programs (APPs). The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

[0133] Exemplarily, Figure 3 FIG. 6 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0134] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0135] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0136] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0137] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0138] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0139] The electronic device 100 implements the display function through the GPU, the display screen 194, the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0140] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0141] The touch sensor 180K, also called the "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called the "touch screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from the display screen 194.

[0142] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of this application, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device 100.

[0143] Figure 4It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework (FWK) layer, the Android runtime and system libraries, and the kernel layer.

[0144] As Figure 4 shown, the application layer may include a series of application packages, and these application packages are applications that can start one or more functions through shortcuts, which are uniformly shown as applications (APPs) in the figure. It can be understood that these applications can be system applications or third-party applications, such as video, camera, gallery, payment applications, etc. In the embodiments of the present application, the application layer may also include system applications of Android such as a desktop launcher, a system user interface (systemUI), and a mobile phone manager.

[0145] Generally, after the Android system is started, the launcher can run as a core application resident in the Android system. The startup icon of the application is generally set in the launcher. Specifically, the launcher can monitor the user's operation on the application icon through an application monitoring process (apTouchDaemon) ( Figure 4 not shown in the figure). When the apTouchDaemon monitors the user's operation of clicking the startup icon of a certain application, the apTouchDaemon generates an input event and reports the input event to the launcher. The launcher distributes and processes the input event, generates a startup message of the application, and sends it to the relevant services in the application framework layer. Through these services, the application process of the application is started, and the activity is loaded. The systemUI is responsible for drawing the startup window or the window of the application, etc. It should be understood that when the user clicks the icons of different applications, the launcher will generate startup messages of different applications, thereby starting the application processes corresponding to different applications.

[0146] The mobile phone manager is used to manage the system of the electronic device.

[0147] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0148] As Figure 4As shown in the figure, in the embodiments of the present application, the application framework layer may include processes such as the system server process, the system UI process, the Zygote process, and the surface flinger process. Specifically, the application framework layer may include a Java framework layer and a native framework layer (also known as a C++ framework layer). The system server process, the system UI process, and the Zygote process may run in the Java framework layer. The surface flinger process runs in the native framework layer. In addition, after the phone manager application is started, the Java framework layer may also include a phone manager process.

[0149] Among them, the system server process can provide almost all system services for the applications in the application layer, such as the activity manager service (AMS), the window manager service (WMS), the package manager service (PMS), and the resource manager service (RMS). These system services can reside in the system server process in the form of threads. Among them, AMS is responsible for uniformly scheduling and managing the activities of all processes in the system. WMS is responsible for managing window views, such as the position, size, and layout of application windows. PMS is responsible for the installation, management, and uninstallation of application packages in the system. Specifically, PMS can identify all components of an application, such as activities, and assign corresponding permissions to these components. RMS is responsible for the unified management, scheduling, and optimization of resources in the system.

[0150] The Zygote process is a daemon service in the Android system, and almost all application processes are forked out by the Zygote process. Since each application is written in the Java language, each application needs to run in its own independent virtual machine in the form of a process. When an application starts, it can fork out the virtual machine of the application through the Zygote process and share the virtual machine memory and various services provided in the system server process.

[0151] The surface flinger process is responsible for the rendering of the interface and application graphics. For example, the window drawn by the system UI process can be handed over to the surface flinger process for rendering and display.

[0152] Generally, in response to a user clicking on the icon of an application, the launcher can send a startup message for that application to the systemserver process. If the application process for that application does not exist in the current application processes, then an application process needs to be created for that application. In this case, the systemserver process can call the AMS to communicate with the Zygote process and request the Zygote process to create a corresponding application process for that application. After receiving the request, the Zygote process responds to the request and creates application process 1. Application process 1 includes the main thread (activityThread) of the application. In order to be able to start running the application code normally, application process 1 needs to first initialize the main thread of the application and load the application's class files into memory. Among them, the main thread can complete the initialization of the main thread by executing the main function of activityThread.

[0153] When the phone manager process starts for the phone manager application, it is the process corresponding to that application forked by the Zygote process, and is used to manage various applications, functions, or data running in the system. A non-real-time processing subsystem can run in the phone manager process, and this system includes a configuration processing module. The configuration processing module is used to implement the processing of the configuration information of applications or activities.

[0154] The application startup method provided by the embodiments of this application can be implemented through the cooperation of processes such as the apTouchDaemon process, launcher process, Zygote process, phone manager process, systemserver process, systemUI process, and surfaceflinger process. Among them, cross-process communication can be carried out between the apTouchDaemon process, launcher process, systemserver process, systemUI process, surfaceflinger process, and phone manager process based on the binder mechanism. Communication between the systemserver process and the Zygote process can be based on the socket mechanism.

[0155] The Android runtime includes core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0156] The core libraries include two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android.

[0157] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0158] The system library can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.

[0159] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.

[0160] The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0161] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0162] The 2D graphics engine is a drawing engine for 2D drawing.

[0163] The kernel layer is the layer between the hardware and the software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0164] Next, on the basis of the software architecture provided Figure 4 below, in combination with Figure 5 the native process of application startup will be introduced. This native process can be applied to scenarios such as Figure 1 and Figure 2 shown in the scenario examples. Taking the function a of starting application A through a shortcut as an example, assuming that the interface of function a is the interface corresponding to the nth activity (i.e., the target interface) is interface a, the system needs to load the 1st to the nth activities in sequence and then display the target interface a. Among them, for example, function a can be the collection function of a payment application, then the target interface a can be Figure 1 Figure (c) in Figure 2 the collection code interface 102 shown in Figure (d) in

[0165] Figure 5 is a timing schematic diagram of an application startup method provided by an embodiment of the present application. As Figure 5 shown, taking the cold startup of function a of application A through a shortcut as an example, the startup process includes:

[0166] ①In response to the occurrence of the lift (up) event in the quick launch operation, the launcher process calls the startShortcut() function to send a start message to the systemserver process.

[0167] Optionally, the quick launch operation can be, for example, an operation of clicking on a desktop shortcut icon, or a long press on an app icon followed by a click on a function option. Specifically, apTouchDaemon monitors the user's quick launch operation and, when it detects that the quick launch operation has been lifted (i.e., the lift event has occurred), generates an input event. apTouchDaemon calls the InputEvent() function to report the input event to the launcher process. After receiving the input event, the launcher process determines the app corresponding to the input location (App A) and the interface corresponding to the function to be launched (Interface a). Subsequently, the launcher process, through the startShortcut() function and based on the binder mechanism, sends a start message to the AMS in the systemserver process. The start message is used to request to launch Function a of App A in a shortcut manner. Optionally, the start message can carry information about the app to be launched (i.e., App A) and the function to be launched (i.e., Function a). Among them, the information about the app can include, for example, one or more of the app's package name, the identity document (ID) of the package, etc. The information about the function to be launched can include, for example, one or more of the name of the function to be launched, the ID of the function to be launched (also known as the ID of the quick launch function or the first piece of information, hereinafter referred to as the quick function ID). Among them, the quick function ID is used to mark the unique identity of the function to be launched.

[0168] ②In response to the start message, the systemserver process requests the Zygote process to fork the process of App A, and the Zygote process responds to the request by forking the process of App A.

[0169] Specifically, the AMS in the systemserver process, in response to the start message, requests the Zygote process to fork the process of App A through the socket communication mechanism. The Zygote process responds to the request from the AMS and forks the process of App A.

[0170] ③The systemserver process processes the start transaction of the first activity. At the same time, the systemserver process collects the activity record corresponding to the first activity of App A.

[0171] It can be understood that the AMS in the systemserver process is responsible for uniformly managing and scheduling activities, and handling activities-related transactions, such as startup requests. While the AMS is handling activities-related transactions, the WMS can collect the status information of the activity, so as to facilitate the subsequent management of the activity's operation, and determine the participants in the animation effects in the subsequent transition pages, allocate layers for the participants to draw animation effects, etc. The status information of the activity can be maintained through activityRecord. activityRecord is the smallest unit of activity management, and each activityRecord corresponds to an activity in the application process.

[0172] In this step, in response to the startup message, the systemserver process defaults to first starting the first activity of Application A. Therefore, after the fork of the process of Application A, the AMS processes the startup transaction of the first activity. At the same time, the WMS collects the activityRecord corresponding to the first activity to record the status of this activity.

[0173] ④ The systemserver process calls the activityPaused() function to notify the activity in the launcher process to enter the paused state. At the same time, the systemserver process collects the activityRecord of the launcher.

[0174] In this step, the activity in the launcher process enters the paused state. Therefore, the AMS records the status of the activity in this launcher process by collecting the activityRecord.

[0175] Optionally, when pausing the activity in the launcher process, the participants in the animation effects may also involve the wallpaper or the leftmost home screen. Therefore, the activityRecord of the wallpaper or the leftmost home screen can also be collected. This application does not make specific limitations on this.

[0176] It can be understood that when other activities are started or paused, the WMS also collects the activityRecord until the transaction is ready. The subsequent embodiments will not elaborate on this.

[0177] ⑤ The system_server process instructs the process of Application A to execute the life cycle of the first activity. In response to the instruction from the system_server process, the process of Application A executes the life cycle of the first activity.

[0178] Specifically, executing the life cycle of an activity includes starting the activity using the activityStart() function, loading the activity layout using the activityResume() function, drawing a frame using the doFrame() function, and indicating the completion of drawing by the finishDrawing() function, etc., Figure 5 which are not all shown. After drawing a frame using the doFrame() function is completed, the process of Application A can request the system_server process to add a display. The system_server process uses addToDisplay() to add a display to the activity.

[0179] ⑥ During the process of the process of Application A executing the life cycle of the first activity, it calls the startActivity() function to request the system_server process to start the second activity. The system_server process processes the start request of the second activity and collects the activityRecord corresponding to the second activity.

[0180] Optionally, the process of Application A can request to start the second activity during the activityStart phase or the activityResume phase of the life cycle of the first activity.

[0181] ⑦ After the system_server process determines that the process of Application A has completed the life cycle of the first activity, it calls the activityPaused() function to notify the process of Application A to pause the first activity and instructs the process of Application A to execute the life cycle of the second activity. In response to the instruction from the system_server process, the process of Application A executes the life cycle of the second activity.

[0182] And so on, until the process of Application A executes the life cycle of the (n - 1)th activity.

[0183] ⑧ During the process of the application A's process executing the life cycle of the (n - 1)th activity, the startActivity() function is called to request the systemserver process to start the nth activity. The systemserver process processes the start request of the nth activity and collects the activityRecord corresponding to the nth activity.

[0184] ⑨ When processing the start request of the nth activity, the systemserver process notifies the systemUI to add a starting window. The systemUI process calls the addStartingWindow() function to create the starting window, uses the doFrame() function to draw the view of the starting window, and then the finishDrawing() function indicates the completion of the drawing of the starting window. After the systemserver process determines that the drawing of the starting window is completed, it applies for readiness (applyReady).

[0185] ⑩ After the systemserver process determines that the application A's process has completed the life cycle of the (n - 1)th activity, it calls the activityPaused() function to notify the application A's process to pause the (n - 1)th activity and instructs the application A's process to execute the life cycle of the nth activity. The application A's process responds to the instruction of the systemserver process and executes the life cycle of the nth activity.

[0186] After determining that the drawing of the starting window is completed, the systemserver process notifies the systemUI process to execute transaction readiness. The systemUI process executes transaction readiness through the onTransactionReady() function.

[0187] Transaction readiness indicates that the transition is ready and can start to execute the transition.

[0188] In some other embodiments, transaction readiness (onTransactionReady) can also be referred to as transition readiness (transitionReady).

[0189] It can be understood that when the systemserver process notifies the systemUI process to execute transaction readiness, it can submit the ready transition to the systemUI process. After being processed by the systemUI process, it further notifies the launcher process to execute the animation effect.

[0190] After the system UI process finishes executing the transaction readiness, it notifies the launcher process to execute the animation effect. The launcher process starts the animation effect through the startAnimation() function and executes the animation effect through the animator() function, that is, executes the transition to display the transition page. Among them, the transition is generated based on the activityRecord of each collected activity.

[0191] After determining that the process of application A has completed the life cycle of the nth activity, the system server process calls showSurface() to display the layer corresponding to the nth activity, that is, to display the target interface a.

[0192] The system server process calls the removeStartingWindow() function to remove the starting window and displays the interface of application A in the window of application A.

[0193] It should be noted that if the target interface a of application A is drawn during the execution of the animation effect, the interface can be displayed. However, at this time, the animation layer is on the upper layer, and the interface cannot respond to user operations. After the animation effect is executed, the interface displayed in the window at this time can respond to user operations.

[0194] From the above description, it can be seen that in the native process, during the quick start of application A, it is necessary to go through the jump of n activities. The time length (i.e., the response time) between the moment when the user executes the quick start operation and the moment when the transition page is displayed in the interface is relatively long. The response time is approximately equal to the sum of the life cycle durations of all activities in application A. That is to say, in the native process, all the interfaces before the target interface (referred to as intermediate interfaces) need to be prepared before responding. The response time depends on the life cycle of the intermediate interfaces of application A, and the response is slow.

[0195] The reasons for the slow response of the native process are analyzed below.

[0196] The display of the transition page depends on the starting window. Only when the starting window is successfully added can the transition page be normally displayed.

[0197] In some embodiments, when cold-starting an application from the desktop through a non-shortcut method (i.e., clicking the application icon on the desktop), part of the process of adding the starting window is as follows:

[0198]

[0199]

[0200] It can be seen that when starting an application in a non-shortcut manner, the starting window can be added through the relevant process of addStartingWindow to implement the display of the transition page.

[0201] In some other embodiments, when cold starting an application from the desktop through a shortcut, part of the process of adding a starting window is as follows:

[0202]

[0203] It can be seen that when quickly starting an application, adding a starting window through the addStartingWindow() function returns false, that is, adding a starting window is intercepted.

[0204] Analysis reveals that the themes corresponding to these activities whose starting windows are intercepted are empty, and the reason for the empty theme is that the activity has a transparent attribute, that is, the value of the windowIsTranslucent attribute is true. And the native system will not add a starting window to an activity with a transparent attribute.

[0205] Further analysis shows that multiple activities loaded during the application startup process are activities in different task stacks, that is, cross-task-stack loading of activities is involved during the quick startup process. For example, in the above embodiment, during the process of quickly starting the money collection function of the payment application, n activities may be in different task stacks. And there is no maintenance mechanism for starting windows for cross-task-stack in the native system. When loading activities across task stacks, the system will attempt to add a starting window for each activity in the task stack, which will result in frequent switching of starting windows when switching task stacks, thus causing a flash screen. To solve this problem, the application sets the value of the windowIsTranslucent attribute of the activity corresponding to the interface before the target interface of the quick startup to true. In this way, the native system intercepts the starting windows of these activities, which can avoid the flash screen when quickly starting a certain function of the application. It should be noted that although the starting windows of the activities are intercepted, the system will still load transitions for these activities, but without a starting window, the transitions cannot be finally displayed.

[0206] That is to say, the native system does not support maintaining a startup window across task stacks, which will cause a flash screen. To avoid the flash screen, the application sets the transparent property of the activity to intercept the startup window. Eventually, the application cannot add a startup window during quick startup, or adds a startup window only when the last activity starts. As a result, the response time of the application depends on the life cycle of the activity corresponding to the intermediate interface, and the response is slow.

[0207] Based on the above analysis, the present application provides an application startup method, which adds a process for adding a startup window based on the native system. Specifically, when processing the startup transaction of the first activity of the application (that is, before the first activity starts), a startup window is added. This addition process is triggered by the systemserver process and specifically executed by the systemUI process, without the participation of the application process and without involving the activity of the application. Therefore, it will not be intercepted by the system due to problems such as the transparent property of the activity. By adding a startup window before the first activity starts, after the window is drawn and the transition is loaded, the transition page can be displayed. In this way, the display of the transition page does not need to depend on the application activity life cycle, which can not only greatly shorten the response time of the application, but also advance the interface response time and improve the user experience. In addition, when quick startup is recognized, each activity and transition of the application are recognized. A startup window is added for the first activity, and for the activities after the first activity and before the activity corresponding to the target interface, the startup window is sequentially passed to these activities. After the activity corresponding to the target interface is loaded, the startup window is removed. In this way, the continuity of the transition page display is ensured, and the flash screen caused by frequent switching of the startup window is also prevented.

[0208] Next, on the basis of the Figure 4 software architecture shown below, the improvement of the software architecture involved in the embodiments of the present application will be described.

[0209] It can be understood that each system service running in the systemserver process can be regarded as a software module, which can provide corresponding services and implement corresponding functions. Based on this, each system service can include modules for implementing a part of the functions (i.e., sub-functions) in the system service functions to implement the application startup method of the present application. The same is true for other modules. Next, the functional modules related to the application startup method provided by the present application included in each system service and related modules will be described.

[0210] For ease of description, hereinafter, the process of the quick startup application method provided in the embodiments of the present application that can shorten the response time is referred to as the optimization process, and the quick startup function corresponding to the optimization process is referred to as the optimization startup function.

[0211] Exemplarily, Figure 6 is a schematic software architecture diagram of another example of an electronic device provided in the embodiments of the present application. Refer to Figure 6 , in the embodiments of the present application, the configuration processing module may include a parsing configuration module. The parsing configuration module is used to read and parse the relevant configurations of the optimization startup function, including but not limited to the switch of the optimization startup function, the delayed removal time of the startup window, the threshold of the number of delayed removals, the whitelist of application types, the blacklist of packages, etc. The optimization startup function switch is used to control the opening and closing of the optimization startup function, that is, to control the execution and non-execution of the optimization process. When the switch is turned on, the system executes the optimization process. When the switch is turned off, the system does not execute the optimization process and executes the native process. The delayed removal time of the startup window refers to the duration of delaying the removal of the startup window, that is, how long it takes to remove the startup window. The threshold of the number of delayed removals refers to the maximum number of times of delaying the removal of the startup window, such as 5 times, 8 times, etc. The whitelist of application types includes information about the application types allowed to be started through the optimization process. For example, the whitelist of application types may include video applications, audio applications, instant messaging applications, payment applications, and so on. The blacklist of packages includes information about the packages of applications not allowed to be started through the optimized process. For example, the blacklist of packages may include package a, package b, package c...

[0212] The RMS includes a cache configuration module. The cache configuration module is used to cache the configuration information parsed by the parsing configuration module to support the optimization startup function.

[0213] The PMS may include a quick startup recognition module. The quick startup recognition module is used to recognize whether the startup of an application is a quick startup, that is, whether it is started through a shortcut. Moreover, the quick startup recognition module is also used to screen the applications or functions of applications for quick startup according to the whitelist of application types and the blacklist of packages cached in the cache configuration module to determine whether the current startup meets the execution scenario of the optimization process provided in the present application.

[0214] The WMS may include an activity recognition module, a transition recognition module, a startup window management module, and a transition component management module. The activity recognition module is used to recognize each activity requested to be loaded during the application startup process to determine whether each activity is the first activity in the quick startup scenario or other activities. The transition recognition module is used to recognize each transition loaded by the WMS to determine whether each transition is the first transition (also known as the first transition component) in the quick startup scenario or other transitions. The startup window management module is used to manage the startup window according to the recognition results of the activity recognition module and the transition recognition module, including but not limited to requesting to add a startup window, passing the startup window, removing the startup window, etc. The transition component management module is used to manage transitions, including but not limited to creating transitions, controlling the execution timing of transitions, setting parameters of transitions, etc. The parameters of a transition may include, for example, animation attributes. If the animation attribute is set to "yes" (such as true), the transition is displayed in an animated form, that is, there is an animation; if the animation attribute is set to "no" (such as false), the transition is not displayed in an animated form, that is, there is no animation.

[0215] The following will take an electronic device with the Figure 3 and Figure 6 shown structure as an example, and in combination with the accompanying drawings and application scenarios, specifically elaborate on the application startup method provided by the embodiments of the present application.

[0216] Figure 7 is a timing schematic diagram of an application startup method provided by an embodiment of the present application. As Figure 7 shown, continuing with the example of cold starting function a of application A through a shortcut, the startup process includes:

[0217] ① In response to the occurrence of the up event in the quick startup operation, the launcher process calls the startShortcut() function to send a startup message to the systemserver process.

[0218] ② The systemserver process requests the Zygote process to fork the process of application A in response to the startup message, and the Zygote process responds to the request and forks the process of application A.

[0219] ③The system_server process handles the startup transaction of the first activity and collects the activityRecord corresponding to the first activity of Application A. Subsequently, the system_server process calls the activityPaused() function to notify the activity in the launcher process to enter the paused state and instructs the process of Application A to execute the lifecycle of the first activity. Meanwhile, the system_server process collects the activityRecord of the launcher.

[0220] ④After the system_server process handles the startup transaction of the first activity, it notifies the SystemUI process to add a startup window. The SystemUI process calls the addStartingWindow() function to create the startup window, uses the doFrame() function to draw the view of the startup window, and then the finishDrawing() function indicates the completion of the drawing of the startup window. After the system_server process determines that the drawing of the startup window is complete, it applies for readiness.

[0221] ⑤While the SystemUI process creates the startup window, the process of Application A responds to the instruction of the system_server process and executes the lifecycle of the first activity.

[0222] ⑥After determining that the drawing of the startup window is complete, the system_server process notifies the SystemUI process to execute transaction readiness. The SystemUI process executes transaction readiness through the onTransactionReady() function.

[0223] ⑦After the SystemUI process finishes executing transaction readiness, it notifies the launcher process to execute the animation effect. The launcher process starts the animation effect through the startAnimation() function and executes the animation effect through the animator() function, that is, executes the transition to display the transition page.

[0224] ⑧During the process of the process of Application A executing the lifecycle of the first activity, it calls the startActivity() function to request the system_server process to start the second activity ( Figure 7 not shown in the figure). The system_server process handles the startup request of the second activity and collects the collect activityRecord corresponding to the second activityFigure 7 (not shown in the figure). After the systemserver process determines that the process of Application A has completed the life cycle of the first activity, it calls the activityPaused() function to notify the process of Application A to pause the first activity and instructs the process of Application A to execute the life cycle of the second activity. And so on, the third... the nth activity of Application A is executed.

[0225] ⑨ After the systemserver process determines that the process of Application A has completed the life cycle of the nth activity, the systemserver process calls showSurface() to display the layer corresponding to the nth activity, that is, to display the target interface a.

[0226] ⑩ The systemserver process calls the removeStartingWindow() function to remove the starting window and displays the interface of Application A in the window of Application A.

[0227] Comparison Figure 5 and Figure 7 and in combination with Figure 8 it can be known that in the native process, after the process of Application A requests to start the nth activity, a starting window is added. Therefore, the addition of the starting window and the display of the transition page need to depend on the life cycle of the activities of the intermediate interface of the application after the first n - 1 activities are started. In the optimized process, during the process of the systemserver process handling the startup transaction of the first activity of Application A, that is, when the systemserver process starts the first activity, a starting window is added. After adding the starting window and completing the drawing of the starting window, it can enter the transaction ready stage. After the systemUI process executes the onTransactionReady() function, the transition page can be displayed. The entire process of adding the starting window and displaying the transition page can be synchronized with the execution of the activity life cycle of the Application A process, without depending on the life cycle of the activities of Application A, greatly shortening the response time. Simply put, the optimized process is equivalent to moving the execution timing of step ⑨ in the native process from when starting the nth activity to when starting the first activity, and the subsequent steps and are also moved forward in sequence, so the response time is greatly shortened, effectively improving the user experience.

[0228] Continue to refer to Figure 5 、 Figure 7 and Figure 8, on the other hand, in the native process, when the animation execution is not completed, that is, the application interface is already displayed, however, the application interface cannot respond to user operations, resulting in a poor user experience. In the optimization process, the animation execution is earlier and can be executed concurrently with the process of loading the activity of Application A. Therefore, the animation can be executed and completed earlier. When the activity of the application is loaded and completed and starts to display the interface, it can respond to user operations without the user having to wait, improving the user experience.

[0229] The optimization process is outlined above in conjunction with the accompanying drawings to illustrate from a timing perspective how the method provided by this application shortens the response time. Further below, in conjunction with Figure 6 , the specific implementation process of the optimization process will be described to clarify the execution details of the process, explain how to transfer and manage after the startup window is added, and how to manage the transition to improve the smoothness of the display of the transition page, etc.

[0230] First, the process of the parsing configuration module in the phone manager process parsing the relevant configuration of the optimization startup function will be described.

[0231] The parsing configuration module is initialized when the electronic device is powered on, reads and parses the relevant configuration of the optimization startup function. Optionally, the name of the relevant configuration of the optimization startup function can be, for example, "AwareAddStartWindow". Through parsing, the corresponding type, switch of the optimization startup function, delay removal time of the startup window, delay count threshold, whitelist of application types (also called support type), and package blacklist (pkgBlacklist) of this function can be obtained.

[0232] It can be understood that when the type of an application belongs to the whitelist of application types and the package of this application is not in the package blacklist, it means that this application is suitable for the optimization process and can be quickly started through the optimization process. Otherwise, it means that this application is not suitable for the optimization process and can be started through the native process.

[0233] The parsing configuration module caches the parsing result in the RMS in the systemserver process. When the switch of the optimization startup function is turned on, the optimization process runs. During the running of the optimization process, each module can obtain the corresponding parameters from the RMS according to requirements.

[0234] The implementation of the optimization process will be described below. In this embodiment, the quick start of Application A is still used as an example for description. In the following description, the fork process of the process of Application A will not be elaborated. In addition, for the sake of easy understanding, the method provided in the embodiment of the present application will be described according to the start process of the first activity of the application (referred to as the first stage) and the start processes of the second and subsequent activities (referred to as the second stage).

[0235] 1. The first stage

[0236] The first stage involves the start of the first activity of the application. Before starting the first activity of the application, the quick start scenario is identified. When processing the start transaction of the first activity, the first activity is identified to determine that the activity to be started is the first activity of the application in the quick start scenario, so as to accurately add a start window for the first activity. Moreover, the first transition is identified to set the attributes of the first transition, improving the display effect of the transition page. The following will be introduced in combination with the accompanying drawings.

[0237] Figure 9 It is a timing diagram of another example of the application start method provided in the embodiment of the present application. Figure 10 It is a flowchart of an example of the application start method provided in the embodiment of the present application. Please refer to Figure 9 and Figure 10 simultaneously. This method includes:

[0238] S101. In response to the occurrence of the up event in the quick start operation, the launcher process calls the startShortcut() function to send a start message to the systemserver process.

[0239] Optionally, the start message carries the information of the application to be started (Application A) and the information of the function to be started (Function a). In this embodiment, the information of the function to be started is used as an example of the quick function ID for description.

[0240] Optionally, the launcher process can also pass the information of the application to be started and the quick function ID to the systemserver process through an intent.

[0241] S102. The quick start recognition module in the PMS of the systemserver process responds to the start message. If it is determined that the current start is a quick start and the information of Application A meets the preset conditions, the quick function ID is stored in the cache.

[0242] Determining whether an application meets the preset conditions is essentially a filtering of the application. Therefore, this step can be simply referred to as identifying and filtering quick launches.

[0243] Optionally, the quick launch identification module can determine whether the current launch is a quick launch based on whether the launch message carries a quick function ID. Specifically, in response to the launch message, the quick launch identification module obtains the application information and the quick function ID from the intent. If the quick function ID is obtained from the intent, it indicates that the current launch is a quick launch, that is, the current scenario is a quick launch scenario; otherwise, it indicates that the current launch is not a quick launch and the current scenario is not a quick launch scenario.

[0244] The preset conditions may include, for example, that the type of application A is in the whitelist of application types and the package of application A is not in the blacklist of packages. Specifically, when it is determined that the current launch is a quick launch, the quick launch identification module can obtain the whitelist of application types and the blacklist of packages from the configuration cache module, and determine whether the class of application A is in the whitelist of application types and whether the package of application A is in the blacklist of packages according to the information of application A carried in the launch message, so as to determine whether application A meets the preset conditions. If the type of application A is in the whitelist of application types and the package of application A is not in the blacklist of packages, it is determined that the information of application A meets the preset conditions. Otherwise, it indicates that the information of application A does not meet the preset conditions.

[0245] If the current launch is a quick launch and the information of application A meets the preset conditions, it indicates that the current is a quick launch scenario and the quick launch can be performed according to the optimized process in the current scenario. Therefore, the quick function ID is stored in the cache of the systemserver process. In this way, on the one hand, the quick function ID in the cache is used as an identifier of the scenario to mark that the current scenario can be quickly launched through the optimized process. On the other hand, the quick function ID in the cache is used as an identifier of the first activity to mark that the activity to be launched at the current moment is the first activity of application A. It should be noted that in some other embodiments, the above two aspects can also be marked by other identification information, such as preset characters, preset numbers, preset texts, etc. The embodiments of the present application do not make any limitations on this and can be set according to actual needs.

[0246] If the current launch is not a quick launch and / or the information of application A does not meet the preset conditions, it indicates that the current scenario is not applicable to quick launch through the optimized process, so the quick function ID is not cached. In the subsequent process, when the quick function ID cannot be recognized from the cache, the process automatically switches to the native process for execution.

[0247] In this step, by identifying the quick launch, the scenario of the optimization process is limited to the quick launch scenario, improving the accuracy of process execution. Moreover, by setting up the application type whitelist and package blacklist, applications that are not applicable to the optimization process can be filtered out, preventing these applications from entering the optimization process and being unable to execute, and ensuring the normal launch of these applications through the native process.

[0248] In some other embodiments, during the execution of the optimization process, the quick function IDs with abnormal launches can be collected, and these quick function IDs can be added to the function blacklist. In this case, the preset conditions can further include: the quick function ID is not in the function blacklist. The fact that the quick function ID is not in the function blacklist further indicates that the function a of application A is applicable to quick launch through the optimization process, and the quick function ID is cached. In this way, the to-be-launched functions that are not applicable to the optimization process are further filtered out, preventing errors in quick launch and improving the user experience.

[0249] S103. The AMS in the systemserver process starts to process the start transaction of the first activity, and the transition component management module in the WMS of the systemserver process collects the activityRecord corresponding to the first activity.

[0250] S104. The activity recognition module in the WMS identifies the first activity according to the quick function ID. After identifying the first activity, it sets the value of the source record (also known as the first sourceRecord) of the first activity to the activityRecord corresponding to the first activity, and adds the first sourceRecord to the sourceRecord set.

[0251] This step can be simply referred to as identifying the first activity and setting the sourceRecord.

[0252] Specifically, the activity recognition module reads the quick function ID from the cache. If the reading is successful, it determines that the currently launched activity is the first activity launched in the quick launch scenario, that is, the first activity is recognized. Optionally, the activity recognition module can add an identifier to the first activity to indicate that this activity is the first activity, which is convenient for quickly determining whether an activity is the first activity in the subsequent process. The identifier of the first activity can be, for example, "first".

[0253] After the first activity is recognized, the activity recognition module sets the value of the first sourceRecord to the activityRecord corresponding to the first activity, and adds the first sourceRecord to the sourceRecord set.

[0254] The sourceRecord is used to indicate the start source of the activity, that is, the previous activity that starts the currently started activity. In the embodiments of the present application, a corresponding sourceRecord is set for each activity, and the sourceRecord is assigned a value. The set formed by the sourceRecords corresponding to multiple activities is called the sourceRecord set.

[0255] Specifically, after the first activity is recognized, the sourceRecord corresponding to the first activity (i.e., the first one) is assigned a value. Optionally, the value of the sourceRecord corresponding to the first activity can be set to its (the first activity) activityRecord. For any activity started after the first activity, a sourceRecord value passing operation is performed. For the sake of convenience of description, the next activity to be started is called the new activity. The activity that requests to start the new activity is called the old activity or the source activity. In a specific embodiment, the old activity passes the sourceRecord value to the new activity, that is, the sourceRecord of the old activity is used as the value of the sourceRecord of the new activity. In this way, the old activity that starts the new activity can be determined through the value of the sourceRecord.

[0256] In this embodiment, each activity is identified, and a corresponding sourceRecord is assigned to each activity. On the one hand, this facilitates using the sourceRecord as the basis for passing the startup window in the subsequent process. Specifically, the value of the sourceRecord of the new activity can be obtained. In most cases, the old activity corresponding to this value is the activity that currently holds the startup window. Therefore, based on the value of the sourceRecord, the activity that holds the startup window can be found, and thus the startup window can be obtained from this activity and passed to the activity requesting to start. The passing of the startup window will be further described in step S208 of the subsequent embodiment.

[0257] On the other hand, in this solution, the process is optimized to identify each activity and set a corresponding sourceRecord for the activity, which is not available in the original process. Conversely, if a sourceRecord exists in the sourceRecord set, then this sourceRecord is set by the optimized process of this solution, indicating that the current is a quick startup scenario and at least the first activity has been started. Therefore, in the subsequent process, the sourceRecord is also used as the basis for identifying other activities after the first activity. Specifically, if a sourceRecord exists in the sourceRecord set, it indicates that the currently started activity is the second activity or an activity after the second activity (referred to as other activities) in the quick startup scenario. Other activities will be further described in step S205 of the subsequent embodiment.

[0258] In some embodiments, for cross-process startup, such as starting In a small program or other special scenarios, when requesting to start a certain activity, if the activity has already been started, the system will reuse the started activity. In this case, the activity holding the startup window is not actually the old activity that requested to start the new activity, but the reused activity. Then, when performing the sourceRecord value passing operation according to the above logic, the passed value may be empty. An empty passed value may cause the subsequent startup window passing to fail or the activity recognition to fail, thereby resulting in the failure of the optimization process. For this situation, in the optimization solution, when starting a new activity, if the passed value of sourceRecord is empty and there is an activity holding the startup window in the collected sourceRecord set, it indicates that this activity involves special scenarios such as cross-process startup. Therefore, the activityRecord corresponding to the activity holding the startup window can be used as the sourceRecord value of the new activity. In this way, the correct assignment of sourceRecord is ensured, preventing the subsequent startup window passing from failing or the activity recognition from failing, and ensuring the reliability of the optimization process.

[0259] Of course, in some other embodiments, other methods can also be used to assign values to the sourceRecord of each activity, and the embodiments of the present application do not make any limitations in this regard.

[0260] S105. The activity recognition module in the WMS of the systemserver process sets a condition variable and the effective duration of the condition variable.

[0261] This step can be simply referred to as setting the condition variable.

[0262] The condition variable is used to restrict the startup timing of the second activity of Application A, preventing the startup of the second activity from affecting the loading of the first transition and thus affecting the display of the transition page.

[0263] Optionally, there may be two conditional variables: conditional variable 1 and conditional variable 2. Conditional variable 1 is: the first transition has been submitted to the system UI process. Conditional variable 1 indicates that the first transition has been handed over to the system UI process for processing, and the processing of the first transition no longer occupies the system server process. Therefore, starting the second activity of application A and creating the second transition (also known as the second transition component) will not affect the loading of the first transition, and thus will not affect the display of the transition page. Conditional variable 2 is: the layer display (showSurface) of the startup window has been completed. After the layer display of the startup window has been completed, the processing of the startup window of the first activity no longer occupies the system server process. Therefore, starting the second activity of application A and creating the second transition will not affect the loading of the first transition, and thus will not affect the display of the transition page.

[0264] The effective duration of the conditional variable represents how long the conditional variable is valid after the setting time. For example, the conditional variable can be 20 ms, indicating that it is valid within 20 ms after the conditional variable is set.

[0265] If the conditional variable is unlocked within the effective duration, the start request for the second activity of application A is triggered, which will not affect the processing of the transition page, enabling the transition page to be displayed as soon as possible, thereby minimizing the response time for quick startup of the application.

[0266] If the conditional variable is not unlocked within the effective duration, the conditional variable is automatically unlocked when the effective duration is reached. In this way, it can prevent the situation where the conditional variable cannot be unlocked due to abnormal process execution, which may lead to the subsequent activities being unable to start, and improve the system stability.

[0267] For the unlocking of the conditional variable and the subsequent process, refer to steps S202 to S204 in the following embodiments.

[0268] S106. The transition component management module in the WMS of the system server process creates the first transition based on the collected activityRecord corresponding to the first activity.

[0269] S107. The transition component recognition module in the WMS of the system server process recognizes the first transition based on the activityRecord in the first transition.

[0270] This step can be simply referred to as identifying the first transition.

[0271] Specifically, in the above step S104, the activity recognition module has recognized the first activity. Therefore, the transition component recognition module determines whether the activityRecord collected in the current transition is the activityRecord corresponding to the first activity, and thus can determine whether the current transition is the first transition.

[0272] Optionally, the transition component recognition module can add a transition identifier 1 to the recognized first transition, and the transition identifier 1 is used to indicate that this transition is the first transition.

[0273] S108. The start window management module in the WMS of the systemserver process requests the systemUI process to add a start window (also called the first start window) for the first activity.

[0274] As a possible implementation, after identifying the first transition and before requesting the systemUI process to add a start window (i.e., after step S107 and before step S108), the activity recognition module in the WMS of the systemserver process can also execute step S104 again, that is, identify the first activity and set the sourceRecord corresponding to the first activity. As described above, in some cases, the system may reuse activities, so this first activity may be a reused activity. After identifying the first transition and before requesting to add a start window, the systemserver process executes step S104 again, which can further accurately identify the first activity, thereby further ensuring the correct assignment of the sourceRecord, preventing subsequent start window transfer failures or activity recognition failures, and ensuring the reliability of the optimization process.

[0275] S109. The systemUI process responds to the request of the start window management module and starts to add and draw the start window.

[0276] Specifically, the systemUI process calls the addStartingWindow() function to create a starting window and uses the doFrame() function to draw the frame of the starting window. After the frame is drawn, the systemUI process requests the WMS in the systemserver process to add the display of the starting window.

[0277] After the systemUI process finishes drawing the starting window, it calls the finishDrawing() function to indicate to the systemserver process that the drawing of the starting window is complete. The WMS in the systemserver process shows the layer of the starting window through showSurface().

[0278] Steps S108 and S109 can be simply referred to as the addition of the starting window.

[0279] S110. The AMS in the systemserver process calls the activityPaused() function to notify the activity of the launcher process to enter the paused state and instructs the process of Application A to execute the life cycle of the first activity. The transition component management module in the WMS of the systemserver process collects the activityRecord of the launcher.

[0280] It can be understood that this step S110 can be executed after the above steps S102 to S109, or can be executed synchronously with the above steps S102 to S109.

[0281] S111. In response to the instruction of the AMS, the process of Application A starts to execute the life cycle of the first activity.

[0282] S112. After the systemUI process starts to add the starting window, the starting window management module identifies whether the starting window is a starting window added through the optimization process; if so, step S113 is executed; if not, step S114 is executed.

[0283] S113. The starting window management module adds an optimization window identifier to the starting window and saves the optimization window identifier to the cache. The optimization start flag is used to represent that the currently added starting window is a starting window added through the optimization process.

[0284] S114. The starting window management module clears the identification information added through the optimization process.

[0285] The above steps S112 to S114 can be simply referred to as identifying the optimization window.

[0286] As analyzed in the above embodiments, when the activity used is started, the native system may add a startup window to the activity. If the application sets the transparency attribute for the activity, or sets code to reject adding a startup window, etc., the native system will fail to add a startup window. However, in actual use, if the actual business of the application requires adding a startup window to the first activity, in this case, the application no longer sets the transparency attribute for the activity. In this way, the process of the native system can successfully add a startup window to the first activity. In this case, it is necessary to abandon the optimization process of this application and run according to the native process to prevent disturbing the original startup logic of the application.

[0287] Based on this, in this embodiment, after starting to add a startup window, it is further identified whether the startup window is a startup window added by the optimization process. If the startup window is a startup window added by the optimization process, an optimization window identifier is added. The optimization window identifier can be used as a basis for determining whether to remove the startup window in the following, specifically referring to the subsequent steps S209 to S212. If the startup window is not a startup window added by the optimization process, all the marked information added through the optimization process is cleared, including but not limited to the shortcut function ID, the sourceRecord set, the conditional variable, the valid duration of the conditional variable, etc. In addition, if an identifier is set after identifying the first activity and the first transition, these identifiers are also cleared. In this way, the subsequent process enters the native process, preventing disturbing the original startup logic of the application, improving the accuracy of the execution of the optimization process, and further improving the stability of the system operation.

[0288] It can be understood that regardless of whether the startup window is a window added by the optimization process, the subsequent drawing of the startup window continues to be added. That is, after steps S113 and S114, the drawing of the startup window continues to be added. The difference is that after S113, other steps of the optimization process will continue to be executed, and after S114, it will be executed according to the native process.

[0289] The specific method for identifying whether the first startup window is a startup window added by the optimization process will be further described in the subsequent embodiments.

[0290] S115. The WMS in the systemserver process responds to the request from the systemUI process, calls the addToDisplay() function to start adding the window for display. After the addition of the window for display is completed, it triggers the applyReady. The transition component management module in the WMS prepares the first transition. After the first transition is prepared and before it is submitted to the systemUI process, the transition component management module in the WMS cancels the transparency attribute of the first transition.

[0291] Before the first transition is submitted to the systemUI process, that is, before the systemserver process requests the systemUI process to execute onTransactionReady.

[0292] Specifically, as described above, after the systemUI process finishes drawing the frame of the starting window through the doFrame() function, it requests the WMS in the systemserver process to add the starting window for display. The WMS in the systemserver process responds to the request from the systemUI process and calls the addToDisplay() function to add the starting window for display. After the addition of the starting window for display is completed, it triggers the WMS to enter the applyReady stage, and the WMS prepares the transition. After the transition is prepared, the WMS executes the AppTransitionReady, and then submits the transition to the systemUI process for processing. That is to say, the addToDisplay of the starting window triggers the transitionReady. Therefore, before the finishDrawing of the starting window, it has already entered the transitionReady stage. In the native process, the transitionReady is triggered by the finishDrawing of the starting window. That is to say, the optimized process advances the transitionReady, making the transitionReady between the moment of adding the starting window (addStartingWindow) and the moment of finishing drawing the starting window (finishDrawing). In this way, the animation is further displayed in advance, further shortening the response time during the quick startup of the application and improving the user experience.

[0293] It should be noted that triggering the transitionReady in advance can be executed as an optional solution. In some other embodiments, it can also be asFigure 7 As shown, the trigger of transitionReady is triggered by finishDrawing of the startup window, and the embodiments of the present application do not make any limitations on this.

[0294] To cancel the transparency attribute of the transition, for example, it can be: set the transparency attribute value of the transition to false.

[0295] S116. The transition component management module in the WMS of the systemserver process submits the first transition after canceling the transparency attribute to the systemUI process for processing. After the systemUI process finishes processing, it submits the first transition after canceling the transparency attribute to the launcher process, notifies the launcher process to execute the first transition, and the launcher process executes the first transition to display the transition page.

[0296] Steps S115 and S116 can be simply referred to as the control of the first animation effect.

[0297] Specifically, the transition component management module submits the first transition after canceling the transparency attribute to the systemUI process for processing and calls the onTransactionReady() function to request the execution of transaction readiness. The systemUI process calls the onTransactionReady() function to execute transaction readiness. After the execution of transaction readiness is completed, the systemUI process submits the first transition to the launcher process, notifies the launcher process to execute the transition. The launcher process starts the animation effect through the startAnimation() function and executes the animation effect through the animator() function to display the transition page.

[0298] If the transition has a transparency attribute, the system cannot create an icon magnification animation effect. Therefore, in this step, the transparency attribute of the first transition is canceled, and the transition without the transparency attribute is passed to the systemUI process for processing and then further submitted to the launcher process. In this way, the launcher process can execute the icon magnification animation effect, improve the animation effect, and enhance the user's visual experience.

[0299] S117. During the process of the application A process executing the life cycle of the first activity, at the activityResume stage, determine whether the interface corresponding to the first activity is a user-perceivable (i.e., visible) interface, and set the visualization flag of the first activity according to the determination result.

[0300] Specifically, if any of the following Condition 1 and Condition 2 is satisfied, it can be determined that the interface corresponding to the first activity is a user-perceivable interface. Condition 1: It is determined that the layout customized by the activity contains at least one view. Condition 2: It is determined that there is a background layout and the transparency is not 0.

[0301] The visualization flag is used to identify whether the interface corresponding to the activity is visible, that is, whether it is a user-perceivable interface. The visualization flag can default to "no" (for example, false). If it is determined that the interface corresponding to the first activity is a user-perceivable interface, set the visualization flag to "yes" (for example, true, also known as the value of the visualization flag being the first value). If it is determined that the interface corresponding to the first activity is a user-unperceivable interface, maintain the visualization flag as no.

[0302] The visualization flag can be used as a basis for determining whether to remove the startup window in subsequent processes. Specifically, if the visualization flag is "yes", it means that the interface corresponding to this activity is a user-perceivable interface, so this interface needs to be displayed normally, so the startup window needs to be removed. Specifically, it will be further described in subsequent embodiments.

[0303] It can be understood that step S117 can be executed by a functional module running in the system framework in the application A process. In other words, this application can add a module for determining whether an activity is visible in the application layer on the system side without changing the execution logic of application A itself, which is convenient for maintenance and can improve the security of the application and the system.

[0304] S118. During the process of the application A process executing the life cycle of the first activity, at the stage of requesting to add to the display (addToDisplay) from the WMS in the systemserver process, pass the visualization flag representation of the first activity as a parameter to the WMS, and the startup window management module in the WMS saves the visualization flag to the activityRecord corresponding to the first activity.

[0305] Steps S117 and S118 can be simply referred to as visualization recognition.

[0306] Optionally, when creating a WindowState, the WMS can save the visualization identifier to the activityRecord corresponding to the first activity.

[0307] The process of adding a startup window to the recognition optimization process is described below.

[0308] See Figure 11 , in an embodiment, after the above step S112, the systemUI process starts to add a startup window, and the startup window management module identifies whether the startup window is the startup window added by the optimization process, including:

[0309] S1121. Determine whether the type parameter of the startup window is NONE (also referred to as the first type), and the currently started activity is the first activity in the quick startup scenario. If so, determine that the startup window is the startup window added by the optimization process; if not, execute step S1122.

[0310] In the native process, a type parameter is set for the startup window. The type parameter of the startup window characterizes the type of the added startup window. Optionally, the type of the startup window can be the snapshot type or the splash type. When adding a startup window, set the type parameter to one of the above two types as needed. When the system does not need to add a startup window for a certain activity, the type parameter can be set to NONE. That is, when the type parameter of the startup window is NONE, it indicates that the native process does not add a startup window to the activity. In this case, if it is further determined that the currently started activity is the first activity in the quick startup scenario, it means that the current startup window is the startup window added by the optimization process of this application.

[0311] As described in the above embodiment, it can be determined whether the currently started activity is the first activity in the quick startup scenario by whether the cache includes the quick function ID.

[0312] S1122. Determine whether the window addition result is a failure to add (also referred to as the first result), and the currently started activity is the first activity in the quick startup scenario. If so, determine that the startup window is the startup window added by the optimization process; if not, determine that the startup window is not the startup window added by the optimization process.

[0313] The window addition result is used to characterize the result of adding a startup window in the native process. The window addition result can be successful addition or failed addition. Successful addition can be indicated by returning a true value, for example, and failed addition can be indicated by returning a false value, for example.

[0314] As described above, when the native system adds a startup window for an activity, if the activity has a transparent attribute, or the application sets code to reject adding a startup window, etc., the native system fails to add the startup window and will return a "false" value. In this case, if it is further determined that the currently started activity is the first activity in the quick startup scenario, it indicates that the current startup window is the startup window added by the optimization process of this application.

[0315] Otherwise, it indicates that the current startup window is not the startup window added by the optimization process.

[0316] In this embodiment, through the type parameter of the startup window and the window addition result, it is possible to accurately determine whether the startup window is added by the optimization process, improving the accuracy of the execution of the optimization process, thereby improving the stability of the system.

[0317] Continue to refer to Figure 11 , in one embodiment, if the judgment result of step S1121 is "yes", then step S1123 is executed.

[0318] S1123. Modify the type parameter of the startup window to the splash type.

[0319] That is to say, if the native process does not add a startup window and the startup window is the startup window added by the optimization process, the type parameter of the startup window is corrected to the type of the startup window added by the optimization process. In this way, the accurate addition of subsequent startup windows is ensured. Moreover, setting the type parameter of the startup window to the splash type, compared with the snapshot type, enables the startup window to be applicable not only to warm startups but also to cold startups, expanding the applicable scope of this optimization process.

[0320] 2. The second stage

[0321] In the second stage, the second and subsequent activities of the application are started in sequence, and the added startup window is passed to these activities in sequence. Moreover, when an activity finishes drawing, it is decided whether to remove the startup window based on the visual identifier of the activity. In addition, the attributes of the transition are managed. Through the above several measures, the transition page can be displayed stably and smoothly without phenomena such as splash screens, further improving the user's visual experience. The following will be introduced in conjunction with the accompanying drawings.

[0322] Figure 12 This is a timing schematic diagram of another application startup method provided by an embodiment of this application. Figure 13 This is a flowchart schematic diagram of another application startup method provided by an embodiment of this application. Please refer to Figure 12 and Figure 13 together. The method includes:

[0323] S201. During the execution of the first activity lifecycle of the process of Application A, the startActivity() function is called to request the AMS in the systemserver process to start the second activity.

[0324] S202. The AMS in the systemserver process determines in real time whether the conditional variable is unlocked and whether the effective duration of the conditional variable is exceeded. If the conditional variable is not unlocked and the effective duration of the conditional variable is not exceeded, step S203 is executed; if the conditional variable is not exceeded and the conditional variable is unlocked, or the conditional variable is not unlocked and the effective duration of the conditional variable is exceeded, step S204 is executed.

[0325] S203. The AMS in the systemserver process blocks the startup of the second activity.

[0326] Blocking the second activity means not processing the startup request of the second activity.

[0327] S204. The AMS in the systemserver process starts to process the startup request of the second activity, and the transition component management module in the WMS of the systemserver process collects the activityRecord corresponding to the second activity.

[0328] Steps S202 to S204 can be simply referred to as the unlocking of the conditional variable.

[0329] As described in step S105 above, the conditional variable can include two conditional variables, conditional variable 1 and conditional variable 2. Determining whether the conditional variable is unlocked means determining whether both conditional variables are unlocked, that is: determining whether the transition corresponding to the first activity has been submitted to the systemUI process and the layer display of the startup window is completed.

[0330] Determining whether the effective duration of the conditional variable is exceeded means determining whether the duration from the current moment to the moment when the conditional variable is set exceeds the effective duration.

[0331] If the time difference between the current moment and the conditional variable moment does not exceed the effective duration of the conditional variable, and neither of the two conditional variables is unlocked, then the start of the second activity is blocked.

[0332] If the time difference between the current moment and the conditional variable moment does not exceed the effective duration of the conditional variable, and both of the two conditional variables have been unlocked, that is, the conditional variable has been unlocked within the effective duration, it indicates that starting the second activity of Application A and creating the second transition will not affect the display of the transition page. Then, AMS starts to process the start request of the second activity. This prevents the second activity and the second transition from affecting the processing of the transition page, enabling the transition page to be displayed as soon as possible, thereby minimizing the response time of the application's quick start to the greatest extent.

[0333] It should be noted that the unlocking order of the two conditional variables is not restricted. It is possible to unlock conditional variable 1 first, or unlock conditional variable 2, or unlock both conditional variables simultaneously.

[0334] If the time difference between the current moment and the conditional variable moment exceeds the effective duration of the conditional variable, and at least one of the two conditional variables is not unlocked, then the conditional variable is automatically unlocked, and AMS starts to process the start request of the second activity. In this way, it is possible to prevent the situation where the conditional variable cannot be unlocked due to abnormal process execution, which in turn causes the subsequent activities to be unable to start, thereby improving the system stability.

[0335] S205. After AMS starts to process the start request of the second activity, the activity recognition module in WMS identifies the second activity as another (other) activity in the quick start scenario based on the sourceRecord set, takes the first sourceRecord as the sourceRecord value of the second activity, and adds this sourceRecord to the sourceRecord set; at the same time, sets the value of the source (from) parameter of this second activity to the value of the sourceRecord of the second activity.

[0336] This step can be simply referred to as identifying other activities and setting sourceRecord.

[0337] As described in the above step S104, the sourceRecord can be used as the basis for identifying the activity. Therefore, if there is a sourceRecord in the sourceRecord set, it indicates that the currently requested activity to be launched is the second activity or an activity after the second one in the quick launch scenario, that is, other activities.

[0338] In this step, when other activities are identified, on the one hand, the sourceRecord value is passed to the other activities, and on the other hand, the value of the from parameter of the other activities is changed. The from parameter is a parameter in the native system that marks the source of the activity, that is, the value of the from parameter represents the old activity that requests to launch a new activity. Different from the sourceRecord in this application, in the native system, there is no maintenance mechanism for launching windows across task stacks. Therefore, the from parameter is only valid for activities within the same task stack. Specifically, if the new activity and the old activity are in the same task stack, the value of this from parameter is the information of the old activity. If the new activity and the old activity are in different task stacks, the value of this from parameter is NONE, indicating that the activity has no source. In this embodiment, after determining the sourceRecord of a certain other activity, the value of the sourceRecord of the other activity is written into the from parameter of the other activity. In this way, by rewriting the value of the from parameter, the launch window can be accurately passed through the from parameter in the subsequent process, preventing situations such as splash screens caused by failed launch window transmission, improving the stability of the launch window display, and enhancing the user's visual experience.

[0339] S206. The transition component management module in the WMS of the systemserver process creates a second transition according to the activityRecord corresponding to the second activity collected.

[0340] S207. The transition recognition module in the WMS of the systemserver process recognizes the second transition as other transitions according to the activityRecord in the second transition.

[0341] This step can be simply referred to as recognizing other transitions.

[0342] Other transitions refer to the second transition or any transitions after the second one.

[0343] Specifically, in step S203 above, the activity recognition module has recognized that the activity currently requested to be launched is another activity. Therefore, the transition component recognition module determines whether the activityRecord collected in the current transition is the activityRecord corresponding to this other activity, and thus can determine whether the current transition is an other transition.

[0344] Optionally, if the transition recognition module determines that the current transition is an other transition, it can add an identifier to the current transition for subsequent searching. The identifier added for other transitions can be, for example, "other".

[0345] S208. The start window management module in the WMS of the systemserver process obtains the sourceRecord corresponding to the second activity, and passes the start window to the second activity according to the value of the sourceRecord corresponding to the second activity.

[0346] This step can be simply referred to as start window passing.

[0347] As described in the above step S104, sourceRecord can be used as the basis for window transfer. Specifically, in the above step S205, a value has been set for the sourceRecord corresponding to the second activity, and this sourceRecord has been added to the sourceRecord set. Therefore, in this step, the value of the sourceRecord corresponding to the second activity can be obtained. Based on this value, the old activity (i.e., the source activity) that starts this activity can be determined. Referring to the explanation in the above step S104, in most cases, the activity that holds the starting window is the old activity. For some cases where the activity that holds the starting window is not the source activity, when the transferred value is empty, the sourceRecord of the activity that holds the starting window in the sourceRecord set is used as the value of the sourceRecord of the new activity. Therefore, in any case, the activity corresponding to the value of sourceRecord in the optimization process of this application holds the starting window. Therefore, through sourceRecord, the activity that currently holds the starting window can be accurately obtained, so as to accurately transfer this starting window to the new activity, improving the accuracy of starting window transfer and the reliability of the optimization process.

[0348] As an optional implementation manner, after recognizing other transitions and before window transfer (that is, after step S207 and before step S208), step S205 can be executed again to recognize other activities and set the sourceRecord corresponding to other activities. In this way, other activities can be further accurately recognized, thereby further ensuring the correct assignment of sourceRecord, preventing subsequent window transfer failures or activity recognition failures, and ensuring the reliability of the optimization process.

[0349] As an optional implementation manner, when transferring the starting window, it can be further determined whether it is a cross-task-stack transfer, that is, to determine whether the second activity and the first activity are in the same task stack. If not, it is a cross-task-stack transfer of the starting window. In this case, the layer level of the starting window can be increased by one level. In this way, when the starting window is successfully added in the native system, it can prevent this starting window from covering the starting window added by the optimization process of this solution, that is, prevent the starting window added by the optimization process of this solution from being blocked, prevent affecting the effect of the transition page, and improve the user experience.

[0350] S209. The process of Application A continues to execute the life cycle of the first activity. After the frame drawing of the first activity is completed, it indicates to the WMS that the interface drawing is completed through the finishDrawing() function. In response to this indication, the startup window management module in the WMS obtains the visualization identifier of the first activity from the activityRecord of the first activity and obtains the optimized window identifier from the cache.

[0351] As introduced in the above steps S117 and S118, during the activityStart stage of the first activity, a visualization identifier is set for this activity, and the visualization identifier is passed and saved to the activityRecord of the first activity. Therefore, the visualization identifier of the first activity can be obtained in this step.

[0352] As described in the above steps S112 and S113, when the startup window management module identifies that the startup window is a startup window added through the optimization process, it adds an optimized window identifier to the startup window. Therefore, if the startup window is the startup window passed by the first activity, the optimized window identifier can be obtained.

[0353] S210. The startup window management module determines whether the delay removal condition is met based on the visualization identifier of the first activity and the acquisition result of the optimized window identifier. If the delay removal condition is met, step S211 is executed; if the delay removal condition is not met, step S212 is executed.

[0354] S211. The startup window management module delays the removal of the startup window.

[0355] S212. The startup window management module removes the startup window and clears all the identification information added through the optimization process.

[0356] Steps S209 to S212 can be simply referred to as the removal of the startup window.

[0357] The delay removal condition can at least include: the visualization identifier of the first activity is "no", and there is an optimized window identifier. That is to say, if the interface corresponding to the first activity is an interface that cannot be perceived by the user and the current startup window is a startup window added through the optimization process, it means that there is no need to display the interface corresponding to the first activity, and the removal of the startup window can be delayed.

[0358] In another embodiment, the delayed removal condition may further include at least one of the following: the startup window held by the activity has not been removed with delay, and the current threshold value of the number of delayed removals is greater than 0. Setting "the startup window held by the activity has not been removed with delay" in the delayed removal condition can prevent the startup window of the same activity from being removed with delay multiple times, that is, prevent the process from being stuck at the same activity all the time, resulting in startup jamming, and improve the user experience.

[0359] As described in the above embodiment, when the electronic device is powered on and starts up, the threshold value of the number of delayed removals can be parsed and configured and cached in the cache configuration module. It can be understood that within a cycle of quick startup, each time the WMS delays the removal of the startup window, the cache configuration module subtracts 1 from the threshold value of the number of delayed removals until the threshold value of the number of delayed removals is 0. When the startup window management module needs to determine whether the delayed removal condition is met, it can obtain the latest threshold value of the number of delayed removals from the cache configuration module. Setting "the threshold value of the number of delayed removals is greater than 0" in the delayed removal condition, that is, when the number of delayed removals is 0, the delay removal cannot continue. This can prevent the startup window from being removed with delay indefinitely, prevent the transition page from being displayed on the screen for a long time, resulting in startup jamming, and improve the user experience.

[0360] It can be understood that in some embodiments, the delayed removal condition may further include: determining that there is a sourceRecord in the sourceRecord set, and determining that there is a current startup window. Determining that there is a sourceRecord in the sourceRecord set means determining that the current scenario is a quick startup scenario and the current startup process is an optimized process. By determining that there is a sourceRecord in the sourceRecord set and determining that there is a current startup window, the judgment of delaying the removal of the window is further enhanced, the reliability of the system is improved, and the user experience is further improved.

[0361] Optionally, when the delayed removal condition is met, the window management module can obtain the start window delayed removal time from the configuration cache module, and can delay the removal of the start window through the delayRemoveCallback() function of the delayed removal recall. The time of the Callback is from the current moment to the moment when the start window delayed removal time is reached. Taking the start window delayed removal time of 500 ms as an example, after 500 ms, the process of restarting the removal of the start window is carried out. However, within these 500 ms, by optimizing the execution of the subsequent steps in the process, the start window may have been passed to the subsequent activity (see step S208). Therefore, the removal of the start window fails in the Callback process, ensuring the normal execution of the subsequent process and thus ensuring the normal display of the transition page. If the start window is not passed out after 500 ms, the start window is removed to prevent the transition page from being displayed on the screen for a long time, causing startup lag and improving the user experience.

[0362] Based on this, as a possible implementation, in the above step S208, after the start window is successfully passed, if there is a Callback for removing the delayed removal of the start window, the Callback is cancelled. In this way, there is no need to return to removing the start window, saving the process and reducing power consumption.

[0363] When the delayed removal condition is not met, that is, the current start window visualization flag is "yes", or there is no optimized window flag, or the start window held by the activity has been delayed removed, or the current delayed removal count threshold is equal to 0. In these cases, the start window is normally removed, so that the interface of the application can be normally displayed and can normally respond to user operations, ensuring the normal switching between the start window and the application window.

[0364] After removing the start window, all the identification information added through the optimization process is cleared, including but not limited to the quick function ID, the sourceRecord set, the conditional variable, the effective duration of the conditional variable, the optimized window flag, the flags of each activity, the flags of each transition, etc. After removing the start window, the system will continue to run according to the application process or the native process. Clearing the identification information added by the optimization process can prevent process confusion in subsequent operations, improving the stability and reliability of the system. In addition, clearing the identification information added by the optimization process can also prevent errors when quickly starting this function of the application next time, improving the reliability of system operation.

[0365] In S213, after the AMS in the systemserver process determines that the lifecycle of the first activity is completed, it calls the activityPaused() function to notify the process of Application A to pause the first activity and instructs the process of Application A to execute the lifecycle of the second activity.

[0366] In S214, the AMS in the systemserver process instructs the process of Application A to pause the first activity and start executing the lifecycle of the second activity. During the process of the process of Application A executing the lifecycle of the second activity, in the activityResume stage, it determines whether the interface corresponding to the second activity is a user-perceivable interface and sets the visualization identifier of the second activity according to the judgment result.

[0367] During the process of the process of Application A executing the lifecycle of the second activity, in the stage of requesting to add a display (addToDisplay) to the WMS in the systemserver process, it passes the visualization identifier of the second activity as a parameter to the WMS, and the start window management module in the WMS saves the visualization identifier to the activityRecord corresponding to the second activity.

[0368] Steps S214 and S215 can be simply referred to as visualization recognition.

[0369] The specific execution of Steps S214 and S215 is similar to the above Steps S117 and S118 and will not be elaborated here.

[0370] In S216, in response to the request of the systemUI process, the WMS in the systemserver process calls the addToDisplay() function to start adding a window display. After the window display addition is completed, it triggers applyReady. The transition component management module in the WMS prepares the second transition. After the second transition is prepared and before the second transition is submitted to the systemUI process, the transition component management module in the WMS in the systemserver process sets the animation effect property of the second transition to "no" (that is, cancels the animation effect property).

[0371] It can be understood that during the startup process of the second and subsequent activities, the application process requests activity pause from the systemserver process, triggering the WMS to enter the apply ready stage, after which the WMS prepares for the transition. In other words, activityPause triggers onTransactionReady.

[0372] S217. The transition component management module in the WMS submits the second transition with the animation property set to "no" to the systemUI process for processing. After the systemUI process finishes processing, it submits the second transition with the animation property set to "no" to the launcher process, notifying the launcher process to execute the second transition. The launcher process executes the second transition to continue displaying the transition page.

[0373] The above steps S216 and S217 can be simply referred to as the control of other animations.

[0374] It can be understood that for each transition after the second transition, the animation property is set to "no" before being submitted to the systemUI process. In other words, the first transition has an animation property, while the transitions after the first one do not have an animation property, and the first transition can be an animation of the icon enlarging. In this way, the display effect on the screen is that the icon gradually enlarges, and then the interface with the enlarged icon is maintained. This will be described in combination with the accompanying drawings later. In this way, it is possible to prevent the screen from flashing due to frequent animation switching when starting an activity across task stacks, improving the display effect. Additionally, only the first transition has an animation, and the animation execution time is short, so there will be no situation where the animation has not been completed while the activity of the application has already been loaded, thus preventing the interface from being unresponsive to user operations and improving the user experience.

[0375] The above steps S201 to S217 have described the process related to the startup stage of the second activity. It can be understood that each subsequent activity is executed according to the above steps. In this way, it is realized to sequentially pass the startup window for the second activity and subsequent activities, and display static images until a certain activity does not meet the condition for delayed removal, or the last activity of application A is loaded, at which point the startup window is removed and the target interface a is displayed.

[0376] It should be noted that in the above embodiments, the optimization process is described by taking cold start as an example. However, the optimization process provided in this application is applicable to cold start, warm start, and hot start.

[0377] The following describes the interface change process of the above first stage and second stage with reference to the accompanying drawings.

[0378] Exemplarily, Figure 14 FIG. is a schematic diagram of an interface change provided in an embodiment of the present application. Continuing with the example of the quick start of the collection function of a payment application, as Figure 14 shown in FIG. (a), in response to the user clicking on the quick icon of the money collection function on the desktop, the electronic device creates a process of the payment application, and then starts the first activity of the payment application. During the process of starting the first activity, the electronic device adds a startup window and draws the startup window, preparing to display the transition page. Taking the first transition having an animation attribute and the animation being an icon enlargement as an example, after the startup window is drawn, the animation is executed, and an icon enlargement effect appears on the screen, as Figure 14 shown in FIG. (b). After that, the icon continues to enlarge, as Figure 14 shown in FIG. (c), until the animation is played out. The second transition and subsequent transitions cancel the animation attribute, so they do not affect the playing of the icon enlargement animation. After the animation is played out, if the activity has not been loaded yet, a static picture, such as a blank picture, is displayed in the transition page, as Figure 14 shown in FIG. (d). After that, when the content to be displayed by the payment application is prepared, the startup window is removed, and the interface of the payment application, such as the Logo page of the payment application, is displayed, as Figure 14 shown in FIG. (e). After that, the interface jumps to the collection code interface, as Figure 14 shown in FIG. (f).

[0379] It can be seen from Figure 14 that through the optimization process, the preset function of the application can be quickly started, and the transition page can be smoothly and stably displayed during the startup process, without problems such as screen flashing, effectively improving the user's visual experience.

[0380] The response time of the optimization process will be further described below.

[0381] Exemplarily, Figure 15 and Figure 16 FIG. is a schematic diagram of the interface comparison of quickly starting an application based on the optimization process and the native process provided in an embodiment of the present application, Figure 16 FIG. (a) continues Figure 15 FIG. (b). Among them Figure 15 and Figure 16In each sub - figure, the left figure shows the interface of the electronic device running the optimized process, and the right figure shows the interface of the electronic device running the native process. As Figure 15 shown in Figure (a) therein, at the same moment T1, the payment application is launched simultaneously through the optimized process and the native process via the shortcut. As Figure 15 shown in Figure (b) therein, at moment T2, a transition page is displayed in the device interface running the optimized process, presenting the effect of the icon gradually enlarging, while the device running the native process has no response. As Figure 16 shown in Figure (a) therein, at moment T3, the startup window has been removed in the device running the optimized process, and the Logo page of the payment application is displayed, while the device running the native process still has no response. As Figure 16 shown in Figure (b) therein, at moment T4, the interface of the receiving payment function has been displayed in the device running the optimized process, while in the device running the native process, the Logo page of the payment application starts to be displayed.

[0382] It can be clearly seen from Figure 15 and Figure 16 that the response time of the optimized process is greatly shortened. Moreover, in the native process, there is no animation effect during startup, and the visual effect is poor.

[0383] In addition, the experimental test data also shows that under the optimized process of this application, the various shortcut startup response times of various applications are all greatly reduced. For example: when launching the payment function via the shortcut, the response time is shortened to 84ms; when launching the scan - code function via the shortcut, the response time is shortened to 80ms; when launching the receiving and payment function via the shortcut, the response time is shortened to 90ms; when launching the scan - code function via the shortcut, the response time is shortened to 80ms. It can be seen that compared with the related technology, the optimized process of this application can shorten the response time by up to 537ms.

[0384] In addition, from the descriptions of the above - mentioned first stage and second stage, it can be seen that the improvements of the application startup method provided by this application to the native process are all on the system side, without the need to change the original startup logic of the application program, which is convenient for maintaining the optimized process and has high security.

[0385] Next, the update of the function blacklist will be described.

[0386] Optionally, during the execution of the optimized process, if the following situations occur, the currently launched function can be added to the function blacklist:

[0387] If the pause of the old activity occurs before the request to start the new activity, delay the onTransactionReady; where the old activity is the second activity or an activity after the second activity.

[0388] As described in the above embodiment, during the operation of a certain activity (i.e., the old activity), if there is an activity (i.e., the new activity) that needs to be started after the old activity, then during the activityStart stage of the old activity, a request can be sent to the systemserver process to start the new activity. Subsequently, the systemserver process processes this start request. After the life cycle of the old activity is completed, the old activity is paused and the new activity is started. It can be seen that the request to start the new activity is carried out before the pause of the old activity.

[0389] See Figure 17 , however, in practical applications, for the second and subsequent activities, the application process may perform a finishActivity operation on the old activity. After the finish activity operation, the old activity is paused. Subsequently, a request may be made to start the new activity again, resulting in a situation where the request to start the new activity is carried out after the pause of the old activity. In this case, when the old activity is paused, a request has not been sent to the systemserver process to start the new activity, so the transfer operation of the start window has not been triggered, and thus the start window is still held by the old activity.

[0390] Since the onTransactionReady may be triggered after the activity is paused. If the start window is still held by the old activity when the old activity is paused, then the start window will be hidden as the old activity is paused, and the start window will be displayed again after being transferred to the new activity, resulting in a flash screen and affecting the user experience.

[0391] In view of this, for the optimization process provided in the embodiments of the present application, on the one hand, for such a scenario, the transaction readiness (onTransactionReady) of the transition corresponding to the old activity is delayed, that is, the transition readiness transitionReady is delayed. Wait until the old activity requests the systemserver process to start a new activity and passes the startup window, and then execute the transaction readiness (onTransactionReady). In this way, the startup window can be passed to the next activity while always being displayed, preventing the splash screen and improving the user experience. On the other hand, the shortcut function ID of such a scenario is added to the function blacklist. In this way, when the function of this application is quickly started next time, it is not allowed to execute according to the optimization process, further preventing the splash screen and improving the reliability of the system.

[0392] Next, the application startup method provided in the embodiments of the present application will be further summarized and described.

[0393] For the application startup method provided in the embodiments of the present application, when it is determined that the current scenario is suitable for quick startup through the optimization process, on the first hand, a startup window is added during the process of starting the first activity to display the transition page, thereby shortening the response time. On the second hand, when starting the second and subsequent activities, the startup window is passed to keep the transition page continuously displayed. On the third hand, when it is determined that the interface of the application needs to be displayed, the startup window is removed to ensure the normal display of the application interface.

[0394] Then, when implementing the solutions in the above three aspects, it is necessary to identify the activities in the quick launch scenario and determine whether the activity is the first activity or the second and subsequent activities (i.e., other activities). In the embodiments of the present application, in the first aspect, by setting a first identifier (such as a quick function ID), the quick launch scenario and the first activity are marked, so that the first activity in the quick launch scenario can be accurately and quickly identified, and then the launch window can be accurately added. In the second aspect, by setting the sourceRecord, the source activity that launches the activity is marked, so that other activities in the quick launch scenario can be accurately and quickly identified, and then the launch window can be accurately passed. In the third aspect, by assigning a visual identifier to each activity, it is marked whether the interface corresponding to the activity is visible, so that it can be accurately determined whether the interface of the application needs to be displayed, and then it can be determined whether the launch window needs to be removed. Moreover, by adding a second identifier (such as an optimization window identifier) to the launch window added for the optimization process, the launch window added for the optimization process is marked, so that when removing the launch window, it can be accurately removed, preventing the removal of the launch window added by the native process, improving the accuracy of the process operation, and then improving the system operation stability.

[0395] In addition, the optimization process also identifies the first transition and each subsequent transition (i.e., other transitions). On the one hand, the transparency attribute of the first transition is cancelled. In this way, the icon magnification effect can be executed, improving the effect of the animation. On the other hand, the transparency attributes of other transitions are cancelled. In this way, it can prevent the flash screen caused by frequent switching of the animation, improving the display effect. And the execution time of the animation is short, and there will be no situation where the execution time of the animation is too long and the activity of the application has been loaded but the animation has not been executed yet. Therefore, it can prevent the phenomenon that the interface of the application cannot respond to user operations, improving the user experience.

[0396] In addition to this, the optimization process restricts the launch timing of the second activity by setting a conditional variable to prevent affecting the loading of the first transition and the display of the transition page.

[0397] All in all, the application launch method provided by the embodiments of the present application can not only shorten the response time during the quick launch of the application, but also make the transition page display smoothly and stably, improving the user experience.

[0398] The above text has introduced in detail the examples of the application startup method provided by the embodiments of this application. It can be understood that in order for an electronic device to implement the above functions, it includes the corresponding hardware and / or software modules for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed in this article, this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of this application.

[0399] The embodiments of this application can divide the functions of the electronic device according to the above method examples. For example, each function can be corresponding to each function module, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software function module. It should be noted that the division of modules in the embodiments of this application is illustrative, only a logical function division, and there can be other division methods in actual implementation.

[0400] It should be noted that all relevant content of each step involved in the above method embodiments can be cited in the function description of the corresponding function module, and will not be repeated here.

[0401] The electronic device provided in this embodiment is used to execute the above application startup method, so it can achieve the same effect as the above implementation method.

[0402] In the case of adopting an integrated unit, the electronic device may further include a processing module, a storage module, and a communication module. Among them, the processing module can be used to control and manage the actions of the electronic device. The storage module can be used to support the electronic device to execute stored program codes and data, etc. The communication module can be used to support the communication of the electronic device with other devices.

[0403] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logical blocks, modules, and circuits described in combination with the disclosure content of this application. The processor can also be a combination that realizes computing functions, such as a combination including one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module can be a memory. The communication module can specifically be a device for interacting with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0404] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment can be a device having Figure 3 the structure shown.

[0405] The embodiment of the present application also provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the processor is caused to execute the application startup method in any of the above embodiments.

[0406] The embodiment of the present application also provides a computer program product. When the computer program product runs on a computer, the computer is caused to execute the above-related steps to implement the application startup method in the above embodiment.

[0407] In addition, the embodiment of the present application also provides a device, which may specifically be a chip, a component or a module. The device may include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device runs, the processor may execute the computer execution instructions stored in the memory, so that the chip executes the application startup method in each of the above method embodiments.

[0408] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.

[0409] Through the description of the above embodiments, those skilled in the art can understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0410] In several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces. The indirect coupling or communication connection of the device or unit may be in electrical, mechanical or other forms.

[0411] The unit described as a separation component may or may not be physically separated. The component displayed as a unit may be a physical unit or multiple physical units, that is, it may be located in one place or may be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0412] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0413] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application. The foregoing storage medium includes: USB flash drive, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disc and other various media that can store program codes.

[0414] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present application, and all of them should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An application startup method, characterized in that, Applied to an electronic device, the electronic device includes a system service process, a system interface process, and a desktop process. The method includes: In response to a first operation of the user, the desktop process sends a start message to the system service process, where the start message is used to indicate starting a first function of a first application through a shortcut, and the interface corresponding to the first function is the interface displayed after the first application loads n activities in sequence, and n is an integer greater than 1; In response to the start message, the system service process starts the first activity among the n activities and creates a first transition component. During the process of starting the first activity, the system interface process adds and draws a first start window for the first activity; In response to the first transition component being ready, the system interface process notifies the desktop process to execute the first transition component; In response to the notification of the system interface process, the desktop process executes the first transition component.

2. The method according to claim 1, wherein The moment when the first transition component is ready is between a first moment and a second moment. The first moment is the moment when the first start window is added, and the second moment is the moment when the drawing of the first start window is completed.

3. The method according to claim 2, characterized in that, The system interface process adding and drawing a first start window for the first activity includes: The system interface process calls the addStartingWindow() function to add the first start window; The system interface process calls the doFrame() function to draw the frame of the first start window; After the frame of the first start window is drawn, the system interface process requests the system service process to add a display for the first start window; The system service process calls the addToDisplay() function to add a display for the first start window; After the addition of the display of the first start window is completed, the system service process triggers the readiness of the first transition component.

4. The method according to any one of claims 1 to 3, characterized in that The start message carries information of the first application. Before the system service process starts the first activity among the n activities, the method further includes: If it is determined that the start message carries a first piece of information, the system service process determines whether the first application meets a preset condition according to the information of the first application; the first piece of information is used to indicate starting the first function through a shortcut; If it is determined that the first application meets the preset condition, the system service process sets a first identifier, and the first identifier is used to indicate that the current scenario is a quick start scenario and the currently started activity is the first activity of the application.

5. The method according to claim 4, wherein The preset condition includes one or more of the following: The type of the first application is in a preset application whitelist; The package of the first application is not in a preset package blacklist; The first piece of information is not in a function blacklist.

6. The method according to claim 4 or 5, characterized in that, The first identifier is the first piece of information.

7. The method according to any one of claims 4 to 6, characterized in that Before the system interface process adds and draws a first start window for the first activity, the method further includes: The system service process determines the existence of the first identifier.

8. The method according to claim 7, characterized in that, The method further includes: After the system interface process starts adding the first startup window for the first activity, the system service process determines whether the type parameter of the first startup window is of a first type and determines whether the first identifier exists, where the first type represents that no startup window has been added; If the type parameter of the first startup window is of the first type and the first identifier exists, the system service process sets a second identifier for the first startup window; If the type parameter of the first startup window is not of the first type and the first identifier exists, the system service process determines whether a first result exists, where the first result represents that adding the startup window fails; If the first result exists, the system service process sets the second identifier; If the first result does not exist, the system service process clears the first identifier.

9. The method according to claim 8, wherein The method further includes: If the type parameter of the first startup window is of the first type and the first identifier exists, modify the type parameter of the first startup window to the splash type.

10. The method according to claim 8 or 9, characterized in that, The method further includes: During the process of starting the first activity, if it is determined that the first identifier exists, the system service process creates a first source record corresponding to the first activity, uses the activity record of the first activity as the value of the first source record, and adds the first source record to the source record set.

11. The method according to claim 10, wherein The electronic device further includes the process of the first application, and the method further includes: During the process of executing the life cycle of the first activity, the process of the first application determines whether the interface corresponding to the first activity is a visual interface; If the interface corresponding to the first activity is a visual interface, the system service process sets the value of the visual identifier of the first activity to a first value.

12. The method according to claim 11, wherein The method further includes: During the activity layout stage of the first activity, if it is determined that the custom interface includes views, or it is determined that there is a background layout and the transparency is not 0, the process of the first application determines that the interface corresponding to the first activity is a visual interface.

13. The method according to claim 11 or 12, characterized in that, The method further includes: After receiving a first completion indication from the process of the first application, the system service process determines whether a delay removal condition is met, where the first completion indication is used to indicate that the first activity has completed drawing; If the delay removal condition is met, the system service process delays removing the first startup window; If the delay removal condition is not met, the system service process removes the first startup window.

14. The method according to claim 13, characterized in that, The delay removal condition includes: the value of the visual identifier of the first activity is not the first value, and the second identifier exists.

15. The method according to claim 14, characterized in that, The delay removal condition further includes one or more of the following: The startup window held by the first activity has not been removed before; The current delay removal count threshold is greater than 0; There is a source record in the source record set.

16. The method according to any one of claims 13 to 15, characterized in that, After removing the first startup window, the method further includes: Clearing the first identifier, the second identifier, the source record set, and the first value.

17. The method according to any one of claims 1 to 16, characterized in that, The first transition component has an animation attribute.

18. The method according to claim 17, wherein The dynamic effect corresponding to the first transition component is an icon magnification dynamic effect, and the method further includes: Before submitting the first transition component to the system interface process, when it is determined that the first transition component is the transition component corresponding to the first activity, the system service process cancels the transparency attribute of the first transition component.

19. The method according to claim 18, characterized in that, The method further includes: During the process of starting the first activity, the system service process determines that the first transition component is the transition component corresponding to the first activity according to the activity record corresponding to the first activity collected in the first transition component.

20. The method according to any one of claims 1 to 19, characterized in that, The electronic device further includes the process of the first application, and the method further includes: In response to the system service process starting the first activity, the process of the first application executes the life cycle of the first activity; During the process of executing the life cycle of the first activity, the process of the first application requests the system service process to start the second activity among the n activities; In response to the request of the first application process, the system service process starts the second activity and creates a second transition component; During the process of starting the second activity, the system service process transfers the first startup window to the second activity.

21. The method according to claim 20, wherein The startup moment of the second activity is after the moment when the first transition component is ready.

22. The method according to claim 21, wherein The startup moment of the second activity is after the completion moment of the layer display of the first startup window.

23. The method according to claim 22, wherein The method further includes: During the process of starting the first activity, the system service process sets a conditional variable, and the conditional variable includes: the first transition component has been submitted to the system interface process, and the layer display of the first startup window has been completed; The system service process starts the second activity, including: When it is determined that the conditional variable has been unlocked, the system service process starts the second activity.

24. According to the method described in claim 23, the method further includes: The system service process sets an effective duration during the process of starting the first activity; If the conditional variable is satisfied within the effective duration starting from the moment when the conditional variable is set, the system service process determines that the conditional variable has been unlocked; If the conditional variable is still not satisfied after the effective duration starting from the moment when the conditional variable is set, the system service process unlocks the conditional variable.

25. The method according to any one of claims 20 to 24, characterized in that Before the system service process transfers the first startup window to the second activity, the method further includes: During the process of starting the second activity, when it is determined that there is a source record in the source record set, the system service process sets the second source record corresponding to the second activity and assigns a value to the second source record; the source record is used to represent the previous activity that starts the third activity, and the third activity is any one of the n activities; Add the second source record to the source record set.

26. The method according to claim 25, wherein The assigning a value to the second source record includes: The system service process transfers the first source record to the second source record, where the first source record is the source record corresponding to the first activity. If the transferred value is empty, the system service process uses the activity record of the fourth activity as the value of the second source record, and the fourth activity is the activity currently holding the first startup window.

27. The method according to claim 25 or 26, characterized in that, The system service process transfers the first startup window to the second activity, including: Obtaining the second source record from the source record set; Transferring the first startup window from the first activity to the second activity according to the value of the second source record.

28. The method according to any one of claims 20 to 27, characterized in that, The method further includes: Before submitting the second transition component to the system interface process, when it is determined that the second transition component is another transition component, the system service process cancels the animation effect attribute of the second transition component, and the other transition component refers to an activity other than the first activity among the n activities.

29. The method according to claim 28, wherein The method further includes: During the process of starting the second activity, the system service process determines that the second transition component is the other transition component according to the activity record corresponding to the second activity collected in the second transition component.

30. The method according to any one of claims 20 to 29, characterized in that, After the system service process transfers the first startup window to the second activity, the method further includes: During the process of starting the second activity, if the first activity and the second activity do not belong to the same task stack, the system service process increases the layer level of the first startup window by one layer.

31. The method according to any one of claims 20 to 30, characterized in that, The method further includes: During the process of executing the life cycle of the second activity, the process of the first application determines whether the interface corresponding to the second activity is a visual interface; If the interface corresponding to the second activity is a visual interface, the system service process sets the value of the visual identifier of the second activity to the first value.

32. The method according to any one of claims 20 to 31, characterized in that, The method further includes: After receiving the second completion indication, which is used to indicate that the second activity has completed drawing, the system service process determines whether the delay removal condition is met; If the delay removal condition is met, the system service process delays removing the first startup window; If the delay removal condition is not met, the system service process removes the first startup window.

33. An electronic device, characterized in that, It includes: A processor, a memory, and an interface; The processor, the memory, and the interface cooperate with each other to enable the electronic device to execute the method according to any one of claims 1 to 32.

34. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the processor executes the method according to any one of claims 1 to 32.

Citation Information

Cited By

  • Application launching method and electronic device

    EP4811125A1

  • Application launching method and electronic device

    WO2025138871A1