Display screen switching method and electronic device
By initiating the power-on process of the second display before the power-off process of the first display is completed, the problem of slow display switching speed is solved, resulting in faster display switching and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2022-09-30
- Publication Date
- 2026-07-24
AI Technical Summary
In existing technologies, the display switching speed is slow, which affects the user experience.
Before the power-down process of the first display screen is completed, the power-on process of the second display screen is started, thus eliminating the need to wait for the power-down process of the first display screen to be completed before starting the power-on process of the second display screen, and shortening the display screen switching time.
The display switching speed has been improved, enhancing the user experience.
Smart Images

Figure CN117812181B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display switching technology, and more particularly to display switching methods and electronic devices. Background Technology
[0002] Currently, if an electronic device has two or more displays, it may need to switch between displays during the interface display process. Display switching can include the process of one display going from on to off, and another display going from off to on.
[0003] Currently, the display switching speed is slow, which affects the user experience. Summary of the Invention
[0004] This application provides a display screen switching method and an electronic device that can improve the switching speed of the display screen.
[0005] In a first aspect, embodiments of this application provide a display screen switching method. The method is applied to an electronic device, which includes a first display screen and a second display screen. The method includes: controlling the first display screen to initiate a power-down process when switching from the first display screen to the second display screen; and controlling the second display screen to initiate a power-on process before the power-down process of the first display screen is completed. This method controls the second display screen to initiate a power-on process after controlling the first display screen to initiate a power-down process but before the power-down process of the first display screen is completed, thereby eliminating the need to wait for the power-down process of the first display screen to complete before initiating the power-on process of the second display screen, thus shortening the switching time from the first display screen to the second display screen and improving the display screen switching speed.
[0006] In one possible implementation, controlling the first display screen to initiate a power-down process includes: HWC receiving first information, the first information indicating power-down of the first display screen; in response to the first information, HWC sending second information to the first display screen driver, the second information indicating the first display screen driver to initiate the power-down process of the first display screen, the first display screen driver driving the first display screen.
[0007] Before the power-down process of the first display screen is completed, the process includes: before the HWC receives the third information sent by the first display screen driver, the third information is sent by the first display screen driver after powering down the first display screen, and the third information is used to indicate to the HWC that the power-down of the first display screen is complete.
[0008] In one possible implementation, controlling the power-on process of the second display screen includes: HWC sending fourth information to the second display screen driver, the fourth information being used to instruct the second display screen driver to initiate the power-on process of the second display screen, the second display screen driver being used to drive the second display screen.
[0009] In one possible implementation, the first information is sent by the display manager to control the second display to start the power-on process, and the method further includes: HWC responding to the first information to send a fifth information to the display manager, the fifth information being used to indicate that the first display has finished powering down; HWC receiving a sixth information sent by the display manager, the sixth information being used to indicate that HWC powers on the second display.
[0010] In one possible implementation, the method further includes: HWC receiving a seventh message sent by the second display driver, the seventh message being sent by the second display driver after powering on the second display, the seventh message being used to indicate to HWC that the power-on of the second display is complete; HWC responding to the seventh message sending an eighth message to the display manager, the eighth message being used to indicate to the display manager that the power-on of the second display is complete.
[0011] In one possible implementation, information transmitted between the HWC and the display manager is forwarded via Surfaceflinger.
[0012] In one possible implementation, the method further includes: HWC responding to the seventh message by updating the state of the second display screen in HWC to the power-on state.
[0013] In one possible implementation, the method further includes: after receiving the third information, HWC updates the state of the first display screen in HWC to the power-off state.
[0014] In one possible implementation, the electronic device is a foldable device; the first display screen is the inner screen of the foldable device, and the second display screen is the outer screen of the foldable device; the method further includes: determining to switch from the first display screen to the second display screen when the folding angle of the electronic device gradually changes from greater than or equal to a first threshold to less than the first threshold.
[0015] In one possible implementation, the electronic device is a foldable device; the first display screen is the outer screen of the foldable device, and the second display screen is the inner screen of the foldable device; the method further includes: determining to switch from the first display screen to the second display screen when the folding angle of the electronic device gradually changes from less than or equal to a second threshold to greater than the second threshold.
[0016] In a second aspect, embodiments of this application provide an electronic device, including: a first display screen; a second display screen; a processor; a memory; and one or more computer programs, wherein the computer programs are stored in the memory, and when the computer programs are executed by the processor, the electronic device performs the method of any one of the first aspects.
[0017] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method of either the first or second aspect.
[0018] Fourthly, this application provides a computer program that, when executed by a computer, performs the method of any one of the first aspects.
[0019] In one possible design, the program in the fourth aspect can be stored wholly or partially on a storage medium packaged with the processor, or it can be stored wholly or partially on a memory not packaged with the processor. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;
[0022] Figure 2 This is a schematic diagram of the software structure of an electronic device according to an embodiment of this application;
[0023] Figure 3A This is a schematic diagram of the folding process of the foldable device according to an embodiment of this application;
[0024] Figure 3B This is a schematic diagram showing the placement of the inner and outer screens on a foldable device according to an embodiment of this application;
[0025] Figure 4 This is a flowchart illustrating a display screen switching method according to an embodiment of this application;
[0026] Figure 5 This is a schematic diagram of another structure of the electronic device according to an embodiment of this application;
[0027] Figure 6 The embodiments of this application are based on Figure 5 The diagram shows another flowchart of the display switching method provided by the structure shown.
[0028] Figure 7A This is a schematic diagram of the folding process of the foldable phone in the embodiments of this application;
[0029] Figure 7B This is a schematic diagram illustrating the unfolding process of the foldable phone in an embodiment of this application. Detailed Implementation
[0030] The terminology used in the implementation section of this application is for the purpose of explaining specific embodiments of this application only, and is not intended to limit this application.
[0031] Taking foldable electronic devices as an example, when using foldable devices, users can choose whether the device is in a folded or unfolded state according to different usage scenarios, which can greatly improve the user experience.
[0032] Taking a foldable phone, which has an inner screen and an outer screen, as an example, a foldable phone can trigger a screen switching process during folding or unfolding. Specifically, during folding, the foldable phone can switch the display screen from the inner screen to the outer screen, at which time the inner screen switches from on to off and the outer screen switches from off to on. During unfolding, the foldable phone can switch the display screen from the outer screen to the inner screen, at which time the inner screen switches from off to on and the outer screen switches from on to off.
[0033] In one example, screen switching involves completing the power-down process of one display and then executing the power-on process of another display. Once the power-on process of the other display is complete, the screen switching is finished. However, in this example, there is a significant time interval between the screen turning off from one display and the screen turning on from another, which negatively impacts the user experience.
[0034] The display switching method and electronic device provided in this application can improve the display switching speed.
[0035] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 1 As shown, the electronic device 100 may include: a processor 110, an internal memory 120, a display screen 130, a folding angle detection component 140, etc.
[0036] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 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.
[0037] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0038] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0039] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0040] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0041] Electronic device 100 implements display functions through a GPU, display screen 130, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 130 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0042] The display screen 130 is used to display images, videos, etc. The display screen 130 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 130, where N is a positive integer greater than 1.
[0043] Internal memory 120 can be used to store computer executable program code, which includes instructions. Internal memory 120 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.). The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 120 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 120 and / or instructions stored in memory located within the processor.
[0044] The folding angle detection component 140 is used to detect the folding angle of the electronic device. Optionally, the folding angle detection component 140 can be implemented by an angle detection sensor.
[0045] Figure 2The diagram shown is a software structure block diagram of an electronic device according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. This embodiment uses the Android system as an example to illustrate the software structure of an Android-based electronic device. In some embodiments, the Android system is divided into five layers, from top to bottom: the application layer, the application framework layer (also called the system framework layer), the system library and Android runtime layer, the hardware abstraction layer (HAL), and the kernel layer.
[0046] The application layer can include several applications (hereinafter referred to as applications), such as camera, gallery, calendar, WLAN, etc.
[0047] The application framework layer provides an Application Programming Interface (API) and programming framework for applications in the application layer, including various components and services to support Android development. The application framework layer also includes some predefined functions. In this embodiment, the application framework layer may include: a display manager, a layer compositor (SurfaceFlinger), etc.
[0048] The display manager is used to manage displays.
[0049] SurfaceFlinger is used to composite layers that require GPU processing, and then sends the composited layers and the layers that require HWC processing to HWC.
[0050] The system libraries and Android runtime layer comprise the system libraries and the Android Runtime. The system libraries can include multiple functional modules, such as a surface manager, a 2D graphics engine, and 3D graphics processing libraries (e.g., OpenGL ES). The 2D graphics engine implements 2D graphics drawing, image rendering, compositing, and layer processing; the 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The Android runtime is responsible for the scheduling and management of the Android system, specifically including the core libraries and the virtual machine. The core libraries consist of two parts: one part contains the functionalities that Java calls, and the other part contains the core Android libraries; the virtual machine runs Android applications developed using Java.
[0051] The HAL layer is the interface layer located between the operating system kernel and the hardware circuitry. The HAL layer includes, but is not limited to, the hardware compositor (hwcomposer, HWC). HWC is used for layer composition, providing hardware support for the SurfaceFlinger service.
[0052] The kernel layer is the layer between hardware and software. The kernel layer can include: display driver, folding angle detection driver, etc. The display driver is used to drive the display screen. HWC can instruct the display driver to power on or off the display screen. For example, HWC can send a blank command or an unblank command to the display driver; the blank command instructs the display screen to power off, and the unblank command instructs the display screen to power off. The folding angle detection driver is used to drive the folding angle detection component.
[0053] The following embodiments will describe in detail the display switching method of this application in conjunction with the software structure of the above-described electronic device.
[0054] The display switching method of this application embodiment can be applied to electronic devices with at least two displays. For example, the electronic device can be a foldable device with at least two displays, such as a foldable mobile phone with an inner screen and an outer screen.
[0055] In one embodiment, such as Figure 3A As shown, the foldable device may include a first component 101 and a second component 102, which are connected by a folding component 100. The folding component 100 can support the folding or unfolding of the first component 101 and the second component 102 about the folding component 100 as an axis. Based on the folding angle θ of the first component 101 and the second component 102, the foldable device has three states; in other words, the positional relationship between the first component 101 and the second component 102 can be divided into three states:
[0056] In the fully unfolded state, the folding angle θ of the first component 101 and the second component 102 is 180 degrees.
[0057] In the incompletely folded state, the folding angle θ of the first component 101 and the second component 102 is less than 180 degrees and greater than 0 degrees.
[0058] In the fully folded state, the folding angle θ of the first component 101 and the second component 102 is 0 degrees.
[0059] Based on whether a foldable device is visible to the user when fully folded, its surface can be divided into outer and inner surfaces. The outer surface refers to the surface visible to the user when the device is fully folded, and from the user's viewing and usage perspective, this includes the front, back, and sides visible when the device is fully folded. The inner surface refers to the surface not visible to the user when the device is fully folded. The aforementioned front, back, and sides can be considered from the user's viewing and usage perspective.
[0060] The inner surface of the foldable device may include: a first surface of the first component 101 and a second surface of the second component 102. The first surface of the first component 101 is a surface of the foldable device that is not visible to the user when the device is fully folded, and the second surface of the second component 102 is a surface of the foldable device that is not visible to the user when the device is fully folded.
[0061] Take a foldable device with two displays as an example.
[0062] A display screen, called an outer screen, can be installed on the outer surface of a foldable device, and a display screen, called an inner screen, can be installed on the inner surface of the foldable device.
[0063] The outer screen can be a foldable screen or a non-foldable screen. The location of the outer screen on the outer surface is not limited in this embodiment. For example,
[0064] If the outer screen is a non-foldable screen, the outer screen can be placed on the front or back of the foldable device when it is fully folded.
[0065] If the outer screen is a foldable screen, the outer screen can be set on the front and back of the foldable device in the fully folded state, so that the outer screen folds or unfolds as the first component 101 and the second component 102 are folded or unfolded.
[0066] The inner screen can be a foldable screen or a non-foldable screen. The location of the inner screen on the inner surface is not limited in this embodiment. For example,
[0067] If the inner screen is a non-foldable screen, the inner screen can be disposed on the first surface of the first component 101, or it can be disposed on the second surface of the second component 102;
[0068] If the inner screen is a foldable screen, the inner screen can be disposed on the first surface of the first component 101 and the second surface of the second component 102, so that the inner screen folds or unfolds as the first component 101 and the second component 102 are folded or unfolded.
[0069] For example, Figure 3BIn the foldable device shown, the outer screen 1011 is disposed on the front of the foldable device in its fully folded state, and the inner screen 1021 is a foldable screen, disposed on both the first surface of the first component 101 and the second surface of the second component 102. As the first component 101 and the second component 102 are folded or unfolded about the folding component 100 as an axis, the inner screen 1021 folds or unfolds accordingly. In some embodiments, Figure 3B The foldable device shown could be a foldable phone.
[0070] It should be noted that the dimensions of the outer screen 1011 and the inner screen 1021 are not limited in this embodiment of the application.
[0071] It should be noted that, in the above embodiments, the electronic device includes two displays as an example. In other embodiments of this application, the electronic device, such as a foldable device, may also include displays other than the outer and inner screens mentioned above. This application does not limit the scope of the embodiments.
[0072] In the embodiments of this application, Figure 3B The example shown is a foldable device that includes an outer screen and an inner screen.
[0073] Figure 4 This is a flowchart illustrating a display screen switching method according to an embodiment of this application. It can be applied to electronic devices including two or more displays provided in the embodiments of this application, such as those described above. Figure 3A and Figure 3B The foldable devices shown are examples of this.
[0074] Figure 4 The electronic device is assumed to include a first display screen and a second display screen. The first display screen can be either an outer screen or an inner screen, as described above. If the first display screen is an outer screen, the second display screen can be an inner screen, and vice versa.
[0075] like Figure 4 As shown, the method may include:
[0076] Step 401: When switching from the first display screen to the second display screen, control the first display screen to start the power-down process;
[0077] Step 402: Before the power-down process of the first display screen is completed, control the second display screen to start the power-on process.
[0078] Optionally, steps 401 and 402 described above can be performed by the HWC in the electronic device.
[0079] Figure 4In the display switching method shown, after controlling the first display to start the power-down process, but before the power-down process of the first display is completed, the second display is controlled to start the power-on process. Therefore, it is not necessary to wait for the power-down process of the first display to be completed before controlling the power-on process of the second display to start the power-on process, thereby shortening the switching time from the first display to the second display and improving the switching speed of the display.
[0080] Figure 5 This is a schematic diagram of another embodiment of the electronic device of this application, wherein the electronic device is... Figure 3B The foldable phone shown, which includes an inner screen and an outer screen, exemplifies how the structure of this electronic device can be used to achieve... Figure 4 The display screen switching method is shown below. Figure 5 As shown, it includes:
[0081] Display manager is used to manage the display screen of an electronic device's user interface based on factors such as the folding angle of the device.
[0082] Surfaceflinger is used for layer compositing.
[0083] HWC is used to merge layers based on the display screen showing the user interface.
[0084] Internal screen driver, used to drive the internal screen.
[0085] External screen driver, used to drive the external screen.
[0086] Folding angle detection driver, used to drive the folding angle detection component.
[0087] Display manager and Surfacefling can be set at the application framework layer of the electronic device. HWC can be set at the HAL layer of the electronic device, while the inner screen driver, outer screen driver, and folding angle detection driver can be set at the kernel layer of the electronic device.
[0088] It should be noted that, Figure 5 The structure shown is merely an example. In other embodiments provided in this application, the modules in the above structure can be merged or split, or the layer where the above modules are located can be adaptively adjusted based on the software structure of the electronic device, etc.
[0089] The following is based on Figure 5 The electronic device structure shown Figure 4 The implementation of the display switching method shown is illustrated by way of example.
[0090] Figure 6 This is another flowchart illustrating the display switching method according to an embodiment of this application. In this method, the electronic device is a foldable phone, which includes an inner screen and an outer screen.
[0091] Step 601: The display manager receives the folding angle detection data sent by the angle detection component driver.
[0092] The angle detection component driver can periodically send the detected folding angle to the display manager, and the specific value of the period is not limited in this application embodiment.
[0093] It should be noted that the smaller the period value, the higher the accuracy of the angle detection component driver in detecting the folding angle. Correspondingly, the display manager can more accurately determine the triggering time for subsequent display switching.
[0094] Step 602: The display manager determines the first switching condition for switching the display from the inner screen to the outer screen based on the detection data of the folding angle, and then determines to switch from the inner screen to the outer screen.
[0095] Optionally, the switching of the display screen can be triggered during the folding or unfolding of the electronic device.
[0096] Regarding the folding process of electronic devices, such as Figure 7A As shown, when the electronic device is in its fully unfolded state, the first and second components move towards each other, and the folding angle gradually decreases from 180 degrees until it finally decreases to 0 degrees, becoming a fully folded state. During this folding process, the display screen can be switched from the inner screen to the outer screen, that is, the inner screen is powered off and the outer screen is powered on. Specifically, a first angle threshold θ1 can be preset. During the above folding process, when the folding angle changes from greater than or equal to θ1 to less than θ1, that is, from a folding angle of 180 degrees to... Figure 7A When the folding angle θ1 shown in the middle of the attached figure is folded again, the display screen is triggered to switch from the inner screen to the outer screen. In this implementation, the first switching condition is that the folding angle changes from greater than or equal to θ1 to less than θ1.
[0097] Regarding the unfolding process of electronic devices, such as Figure 7B As shown, when the electronic device is in a fully folded state, the first and second components move in opposite directions, and the folding angle gradually increases from 0 degrees until it reaches 180 degrees, becoming fully unfolded. During this unfolding process, the display screen can be switched from the outer screen to the inner screen, that is, the outer screen is powered off and the inner screen is powered on. Specifically, a second angle threshold θ2 can be preset. During the above unfolding process, when the folding angle changes from less than or equal to θ2 to greater than θ2, that is, when it unfolds from a folding angle of 0 degrees to... Figure 7B When the folding angle θ2 shown in the middle of the attached diagram is folded further, the display screen is triggered to switch from the outer screen to the inner screen. In this implementation, the second switching condition for switching from the outer screen to the inner screen is that the folding angle changes from less than or equal to θ2 to greater than θ2.
[0098] Wherein, θ1 and θ2 may be equal or unequal, and this application does not limit them.
[0099] Step 603: The display manager sends a first instruction message to Surfaceflinger, which is used to indicate that the inner screen is powered off.
[0100] Step 604: Surfaceflinger sends a second instruction message to HWC, which is used to indicate that the inner screen is powered off.
[0101] Step 605: HWC sends a third instruction message to the internal screen driver, which is used to instruct the internal screen driver to power down the internal screen. Step 606 is executed. HWC sends a first feedback message to Surfaceflinger, which is used to instruct Surfaceflinger that the power-down of the internal screen is complete. Step 608 is executed.
[0102] For example, the third instruction could be the blank command.
[0103] In other embodiments, after HWC sends the third instruction information to the internal screen driver, it needs to wait for the internal screen driver to complete the internal screen power-down process before sending the second feedback information back to HWC to indicate that the internal screen power-down is complete. After receiving the second feedback information, HWC sends the first feedback information to Surfaceflinger. Figure 6 In the embodiment of this application shown, after HWC receives the third instruction information, it can send the first feedback information to Surfaceflinger. Therefore, compared with the other embodiments mentioned above, in this step, the first feedback information can be sent to Surfaceflinger before HWC receives the second feedback information from the inner screen driver. This saves the time that HWC waits for the inner screen driver to control the inner screen to execute the power-down process and send the first feedback information to HWC, shortens the time of inner screen power-down and outer screen power-on, and thus shortens the display switching time and improves the display switching speed.
[0104] Optionally, a thread can be pre-defined to send feedback information that the display has finished powering off to Surfaceflinger. In this step, HWC can call this thread to send the aforementioned first feedback information to Surfaceflinger.
[0105] The execution order between the two steps of HWC sending the third instruction information to the inner screen driver and HWC sending the first feedback information to Surfaceflinger is not limited in this embodiment of the application, as long as the step of HWC sending the first feedback information to Surfaceflinger is executed before HWC receives the second feedback information sent by the inner screen driver.
[0106] Optionally, after receiving the second instruction information, HWC can send the first feedback information directly to Surfaceflinger without waiting, thereby minimizing the time HWC waits for the internal screen driver to control the internal screen to execute the power-down process and send the first feedback information to HWC, and shortening the display switching time.
[0107] Step 606: The internal screen driver starts the power-down process of the internal screen. After the power-down process is completed, it sends a second feedback message to the HWC. The second feedback message is used to indicate to the HWC that the power-down process of the internal screen is complete. Then, proceed to step 607.
[0108] The power-on and power-off process for a display driver is specific to the display screen and may vary depending on the display screen. For example, the power-off process for a display driver might include: powering off the backlight IC, bias IC, MIPI controller, and display panel (e.g., LCD), etc. Once the power-off process is complete...
[0109] For example, the process of controlling the power-down of the internal screen by the internal screen driver may include, but is not limited to: sequentially powering down the backlight IC, the bias IC, the MIPI IC, and the LCD, etc.
[0110] Step 607: HWC updates the internal screen to the power-off state, and this branch process ends.
[0111] HWC can store the power-on and power-off states of the display screen. Specifically, this can be achieved by setting corresponding power-on and power-off state parameters for each display screen. Different parameter values can respectively indicate whether the display screen is in a power-on state (e.g., parameter value 0) or a power-off state (e.g., parameter value 1).
[0112] For example, before receiving the second feedback information, the power-on / off status parameters of the display screen in the HWC can be: inner screen: 0, outer screen: 1; after receiving the second feedback information, the power-on / off status parameters of the display screen in the HWC can be: inner screen: 1, outer screen: 1.
[0113] Step 608: Surfaceflinger updates the inner screen to a power-down state and sends a third feedback message to the display manager, which is used to indicate to the display manager that the power-down of the inner screen is complete.
[0114] Surfaceflinger can save the power-on and power-off states of the display. Specifically, this can be achieved by setting corresponding power-on and power-off state parameters for each display, using different parameter values to indicate whether the display is in a power-on state (e.g., parameter value 0) or a power-off state (e.g., parameter value 1).
[0115] For example, before receiving the third feedback information, the power-on / off status parameters of the Surfaceflinger display can be: inner screen: 0, outer screen: 1; after receiving the third feedback information, the power-on / off status parameters of the Surfaceflinger display can be: inner screen: 1, outer screen: 1.
[0116] Step 609: The display manager sends a fourth instruction message to Surfaceflinger, which is used to indicate that the external screen is powered on.
[0117] Step 610: Surfaceflinger sends the fifth instruction message to HWC, which is used to indicate that the external screen is powered on.
[0118] Step 611: HWC sends the sixth instruction information to the external screen driver. The sixth instruction information is used to instruct the external screen driver to power on the external screen.
[0119] Step 612: The external screen driver initiates the power-on process of the external screen. After the power-on process is completed, it sends the fourth feedback information to the HWC. The fourth feedback information is used to indicate to the HWC that the external screen power-on is complete.
[0120] Step 613: HWC updates the external screen to power-on state and sends the fifth feedback message to Surfaceflinger, which is used to indicate to Surfaceflinger that the external screen power-on is complete.
[0121] For example, before receiving the fifth feedback information, the power-on / off status parameters of the display screen in the HWC can be: inner screen: 1, outer screen: 1; after receiving the fifth feedback information, the power-on / off status parameters of the display screen in the HWC can be: inner screen: 1, outer screen: 0.
[0122] Step 614: Surfaceflinger updates the external screen to a powered-on state and sends a sixth feedback message to the display manager, which indicates to the display manager that the external screen is powered on.
[0123] For example, before receiving the sixth feedback message, the power-on / off status parameters of the Surfaceflinger's display can be: inner screen: 1, outer screen: 1; after receiving the sixth feedback message, the power-on / off status parameters of the Surfaceflinger's display can be: inner screen: 1, outer screen: 0.
[0124] At this point, the switching from the inner screen to the outer screen, triggered by the display manager, is complete.
[0125] This application also provides an electronic device, including a first display screen, a second display screen, a processor, and a memory, wherein the processor is used to execute the method provided in any embodiment of this application.
[0126] This application also provides an electronic device, which includes a storage medium and a central processing unit. The storage medium may be a non-volatile storage medium, and a computer-executable program is stored in the storage medium. The central processing unit is connected to the non-volatile storage medium and executes the computer-executable program to implement the method provided in any embodiment of this application.
[0127] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method provided in any embodiment of this application.
[0128] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to perform the method provided in any of the embodiments shown in this application.
[0129] In this application embodiment, "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 the existence of A alone, A and B simultaneously, or B alone. 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" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0130] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0131] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0132] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in 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.
[0133] The above description is merely a specific embodiment of this application. 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 protection scope of this application. The protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method for switching displays, characterized in that, The method is applied to an electronic device, the electronic device including a first display screen and a second display screen; the method includes: When switching from the first display screen to the second display screen, Surfaceflinger receives a first instruction from the display manager, indicating that the first display screen should be powered down; HWC receives a second instruction from Surfaceflinger, also indicating that the first display screen should be powered down; in response to the second instruction, HWC sends a third instruction to the first display screen driver, instructing the first display screen driver to initiate the power-down process for the first display screen, the first display screen driver being used to drive the first display screen; Surfaceflinger and the display manager are located in the application framework layer of the electronic device; HWC is located in the HAL layer of the electronic device; the first display screen driver is located in the kernel layer of the electronic device; After the HWC sends the third indication information to the first display driver and before receiving the second feedback information sent by the first display driver, the HWC sends a first feedback information to the Surfaceflinger; the second feedback information is sent by the first display driver after the first display has been powered down, and the second feedback information is used to indicate to the HWC that the first display has been powered down; the first feedback information is used to indicate that the first display has been powered down; in response to the first feedback information, the Surfaceflinger updates the first display in the Surfaceflinger to a powered-down state, and sends a third feedback information to the display manager, the third feedback information being used to indicate to the display manager that the first display has been powered down; The Surfaceflinger receives a fourth instruction from the display manager in response to the third feedback information, the fourth instruction being used to instruct the Surfaceflinger to power on the second display; the HWC receives a fifth instruction from the Surfaceflinger, the fifth instruction being used to instruct the second display to power on. In response to the fifth indication information, the HWC sends a sixth indication information to the second display driver. The sixth indication information is used to instruct the second display driver to start the power-on process of the second display. The second display driver is used to drive the second display. The second display driver is located in the kernel layer of the electronic device.
2. The method according to claim 1, characterized in that, The method further includes: The HWC receives a fourth feedback message sent by the second display driver. The fourth feedback message is sent by the second display driver after the second display has been powered on. The fourth feedback message is used to indicate to the HWC that the second display has been powered on. In response to the fourth feedback information, the HWC sends a fifth feedback information to the Surfaceflinger, which is used to indicate to the Surfaceflinger that the second display screen has completed power-on; the Surfaceflinger updates the second display screen in the Surfaceflinger to a power-on state, and sends a sixth feedback information to the display manager, which is used to indicate to the display manager that the second display screen has completed power-on.
3. The method according to claim 2, characterized in that, The method further includes: In response to the fourth feedback information, the HWC updates the state of the second display screen in the HWC to the power-on state.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: After receiving the second feedback information, the HWC updates the state of the first display screen in the HWC to the power-off state.
5. The method according to any one of claims 1 to 3, characterized in that, The electronic device is a foldable device; The first display screen is the inner screen of the foldable device, and the second display screen is the outer screen of the foldable device; the method further includes: When the folding angle of the electronic device gradually changes from greater than or equal to a first threshold to less than the first threshold, it is determined that the device will switch from the first display screen to the second display screen.
6. The method according to any one of claims 1 to 3, characterized in that, The electronic device is a foldable device; The first display screen is the outer screen of the foldable device, and the second display screen is the inner screen of the foldable device; The method further includes: When the folding angle of the electronic device gradually changes from less than or equal to the second threshold to greater than the second threshold, it is determined that the device will switch from the first display screen to the second display screen.
7. An electronic device, characterized in that, include: First display screen; Second display screen; processor; Memory; And one or more computer programs, wherein the computer programs are stored in the memory, and when executed by the processor, the computer programs cause the electronic device to perform the method of any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to perform the method described in any one of claims 1 to 6.