Application control method, electronic equipment and readable medium
By creating a virtual screen in a foldable electronic device and taking snapshots of applications that are adapted to different screen sizes, the problem of snapshot mismatch when the application is started on the foldable screen device is solved, and the correct display and efficient transition animation are achieved when the application is started.
Patent Information
- Application Number
- CN202311762516.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2043-12-19
AI Technical Summary
In the folded screen scenario of an electronic device, the snapshot obtained when the application enters the background to run does not match the screen expansion or collapse state, resulting in the application being unable to correctly display the application snapshot when the application is started.
By creating a virtual screen corresponding to multiple screen sizes in a foldable electronic device, and controlling the corresponding virtual screens to image drawing when switching between the first screen and the second screen, the screenshots of the application adapted to different screen sizes are captured so that the application is correctly displayed when the application is started.
It enables the application snapshot to correctly match the screen size regardless of the screen status on the folding screen device, thereby ensuring the continuity and efficiency of transition animation and interface display when the application is started.
Smart Images

Figure CN120223797A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of application control, and particularly relates to a method for controlling an application, an electronic device, a computer program product, and a computer-readable storage medium. Background Art
[0002] The electronic device has added a TaskSnapshot function. The TaskSnapshot function means that when an application enters the background, an application snapshot is obtained, and when the application enters the foreground again, the application snapshot is used as the transition animation of the application for display.
[0003] However, in the scenario where the display screen of the electronic device is a foldable screen, when the foldable screen is in the folded state and the application enters the background, the obtained application snapshot is the interface displayed on the folded display screen. When the foldable screen is in the unfolded state and the application enters the foreground through the hot start of the application, the application snapshot does not match the display area of the foldable screen in the unfolded state; similarly, when the foldable screen is in the unfolded state and the application enters the background, the obtained application snapshot is the interface displayed on the unfolded display screen. When the foldable screen is in the folded state and the application enters the foreground through the hot start of the application, the application snapshot also does not match the display area of the foldable screen in the folded state.
[0004] Therefore, in the scenario where the display screen of the electronic device is a foldable screen, there is a problem that the application snapshot cannot be correctly displayed during the application startup process. Summary of the Invention
[0005] The present application provides a method for controlling an application, an electronic device, a computer program product, and a computer-readable storage medium, aiming to avoid the problem that the application snapshot cannot be correctly displayed during the application startup process.
[0006] To achieve the above object, the present application provides the following technical solutions:
[0007] In a first aspect, the present application provides a method for controlling an application applied to a foldable electronic device. The foldable electronic device includes a first screen and a second screen. The first screen corresponds to a first virtual screen, and the second screen corresponds to a second virtual screen. The sizes of the first screen and the second screen are different, the size of the first screen is the same as that of the first virtual screen, and the size of the second screen is the same as that of the second virtual screen. The method includes: displaying a first interface of a first application on the first screen; receiving an operation for exiting the first application input by a user on the first screen; in response to the operation for exiting the first application input by the user on the first screen, controlling image drawing for the first interface on the second virtual screen, and the image drawn on the second virtual screen is used as the first application snapshot of the first application, and the first interface is used as the second application snapshot of the first application.
[0008] In some embodiments, the foldable electronic device is an inward-folding electronic device. The first screen may refer to the foldable display screen, and the second screen refers to the small screen visible to the user in the folded state. The foldable electronic device is an outward-folding electronic device. The first screen may refer to the display screen in the unfolded state, and the second screen refers to a small screen in the folded state.
[0009] It can be seen from the above that after the user inputs an operation to exit the first application on the first screen, the foldable electronic device responds to this operation and controls the image drawing of the first interface on the second virtual screen. The image drawn on the second virtual screen serves as a snapshot of the first application, and the first interface serves as a snapshot of the second application. Since the second virtual screen has the same size as the second screen, the snapshot of the first application is adapted to the second screen. The first interface is the interface of the first screen, and the snapshot of the second application is adapted to the first screen. Based on this, the foldable electronic device obtains an application snapshot adapted to the first screen and an application snapshot adapted to the second screen. In the startup process of the first application, an application snapshot adapted to the first screen or the second screen can be used, and the application snapshot can be correctly displayed in the startup process of the application.
[0010] In a possible implementation manner, after controlling the image drawing of the first interface on the second virtual screen in response to the operation of the user inputting to exit the first application on the first screen, it further includes: receiving the operation of the user inputting to start the first application on the second screen; in response to the operation of the user inputting to start the first application on the second screen, displaying a first transition animation and then displaying the second interface of the first application. The image size in the first transition animation matches the size of the second screen.
[0011] In a possible implementation manner, the first transition animation is generated based on the snapshot of the first application. When the user starts the first application on the second screen, the image size of the first transition animation displayed by the foldable electronic device matches the second screen, ensuring the normal display of the snapshot of the first application.
[0012] In a possible implementation manner, after displaying the first transition animation and then displaying the second interface of the first application, it further includes: determining that the first application is a warm start.
[0013] In a possible implementation manner, it further includes: controlling the image drawing of the second interface on the first virtual screen. When the user starts the first application on the second screen, the second screen is in the active state, and the first virtual screen is then activated. The foldable electronic device controls the image drawing of the second interface on the first virtual screen, which can avoid the problem that the drawing time of the first virtual screen is too long when exiting the first application after the second interface is displayed on the second screen.
[0014] In a possible implementation, after the first interface of the first application is displayed on the first screen, the following steps are further included: receiving an operation for switching the interface input by the user on the first screen; in response to the operation for switching the interface input by the user on the first screen, displaying the third interface of the first application on the first screen, and controlling the image rendering for the third interface on the second virtual screen, so as to avoid the problem that the rendering time of the second virtual screen is too long when the first application exits after the third interface is displayed on the first screen.
[0015] In a possible implementation, determining that the first application is a warm start includes: determining that both the process and the activity of the first application exist.
[0016] In a possible implementation, after controlling the image rendering for the first interface on the second virtual screen in response to the operation for exiting the first application input by the user on the first screen, the following steps are further included: receiving an operation for starting the first application input by the user on the first screen; in response to the operation for starting the first application input by the user on the first screen, displaying a second transition animation and then displaying the fourth interface of the first application, where the second transition animation is generated based on a second application snapshot.
[0017] In the above possible implementation, when the user starts the first application on the first screen, the foldable electronic device can generate a second rotation animation based on the second application snapshot and display the second transition animation. Since the second transition animation is the first interface displayed on the first screen and matches the first screen, the correct display of the application snapshot on the first screen is realized.
[0018] In a possible implementation, the following step is further included: controlling the image rendering for the fourth interface on the second virtual screen.
[0019] In a second aspect, the present application provides an electronic device, including: one or more processors, a memory, and a foldable display screen; the foldable display screen includes: a first screen and a second screen, the first screen corresponds to a first virtual screen, the second screen corresponds to a second virtual screen, the sizes of the first screen and the second screen are different, the sizes of the first screen and the first virtual screen are the same, and the sizes of the second screen and the second virtual screen are the same; the memory and the foldable display screen are coupled to the one or more processors, and the memory is used to store a computer program, the computer program includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the application control method provided in any item of the first aspect.
[0020] In a third aspect, the present application provides a computer-readable storage medium for storing a computer program, which is specifically used to implement the application control method provided in any item of the first aspect when executed.
[0021] Fourthly, the present application provides a computer program product, which, when running on a computer, enables the computer to execute the control method of the application provided in any item of the first aspect. Description of the Drawings
[0022] Figure 1 It is a display diagram of an application snapshot and a transition animation provided in the related art;
[0023] Figure 2 It is a flowchart of a method for intercepting an application snapshot provided in an embodiment of the present application;
[0024] Figure 3 It is a flowchart of a method for hot starting an application provided in an embodiment of the present application;
[0025] Figure 4 It is a display diagram of an application snapshot and a transition animation provided in an embodiment of the present application;
[0026] Figure 5 It is a hardware structure diagram of an electronic device provided in an embodiment of the present application;
[0027] Figure 6 It is a software structure diagram of an electronic device provided in an embodiment of the present application. Detailed Embodiments
[0028] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the specification and the appended claims of the present application, the singular forms "a", "an", "the", "above", "said", "this" are also intended to include the expressions such as "one or more", unless there is a clear opposite indication in the context.
[0029] Reference to "some embodiments" etc. described in this specification means that specific features, structures or characteristics described in conjunction with the embodiment are included in one or more embodiments of the present application. Thus, the statements "in some embodiments", "in other embodiments" etc. that appear in different places in this specification 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.
[0030] In the embodiments of the present application, "multiple" refers to two or more. It should be noted that in the description of the embodiments of the present application, terms such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0031] During the operation of an application on an electronic device for a period of time, it can be divided into five stages: foreground, background, compression, swap out, and swap in (hot start).
[0032] Taking Application A as an example, in the foreground stage: the user opens Application A, and Application A starts its process. In the background stage: after the user uses Application A for a period of time, if the user wants to use other applications, such as Application B. The user will open Application B, and at this time, Application A switches from running in the foreground to running in the background. In the compression stage: if the user opens other applications again, occupying more memory, the memory pressure of the electronic device increases at this time. When the proportion of the total memory space occupied exceeds a preset threshold A, the electronic device compresses the data of the application programs that are not in the foreground in the memory. In the swap out stage: if the user continues to open other new applications, occupying more memory, the memory pressure continues to increase. When the proportion of the compressed memory space occupied also exceeds a preset threshold B, the electronic device can swap out some data in the compressed memory space of the memory to the swap partition of the storage device. In the swap in stage (also known as hot start): if the user wants to use Application A again at this time, the user actively switches Application A to the foreground.
[0033] In order to improve the startup time of hot-start applications, the electronic device has added a Task Snapshot function. The Task Snapshot function means that when an application enters the background operation, an application snapshot is obtained, and when the application enters the foreground operation again, the application snapshot is displayed as the transition animation of the application.
[0034] Then, when a foldable electronic device uses the Task Snapshot function to hot-start an application, the inventor found that the foldable electronic device has a problem that the application snapshot cannot be correctly displayed.
[0035] Taking a foldable screen mobile phone that folds outwards as an example, Figure 1 In (a), it shows that the foldable screen mobile phone is in the folded state, displaying the interface of a certain instant messaging application. At this time, the user controls the application to enter the background operation, and the mobile phone will first obtain the application interface before the application enters the background operation, that is, the application snapshot, and this application snapshot is Figure 1 as shown in (a). The foldable screen mobile phone switches from the folded state to the unfolded state, and the user controls the application to enter the foreground operation again through the multi-task management interface or by clicking on the application icon. The application is started in the hot-start mode, and the foldable screen mobile phone uses Figure 1The application snapshot shown in (a) generates a transition animation, and the transition animation is displayed on the unfolded display screen, and the display effect is as shown in Figure 1 shown in (b) of the figure.
[0036] It can be seen that the application snapshot obtained by the folded-screen mobile phone in the folded state is not adapted to the unfolded display screen. During the process of the mobile phone generating a transition animation using the application snapshot, it will be determined that the application snapshot is invalid or missing. In this regard, in the related art, the folded-screen mobile phone can generate a transition animation in the following two ways.
[0037] 1. The folded-screen mobile phone uses the built-in image of the application (Splashscreen, usually used for the cold start of the application) to generate a transition animation and display the transition animation, and the display effect is as shown in Figure 1 shown in (c) of the figure. However, when the folded-screen mobile phone uses the built-in image of the application to generate a transition animation, there is a problem of discontinuous display. The folded-screen mobile phone first displays Figure 1 the interface shown in (c) of the figure, and then displays the first interface of the application, causing the user to feel a display jump.
[0038] 2. The folded-screen mobile phone waits for the first interface of the application to be drawn, and uses the first interface to generate a transition animation and display the transition animation. However, when the folded-screen mobile phone uses the first interface to generate a transition animation and display the transition animation, it will cause the start time of the transition animation to be delayed, and the startup time of the application will increase slightly. After the user clicks on the application icon, the folded-screen mobile phone responds slowly.
[0039] Based on this, the embodiment of the present application provides a control method for an application. The control method of the application can be divided into the link of intercepting the application snapshot during the startup, running, and exiting processes of the application, and the link of displaying the transition animation during the hot start of the application. The control method of the application provided by the embodiment of the present application can be applied to electronic devices with foldable display screens such as folded-screen mobile phones. The foldable electronic device can be an electronic device that folds outwards or an electronic device that folds inwards according to the folding direction. Usually, an electronic device that folds outwards includes a display screen that can be folded outwards, and the display screen can be folded into at least two small screens, and the sizes of the two small screens are usually the same. According to the different forms of the display screen, the electronic device that folds outwards can include a large display screen and two small screens. An electronic device that folds inwards also includes a display screen that can be folded inwards, and the display screen can be folded into at least two small screens. In some embodiments, the electronic device that folds inwards also includes a small screen, and the small screen is visible to the user when the electronic device is in the folded state. According to the different forms of the display screen, the electronic device that folds inwards can include a large display screen and a small screen that is visible to the user in the folded state.
[0040] In the following embodiments, a folded-screen mobile phone is taken as an example for introduction.
[0041] The following is combined with Figure 2, an introduction to the method for capturing application snapshots provided by the embodiments of the present application is given.
[0042] As Figure 2 shown, the method for capturing application snapshots includes the steps:
[0043] S201. Create virtual screens corresponding to multiple screen sizes, with one virtual screen corresponding to one screen size.
[0044] The display screen of a foldable screen mobile phone can be folded, so this display screen can have at least two sizes, including the size in the folded state and the size in the unfolded state. After the foldable screen mobile phone is started, for each screen size, a corresponding virtual screen can be created respectively. It can be known that the size of the virtual screen is the same as the screen size of the foldable screen mobile phone. That is, the foldable screen mobile phone creates multiple virtual screens, and one virtual screen corresponds to one screen size of the foldable screen. After the foldable screen mobile phone is shut down, the virtual screens will be destroyed synchronously.
[0045] The virtual screen can be understood as a display screen that does not exist physically and is not visible to the user, but the image displayed on the virtual screen can be drawn.
[0046] In some embodiments, creating a virtual screen by the foldable screen mobile phone means that the foldable screen mobile phone configures a part of the storage space of the memory to save the image drawn on the virtual screen.
[0047] In some embodiments, the application framework of the operating system of the foldable screen mobile phone includes a screen management service (DisplayManagerService, DMS). When the foldable screen mobile phone is powered on and started, the DMS follows to start. During the startup process of the DMS, virtual screens corresponding to multiple screen sizes will be created.
[0048] In the embodiments of the present application, taking the foldable screen mobile phone including a screen with a first screen size and a screen with a second screen size as an example for illustration, in the following content, the screen with the first screen size is simply referred to as the first screen, and the screen with the second screen size is simply referred to as the second screen.
[0049] S202. When the first screen enters the active state, activate the virtual screen corresponding to the second screen.
[0050] After the foldable screen mobile phone finishes powering on, the first screen of the foldable screen mobile phone is lit and enters the active state. Correspondingly, the foldable screen mobile phone activates the virtual screen corresponding to the second screen.
[0051] When the foldable mobile phone is powered on in the folded state, after the power-on is completed, the display screen with the folded-state size is the first screen, which is lit up and enters the active state, and the display screen with the unfolded-state size is the second screen, and its corresponding virtual screen is activated; similarly, when the foldable mobile phone is powered on in the unfolded state, after the power-on is completed, the display screen with the unfolded-state size is the first screen, which is lit up and enters the active state, and the display screen with the folded-state size is the second screen, and its corresponding virtual screen is activated.
[0052] In some embodiments, when the first screen enters the active state, the DMS activates the virtual screen corresponding to the second screen. The DMS can also monitor the state switching between the folded state and the unfolded state of the foldable mobile phone. When the screen size changes due to the state switching, the DMS switches the virtual screen in the opposite direction of the change to ensure that the virtual screen to be activated has a different size from the screen entering the active state. That is: when the display screen in the folded state enters the active state, the DMS activates the virtual screen corresponding to the size of the display screen in the unfolded state; similarly, when the display screen in the unfolded state enters the active state, the DMS activates the virtual screen corresponding to the size of the display screen in the folded state.
[0053] S203. When an interface switch occurs on the first screen, control the virtual screen corresponding to the second screen to perform image rendering for the switched interface.
[0054] When an interface switch occurs on the first screen, for the switched interface, after its Activity resumes, the first screen performs image frame rendering. After the first screen completes the image rendering, it triggers the image rendering of the virtual screen corresponding to the second screen.
[0055] In some embodiments, during the operation of the foldable mobile phone, following the user's operation on the application, the foldable mobile phone can display different interfaces on the first screen. When the first interface on the first screen is switched to the second interface, the foldable mobile phone can control the virtual screen corresponding to the second screen to perform image rendering of the second interface, that is, trigger the virtual screen corresponding to the second screen to render the second interface. The interface of the first application consists of activities, and an activity consists of views, and a view is the existence form of a window, and a window is the carrier of a view.
[0056] An interface switch on the first screen generally refers to: the first screen switches from the first interface of the application to the second interface.
[0057] In some other embodiments, after the foldable mobile phone is powered on and the first screen enters the active state, it can enter the interface startup process of the first screen. During the interface startup process of the first screen, the first screen completes the first-frame rendering. Since the first-frame rendering includes the interface layout, therefore, after the first screen completes the first-frame operation, that is, after displaying the first interface, it also triggers the first-frame rendering of the virtual screen corresponding to the second screen.
[0058] In some embodiments, the application framework of the operating system of a foldable screen mobile phone includes a Window Manager Service (WMS) and a View System. The Window Manager Service is generally used to manage windows, and the View System constructs the basic components of an application. The Window Manager Service can create windows on the virtual screens corresponding to the first screen and the second screen to support the View System in refreshing the interfaces of the windows on the virtual screens corresponding to the first screen and the second screen, that is, performing image rendering on the windows on the virtual screens corresponding to the first screen and the second screen. It should be noted that when an interface switch occurs on the first screen, refreshing the layout is required for rendering the switched interface, which takes a long time. To avoid excessive time consumption for rendering on the virtual screen when exiting the first application after an interface switch occurs on the first screen, after an interface switch occurs on the first screen, control is performed to render the image of the switched interface on the virtual screen corresponding to the second screen.
[0059] S204. When it is detected that the first application exits, control is performed to render the image of the interface when the first application exits on the virtual screen corresponding to the second screen, and a snapshot of the image rendered on the virtual screen corresponding to the second screen is intercepted.
[0060] The first application refers to an application that is in the foreground stage and whose interface is displayed on the first screen.
[0061] When the first application exits, to support the hot start of the first application, the foldable screen mobile phone intercepts the interface displayed on the first screen when the first application exits as the first application snapshot. This first application snapshot is used to generate a transition animation when the foldable screen mobile phone hot-starts the first application when the first screen is in the active state. Moreover, when the foldable screen mobile phone detects that the first application exits, it first controls the virtual screen to render the image of the interface when the first application exits, and then intercepts the image rendered on the virtual screen as the second application snapshot. This second application snapshot is used to generate a transition animation when the foldable screen hot-starts the first application when the second screen is in the active state. In this way, whether the first application is hot-started on the foldable screen mobile phone when the first screen is in the active state or when the second screen is in the active state, an application snapshot that matches the size of the active display screen can be used to generate a transition animation.
[0062] In some embodiments, when it is detected that the first application exits, the View System controls the virtual screen corresponding to the second screen to render the image of the interface when the first application exits. After the View System finishes rendering the image on the virtual screen corresponding to the second screen, the Window Manager Service intercepts the interface displayed on the virtual screen corresponding to the second screen. Moreover, the Window Manager Service also intercepts the interface displayed on the first screen when the first application exits.
[0063] The following Figure 3 introduces the method for hot-starting an application provided by the embodiments of the present application.
[0064] An embodiment of the present application provides a method for hot-starting an application, as Figure 3 shown, including the steps:
[0065] S301. Receive a start operation of a first application.
[0066] The user starts the first application by clicking on the icon of the first application or through the multitasking management interface, and the folding screen mobile phone receives the operation of starting the first application input by the user to know that the user needs to start the first application.
[0067] S302. In response to the start operation of the first application, determine whether the first application is a hot start.
[0068] In some embodiments, the window management service proposed by the foregoing content determines whether the first application is a hot start in response to the start operation of the first application.
[0069] If it is determined that the first application is a hot start, then steps S303 to S305 are executed. If it is determined that the first application is not a hot start, this process can be exited. Usually, if the first application is not a hot start, it belongs to a cold start, and a transition animation can be generated based on the built-in image of the application and the transition animation can be displayed until the first frame interface of the first application is drawn.
[0070] In some embodiments, a hot start means that after exiting the first application, restarting the first application, when starting, the first application process exists and the Activity still exists in memory. Based on this, the folding screen mobile phone can determine that the process of the first application has been started and is in a running state, and the Activity of the first application exists in memory, then it is determined that the first application is a hot start, otherwise, the first application is not a hot start.
[0071] S303. Determine that the screen in the active state is the second screen.
[0072] In some embodiments, based on the detection data of the sensors of the folding screen mobile phone, the posture of the folding screen mobile phone can be determined, and based on the posture of the folding screen mobile phone, it can be further known whether the screen in the active state is the second screen.
[0073] In some other embodiments, following the adjustment of the posture of the folding screen mobile phone, that is, the folding screen mobile phone is switched from the folded state to the unfolded state, or from the unfolded state to the folded state, the window management service can record the screen of the folding screen mobile phone in the active state. Based on this, after the folding screen mobile phone determines that the first application is a hot start, it searches for the content recorded by the window management service to determine whether the screen in the active state is the second screen.
[0074] In some embodiments, the window management service determines whether the screen in the active state is the second screen.
[0075] If the screen determined to be in the active state of the foldable screen mobile phone is not the second screen, that is, the first screen, then select the application snapshot of the first screen, generate a transition animation based on the application snapshot of the first screen, display the transition animation until the first interface of the first application is drawn, and switch the display of the transition animation to display the first interface of the first application.
[0076] It should also be noted that when the foldable screen mobile phone determines that the second screen is in the active state, the virtual screen corresponding to the first screen can also be activated. For the method of activating the virtual screen corresponding to the first screen by the foldable screen mobile phone, reference can be made to the content of step S202 in the foregoing embodiment.
[0077] S304. Select the application snapshot of the virtual screen corresponding to the second screen, and generate a transition animation based on the application snapshot.
[0078] If the foldable screen mobile phone determines that the first application is a warm start and the display screen determined to be in the active state is the second screen, then select the application snapshot of the virtual screen corresponding to the second screen, and generate a transition animation based on the application snapshot, which can achieve the size matching between the application snapshot and the screen for displaying the transition animation.
[0079] In some embodiments, the window management service can select the application snapshot of the virtual screen corresponding to the second screen and generate a transition animation based on the application snapshot. Moreover, the window management service can generate a transition animation based on the application snapshot by using conventional techniques, and this application does not make any limitations in this regard.
[0080] S305. Display the transition animation.
[0081] Exemplarily, Figure 4 (a) in the figure shows that the foldable screen mobile phone is in the folded state, and the foldable screen (i.e., the first screen) displays the interface of a certain instant messaging application. At this time, the user controls the application to enter the background operation, and the foldable screen mobile phone obtains the application interface before the application enters the background operation, that is, the application snapshot, and the application snapshot is as shown in Figure 4 (a) in the figure. When the user controls the application to enter the background operation, the foldable screen mobile phone also uses the method provided by Figure 2 to obtain the application snapshot of the virtual screen corresponding to the unfolded state screen (i.e., the virtual screen corresponding to the second screen).
[0082] The foldable screen mobile phone switches from the folded state to the unfolded state, and the user controls the instant messaging application to enter the foreground operation again. The application is started in the warm start mode. The foldable screen mobile phone generates a transition animation with the application snapshot of the virtual screen corresponding to the unfolded state screen. Since the application snapshot of the virtual screen corresponding to the unfolded state screen matches the size of the unfolded state screen, the display effect of the transition animation generated with the application snapshot of the virtual screen corresponding to the unfolded state screen is as shown in Figure 4 (b) in the figure.
[0083] S306. In response to the startup operation of the first application, start the first application and draw the initial interface of the first application.
[0084] After the user starts the first application, in addition to performing steps S302 to S305, the foldable mobile phone can also perform steps S306 to S307 in parallel.
[0085] In some embodiments, the first application is hot-started, and the interface content of its initial interface is the same as the interface content of the interface when the first application exits.
[0086] It should be noted that after the initial interface of the first application is drawn, the foldable mobile phone can also trigger the drawing of the initial interface on the virtual screen corresponding to the first screen.
[0087] S307. After the initial interface of the first application is drawn, switch the display transition animation to display the initial interface of the first application.
[0088] During the drawing process of the initial interface of the first application, the foldable mobile phone generates a transition animation and displays the transition animation. After the initial interface of the first application is drawn and the transition animation is played, switch the display of the transition animation to display the initial interface of the first application.
[0089] In the embodiments of the present application, when the foldable mobile phone hot-starts the first application with the second screen in the active state, a transition animation is generated from the application snapshot of the virtual screen corresponding to the second screen, which can ensure the display continuity of the transition animation and the initial interface. Moreover, since there is no need to wait for the initial interface to generate the transition animation, the hot-start response time can also be optimized, avoiding the problem of too long hot-start of the foldable mobile phone.
[0090] The foldable electronic device in the above embodiments of the present application can also be an electronic device such as a tablet computer, a personal digital assistant (PDA), a desktop computer, a laptop computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, and a wearable device.
[0091] Taking the foldable mobile phone as an example, Figure 5 This is a composition example of an electronic device provided by the embodiments of the present application. As Figure 5 shown, the electronic device 100 may include a processor 110, an internal memory 120, a camera 130, a display screen 140, and a sensor module 150, etc.
[0092] It should be understood that for the convenience of understanding the embodiments of the present application, Figure 5The illustrated electronic device 100 only includes some components related to the method for intercepting an application snapshot and the method for hot starting an application provided by the embodiments of the present application. The electronic device provided by the embodiments of the present application may include more or fewer components than Figure 5 the illustrated electronic device 100. That is to say, Figure 5 the illustrated electronic device 100 does not constitute a specific limitation on the electronic device provided by the embodiments of the present application.
[0093] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a graphics processing unit (GPU), an image signal processor (ISP), and a video codec. A memory may also be provided in the processor 110 for storing instructions and data.
[0094] The internal memory 120 may be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 120. In some embodiments, the instructions stored in the internal memory 120 are for executing the method for intercepting an application snapshot and the method for hot starting an application. The processor 110 may intercept an application snapshot when an application exits and hot start the application by executing the instructions stored in the internal memory 120.
[0095] The electronic device 100 may implement a shooting function through an ISP, a camera 130, a video codec, a GPU, a display screen 140, an application processor, etc. The electronic device 100 implements a display function through a GPU, a display screen 140, an application processor, etc.
[0096] In the sensor module 150, the pressure sensor 150A is used to sense a pressure signal and can convert the pressure signal into an electrical signal. The touch sensor 150B is also called a "touch control device". The touch sensor 150B may be disposed on the display screen 140, and the touch sensor 150B and the display screen 140 form a touch screen, also called a "touch control screen". The touch sensor 150B is used to detect a touch operation acting thereon or nearby. The touch sensor may transmit the detected touch operation to the application processor to determine the type of touch event.
[0097] In addition, an operating system runs on the above components. The operating system of the electronic device 100 may adopt a layered architecture. Taking the Android system with a layered architecture as an example in the embodiments of the present application, the software structure of the electronic device 100 is exemplarily described.
[0098] Figure 6 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
[0099] The layered architecture divides 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 layer, the Android runtime, and the system library, and the kernel layer.
[0100] The application layer may include a series of application packages. Such as Figure 6 shown, the application packages may be application programs such as instant messaging applications and video applications.
[0101] 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. Such as Figure 3 shown, the application framework layer may include a view system, a WindowManagerService (WMS), and a DisplayManagerService (DMS), etc. Among them, the functions of the view system, the window management service, and the screen management service can be seen in the above-mentioned embodiment content, which will not be elaborated here.
[0102] Android Runtime includes a core library and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.
[0103] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0104] Another embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When it runs on a computer or a processor, the computer or the processor is caused to execute one or more steps in any of the above methods.
[0105] The computer-readable storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0106] Another embodiment of the present application further provides a computer program product including instructions. When the computer program product runs on a computer or a processor, it causes the computer or the processor to execute one or more steps in any of the above methods.
Claims
1. A control method for an application, characterized in that, Applied to a foldable electronic device, the foldable electronic device includes a first screen and a second screen. The first screen corresponds to a first virtual screen, and the second screen corresponds to a second virtual screen. The sizes of the first screen and the second screen are different. The size of the first screen is the same as that of the first virtual screen, and the size of the second screen is the same as that of the second virtual screen. The method includes: Display a first interface of a first application on the first screen; Receive an operation input by the user on the first screen to exit the first application; In response to the operation input by the user on the first screen to exit the first application, control image drawing for the first interface on the second virtual screen. The image drawn on the second virtual screen serves as a first application snapshot of the first application, and the first interface serves as a second application snapshot of the first application.
2. The control method of the application according to claim 1, characterized in that, After the control of image drawing for the first interface on the second virtual screen in response to the operation input by the user on the first screen to exit the first application, it further includes: Receive an operation input by the user on the second screen to start the first application; In response to the operation input by the user on the second screen to start the first application, display a first transition animation and then display a second interface of the first application. The image size in the first transition animation matches the size of the second screen.
3. The control method of the application according to claim 2, wherein The first transition animation is generated based on the first application snapshot.
4. The control method of the application according to claim 3, characterized in that, The step of displaying a second interface of the first application after displaying the first transition animation further includes: Determine that the first application is a warm start.
5. The control method of the application according to claim 2, wherein It further includes: Control image drawing for the second interface on the first virtual screen.
6. The control method of the application according to any one of claims 1 to 5, characterized in that, After displaying a first interface of a first application on the first screen, it further includes: Receive an operation input by the user on the first screen to switch the interface; In response to the operation input by the user on the first screen to switch the interface, display a third interface of the first application on the first screen and control image drawing for the third interface on the second virtual screen.
7. The control method of the application according to claim 4, characterized in that, The determination that the first application is a warm start includes: determining that both the process and the activity of the first application exist.
8. The control method of the application according to claim 1, characterized in that, After the control of image drawing for the first interface on the second virtual screen in response to the operation input by the user on the first screen to exit the first application, it further includes: Receive an operation input by the user on the first screen to start the first application; In response to the operation input by the user on the first screen to start the first application, display a second transition animation and then display a fourth interface of the first application. The second transition animation is generated based on the second application snapshot.
9. The control method of the application according to claim 8, characterized in that, It further includes: Control image drawing for the fourth interface on the second virtual screen.
10. A foldable electronic device, characterized in that, It includes: One or more processors, a memory, and a foldable display screen; The foldable display screen includes: a first screen and a second screen. The first screen corresponds to a first virtual screen, and the second screen corresponds to a second virtual screen. The sizes of the first screen and the second screen are different. The size of the first screen is the same as that of the first virtual screen, and the size of the second screen is the same as that of the second virtual screen; The memory and the foldable display screen are coupled to the one or more processors. The memory is used to store a computer program, and the computer program includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the control method of the application described in any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that, For storing a computer program, when the computer program is executed, it is specifically used to implement the control method of the application described in any one of claims 1 to 9.
Citation Information
Patent Citations
Display method applied to electronic equipment with folding screen and electronic equipment
CN111124561A
Method for displaying application and electronic equipment
CN111949345A
Display control method and device, storage medium and electronic equipment
CN112269555A
Screen refresh rate adjusting method, electronic equipment and readable storage medium
CN114495864A
Snapshot processing method and device
CN116149531A