Animation display method, electronic device and computer-readable storage medium
By monitoring and blocking the garbage collection thread during desktop animations, the stuttering issue when electronic devices play desktop animations was resolved, resulting in smoother animation display and improved user experience.
Patent Information
- Application Number
- PCT/CN2026/082117
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-08
- Filing Date
- 2026-03-09
- Publication Date
- 2026-11-12
AI Technical Summary
Electronic devices are prone to stuttering when playing desktop animations, which affects the user experience.
During desktop animation execution, the garbage collection thread is monitored and blocked. By increasing the priority of the GC thread and resuming its execution after the animation ends, the garbage collection operation avoids blocking the main thread.
It improves the smoothness of desktop animations, reduces frame drops and stuttering, and enhances the user experience.
Smart Images

Figure CN2026082117_12112026_PF_FP_ABST
Abstract
Description
Animation display methods, electronic devices and computer-readable storage media
[0001] This application claims priority to Chinese Patent Application No. 202510592871.5, filed on May 8, 2025, entitled "Method for Displaying Motion Effects, Electronic Device and Computer-Readable Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of terminal technology, and in particular to motion display methods, electronic devices, and computer-readable storage media. Background Technology
[0003] The desktop is a crucial user interface for interaction between electronic devices and users. It not only provides quick access to applications but also displays frequently used information. When the desktop content changes or the desktop switches between the foreground and background, electronic devices often use animations to achieve a smooth visual transition. Sometimes, however, these animations can stutter, negatively impacting the user experience. Summary of the Invention
[0004] This application provides a motion effect display method, an electronic device, and a computer-readable storage medium, which can improve the smoothness of desktop motion effects played by electronic devices and reduce frame drops and stuttering.
[0005] In a first aspect, embodiments of this application provide a dynamic effect display method, which is applied to an electronic device running a desktop launcher. The method includes: the electronic device receiving a first user operation; in response to the first user operation, the electronic device executing a first desktop dynamic effect, the first desktop dynamic effect being used to display one of the following processes: the process of entering the desktop, the process of exiting the desktop, and the process of changing the displayed content of the desktop, the desktop being provided by the desktop launcher; wherein, during the execution of the first desktop dynamic effect, the electronic device monitors the garbage collection operation of the garbage collection (GC) thread of the desktop launcher, and when the garbage collection operation of the GC thread is triggered, the electronic device blocks the execution of the GC thread, the garbage collection operation being used to release part of the memory resources occupied by the desktop launcher.
[0006] Referring to the embodiment shown in Figure 9, during the execution of animation effects on the electronic device, when a garbage collection operation is triggered, the electronic device will block the garbage collection thread, causing the garbage collection thread to enter a sleep state. This ensures that no garbage collection operation will block the main thread from processing the first desktop animation effect during its execution, thereby ensuring that the electronic device can execute the first desktop animation effect more smoothly, reducing lag and improving the user experience.
[0007] In conjunction with the first aspect, in some embodiments, the electronic device monitors the garbage collection operation of the GC thread of the desktop launcher during the execution of the first desktop animation, specifically including: the electronic device monitors the garbage collection operation of the GC thread through the desktop launcher during the execution of the first desktop animation.
[0008] In conjunction with the first aspect, in some embodiments, the electronic device blocks the execution of the GC thread, specifically including: the electronic device blocks the execution of the GC thread through a desktop launcher.
[0009] In other words, the code used to monitor garbage collection operations and to block the execution of the GC thread can reside in the desktop launcher. Electronic devices can then run this code within the launcher to achieve the aforementioned functionality. This allows developers to achieve smooth desktop animations without modifying the internal virtual machine code of the electronic device, thus reducing development complexity.
[0010] In conjunction with the first aspect, in some embodiments, the method further includes: when the first desktop animation finishes execution, the electronic device resumes the operation of the GC thread.
[0011] In other words, electronic devices can resume the GC thread after the desktop animation finishes, so that the GC thread can continue to perform GC operations, avoiding the desktop launcher being unable to release unused memory resources due to the GC operations being blocked for a long time, thus affecting the normal operation of the desktop launcher.
[0012] In conjunction with the first aspect, in some embodiments, the method further includes: when the electronic device determines that the blocking duration of the GC thread exceeds a first duration, the electronic device resumes the operation of the GC thread.
[0013] In conjunction with the first aspect, in some embodiments, the first duration is longer than the execution duration of the first desktop animation.
[0014] This prevents the desktop launcher from blocking the GC thread for an extended period after the first desktop animation ends, thus avoiding the GC thread malfunctioning and affecting the normal operation of the desktop launcher.
[0015] In conjunction with the first aspect, in some embodiments, after the electronic device executes the first desktop animation, the method further includes: the electronic device stopping monitoring the garbage collection operation of the GC thread.
[0016] After the first desktop animation ends, the electronic device does not need to continue monitoring the GC operation of the GC thread. The electronic device can stop monitoring in time to reduce the occupation of computing resources.
[0017] In conjunction with the first aspect, in some embodiments, after the electronic device receives the first user operation, the method further includes: the electronic device increasing the priority of the GC thread, wherein the higher the priority of the GC thread, the lower the probability of the garbage collection operation being blocked.
[0018] Referring to the embodiment shown in Figure 7, the electronic device can increase the priority of the GC thread. This reduces the probability of the GC thread being blocked if GC operations are already in progress when the first desktop animation is triggered. The electronic device 100 can then complete the GC operation more quickly, thereby reducing the probability of the GC operation blocking the main thread from processing the first desktop animation, preventing stuttering when the electronic device executes the animation, and improving the user experience.
[0019] In conjunction with the first aspect, in some embodiments, after the electronic device executes the first desktop animation, the method further includes: the electronic device canceling the increase of the priority of the GC thread.
[0020] This prevents the GC thread from being at a high priority for an extended period, which could cause other threads to malfunction and affect the normal operation of the desktop launcher.
[0021] In conjunction with the first aspect, in some embodiments, the first user operation includes one of the following: entering the desktop, exiting the desktop, or changing the displayed content of the desktop; entering the desktop includes one of the following: powering on the electronic device, unlocking the electronic device, running the first application in the background, or exiting the first application; exiting the desktop includes: launching the first application from the desktop; changing the displayed content of the desktop includes one of the following: swiping on the desktop or dragging an icon on the desktop; wherein, the first application is an application other than the desktop launcher in the electronic device.
[0022] In a second aspect, embodiments of this application provide an electronic device, which includes a memory and a processor coupled to the memory; the memory stores a computer program, and when the processor executes the computer program, the electronic device implements the method described in any one of the first aspects.
[0023] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program or computer instructions, which are executed by a processor to implement the method described in any of the first aspects above.
[0024] Fourthly, embodiments of this application provide a computer program product, which, when executed by a processor, implements the method described in any of the first aspects above.
[0025] Fifthly, embodiments of this application provide a chip including a processor and a memory, wherein the memory is used to store computer programs or computer instructions, and the processor is used to execute the computer programs or computer instructions stored in the memory, causing the chip to perform the method described in any of the first aspects above.
[0026] The solutions provided in the second to fifth aspects above are used to implement or cooperate with the methods provided in the first aspect above, and therefore can achieve the same or corresponding beneficial effects as the methods in the first aspect, which will not be elaborated here. Attached Figure Description
[0027] Figures 1A-1D are schematic diagrams of scenarios where an electronic device performs desktop animations according to embodiments of this application;
[0028] Figures 2A and 2B are schematic diagrams illustrating the stuttering during desktop animation execution on the electronic device provided in the embodiments of this application;
[0029] Figure 3 is a schematic diagram of the hardware structure of the electronic device 100 provided in an embodiment of this application;
[0030] Figure 4 is a software structure block diagram of the electronic device provided in an embodiment of this application;
[0031] Figure 5 is a schematic diagram of the software modules included in the desktop launcher provided in the embodiment of this application;
[0032] Figure 6 is a flowchart of a method for setting the GC thread priority in a desktop launcher according to an embodiment of this application;
[0033] Figure 7 is a schematic diagram of the desktop animation processing optimization effect after implementing the method shown in Figure 6 according to the embodiment of this application;
[0034] Figure 8 is a flowchart of a method for suppressing GC operations in a desktop launcher according to an embodiment of this application.
[0035] Figure 9 is a schematic diagram of the desktop animation processing optimization effect after implementing the method shown in Figure 8 according to the embodiment of this application;
[0036] Figure 10 is a flowchart illustrating the motion effect display method provided in an embodiment of this application.
[0037] Figure 11 is a schematic diagram of the structure of a device provided in an embodiment of this application;
[0038] Figure 12 is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation
[0039] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.
[0040] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0041] The desktop is the initial user interface for interaction between an electronic device and the user. When an electronic device is powered on, unlocked, exited, or when an application's interface is switched from the foreground to the background, the desktop is typically displayed. The desktop can provide users with quick access to applications or one or more functions of an application. Furthermore, the desktop can display frequently used information such as calendars, weather, clocks, and fitness data. To achieve a smooth visual transition and avoid abrupt changes in the user interface, when the content displayed on the desktop changes or when the desktop switches between the foreground and background, the electronic device can display a series of image frames to represent the change in the user interface. This series of image frames can be called animation effects, or motion effects.
[0042] Figures 1A-1D are schematic diagrams of the scene of the electronic device performing desktop animations provided in the embodiments of this application.
[0043] As shown in Figure 1A, the electronic device 100 displays a desktop 101, which may include a status bar 102, an icon page 103, and a menu bar 104. The desktop 101 shown in Figure 1A may also be referred to as the home screen interface.
[0044] The status bar 102 may include a mobile communication signal strength indicator, a Wi-Fi signal strength indicator, a battery status indicator, and the current time. The weather indicator may display weather and temperature information for the location of the electronic device 100.
[0045] Icon page 103 can be used to display icons, service cards, frequently used user information, etc. As shown in Figure 1A, icon page 103 may include a clock (“8:08”), date (“Sunday, September 26”), weather indicator, and icons for multiple applications. These application icons may include, for example, memo icons, calendar icons, lifestyle service icons, online chat application icons, weather icons, shopping mall icons, gallery icons, fitness and health icons, etc. These icons are used to quickly launch or access applications. For example, when electronic device 100 receives a click operation from a user on the online chat application icon, electronic device 100 can launch the online chat application and display its user interface in the foreground, while simultaneously switching desktop 101 to the background. The foreground display refers to showing the user interface on the screen. After electronic device 100 switches desktop 101 to the background, desktop 101 is not displayed on the screen, and the user cannot directly view or operate desktop 101, but the application providing desktop 101 (desktop launcher) still runs within the internal system of electronic device 100.
[0046] The menu bar 104 can display several commonly used icons, such as the voice call icon, SMS icon, contact icon, and browser icon. These icons can be used to access the corresponding functions.
[0047] The electronic device 100 can receive a user's swipe-left operation on the icon page 103. In response to this operation, the electronic device 100 can change the displayed content of the area where the icon page 103 is located. Specifically, the electronic device 100 can use animation effects to represent the process of the desktop 101 changing its displayed content. As shown in Figures 1B-1D, the electronic device 100 can sequentially display multiple image frames at a preset frame rate. In these multiple image frames, the icon page 103 gradually shifts to the left, and during this shift, the display area of the icon page 103 on the screen gradually decreases until it moves out of the display area. In the multiple image frames, a new icon page 105 gradually shifts from the right side of the display area to the left, and during this shift, the display area of the icon page 105 on the screen gradually increases until it completely occupies the area where the icon page 103 is located as shown in Figure 1A. The final content displayed on the screen after the desktop animation effect is completed is shown in Figure 1D. It should be noted that Figures 1B and 1C only show a portion of the image frames during the execution of the desktop animation effect by the electronic device; the desktop animation effect can include more image frames when the electronic device executes the desktop animation effect.
[0048] Figures 1A-1D are merely examples of desktop animations executed by an electronic device. Desktop animations can include many more triggering methods. For example, when the electronic device 100 receives an operation from the user on an application icon, it will execute an animation to switch the desktop from the foreground to the background and then bring the application's user interface to the foreground. When the electronic device 100 unlocks from the lock screen, it will execute an animation to enter the desktop. When the electronic device 100 puts an application in the background or closes the application, it will execute an animation to close the application's user interface and bring the desktop to the foreground, etc. This application embodiment does not limit the ways in which animations can be triggered on the desktop. It is not limited to the interface translation animations shown in Figures 1A-1D; desktop animations can include many more types, such as push animations, rotation animations, flip animations, etc. This application embodiment also does not limit the types of desktop animations.
[0049] The desktop launcher in electronic device 100 is responsible for managing the desktop, including drawing the desktop and its animations, managing the desktop layout, and processing user actions on the desktop. For example, when a user action (such as a click) is applied to the desktop, the desktop launcher process can process the event generated by the user action to determine whether the user event triggers an animation. The desktop launcher runs when electronic device 100 starts up.
[0050] A process is the basic unit for resource allocation and scheduling in an operating system. Running a desktop launcher on an electronic device 100 means running the desktop launcher process. A process can contain one or more threads, each thread being an execution flow within the process and a unit of actual operation. The desktop launcher process can contain a main thread (also known as the UI thread) and heap task daemon threads.
[0051] The UI thread can be used to draw the image frames contained in the desktop and desktop animations.
[0052] The heap task program thread is used to perform garbage collection on the virtual machine corresponding to the desktop launcher. Garbage collection, also known as memory reclamation, is used to release the memory resources occupied by the virtual machine. Each process within the electronic device 100 can correspond to a virtual machine, and each process can contain a heap task program thread. This thread is mainly responsible for performing garbage collection (GC) functions, and can be referred to as the GC thread or garbage collection thread. The GC thread is responsible for monitoring the heap memory usage of the virtual machine corresponding to its process and determining whether to start GC operations based on the heap memory usage. For example, when the heap memory used by the virtual machine exceeds a certain threshold, or the heap memory available to the virtual machine is less than a certain threshold, or the heap memory available to the virtual machine is less than the heap memory required by the objects to be allocated, the GC thread can be triggered to perform GC operations. Here, GC operation refers to destroying objects and releasing the memory resources they occupy when the program no longer needs to use the allocated memory space, so that this memory space can be reused.
[0053] To ensure the consistency of objects or data in the memory space of the virtual machine corresponding to the desktop launcher, the UI thread will pause drawing desktop image frames when the GC thread in the desktop launcher process performs GC operations. This may cause frame drops and stuttering when the electronic device 100 executes animation effects.
[0054] Figures 2A and 2B are schematic diagrams illustrating stuttering during desktop animation execution on an electronic device according to embodiments of this application. In Figures 2A and 2B, the black rectangles in the heap task program thread represent the processing time of GC operations, and the black rectangles in the UI thread represent the processing time of each image frame in the animation. Depending on the timing of the GC operation, stuttering during desktop animation execution on the electronic device can include:
[0055] (1) As shown in Figure 2A, when the UI thread starts processing the desktop animation, the GC thread is performing GC operations. The GC thread's GC operations block the UI thread, causing the desktop animation to lag.
[0056] (2) As shown in Figure 2B, the GC operation is triggered during the UI thread’s processing of desktop animations. The GC thread performs the GC operation, which blocks the UI thread and causes the desktop animations to lag.
[0057] To address the issue of desktop animation stuttering caused by garbage collection (GC) operations performed by the desktop launcher in the electronic device 100, this application provides an animation display method, an electronic device, and a computer-readable storage medium. In this method, the electronic device 100 can increase the priority of the GC thread when a desktop animation is triggered. If the GC thread is performing GC operations when the desktop animation is triggered, other high-priority threads cannot block the GC thread during its GC operations, allowing the GC thread to complete its GC operations more quickly. This reduces the time that GC operations affect the UI thread's processing of desktop animation frames, thus lowering the probability of desktop animation stuttering. Furthermore, the electronic device 100 can continuously monitor whether GC operations are triggered after the desktop animation is triggered via the desktop launcher. When a GC operation is triggered, the electronic device 100 can promptly block the GC thread, ensuring that no GC operations occur during the execution of the desktop animation, thereby preventing desktop animation stuttering caused by GC operations.
[0058] The electronic device 100 provided in the embodiments of this application will be introduced first below.
[0059] Electronic device 100 may be equipped with Or other portable terminal devices with different operating systems, such as mobile phones, tablets, desktop computers, laptops, handheld computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), artificial intelligence (AI) devices, in-vehicle devices, smart home devices and / or smart city devices, etc.
[0060] Figure 3 is a schematic diagram of the hardware structure of the electronic device 100 provided in an embodiment of this application.
[0061] As shown in Figure 3, the electronic device may include: a processor 110, an external memory interface 130, an internal memory 120, a display screen 140, and a sensor module 150. The sensor module 150 may include a pressure sensor 150A, a touch sensor 150B, etc.
[0062] The processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0063] The controller can serve as the nerve center and command center of an electronic device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.
[0064] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0065] Internal memory 120 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 120. Internal memory 120 may include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as face recognition, fingerprint recognition, mobile payment, etc.). The data storage area may store data created during the use of electronic device 100 (such as face information template data, fingerprint information templates, etc.). In addition, internal memory 120 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0066] The external memory interface 130 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 110 through the external memory interface 130 to perform data storage functions.
[0067] Electronic devices implement display functions through a GPU, a display screen 140, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 140 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0068] The display screen 140 is used to display images, videos, etc. The display screen 140 includes a display panel. In some embodiments, the electronic device may include one or N display screens 140, where N is a positive integer greater than 1.
[0069] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0070] Pressure sensor 150A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, pressure sensor 150A may be disposed on display screen 140. When a touch operation is applied to display screen 140, electronic device 100 detects the intensity of the touch operation based on pressure sensor 150A. Electronic device 100 may also calculate the touch position based on the detection signal from pressure sensor 150A.
[0071] Touch sensor 150B, also known as a "touch panel," can be located on display screen 140. The touch sensor 150B and display screen 140 together form a touchscreen, also known as a "touch screen." Touch sensor 150B is used to detect touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. The electronic device 100 then provides visual output related to the touch operation through display screen 140, such as executing desktop animations.
[0072] The structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than those shown in FIG. 3, or combine some components, or split some components, or have different component arrangements. The components shown in FIG. 3 may be implemented in hardware, software, or a combination of software and hardware.
[0073] Figure 4 is a software structure block diagram of the electronic device provided in an embodiment of this application.
[0074] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom: the application layer, the application framework layer, the runtime and system libraries, and the kernel layer.
[0075] The application layer can include a series of application packages.
[0076] As shown in Figure 4, the application package may include applications (also known as apps) such as desktop launcher, camera, gallery, calendar, call, and online chat.
[0077] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0078] As shown in Figure 4, the application framework layer may include a window manager, a view system, an activity manager, a service manager, and so on.
[0079] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0080] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0081] The Activity Manager manages the lifecycle of activities within an electronic device. Each user interface corresponds to one activity, which manages the interaction logic of the user interface. When a user interacts with the user interface, the corresponding activity processes the interaction. Instances of activities run within the application's process.
[0082] The ServiceManager is used to manage the internal system-level services of the electronic device 100 and the services provided by third-party applications. Services provide specific functionalities, and applications can access these functionalities by calling the service's interface through the ServiceManager.
[0083] The runtime consists of the core libraries and the virtual machine. The runtime is responsible for system scheduling and management. The core libraries consist of two parts: one part is the functionalities that the programming language (e.g., Java) needs to call, and the other part is the system's core libraries.
[0084] The application layer and application framework layer run in a virtual machine. The virtual machine executes the programming files (e.g., Java files) of the application layer and 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.
[0085] System libraries can include multiple functional modules. For example: surfaceflinger, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0086] The surface compositer is used to composite image frames (including user interface and desktop animation frames) to be displayed on the screen based on the views provided by the application.
[0087] The 3D graphics processing library provides interfaces for 3D graphics drawing, image rendering, compositing, and layer processing, which can be called by other software modules to implement corresponding functions.
[0088] A 2D graphics engine is a graphics engine for 2D drawing.
[0089] The media decoder supports playback and recording of various common audio and video formats, as well as still image files.
[0090] The kernel layer is the layer between hardware and software. The kernel layer can contain display drivers, sensor drivers, audio drivers, and so on.
[0091] The software architecture of the electronic device 100 shown in Figure 4 is merely an example. The software architecture of the electronic device 100 may include more or fewer software layers and software modules, and this application embodiment does not impose any limitations on this. For example, a hardware abstraction layer (HAL) may also be included between the system library and the kernel layer. The hardware abstraction layer is used to provide an interface for upper-layer software to interact with the hardware.
[0092] Figure 5 is a schematic diagram of the software modules included in the desktop launcher provided in the embodiment of this application.
[0093] As shown in Figure 5, the desktop launcher may include an animation execution module 501, an animation status acquisition module 502, a garbage collection suppression module 503, and a priority setting module 504.
[0094] Among them, the animation execution module 501 is used to execute desktop animations when desktop animations are triggered.
[0095] The animation state acquisition module 502 is used to acquire the state of the desktop animation. When the desktop animation is triggered and when the desktop animation finishes execution, the animation execution module 501 will pass the above animation state to the animation state acquisition module 502.
[0096] The garbage collection suppression module 503 receives the animation status from the animation status acquisition module 502 and monitors the GC operations of the GC thread. When the garbage collection suppression module 503 determines that a GC operation is triggered during the execution of the desktop animation, it can put the GC thread to sleep until the desktop animation ends or the sleep duration reaches a preset duration before resuming the GC operation. Specifically, the garbage collection suppression module 503 can intercept (or hook) the functions that run GC operations in the GC thread. Taking the Android system as an example, the garbage collection suppression module 503 can determine that a GC operation has been triggered through the `_ZN3art2gc4Heap16ConcurrentGCTask3RunEPNS_6ThreadE` method and the `art::gc::Heap::ConcurrentGCTask::Run(art::Thread*)` method, and puts the GC thread to sleep when the GC operation is triggered, until the desktop animation ends or the sleep duration reaches a preset duration before resuming the GC thread and stopping the hook.
[0097] The priority setting module 504 can be used to receive the animation status transmitted by the animation status acquisition module 502, and to set the priority of the GC thread. When the priority setting module 504 determines that a desktop animation has been triggered, it can increase the priority of the GC thread, thereby reducing the probability of the GC thread being blocked. This way, if there is an ongoing GC operation when the desktop animation is triggered, the GC thread can complete the GC operation as soon as possible, thus reducing the probability of the desktop animation stuttering due to the GC operation.
[0098] The software modules included in the desktop launcher shown in Figure 5 are merely examples. The desktop launcher may also contain more or fewer software modules, or combine the above software modules, or split the functions implemented by the above software modules, etc. This application embodiment does not limit this.
[0099] The following section, with reference to Figure 5, describes how the desktop launcher improves the smoothness of desktop animations by increasing the priority of GC threads and suppressing garbage collection operations.
[0100] Figure 6 is a flowchart of the method for setting the GC thread priority in the desktop launcher provided in an embodiment of this application.
[0101] As shown in Figure 6, this method includes, but is not limited to, the following steps:
[0102] S601, Begin.
[0103] S602, Get the GC thread identifier.
[0104] The desktop launcher can obtain the GC thread identifier of the desktop launcher. This GC thread identifier can be, for example, the thread ID (TID) of the GC thread.
[0105] S603, Get animation state.
[0106] The animation status acquisition module 502 of the desktop launcher can monitor the animation status. When the animation execution module 501 determines that the desktop animation is triggered or ends, the animation status acquisition module 502 can capture the aforementioned animation status. Then, the animation status acquisition module 502 can send the animation status to the priority setting module 504. The desktop animation can be triggered by user interaction, or it can be automatically triggered based on preset rules without user interaction; this embodiment does not impose any limitations on this.
[0107] When the animation state is "desktop animation triggered", the priority setting module 504 can execute step S604.
[0108] When the animation status is "desktop animation ended", the priority setting module 504 can execute step S606.
[0109] S604. Confirm whether the priority of the GC thread has not been adjusted.
[0110] The priority setting module 504 can confirm whether the priority of the GC thread has been adjusted after the desktop animation was triggered. If so, the priority setting module 504 can execute step S605. If not, the priority setting module 504 can output an exception log.
[0111] S605. Increase the priority of GC threads based on GC thread identifiers.
[0112] The priority setting module 504 can increase the priority of a GC thread based on its identifier, such as its TID. In some embodiments, the priority setting module 504 can set the GC thread's priority to a real-time priority. When the GC thread has a real-time priority, threads other than the GC thread in the desktop launcher process cannot preempt the GC thread's computing resources. This can be understood as the GC thread having the highest priority among the threads in the desktop launcher process when it has a real-time priority. When multiple threads need to use the same computing resources, the electronic device 100 will prioritize executing the thread with the higher priority.
[0113] S606. Confirm whether the priority of the GC thread has been adjusted.
[0114] S607. Restore the priority of GC threads based on GC thread identifiers.
[0115] When the desktop animation ends, the priority setting module 504 can confirm whether the GC thread has been elevated after the desktop animation was triggered. If so, the priority setting module 504 can execute step S607 to restore the priority of the GC thread. If not, the priority setting module 504 can output an exception log for analysis and processing by the electronic device. Restoring the priority of the GC thread can be achieved by canceling the real-time priority of the GC thread or by lowering the priority value of the GC thread.
[0116] S608, End.
[0117] Figure 7 is a schematic diagram of the desktop animation processing optimization effect after implementing the method shown in Figure 6 according to the embodiment of this application.
[0118] As shown in Figure 7, the GC thread (also known as the heap task program thread) begins performing GC operations before the animation starts. When the desktop animation is triggered, the desktop launcher increases the priority of the GC thread. This reduces the probability that the GC thread will be blocked by other threads during GC operations, allowing it to finish its GC operations earlier. This reduces the probability or duration that the GC thread will block the UI thread from processing animation frames, resulting in less impact from the GC thread when the UI thread processes the desktop animation frames. Consequently, the desktop animation on electronic devices will play more smoothly.
[0119] Figure 8 is a flowchart of the method for suppressing GC operations in a desktop launcher provided in an embodiment of this application.
[0120] As shown in Figure 8, this method includes, but is not limited to, the following steps:
[0121] S801, Start.
[0122] S802, Get animation state.
[0123] When a desktop animation is triggered or ends, the animation execution module 501 can send the above animation status to the garbage collection suppression module 503.
[0124] When the desktop animation is triggered, the desktop launcher can execute steps S803-S806 through the garbage collection suppression module 503.
[0125] When the desktop animation ends, the desktop launcher can execute steps S807-S810 through the garbage collection suppression module 503.
[0126] S803. Confirm whether monitoring of GC operations is not enabled.
[0127] When a desktop animation is triggered, the animation status acquisition module 502 sends the triggered animation status to the garbage collection suppression module 503. The garbage collection suppression module 503 can then confirm whether monitoring of GC operations is not enabled. If not, the garbage collection suppression module 503 can execute S804.
[0128] S804, Enable monitoring of GC operations.
[0129] S805, GC operations pending execution are monitored.
[0130] S806, blocks the GC thread from performing GC operations.
[0131] The garbage collection suppression module 503 can monitor GC operations. If a GC operation is triggered by the GC thread, the garbage collection suppression module 503 can intercept (or block) the GC operation, thus blocking the GC thread. During the period when the GC thread is blocked, GC operations cannot be performed.
[0132] S807. Confirm whether monitoring of GC operations has been enabled.
[0133] S808, Stop monitoring GC operations.
[0134] S809. Check if any GC threads are blocked.
[0135] S810, Stop blocking GC threads.
[0136] When the desktop animation ends, the garbage collection suppression module 503 can check whether GC monitoring has been enabled. If so, the garbage collection suppression module 503 can stop monitoring GC. Optionally, the garbage collection suppression module 503 can stop monitoring GC after a certain period of time after the desktop animation ends, such as 1 second. If not, the process ends.
[0137] The garbage collection suppression module 503 can also confirm whether any GC threads are blocked due to the above steps S805-S806. If so, the garbage collection suppression module 503 can stop blocking the GC threads and resume the operation of the GC threads, so that the GC threads can continue to perform GC operations.
[0138] S811, End.
[0139] Optionally, and not limited to, the garbage collection suppression module 503 can resume the GC thread's execution after receiving the animation end status sent by the animation status acquisition module 502. The garbage collection suppression module can also resume the GC thread's execution if the GC thread is blocked for a duration exceeding a preset time. This avoids situations where the garbage collection suppression module 503 fails to receive the animation end status after the desktop animation ends, or where the desktop animation continues for an extended period due to execution errors, leading to a continuous blockage of the GC thread. The preset time can be, for example, 1 second, 2 seconds, etc., and the value of the preset time can exceed the duration of multiple desktop animations.
[0140] The execution order of each step in the flowchart shown in Figure 8 is merely an example and does not constitute a limitation of the embodiments of this application. For example, the above steps S809-S810 may also be executed between S807-S808, or may be executed in parallel by multiple threads. In some embodiments, some steps in the flowchart shown in Figure 8 are optional, such as S803, S807, and S809, and the embodiments of this application do not limit this.
[0141] Figure 9 is a schematic diagram of the desktop animation processing optimization effect after implementing the method shown in Figure 8 according to the embodiment of this application.
[0142] As shown in Figure 9, after the desktop animation is triggered, the desktop launcher starts listening for garbage collection (GC) operations. When a GC operation is triggered while the UI thread is processing the desktop animation, the garbage collection suppression module 503 will block the GC thread, causing it to sleep. This prevents the GC thread from performing GC operations while the UI thread is processing the desktop animation, thus ensuring that the UI thread is not affected by GC operations and improving the smoothness of the desktop animation.
[0143] The following describes the animation display method provided in the embodiments of this application.
[0144] Figure 10 is a flowchart illustrating the animation display method provided in an embodiment of this application. As shown in Figure 10, the method may include, but is not limited to, the following steps:
[0145] S1001, The electronic device receives the first user operation.
[0146] The electronic device may run a desktop launcher, which provides a desktop. The electronic device 100 can display the desktop when it is powered on, unlocked, or when an application is exited.
[0147] In some embodiments, the first user operation may include, for example, one of the following: entering the desktop, exiting the desktop, or changing the displayed content of the desktop; wherein entering the desktop includes one of the following: powering on the electronic device, unlocking the electronic device, running the first application in the background, or exiting the first application; exiting the desktop includes: launching the first application from the desktop; and changing the displayed content of the desktop includes one of the following: swiping on the desktop or dragging icons or cards on the desktop.
[0148] The first application can be an application outside the desktop of the electronic device 100. For example, the first application can be an online chat application. Launching the first application from the desktop can be, for example, clicking the online chat application icon on icon page 103 as shown in Figure 1A. When the electronic device 100 receives the user's click on the online chat application icon, the electronic device 100 can enter and display the user interface of the online chat application. Running the first application in the background can be, for example, returning to the desktop from the user interface of the first application, such as the user interface of the online chat application.
[0149] The aforementioned swiping operation on the desktop can be, for example, a left-right swipe operation on the desktop 101 as shown in Figures 1A-1C. It is not limited to this; it can also be a bottom-up swipe operation, in which case the electronic device 100 can display a resource library, which can be used to categorize and display the icons of applications on the electronic device 100.
[0150] S1002. In response to the first user operation, the electronic device executes the first desktop animation. During the execution of the first desktop animation, the electronic device monitors the garbage collection operation of the garbage collection GC thread of the desktop launcher. When the garbage collection operation of the GC thread is triggered, the electronic device blocks the execution of the GC thread.
[0151] The first desktop animation is used to demonstrate one of the following processes: entering the desktop, exiting the desktop, or changing the displayed content of the desktop. The content displayed by the desktop animation varies depending on the user's action. For example, if the first user action includes entering the desktop, the first desktop animation can be used to demonstrate the process of entering the desktop; if the first user action includes exiting the desktop, the first desktop animation can be used to demonstrate the process of exiting the desktop; if the first user action includes changing the displayed content of the desktop, the first desktop animation can be used to demonstrate the process of changing the displayed content of the desktop.
[0152] The first desktop animation effect can have various types, such as translation animation, push animation, rotation animation, flip animation, etc. For example, when the first desktop animation effect is a push animation, the electronic device 100 displays the change process of the user interface in the form of the newly appearing user interface pushing the already displayed user interface; when the first desktop animation effect is a rotation animation, the user interface to be displayed can rotate into the display area of the screen.
[0153] The electronic device 100 can monitor the GC operations of the GC thread of the desktop launcher during the execution of the first desktop animation. The GC operations are used to release unused memory resources occupied by the desktop launcher. The execution of the first desktop animation by the electronic device 100 may include the UI thread of the desktop launcher drawing the animation frames of the first desktop animation. Refer to S801-S806 in the embodiment shown in Figure 8. When the first desktop animation is triggered, the electronic device 100 can monitor the GC operations through the desktop launcher and block the execution of the GC thread when a GC operation to be executed is detected. As shown in Figure 9, after the electronic device 100 blocks the execution of the GC thread, the GC thread cannot perform GC operations during the execution of the desktop animation. This prevents the GC operations from blocking the UI thread from processing the animation, thus avoiding stuttering of the desktop animation and improving its smoothness. Optionally, the execution of the first desktop animation by the electronic device 100 may also include the rendering thread of the desktop launcher rendering the animation frames of the first desktop animation drawn by the UI thread. This may include compositing the rendered frames using a surface compositor, or displaying the first desktop animation on a screen, etc.
[0154] In some embodiments, referring to S807-S810 in the embodiment shown in FIG8, the electronic device 100 can stop monitoring GC operations and stop blocking the GC thread after the first desktop animation ends. As shown in FIG9, the GC thread can continue to perform GC operations after it resumes running.
[0155] In some embodiments, the electronic device 100 can also resume the execution of the GC thread if the duration of the GC thread being blocked exceeds a first duration. This avoids the situation where the GC thread is blocked during the execution of the desktop animation, but the desktop launcher fails to successfully obtain the end status of the desktop animation after its execution, resulting in the GC thread being continuously blocked. The first duration can be preset by the electronic device 100 and can be longer than the execution duration of the first desktop animation.
[0156] When an electronic device has multiple threads waiting to run, it can prioritize running the higher-priority threads, and lower-priority threads can run after the higher-priority threads have finished. In some embodiments, after the electronic device receives a first user operation, the method further includes: the electronic device increasing the priority of the GC thread; the higher the priority of the GC thread, the lower the probability of garbage collection operations being blocked. The electronic device 100 can increase the priority of the GC thread through the priority setting module 504 of the desktop launcher. The method by which the electronic device 100 increases the priority of the GC thread through the desktop launcher can be referred to in the description of S602, S603, and S604-S605 in Figure 6, which will not be repeated here. Optionally, the electronic device can set the GC thread to real-time priority. When the GC thread is set to real-time priority, threads other than the GC thread in the desktop launcher process cannot preempt the computing resources of the GC thread.
[0157] Optionally, after the first desktop animation ends, the electronic device 100 can cancel the increase in the priority of the GC thread. The method for canceling the increase in the GC thread priority can be found in the descriptions of S602, S603, and S606-S607 in Figure 6, and will not be repeated here. Canceling the increase in the GC thread priority can mean canceling the priority increase caused by the desktop animation. After the increase in the GC thread priority is canceled, it can be restored to its original priority, or it can be restored to another priority, which may be the priority set for the GC thread due to other processes. For example, after the desktop animation is triggered, the electronic device 100 increases the GC thread priority from priority A to priority B, where priority A is lower than priority B. Canceling the increase in the GC thread priority could mean that the electronic device 100 restores the GC thread priority from priority B to priority A. Alternatively, canceling the increase in GC thread priority could mean that electronic device 100 adjusts the GC thread priority from priority B to priority C. Priority C could be the priority adjusted by other threads in electronic device 100. For example, if other threads adjust the GC thread priority to priority C during the execution of the desktop animation, then canceling the increase in GC thread priority after the first desktop animation ends could mean adjusting the GC thread priority from priority B to priority C.
[0158] The apparatus for performing the above method provided in the embodiments of this application is described below. As shown in FIG11, FIG11 is a schematic diagram of the structure of an apparatus provided in an embodiment of this application. The motion effect display device 1100 may be an electronic device in the embodiments of this application, or a chip or chip system within an electronic device.
[0159] The animation display device 1100 may include an operation receiving unit 1101, an animation execution unit 1102, a garbage collection unit 1103, and a garbage collection suppression unit 1104. The animation execution unit 1102, garbage collection unit 1103, and garbage collection suppression unit 1104 are included in a desktop launcher application (not shown in Figure 11). The operation receiving unit 1101 receives a first user operation; the animation execution unit 1102, in response to the first user operation, executes a first desktop animation, which displays one of the following processes: entering the desktop, exiting the desktop, or changing the desktop's displayed content. The desktop is provided by the desktop launcher of the animation display device 1100. The garbage collection suppression unit 1104 monitors the garbage collection operation of the garbage collection unit 1103 during the execution of the first desktop animation by the animation execution unit 1102. The garbage collection suppression unit 1104 blocks the operation of the garbage collection unit 1103 when the garbage collection operation is triggered, and the garbage collection operation releases redundant memory resources occupied by the desktop launcher.
[0160] In some embodiments, the garbage collection suppression unit 1104 is also configured to resume operation of the garbage collection unit 1103 when the execution of the first desktop animation ends.
[0161] In some embodiments, the garbage collection suppression unit 1104 is further configured to resume operation of the garbage collection unit 1103 when it is determined that the duration of the garbage collection unit 1103 being blocked exceeds a first duration.
[0162] In some embodiments, the first duration is longer than the execution duration of the first desktop animation.
[0163] In some embodiments, the garbage collection suppression unit 1104 is further configured to stop monitoring the garbage collection operation of the garbage collection unit 1103 after the first desktop animation is executed.
[0164] In some embodiments, the desktop launcher in the motion effect display device 1100 further includes a priority boosting unit 1105. The priority boosting unit 1105 is used to increase the priority of the garbage collection unit 1103 after the operation receiving unit 1101 receives the first user operation. The higher the priority of the garbage collection unit 1103, the lower the probability of the garbage collection operation being blocked.
[0165] In some embodiments, the priority boosting unit 1105 is further configured to cancel the priority boosting of the garbage collection unit 1103 after the animation execution unit 1102 executes the first desktop animation.
[0166] In some embodiments, the first user operation includes one of the following: entering the desktop, exiting the desktop, or changing the displayed content of the desktop; entering the desktop includes one of the following: unlocking the animation display device 1100, running the first application in the background, or exiting the first application; exiting the desktop includes: launching the first application from the desktop; changing the displayed content of the desktop includes one of the following: swiping on the desktop, wherein the first application may be an application other than the desktop launcher in the animation display device 1100.
[0167] Figure 12 is a schematic diagram of the structure of a chip provided in an embodiment of this application.
[0168] As shown in Figure 12, chip 1200 includes one or more processors 1201, communication lines 1202 and communication interfaces 1203. Optionally, chip 1200 also includes a memory 1204.
[0169] In some implementations, memory 1204 stores elements such as executable modules or data structures, or subsets thereof, or extended sets thereof.
[0170] The methods described in the embodiments of this application can be applied to or implemented by the processor 1201. The processor 1201 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 1201 or by instructions in the form of software. The processor 1201 may be a general-purpose processor (e.g., a microprocessor or conventional processor), a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates, transistor logic devices, or discrete hardware components. The processor 1201 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0171] The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in mature storage media in the art, such as random access memory, read-only memory, programmable read-only memory, or electrically erasable programmable read-only memory (EEPROM). This storage medium is located in memory 1204, and processor 1201 reads information from memory 1204 and, in conjunction with its hardware, completes the steps of the above method.
[0172] The processor 1201, memory 1204 and communication interface 1203 can communicate with each other via communication line 1202.
[0173] In the above embodiments, the instructions stored in the memory for execution by the processor can be implemented in the form of a computer program product. This computer program product can be pre-written into the memory, or it can be downloaded and installed into the memory as software.
[0174] This application also provides a computer program product comprising one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. For example, available media may include magnetic media (e.g., floppy disk, hard disk, or magnetic tape), optical media (e.g., digital versatile disc (DVD)), or semiconductor media (e.g., solid-state disk (SSD)).
[0175] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program or instructions. When the computer program or instructions are executed by a processor, they implement the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0176] As one possible design, computer-readable media may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM, or other optical disc storage; computer-readable media may include disk storage or other disk storage devices. Furthermore, any connecting cable may also be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of media. As used herein, disks and optical discs include optical discs (CD), laser discs, optical discs, DVDs, floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0177] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0178] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0179] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0180] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for displaying animation effects, characterized in that, The method is applied to an electronic device that runs a desktop launcher, and the method includes: The electronic device receives a first user operation; In response to the first user operation, the electronic device executes a first desktop animation, which is used to display one of the following processes: entering the desktop, exiting the desktop, or changing the displayed content of the desktop, wherein the desktop is provided by the desktop launcher; During the execution of the first desktop animation, the electronic device monitors the garbage collection (GC) thread of the desktop launcher. When the GC thread's garbage collection operation is triggered, the electronic device blocks the execution of the GC thread. The garbage collection operation is used to release some of the memory resources occupied by the desktop launcher.
2. The method according to claim 1, characterized in that, During the execution of the first desktop animation, the electronic device monitors the garbage collection (GC) thread of the desktop launcher for garbage collection operations, specifically including: During the execution of the first desktop animation, the electronic device monitors the garbage collection operation of the GC thread through the desktop launcher.
3. The method according to claim 2, characterized in that, The electronic device blocks the execution of the GC thread, specifically by the electronic device blocking the execution of the GC thread through the desktop launcher.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: Once the first desktop animation finishes executing, the electronic device resumes the operation of the GC thread.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: When the electronic device determines that the blocking time of the GC thread exceeds a first duration, the electronic device resumes the operation of the GC thread.
6. The method according to claim 5, characterized in that, The first duration is greater than the execution duration of the first desktop animation.
7. The method according to any one of claims 1-6, characterized in that, After the electronic device executes the first desktop animation, the method further includes: The electronic device stops monitoring the garbage collection operations of the GC thread.
8. The method according to any one of claims 1-7, characterized in that, After the electronic device receives the first user operation, the method further includes: The electronic device increases the priority of the GC thread; the higher the priority of the GC thread, the lower the probability that the garbage collection operation will be blocked.
9. The method according to claim 8, characterized in that, After the electronic device executes the first desktop animation, the method further includes: The electronic device cancels the promotion of the GC thread's priority.
10. The method according to any one of claims 1-9, characterized in that, The first user operation includes one of the following: entering the desktop, exiting the desktop, or changing the displayed content of the desktop; The operation of entering the desktop includes one of the following: powering on the electronic device, unlocking the electronic device, running the first application in the background, or exiting the first application. The operation of exiting the desktop includes: launching the first application from the desktop; The operation of changing the display content of the desktop includes one of the following: sliding on the desktop, or dragging icons on the desktop; The first application is an application other than the desktop launcher in the electronic device.
11. An electronic device, characterized in that, The electronic device includes: a display screen, a memory, and a processor coupled to the memory; the display screen is used to display a user interface, the memory stores a computer program, and the processor executes the computer program to cause the electronic device to implement the method as described in any one of claims 1-10.
12. A computer-readable storage medium storing computer instructions, characterized in that, When the computer instructions are executed on the processor, they cause the method as described in any one of claims 1-10 to be performed.
13. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method of any one of claims 1-10.
