Application starting method and electronic device
By matching the color mode of the startup window with the color mode of the application interface during warm startup, the flickering problem caused by color contrast during warm startup is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202411628311.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-11-14
AI Technical Summary
During a warm start-up, the color contrast between the startup window displayed on the electronic device and the application interface is too large, causing a flickering effect and affecting the user experience.
By analyzing screenshots of the application's interface during warm startup, the application's color mode is determined, and the color mode of the startup window is matched to the application's color mode to ensure color consistency between the startup window and the application interface and avoid color contrast.
It effectively avoids color flickering in the startup window and application interface, improving the display effect and user experience of warm startup.
Smart Images

Figure CN119127342B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to an application startup method and electronic device. Background Technology
[0002] Most electronic devices have different types of applications (APPs) installed. Applications (simply put) are typically launched via cold start or warm start, but some applications (such as social applications) also include warm start. For example, if an application's process exists on the electronic device, but no application activity exists, then the electronic device performs a warm start when an application needs to be launched.
[0003] When a device warm-starts an application, it first displays a gradually enlarging launch window. After the warm start is complete, indicating that the application's activity has been created and its interface has been rendered, the device can then stop displaying the launch window and begin showing the application's main interface. However, the current display quality of warm starts may be poor, resulting in a less than ideal user experience. Summary of the Invention
[0004] This application provides an application startup method and an electronic device to avoid flickering caused by a large color contrast between the startup window displayed during warm startup and the application interface, thereby improving the display effect of warm startup.
[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0006] Firstly, a method for launching an application is provided, applied to an electronic device, wherein the electronic device's display mode is a first color mode. The electronic device receives a first operation input by a user, which triggers the launch of a first application, the first application's display mode being a second color mode, the second color mode being different from the first color mode.
[0007] In response to the first operation, if a process of the first application exists but no activity of the first application exists, the electronic device begins a warm boot and displays the startup window in a first color that matches the second color mode.
[0008] In response to the startup window stopping display, the electronic device displays the first interface of the first application in a second color that matches the second color mode.
[0009] In this application, when an electronic device is in the first color mode of display mode and needs to launch a first application, if there is no activity of the first application at present, but a process of the first application exists, the electronic device performs a warm start. It first displays the launch window in the first color mode, which matches the second color mode, while the first application's display mode is the second color mode. After the warm start is complete, the electronic device stops displaying the launch window and continues to display the first application's interface in the second color mode, ensuring consistency in the color mode (display mode) between the successively displayed launch window and the first application's interface. This avoids the flickering effect caused by a large color contrast between the launch window and the application's interface during a warm start. Furthermore, it ensures consistency in display style, improves the display effect of the warm start, and enhances the user experience.
[0010] The aforementioned startup window is added by the electronic device and is not part of the first application. The first color and the second color can be the same color, such as both being black. Alternatively, they can be different colors, but both must match the second color mode.
[0011] Optionally, the first color mode can be either a dark mode or a light mode. The first color mode differs from the second color mode, which can be either a light mode or a dark mode.
[0012] In one possible design approach, the display mode of the first application can be determined through the interface of the first application. Before receiving the first operation, that is, before warm-starting the first application, the electronic device can run the first application in the foreground and display a second interface of the first application. The electronic device can determine the display mode of the first application based on the interface state when displaying the second interface.
[0013] Based on this, after determining the display mode of the first application, the electronic device can display the startup window with a color that matches the determined display mode of the first application during the next warm start.
[0014] In one possible design approach, the process of determining the display mode of the first application based on the interface state when the second interface is displayed may include: the electronic device may take a screenshot of the second interface based on the interface state when the second interface is displayed, obtaining a screenshot result of the second interface; wherein the screenshot result of the second interface includes the background of the second interface. Then, the electronic device may determine the display mode of the first application based on the background color value of the screenshot result.
[0015] Based on this, the electronic device identifies the background color of the screenshot result of the second interface based on the interface state of the second interface, and obtains the background color value of the second interface. The electronic device can then use this background color value to determine the display mode of the first application, thereby achieving accurate determination of the display mode of the first application.
[0016] In one possible design approach, the aforementioned interface states include: whether the electronic device displays a status bar when the second interface is displayed. If the interface state is that the status bar is displayed, the screenshot of the second interface includes all layers of the second interface. If the interface state is that the status bar is not displayed, the screenshot of the second interface includes the background layer of the second interface.
[0017] Based on this, when the interface is in the state of displaying a status bar, the second interface displayed by the electronic device includes the actual background of the second interface. Therefore, the electronic device can directly take a screenshot of the entire second interface to determine the background color value of the second interface using the screenshot.
[0018] When the interface is in a state where the status bar is not displayed, the actual background of the second interface may be covered by the content displayed on the second interface. Therefore, the electronic device needs to determine the background layer in the second interface that includes the actual background of the second interface, so as to use the screenshot of the background layer to determine the background color value of the second interface, thereby achieving accurate determination of the background color value of the second interface.
[0019] In one possible design approach, if the second interface includes a SurfaceView layer, the background layer includes all layers in the second interface except for the SurfaceView layer. If the second interface does not include a SurfaceView layer, the background layer includes all layers in the second interface except for the topmost layer. Based on this, the background layer of the second interface is determined according to its specific type, thus achieving accurate determination of the background layer.
[0020] In one possible design approach, the display mode of the first application can be set to either a first color mode or a second color mode. Determining the display mode of the first application based on the background color value of the screenshot result includes:
[0021] If the background color value matches a first color mode, the electronic device can determine that the display mode of the first application is the first color mode. If the background color value matches a second color mode, the electronic device can determine that the display mode of the first application is the second color mode.
[0022] Based on this, the electronic device determines whether the display mode of the first application is the first color mode by determining whether the background color value is close to the first color mode, thereby achieving accurate determination of the color mode of the first application.
[0023] In one possible design approach, matching the background color value with the first color mode includes situations where the difference between the background color value and the color threshold corresponding to the first color mode falls within the difference range corresponding to the first color mode, the difference between the background color value and the color threshold corresponding to the second color mode does not fall within the difference range corresponding to the second color mode, the background color value falls within the color value range corresponding to the first color mode, or the background color value does not fall within the color value range corresponding to the second color mode.
[0024] In one possible design approach, the display mode, or color mode, of the first application can be determined when the first application is moved to the background. That is, the electronic device receives a second operation; whereby the second operation triggers the first application to run in the background. In response to the second operation, the electronic device runs the first application in the background, and determines the display mode of the first application based on the interface state when the second interface is displayed.
[0025] Based on this, while using the first application, the user may change the display mode of the first application. Therefore, the electronic device can determine the display mode of the first application when the first application is moved to the background, so as to accurately determine the latest display mode of the first application.
[0026] In one possible design approach, after determining that the display mode of the first application is the second color mode, the electronic device can either set the background color of the launch window to the first color or set the display mode of the launch window to the second color mode.
[0027] Accordingly, displaying the startup window in the first color indicates that the background color of the startup window is the first color. Similarly, displaying the first interface in the second color indicates that the background color of the first interface is the second color.
[0028] Therefore, since the launch window is added by the electronic device, the electronic device can directly modify the background color or display mode of the launch window so that when the first application is launched, the launch window can be displayed in a color that matches the second color mode, ensuring the consistency of the launch window's display style due to the first application.
[0029] In one possible design approach, after the first application runs in the background, if the conditions for stopping background operation are met, the electronic device can delete the activity of the first application but retain its process. Thus, when the first application is restarted, there is no need to create the process of the first application, thereby shortening the startup time of the first application.
[0030] Secondly, this application provides an electronic device, the electronic device including a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the camera is used to capture images, the display screen is used to display images generated by the processor, the memory is used to store computer program code, the computer program code including computer instructions; when the processor executes the computer instructions, the electronic device causes the application startup method described above to be executed.
[0031] Thirdly, this application provides a chip, the chip including a communication interface and at least one processor:
[0032] The communication interface is used for inputting and / or outputting signaling or data;
[0033] The at least one processor is used to execute a computer program to implement the application startup method described above.
[0034] Fourthly, this application provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the application startup method described above.
[0035] Fifthly, this application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the application startup method described above.
[0036] It is understood that the beneficial effects achieved by the electronic device described in the second aspect, the chip described in the third aspect, the computer-readable storage medium described in the fourth aspect, and the computer program product described in the fifth aspect can be referred to the beneficial effects in the first aspect and any of its possible design embodiments, which will not be repeated here. Attached Figure Description
[0037] Figure 1 This application provides an illustration of a startup scenario. Figure 1 ;
[0038] Figure 2 A schematic diagram illustrating a return to the desktop scenario provided in an embodiment of this application;
[0039] Figure 3 A schematic diagram illustrating a scenario of retreating to the background, as provided in an embodiment of this application;
[0040] Figure 4 This application provides an illustration of a startup scenario. Figure 2 ;
[0041] Figure 5 This application provides an illustration of a startup scenario. Figure 3 ;
[0042] Figure 6 A schematic diagram illustrating a scenario where an application stops running, as provided in an embodiment of this application.
[0043] Figure 7 A schematic diagram of a color mode setting provided in an embodiment of this application. Figure 1 ;
[0044] Figure 8 A schematic diagram of a dark mode scene provided in an embodiment of this application;
[0045] Figure 9 A schematic diagram of a color mode setting provided in an embodiment of this application. Figure 2 ;
[0046] Figure 10 A schematic diagram of a non-immersive interface provided in an embodiment of this application;
[0047] Figure 11 This application provides an illustration of a startup scenario. Figure 4 ;
[0048] Figure 12 This application provides an illustration of a startup scenario. Figure 5 ;
[0049] Figure 13 This application provides an illustration of a startup scenario. Figure 6 ;
[0050] Figure 14 This application provides an illustration of a startup scenario. Figure 7 ;
[0051] Figure 15 A schematic diagram of the hardware structure of an electronic device provided in this application embodiment. Figure 1 ;
[0052] Figure 16 A schematic diagram of the software structure of an electronic device provided in an embodiment of this application;
[0053] Figure 17 A flowchart illustrating a warm start method provided in this application embodiment. Figure 1 ;
[0054] Figure 18 A schematic diagram of an immersive interface provided in an embodiment of this application. Figure 1 ;
[0055] Figure 19 A schematic diagram of an immersive interface provided in an embodiment of this application. Figure 2 ;
[0056] Figure 20 A flowchart illustrating a warm start method provided in this application embodiment. Figure 2 ;
[0057] Figure 21 A schematic diagram of the hardware structure of an electronic device provided in this application embodiment. Figure 2 ;
[0058] Figure 22 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation
[0059] To facilitate a clear description of the technical solutions in the embodiments of this application, the terms "exemplary" or "for example" are used in the embodiments of this application to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present related concepts in a specific manner. In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. In the embodiments of this application, "first," "second," "1," and "2" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined with "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "multiple" means two or more.
[0060] To facilitate understanding of the technical solution of this application, the terminology involved in this application will be introduced below.
[0061] There are three ways to launch an application: cold start, warm start, and lukewarm start.
[0062] A cold start refers to the way an application's process is started from scratch. Before the application starts, no process for that application exists on the electronic device. During application startup, the electronic device creates the application's process and also creates the application's activities. For example, launching an application for the first time after the electronic device is powered on, or launching an application after its process has been cleared, can be called a cold start.
[0063] A warm start refers to a launch method where the application's process and activity still exist. After the application is switched from the foreground to the background, the electronic device restarts the application. When restarting the application, because the application's process and activity still exist, the electronic device does not need to create the application's process and activity again. For example, if the electronic device restarts the application in response to a user's click on the application's card displayed in the background while the application is in the background, this can be called a warm start.
[0064] A warm start refers to a launch method where the application's process exists, but its activities do not. When an application is switched from the foreground to the background, the electronic device stops running the application in the background and clears the application's card from the background, but may still retain the application's process. When restarting the application, the electronic device does not need to create the application's process, but it does need to create the application's activities. Additionally, it can be understood that for some applications, stopping the electronic device from running the application in the background means that neither the application's process nor its activities exist on the device; in other words, these applications do not exhibit warm starts.
[0065] It should be noted that application activities are used to implement the application's interface, and application activities can belong to the application's process and run within the application's process.
[0066] The following uses social applications as an example to illustrate the three launch methods mentioned above. Figure 1 As shown, after powering on, the phone displays desktop 10. Desktop 10 includes icons 11 for social applications. In response to the user's click on the social application icon 11, the phone launches the social application, displays the application's startup content 12, and shows the process and activity of creating the social application. After startup is complete, the phone displays the social application's interface 13. This startup method is a cold start.
[0067] After that, as Figure 2 As shown, while the phone is displaying the social media app interface 13, the user swipes up from the bottom of the screen. In response to the swipe, the phone no longer displays the social media app interface 13, but instead displays the home screen 14, switching the social media app from the foreground to the background. Then, as... Figure 3As shown, in response to the user's upward swipe gesture on desktop 14, the phone displays the cards (or interfaces, windows) of the apps running in the background. These apps' cards include cards 15 for social applications.
[0068] In one example, such as Figure 4 As shown, in response to the user's tap on the social application's card 15, the phone launches the social application, displays the social application's interface 16, and switches the social application from the background back to the foreground without recreating the social application's process and activities. This launch method is called a warm start.
[0069] In another example, such as Figure 5 As shown, in response to the user's swipe-up action on the social application's card 15, the phone stops the social application from running in the background and deletes the social application's card 15. Since there are no other background applications, the phone can display the desktop 17. Although the phone stops the social application from running in the background, because social applications are frequently used, in order to shorten the startup time of social applications and ensure the user experience, the phone can still retain the process of the social application when it stops running in the background, but delete the social application's activity.
[0070] After that, continue as Figure 5 As shown, in response to a user's click on the social application icon 18 on the phone's home screen 17, the phone launches the social application, displays a gradually enlarging launch window 19, creates the social application's activity, and renders the social application's interface. After launch, the phone displays the social application's interface 20. This launch method is a warm launch.
[0071] Understandably, if a user wants to terminate a social application, they can do so using controls provided by their phone (see...). Figure 6 The forced stop control 21 shown is used to trigger the phone to terminate the process of the social application. Of course, the phone can also terminate the process of the social application in other situations, and this application does not limit this.
[0072] Furthermore, the aforementioned launch window is displayed to ensure a smooth warm start and avoid giving users the feeling of lag. When warm-starting a social application, creating the social application's activity takes some time. If the user had to wait for the social application's activity to complete creation before the interface appeared after clicking the app's icon, it might feel like a lag. Therefore, to ensure a smooth start for social applications, a launch window is added, allowing the phone to create the social application's activity while the launch window is displayed. Simply put, this launch window is equivalent to a launch animation.
[0073] Color mode refers to the background color of the interface displayed on an electronic device. Color modes include dark mode and light mode. Dark mode displays a black background, such as black or gray. Light mode displays a light background, such as white.
[0074] Some electronic devices offer color mode (or system color mode) settings, such as... Figure 7 The diagram shows light (or normal) and dark modes. When the system color mode is dark, the background color of the electronic device's system interface (including the interface of system applications) is dark, such as... Figure 8 The desktop 30 shown is a dark color. When the system color mode is light, the background color of the electronic device's system interface is light, as described above. Figure 1 The desktop 10 in the image is a light color.
[0075] Additionally, third-party applications on electronic devices may also offer color mode settings. The color mode set by the third-party application may or may not match the system color mode. For example, the color mode of the third-party application may or may not follow the system color mode. Figure 9 As shown, the social application provides a "Follow System" switch 31. When this switch is on, the social application's color mode matches the system color mode. For example, if the system color mode is dark mode, then the social application's color mode is also dark mode. Specifically, Figure 8 The desktop 30 shown is dark in color. Figure 10 The background color of the social application interface shown is also dark.
[0076] When the system color switch is off, the color mode of third-party applications can differ from the system color mode. For example, after setting the color mode of a social application to dark mode, the background color of the social application will be dark regardless of whether the system color mode is dark or light. Conversely, after setting the color mode of a social application to dark mode, the background color of the social application will be light regardless of whether the system color mode is dark or light. Specifically, as described above... Figure 9 As shown, the social application provides a dark mode control 32 and a normal mode control 33. The dark mode control 32 is used to set the color mode of the social application to dark mode, and the normal mode control 33 is used to set the color mode of the social application to light mode.
[0077] The terminology used in this application has been introduced above. The technical solutions provided in this application will be introduced below.
[0078] As described above, when a third-party app warm-starts, the electronic device first displays a launch window. Since this launch window is added by the electronic device and belongs to the system interface, not the third-party application itself, its background color follows the system color mode. When the system color mode and the third-party app's color mode are inconsistent, the color of the launch window displayed on the electronic device differs from the background color of the third-party app's window after the warm start is complete. This significant color difference between the launch window and the third-party app's window causes flickering, reduces the user experience, and may mislead users into believing there is a malfunction on their phone.
[0079] Taking a mobile phone as an example, such as Figure 11 As shown, the phone displays a light-colored desktop 40. In response to a click on the social application icon 41 on the desktop 40, since the phone has a process running the social application but no activity, it performs a warm start on the social application. During the warm start, the phone displays a light-colored launch window 42. After the warm start, the phone displays a dark-colored social application interface 43. From the user's perspective, because of the significant color difference between the launch window 42 and the social application interface 43, a flickering white screen occurs when switching from the launch window 42 to the social application interface 43.
[0080] Similarly, such as Figure 12 As shown, the phone displays a dark background desktop 50. In response to a click on the social application icon 51 on desktop 50, the phone performs a warm start on the social application. During the warm start, the phone displays a dark background launch window 52. After the warm start, the phone displays a light background interface 53 of the social application. From a user's perspective, due to the significant color difference between the launch window 52 and the social application interface 53, a flickering black screen occurs when switching from the launch window 42 to the social application interface 43.
[0081] Therefore, to address the aforementioned problems, this application provides a warm-start method for third-party applications to solve the flickering problem that occurs when a third-party application's color mode is inconsistent with the system color mode during warm-start. Considering system limitations, the electronic device cannot directly know the color mode settings of the third-party application, i.e., it cannot know whether the third-party application's color mode is dark or light. Therefore, to enable the electronic device to determine the color mode settings of the third-party application, the electronic device can take a screenshot of the third-party application's interface when displaying it. The electronic device then analyzes the screenshot to determine the background color of the third-party application, thereby determining the color mode of the third-party application (i.e., the color mode currently used by the third-party application) based on the background color, achieving accurate determination of the third-party application's color mode. Since the electronic device can directly obtain the system color mode setting information, it can determine whether the current system color mode is consistent with the color mode currently used by the third-party application.
[0082] In cases of inconsistency, the color mode of the launch window corresponding to the third-party application is set to the color mode of the third-party application. During a warm start, the electronic device displays a launch window with the same color mode as the third-party application, thus minimizing the color difference between the launch window and the interface of the third-party application after startup. This avoids significant color differences between the launch window and the third-party application interface, thereby preventing flickering. Furthermore, it ensures consistent display style, improves the display effect of warm starts, and guarantees a better user experience.
[0083] For example, the phone's system color mode is light mode, while third-party applications use dark mode. Figure 13 As shown, the phone displays a light-colored desktop 60 with a background color. In response to a click on the social application icon 61 on the desktop 60, the phone performs a warm launch of the social application. During the warm launch, the phone displays a launch window 62 with a dark background color. After the warm launch ends, the phone displays the social application interface 63 with a dark background color to avoid flickering white screens.
[0084] Similarly, the phone's system color mode is dark mode, while third-party applications use light mode. For example... Figure 14 As shown, the phone displays a dark background desktop 70. In response to a click on the social application icon 71 on the desktop 70, the phone performs a warm launch of the social application. During the warm launch, the phone displays a launch window 72 with a light background. After the warm launch ends, the phone displays the social application interface 73 with a light background to avoid flickering or a black screen.
[0085] It is understandable that after the color mode of the launch window is consistent with the color mode of the third-party application window, although the color mode of the launch window is different from the color mode of the phone desktop, the user may think that the launch window is the launch content of the third-party application. The background color of the launch window itself is different from the background color of the phone desktop, so it will not cause the user to feel flickering.
[0086] Furthermore, when an electronic device is in a certain system color mode, although the color mode of different system interfaces on the electronic device is the same, the specific background color can be the same or different. For example, although the background color of the startup window and the background color of the desktop are both dark, they can be different, such as the background color of the startup window being black and the background color of the desktop being gray. This application does not impose any restrictions on the specific background color.
[0087] For example, the electronic device in this application embodiment may be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as wearable device, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, etc., which can install APP. This application embodiment does not impose any special restrictions on the specific form of the electronic device.
[0088] For example, Figure 15 A schematic diagram of the structure of electronic device 200 is shown. For example... Figure 15 As shown, the electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 211, a power management module 212, a battery 213, an antenna 1, an antenna 2, a mobile communication module 240, a wireless communication module 250, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor module 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc.
[0089] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 200. In other embodiments of this application, the electronic device 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0090] Processor 210 may include one or more processing units, such as application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0091] The controller can be the nerve center and command center of the electronic device 200. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0092] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0093] The wireless communication function of electronic device 200 can be implemented through antenna 1, antenna 2, mobile communication module 240, wireless communication module 250, modem processor, and baseband processor.
[0094] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 200 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0095] The mobile communication module 240 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 200. The mobile communication module 240 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 240 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 240 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 240 may be housed in the processor 210. In some embodiments, at least some functional modules of the mobile communication module 240 and at least some modules of the processor 210 may be housed in the same device.
[0096] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 270A, receiver 270B, etc.) or displays images or videos through the display screen 294. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 210 and may be housed in the same device as the mobile communication module 240 or other functional modules.
[0097] The wireless communication module 250 can provide solutions for wireless communication applications on the electronic device 200, including wireless local area networks (WLAN) (such as Wi-Fi), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR). The wireless communication module 250 can be one or more devices integrating at least one communication processing module. The wireless communication module 250 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 210. The wireless communication module 250 can also receive signals to be transmitted from processor 210, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0098] Electronic device 200 implements display functions through GPU, display screen 294, and application processor.
[0099] The display screen (or screen) 294 is used to display images, videos, etc. In some embodiments, the electronic device 200 may include one or N display screens 294, where N is a positive integer greater than 1.
[0100] Electronic device 200 can perform shooting functions through ISP, camera 293, video codec, GPU, display screen 294 and application processor.
[0101] The external storage interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.
[0102] Internal memory 221 can be used to store computer executable program code, which includes instructions. Processor 210 executes various functional applications and data processing of electronic device 200 by running the instructions stored in internal memory 221. Internal memory 221 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 200 (such as audio data, phonebook, etc.). Furthermore, internal memory 221 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.
[0103] Electronic device 200 can implement audio functions such as music playback and recording through audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, and application processor.
[0104] Buttons 290 include a power button, volume buttons, etc. Indicator 292 may be an indicator light.
[0105] The sensor module 280 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc.
[0106] The software system of the aforementioned electronic device 200 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of the electronic device 200.
[0107] Figure 16 This is a software structure block diagram of the electronic device 200 according to an embodiment of the present invention.
[0108] 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 Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0109] The application layer can include a series of application packages.
[0110] like Figure 16As shown, the application package may include applications such as gallery, social networking, recent tasks, launcher, Bluetooth, music, video, and SMS.
[0111] The Recent Tasks module is used to manage background applications, such as stopping background applications.
[0112] Desktop launchers are used to launch applications, such as social applications, on electronic devices 200 based on user actions.
[0113] 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.
[0114] like Figure 16 As shown, the application framework layer may include a window manager service (WMS), a surfaceflinger, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0115] The window manager is used to manage window applications. The window manager can obtain the screen size, determine the presence of a status bar, and so on. Specifically, the window manager can determine the type of the currently displayed interface based on the presence of a status bar. This interface type includes non-immersive interfaces and immersive interfaces. Optionally, immersive interfaces can include immersive interfaces of the surface view type and immersive interfaces of the non-surface view type. The window manager can determine the specific type of immersive interface based on whether the immersive interface contains a surface view component.
[0116] Furthermore, the window manager can also obtain the current color mode (or system color mode) of the electronic device 200, and adjust the color mode of the application's startup window, etc.
[0117] SurfaceFlinger is used to determine the background layer in an immersive interface in order to capture a screenshot of the background layer in the immersive interface.
[0118] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0119] 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.
[0120] The phone manager provides communication functions for electronic devices 200. The resource manager provides various resources for applications.
[0121] The notification manager allows applications to display notification information in the status bar. It can be used to convey informational messages and can disappear automatically after a short time without user interaction.
[0122] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0123] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0124] The application layer and application framework layer run in a virtual machine. The virtual machine executes the 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.
[0125] The system library can include multiple functional modules. Examples include: a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). The surface manager manages the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0126] The media library supports playback and recording of various common audio and video formats, as well as still image files. The 3D graphics processing library is used for 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is a drawing engine for 2D graphics.
[0127] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0128] It is understandable that the above Figure 16 The structure shown is merely an example; electronic devices can be divided into software layers according to their needs. For instance, an electronic device may include not only the software layers described above but also other software layers. Alternatively, an electronic device may include one or more of the software layers described above. Similarly, the content included in each software layer is also merely an example, and this application does not impose any limitations on it.
[0129] This application provides a warm start method. When an application exits the foreground, the electronic device can determine the type of the currently displayed interface (i.e., the interface state when the interface is displayed). The interface type includes non-immersive and immersive interfaces. A non-immersive interface means that the electronic device displays a status bar, and the currently displayed background is the actual background of the interface. Therefore, the electronic device can directly determine the background color value of the interface based on the background. An immersive interface means that the electronic device displays the interface in full screen without a status bar. The currently displayed background may not be the actual background of the interface, as the actual background may be covered by the displayed content. Therefore, the electronic device needs to determine the background color value of the interface based on the background layer of the interface, which includes the actual background.
[0130] Next, the electronic device determines the application's color mode based on the interface's background color value. If the application's color mode differs from the system color mode, the electronic device sets the application's launch window to the application's color mode. Then, during a warm start of the application, the launch window in that color mode is displayed. After the warm start is complete, the electronic device continues to display the interface in that color mode, ensuring consistency between the launch window and the application's interface color mode. This avoids flickering issues caused by excessive color contrast and prevents users from perceiving a malfunction, thus improving the display effect of the warm start.
[0131] The following will use a mobile phone as an example, where the electronic device is a dark mode (or display mode) and the application is a social media application, to illustrate the implementation process of the warm start method provided in this application. Figure 17 As shown, the warm start method may include the following steps:
[0132] S301, The mobile phone displays the interface of the social application 1.
[0133] S302: In response to the user's swipe-up gesture, the phone switches the social application to the background.
[0134] In this embodiment, while a social application is running in the foreground (which can be an example of the first application), when the user wants the phone to stop the social application from running in the foreground, the user can perform a swipe-up operation. The phone will then stop the social application from running in the foreground and bring it to the background. It should be understood that the swipe-up operation is only one example of the home operation, and the home operation can also be other operations. For example, it could be an operation on the home button displayed on the phone. In addition, it should be understood that the home operation is also an example of an operation that triggers the switching of the social application to the background. In general, this application does not limit the operation (or second operation) that triggers the phone to switch the social application to the background.
[0135] S303, The phone confirms that the current system color mode is light mode.
[0136] S304. Determine whether the mobile phone's interface 1 is a non-immersive interface.
[0137] As discussed above, when Interface 1 (or the second interface) is a non-immersive interface, it means that while the phone displays Interface 1, a status bar is also displayed, and the content of Interface 1 is not displayed in full screen. Therefore, the background displayed by Interface 1 is its actual background and is not covered by its content. Thus, the phone can directly determine the background color of Interface 1 based on its color, and can then execute S305.
[0138] When Interface 1 is an immersive interface, it means the status bar is hidden, and the content of Interface 1 is displayed in full screen. The content displayed on Interface 1 covers the actual background of Interface 1. In other words, the background color displayed on Interface 1 may not be the actual background color of Interface 1. Therefore, the phone cannot directly determine the background color of Interface 1 based on its display, and the phone can execute S307 or S308.
[0139] S305, take a screenshot of interface 1 with the mobile phone.
[0140] For example, Interface 1 is as described above. Figure 10 The social application interface shown is displayed on the phone, along with the status bar 34. The phone can determine that interface 1 is a non-immersive interface, and the background of interface 1 is not completely covered by the content displayed in interface 1. Therefore, the phone can take a full screenshot of interface 1 to determine the background color value of interface 1 through the background in the screenshot. This background color value of interface 1 represents the determination of the background color value of the social application.
[0141] S306. The phone determines the background color value of the screenshot, and obtains the background color value of interface 1.
[0142] For example, a mobile phone can select multiple feature points (or pixels) from a screenshot and determine the background color value of the screenshot based on the color values (or pixel values) of these feature points. Generally, the background area of an interface (such as the screenshot above) is the top or bottom of the interface; therefore, the mobile phone can select multiple feature points from the top or bottom. For example, interface 1 is... Figure 10 As shown in the social application interface, the phone can randomly select multiple pixels from the vicinity of the status bar 34. Alternatively, when the interface is in a certain color mode, the overall color of the interface is the color corresponding to that color mode. Therefore, the phone can also randomly select multiple feature points from interface 1 (such as the screenshot of interface 1) to determine the background color value of interface 1.
[0143] Optionally, the process of determining the background color value of a screenshot based on the color values of multiple feature points may include: based on the color value of each feature point among the multiple feature points, the mobile phone determines the number of feature points corresponding to each color value. Then, the mobile phone can use the color value of the feature point with the most occurrences as the background color value of the screenshot. Alternatively, the mobile phone can calculate the average of the color values of multiple feature points to obtain the background color value of the screenshot. Of course, the background color value of the screenshot can also be determined in other ways, and this application does not limit it.
[0144] The number of feature points selected can be set according to requirements, and this application does not limit it.
[0145] The above describes the process of determining the background color value directly from a full screenshot of Interface 1 when Interface 1 is a non-immersive interface. However, there is also the possibility that Interface 1 is an immersive interface. In the case of an immersive interface, it means that Interface 1 is displayed in full screen, and the currently displayed content may already cover the actual background of Interface 1. Therefore, the phone needs to determine the background layer of Interface 1, which includes the actual background. Then, the phone can identify the color of this background layer, such as by taking a screenshot of the background layer and determining the background color value of the screenshot, thereby obtaining the background color value of Interface 1. This background layer of Interface 1 can be a layer below the topmost layer, where the topmost layer refers to the layer containing the displayed content.
[0146] Optionally, to improve the accuracy of determining the background layer, the background layer of the immersive interface can be determined based on the specific type of the immersive interface, so that the background color value of the immersive interface can be determined using the background layer. The following will continue to describe the process of determining the background color value of interface 1 when interface 1 is an immersive interface.
[0147] S307. When interface 1 is an immersive interface of the surface view type, the mobile phone uses the layers in interface 1 other than the surface view layer as the background layer of interface 1.
[0148] S308. When interface 1 is an immersive interface of non-surface view type, the mobile phone uses the layers in interface 1 other than the topmost layer as the background layer of interface 1.
[0149] In this embodiment, an interface can consist of one or more layers, but generally, an interface is composed of multiple layers superimposed. That is, an immersive interface is composed of multiple layers superimposed. The type of immersive interface can include SurfaceView type and non-SurfaceView type. Since SurfaceView is generally used for video playback, if interface 1 is a SurfaceView type immersive interface (i.e., interface 1 includes a SurfaceView layer), it indicates that before the social application is moved to the background, the phone plays the video in full screen, and the SurfaceView layer containing the video covers the actual background of interface 1. Therefore, the phone can use layers other than the SurfaceView layer in interface 1 as the background layer of interface 1. In other words, the specific content displayed by the background layer refers to the content displayed by interface 1 after removing the SurfaceView layer.
[0150] In the case where Interface 1 is a non-SurfaceView type immersive interface (i.e., Interface 1 does not include a SurfaceView layer), before the social application is moved to the background, the phone displays content in full screen, such as a full-screen image. The displayed content already covers the actual background of Interface 1, and the displayed content is generally located on a single layer. Therefore, the phone can use all layers in Interface 1 except the topmost layer as the background layer of Interface 1. In other words, the specific content displayed on the background layer refers to the content displayed on Interface 1 after removing the topmost layer.
[0151] For example, such as Figure 18 As shown, when a user clicks on video 81 in chat interface 80, the phone displays interface 82, playing video 81 in full screen on interface 82. The background 83 displayed on interface 82 is not actually the actual background of interface 82; that is, the color of background 83 (i.e., black) is not the actual background color of interface 82. Therefore, if a full screenshot of interface 82 is taken and the background color of the screenshot is used as the actual background color of interface 82, the background color of interface 82 will be mistakenly determined as black. Thus, to accurately determine the background color, the phone needs to determine the layers of interface 82 and identify the background layer from these layers, thereby determining the actual background color of interface 82 based on the color of the background layer. This background layer can be any layer in interface 82 other than the SurfaceView layer. Here, interface 82 can refer to the aforementioned interface 1.
[0152] Similarly, such as Figure 19As shown, when a user clicks on image 85 in chat interface 84, the phone displays interface 86, showing image 85 in full screen. The background 87 displayed on interface 86 is not actually the actual background of interface 86. That is, the color of background 87 (i.e., black) is not the actual background color of interface 86. Therefore, if a full screenshot of interface 86 is taken and the background color of the screenshot is used as the actual background color of interface 86, the actual background color of interface 86 will be mistakenly determined as black. Thus, to accurately determine the background color, the phone needs to determine the layers of interface 86 and identify the background layer from within the layers of interface 86, thereby determining the actual background color of interface 86 based on the color of the background layer. This background layer can be any layer in interface 86 except for the topmost layer. Here, interface 86 can refer to the aforementioned interface 1.
[0153] S309. The mobile phone takes a screenshot of the background layer and determines the color value of the screenshot to obtain the background color value of interface 1.
[0154] In this embodiment, the mobile phone takes a screenshot of the background layer, which is equivalent to taking a screenshot of the specific display of the background layer, thus obtaining a screenshot of the background layer. Then, the mobile phone can select one or more feature points from the background layer, using the color values of the selected feature points to determine the color value of the screenshot of the background layer, and using this screenshot color value as the background color value of interface 1.
[0155] The process of determining the background layer's screenshot color value using the color values of selected feature points can be referred to in the above-described process of determining the background color value of the screenshot of interface 1 based on the color values of multiple feature points, and will not be repeated here.
[0156] It should be noted that when Interface 1 is an immersive interface of type SurfaceView, Interface 1 without the SurfaceView layer may still display other content, but it is generally not displayed in full screen. In other words, the background layer may display other content, but this other content will not completely cover the actual background of Interface 1. That is to say, the background layer can display the actual background of Interface 1, thus allowing the actual background color of Interface 1 to be determined based on the background layer.
[0157] Similarly, if Interface 1 is a non-SurfaceView type immersive interface, Interface 1, even after removing the topmost layer, may still display other content, but it is generally not displayed in full screen. In other words, the background layer may display other content, but this other content will not completely cover the actual background of Interface 1. That is to say, the background layer can display the actual background of Interface 1, thus allowing the actual background color of Interface 1 to be determined based on the background layer.
[0158] The above describes the process of determining the background color value of interface 1. After determining the background color value of interface 1, the mobile phone can determine the color mode of interface 1 based on this background color value, thus obtaining the color mode of the social application. The following will continue to describe the process of determining the color mode of the social application based on the background color value of interface 1.
[0159] S310, the difference between the background color value of the mobile phone's computing interface 1 and the color threshold corresponding to the dark mode is 1.
[0160] S311. The phone determines whether the difference value 1 belongs to the difference value range 1 corresponding to the dark mode.
[0161] If the difference value 1 is within the difference range 1 corresponding to dark mode, it indicates that the background color value of interface 1 is close to the dark value, that is, the background color of interface 1 is dark, that is, the color mode of interface 1 is dark mode, and the phone can execute S312.
[0162] If the difference value of 1 does not fall within the difference range of 1 corresponding to dark mode, it indicates that the background color value of interface 1 is not close to the dark value, meaning that the background color of interface 1 is not dark. In other words, the background color of interface 1 is light, which means that the color mode of interface 1 is light mode, and the phone can execute S314.
[0163] It should be noted that the phone can determine whether the color mode of interface 1 is light or dark by calculating not only the difference 1 between the background color value of interface 1 and the color threshold corresponding to dark mode, but also the difference 2 between the background color value and the color threshold corresponding to light mode. This difference 2 is used to determine whether the background color value is close to the light color value, thus determining whether the color mode of interface 1 is the preset color mode. In other words, the phone can determine whether the background color value of interface 1 is close to the color value corresponding to the preset color mode by calculating the difference between the background color value of interface 1 and the color threshold corresponding to the preset color mode, thus determining whether the color mode of interface 1 is the preset color mode.
[0164] Additionally, the phone can directly determine whether the background color value of interface 1 falls within the color value range corresponding to the preset color mode. If it does, the phone can determine that the color mode of interface 1 is the preset color mode. If it doesn't, the phone can determine that the color mode of interface 1 is not the preset color mode. In general, when the background color value matches the preset color mode, the phone determines that the display mode of the social application is the preset color mode. When the background color does not match the preset color mode, the phone determines that the display mode of the social application is not the preset color mode. The preset color mode can be either a dark mode or a light mode.
[0165] S312, The phone has set the color mode of social applications to dark mode.
[0166] S313: The phone changes the color mode of the social application's launch window to dark mode.
[0167] In this embodiment, since the social application's color mode is dark mode while the system's color mode is light mode, the startup window's color mode is also light mode. To avoid screen flickering caused by the inconsistency between the startup window's color mode and the social application's color mode, the phone can also set the startup window's color mode to dark mode, thus making the startup window's color mode consistent with the social application's color mode.
[0168] For example, the launch window's attribute information may include color mode attribute information. The phone can modify the color mode attribute information in the relevant code corresponding to the launch window, thereby changing the attribute information to dark mode information. Alternatively, the launch window's attribute information may include background color (or alternatively described as color) attribute information. The phone can modify the background color to a color that matches dark mode, i.e., dark, such as black.
[0169] S314. The phone has set the color mode of social applications to light mode.
[0170] S315, the phone does not modify the color mode of the social application's startup window.
[0171] In this embodiment, since the color mode of the social application is consistent with the color mode of the launch window, the phone will not experience screen flickering issues when launching the social application in a warm state. Therefore, the phone does not need to modify the color mode of the launch window.
[0172] In some embodiments, certain applications only have cold start and warm start options, but not warm start. If an application does not have warm start, the flickering issue caused by the inconsistency between the background color of the launch window and the application's interface will not arise. Therefore, when a social application is moved to the background, the phone can determine whether the social application's launch method includes warm start. If warm start is not included, the phone does not need to determine the social application's color mode, nor does it need to modify the launch window's color mode. If warm start is included, the phone can normally determine the social application's color mode and, based on the social application's color mode and the system color mode, determine whether to modify the launch window's color mode.
[0173] Specifically, when an app is warm-launched, the phone can record whether the app's launch method includes warm launch. However, for apps that have not been warm-launched, the phone cannot determine whether warm launch was one of the launch methods.
[0174] In this embodiment, considering that users may modify the color mode of a social application while using it, when the social application is in the background, the phone can determine how to capture a screenshot including the actual background of interface 1 based on the type of the interface 1 displayed by the social application. This screenshot can then be used to determine the color mode of the social application, ensuring accurate determination of the color mode and guaranteeing consistency between the determined color mode and the current color mode of the social application. Furthermore, since the social application being in the background indicates a possibility of subsequent warm-up of the social application, the phone's determination of the color mode can, to some extent, avoid unnecessary determination of the social application's color mode.
[0175] Of course, determining the color mode of a social media app when it's in the background is just one example. A phone can determine the color mode at other times. For instance, the phone can determine the color mode directly while the social media app is running, or when the app is launched. However, determining the color mode when the app is in the background improves the accuracy of color mode determination compared to determining it at other times.
[0176] Furthermore, the modification of the startup window's color mode described in S313 above can be performed by the phone after determining that the social application's color mode is inconsistent with the system's color mode, or it can be performed only when the social application is warmly launched. This application does not impose any restrictions on the timing of modifying the startup window's color mode.
[0177] S316. If the social application meets the background clearing conditions, the phone clears the social application cards displayed in the background, deletes the social application activities, and retains the social application process.
[0178] The background clearing condition (or stop background operation condition) indicates the conditions that trigger the phone to clear social applications running in the background. The background clearing condition may include receiving a user input to clear the social application card, and / or the social application running in the background for more than a preset time.
[0179] For example, the operation of clearing cards from a social application may include swiping up on the cards of the social application displayed in the background (as described above). Figure 5 The example shown is a user swiping up on card 15 of a social application. Alternatively, it could be a tap on a delete control displayed in the phone's background.
[0180] S317. In response to launching a social application, the phone displays a dark-colored launch window.
[0181] Among these, the startup operation can be considered the first operation.
[0182] S318. After startup, the phone displays interface 2. The background color of interface 2 is dark.
[0183] For example, in response to a user's click on the social application icon on the desktop, indicating that the phone needs to launch the social application, since the social application process still exists on the phone but the social application activity does not exist, this launch of the social application is a warm launch. Only the social application activity needs to be created to draw the social application's interface 2 (or first interface). To ensure the continuity of the launch, the phone displays a blank launch window, and the color of this launch window (i.e., the background color) is dark (which can be used as an example of the first color). Simply put, the phone displays a pure dark launch window.
[0184] After the warm start is complete, the social application's activity is created, and the phone no longer displays the launch window. Instead, it displays the social application's interface 2, which has a dark background color (which can be used as an example of a second color) to avoid flickering caused by the large color contrast between the launch window and interface 2.
[0185] Optionally, interface 2 can be the default home screen of the social application. Of course, interface 2 can also be other than the home screen, such as interface 2 being the same as interface 1.
[0186] It's understandable that a blank startup window is just one example, as mentioned above. Figure 5 The startup window shown is 19. Figure 12 The launch window 52 shown is just one example. Launch windows can also include content, such as icons for social applications.
[0187] In some embodiments, the warm start process of the social application may include steps such as displaying the launch window and creating activities of the social application (or, alternatively, drawing interface 2), but does not include displaying interface 2. The display of interface 2 can be performed after the warm start is complete.
[0188] In some embodiments, when a social application is brought back to the background, the phone can still redetermine the latest color mode of the social application to ensure that the background color of the launch window displayed on the next warm launch matches the latest color mode.
[0189] It should be noted that the step numbers above do not represent the actual execution order of the steps. For example, determining the phone's system color mode as described in S303 above could be done when the social application is scrambled to the background, or it could be done at other times, such as when the social application is warm-started. This application does not impose any restrictions on the execution order of the above steps.
[0190] In some embodiments, when a social application is brought to the background, the phone's launcher can trigger the window manager to read the current system color mode information from the settings database and determine the color mode of the social application. If the social application's color mode differs from the system color mode, the window manager can modify the background color of the launch window, ensuring that the launch window displayed when the social application is launched matches the background color of the social application's interface, thus avoiding flickering. The following will combine the above... Figure 16 The software structure shown illustrates the process, which is to say, it introduces... Figure 17 One possible implementation process of the corresponding embodiment. For example... Figure 20 As shown, the process is as follows:
[0191] S1, Social Application Display Interface 1.
[0192] S2, the desktop launcher receives swipe-up gestures for social applications.
[0193] S3, the desktop launcher responds to the swipe-up action, returns to the desktop via the window manager, and runs social applications in the background.
[0194] Sections S1-S3 describe the process of a social application being moved to the background, which can be found in the descriptions in S301-S302 above.
[0195] S4. The window manager reads the phone's current system color mode information from the settings database. The system color mode is light mode.
[0196] The settings database stores information about the phone's current color mode (i.e., system color mode). When the phone's color mode changes, the color mode information stored in the settings database is updated accordingly. Furthermore, the process for determining the phone's system color mode, as described in S4, can be found in the relevant description in S303 above.
[0197] S5. The window manager determines the type of interface 1. Interface 1 can be a non-immersive interface, a non-surface view type immersive interface, or a surface view type immersive interface.
[0198] S6. The window manager sends the type of interface 1 to the layer compositor.
[0199] The type of Interface 1 can also be referred to as the state of Interface 1. When the social application is in the background, the window manager can determine the state of Interface 1 displayed by the social application and send the state of Interface 1 to SurfaceFlinger so that SurfaceFlinger can use the state of Interface 1 to determine the screenshot result including the actual background of Interface 1.
[0200] S7. When the type of interface 1 is a non-immersive interface, the layer compositor takes a screenshot of interface 1 and obtains the screenshot result.
[0201] In this embodiment of the application, when the type of interface 1 is a non-immersive interface, it indicates that the background displayed by interface 1 is the actual background of interface 1 and is not completely covered by the displayed content. Therefore, surfaceflinger can directly take a screenshot of interface 1 and use the screenshot as the screenshot result to identify the color mode of interface 1.
[0202] S8. When the type of interface 1 is an immersive interface of the surface view type, the layer compositor analyzes the layers of interface 1 and uses the layers of interface 1 other than the surface view layer as the background layer of interface 1.
[0203] S9. The layer compositer takes a screenshot of the background layer of interface 1 and obtains the screenshot result.
[0204] S10. When the type of interface 1 is an immersive interface of non-surface view type, the layer compositor analyzes the layers of interface 1 and uses the layers of interface 1 other than the topmost layer as the background layer of interface 1.
[0205] S11. The layer compositer takes a screenshot of the background layer of interface 1 to obtain the screenshot result.
[0206] The above steps S7-S11 describe the process of determining the screenshot result of Interface 1. The following section will continue to describe the process of determining the background color value of Interface 1 based on this screenshot result.
[0207] S12. After obtaining the screenshot result, the layer compositor sends the screenshot result to the window manager.
[0208] S13. The window manager determines the background color value of the screenshot result and obtains the background color value of interface 1.
[0209] The process of determining the type of interface 1 and taking a screenshot based on the type of interface 1, as described in S5-S13, to determine the background color value of interface 1 using the screenshot, can be referred to the relevant content in S304-S311 above.
[0210] S14. The window manager determines the color mode of the social application based on the background color value of interface 1. The color mode of the social application is dark mode.
[0211] S15. The window manager sets the background color of the startup window to the color corresponding to dark mode.
[0212] For example, if the window manager determines that the social application's color mode is inconsistent with the system color mode, it can modify the background color of the launch window to match the color of the social application's color mode. For instance, if the social application's color mode is dark mode, and the corresponding color is black, the window manager can set the launch window's background color to black.
[0213] The specific implementation process of S14-S15 can be referred to the relevant content of S312-S313 above, and will not be repeated here.
[0214] S16. In response to the user's action of clearing the cards of social applications displayed in the background, the recent tasks module deletes the cards of social applications, deletes the activities of social applications, but does not delete the process of social applications.
[0215] The implementation process of S16 can refer to the relevant content of S316 above.
[0216] S17. In response to the user's click on the social application icon, the desktop launcher launches the social application through the window manager.
[0217] S18. When a social application is in process but no social application activity exists, the window manager displays a startup window with a background color corresponding to the dark mode.
[0218] In this embodiment, the window manager draws a launch window with a background color corresponding to the dark mode and displays the launch window through a social application. This launch window is not provided by the social application.
[0219] S19. The window manager creates an activity for the social application to draw interface 2. The background color of interface 2 is the color corresponding to dark mode.
[0220] In this embodiment of the application, during the display of the startup window, the window manager can draw interface 2 based on the recreated activity.
[0221] S20. After startup, the social application displays interface 2.
[0222] Interface 2 is the interface provided by the social application. After Interface 2 is drawn, the social application can display Interface 2. Furthermore, the warm start process described in S17-S20 can be found in the relevant content of S317-S318 above, and will not be repeated here.
[0223] It should be noted that the above example illustrates how to change the background color of the launch window when the social application's color mode is dark and the system's color mode is light. Of course, the inconsistency could also occur when the social application's color mode is light and the system's color mode is dark. However, the process of changing the launch window's background color in either case remains similar to the above-described process. In other words, the system color mode can be referred to as the first color mode, and the social application's color mode as the second color mode. The first color mode can be either dark or light, and the second color mode can also be either light or dark. The modification of the launch window's background color is involved when the first and second color modes differ.
[0224] Furthermore, dark mode and light mode are merely examples of display modes. Display modes can include not only dark mode and light mode, but also other color modes. Of course, display modes can also be other modes, but include multiple color modes. And the aforementioned social application is only one example; other applications may also involve warm start. Therefore, this application does not impose any restrictions on the application (or the first application).
[0225] It should be noted that the operations performed by the software modules in the aforementioned mobile phone (such as the desktop launcher, recent tasks module, window manager, SurfaceFlinger, etc.) can also be performed by other software modules. This application does not impose any restrictions on the software modules that perform the above steps. Furthermore, the operations performed by the software modules are actually performed by the mobile phone itself; that is, the executing entity of the technical solution described in this application is the mobile phone.
[0226] The above mainly describes the solutions provided by the embodiments of this application from a methodological perspective. It is understood that, in order to achieve the above functions, the electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Based on the units and algorithm steps of the various examples described in the embodiments disclosed in this application, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software.
[0227] Whether a function is implemented through hardware or by a computer-driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described function for each specific application, but such implementations should not be considered beyond the scope of the technical solutions in this application.
[0228] This application provides embodiments for dividing an electronic device into functional modules based on the above method examples. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into a single processing unit. The integrated unit can be implemented in hardware or as a software functional module. It should be noted that the unit division in this application embodiment is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used.
[0229] like Figure 21 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. This electronic device 1000 can be used to implement the methods executed by the electronic devices described in the above method embodiments. For example, the electronic device 1000 may include a processing unit 1001, a communication unit 1002, and a display unit 1003. The processing unit 1001 is used to support the electronic device 1000 in executing... Figures 1 to 20 The electronic device described in any one of the following embodiments includes a communication unit 1002 for supporting the communication function of the electronic device 1000, and a display unit 1003 for supporting the display function of the electronic device 1000.
[0230] Optional, Figure 21 The electronic device 1000 shown may also include a storage unit ( Figure 21 (Not shown in the image), this storage unit stores a program or instruction. When the processing unit 1001 executes the program or instruction, it causes... Figure 21 The electronic device 1000 shown can perform the method described in the above-described method embodiments.
[0231] Figure 21 The technical effects of the electronic device 1000 shown can be referred to the technical effects described in the above method embodiments, and will not be repeated here. Figure 21 The processing unit 1001 in the illustrated electronic device 1000 can be implemented by a processor or processor-related circuit components, and can be a processor or processing module. The communication unit 1002 can be implemented by a transceiver or transceiver-related circuit components, and can be a transceiver or transceiver module. The display unit 1003 can be implemented by display screen-related components.
[0232] This application also provides a chip system, such as... Figure 22As shown, the chip system includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 and the interface circuit 1102 are interconnected via lines. For example, the interface circuit 1102 can be used to receive signals from other devices. As another example, the interface circuit 1102 can be used to send signals to other devices (e.g., the processor 1101). Exemplarily, the interface circuit 1102 can read instructions stored in memory and send those instructions to the processor 1101. When the instructions are executed by the processor 1101, the electronic device can perform the various steps performed by the electronic device in the above embodiments. Of course, the chip system may also include other discrete devices, and this application embodiment does not specifically limit this.
[0233] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.
[0234] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application does not specifically limit the type of memory or the arrangement of the memory and processor.
[0235] For example, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0236] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0237] This application also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the warm start method described in the above method embodiments, which is the application startup method.
[0238] This application provides a computer program product, which includes a computer program or instructions that, when executed on an electronic device, cause the electronic device to perform the warm start method described in the above method embodiments.
[0239] In addition, this application embodiment also provides an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory. The memory stores computer execution instructions. When the apparatus is running, the processor executes the computer execution instructions stored in the memory to cause the apparatus to perform the warm-start method in the above-described method embodiments. The electronic device, computer storage medium, computer program product, or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they achieve can be referred to in the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0240] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0241] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The embodiments can be combined with or referenced to each other without conflict. The apparatus embodiments described above are merely illustrative; for example, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0242] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0243] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0244] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0245] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for launching an application, characterized in that, Applied to an electronic device, wherein the display mode of the electronic device is a first color mode, the method includes: Display the second interface of the first application; Receive a second operation; wherein the second operation is used to trigger the first application to run in the background; In response to the second operation, based on the interface state when the second interface is displayed, it is determined that the display mode of the first application is a second color mode, which is different from the first color mode; Change the color mode of the startup window from the first color mode to the second color mode; Receive a first operation; wherein the first operation is used to trigger the launch of the first application; In response to the first operation, if a process of the first application exists but no activity of the first application exists, the first application is warmly launched, and a launch window is displayed in a first color that matches a second color mode; the launch window belongs to the system interface of the electronic device. In response to the startup window stopping display, the first interface of the first application is displayed in a second color, which matches the second color mode.
2. The method according to claim 1, characterized in that, Determining the display mode of the first application based on the interface state when the second interface is displayed includes: Based on the interface state when the second interface is displayed, a screenshot of the second interface is taken to obtain the screenshot result of the second interface; wherein, the screenshot result of the second interface includes the background of the second interface; Based on the background color value of the screenshot result, the display mode of the first application is determined.
3. The method according to claim 2, characterized in that, The interface state when the second interface is displayed includes: whether the electronic device displays a status bar when the second interface is displayed; When the interface is in the state of displaying the status bar, the screenshot result of the second interface includes all layers of the second interface; When the status bar is not displayed on the interface, the screenshot of the second interface includes the background layer of the second interface.
4. The method according to claim 3, characterized in that, In the case where the second interface includes a surfaceview layer, the background layer includes all layers in the second interface other than the surfaceview layer. If the second interface does not include a SurfaceView layer, the background layer includes all layers in the second interface except for the topmost layer.
5. The method according to any one of claims 2 to 4, characterized in that, The display mode of the first application can be set to either the first color mode or the second color mode; Determining the display mode of the first application based on the background color value of the screenshot result includes: If the background color value matches the first color mode, it is determined that the display mode of the first application is the first color mode. If the background color value matches the second color mode, the display mode of the first application is determined to be the second color mode.
6. The method according to claim 5, characterized in that, The background color value matching the first color mode includes the following: the difference between the background color value and the color threshold corresponding to the first color mode is within the difference range corresponding to the first color mode; the difference between the background color value and the color threshold corresponding to the second color mode is not within the difference range corresponding to the second color mode; the background color value is within the color value range corresponding to the first color mode; or the background color value is not within the color value range corresponding to the second color mode.
7. An electronic device, characterized in that, The electronic device includes a display screen, a memory, and one or more processors; the display screen, the memory, and the processors are coupled; the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, the computer program code including computer instructions; when the processor executes the computer instructions, the electronic device performs the application startup method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the application launch method as described in any one of claims 1 to 6.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the application startup method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Application launching method and terminal
CN105630550A
Application startup optimization method and apparatus, storage medium and intelligent terminal
CN107748686A
Display mode switching method and device, electronic equipment and medium
CN115484345A
Image processing method, and training method and device of image processing model
CN117218213A