Power failure detection method, electronic equipment, storage medium and program product
By implementing a power-down detection method in the display driver, the problem of sudden blackouts in the AOD function of electronic devices is solved, ensuring that the display lights up normally and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2026-04-28
AI Technical Summary
In the AOD (Away From Demand) function of electronic devices, the screen may suddenly go black, affecting the user experience. Existing technologies are unable to effectively solve this problem.
By implementing a power-down detection method in the display driver, the system can detect whether the display is powered on and perform power-on recovery if it is not powered on, ensuring that the display can be quickly repaired when there is an abnormal black screen.
It effectively solves the problem of electronic devices suddenly going black during AOD (Always On Demand) function, ensuring that the display can light up normally and reducing the impact on the user experience.
Smart Images

Figure CN121938281A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a power failure detection method, electronic device, storage medium, and program product. Background Technology
[0002] With the rapid development of terminal technology, electronic devices such as mobile phones and tablets have become increasingly feature-rich, becoming indispensable tools in people's daily lives. Users frequently turn on the screen of their electronic devices to view basic information such as time and notifications. To facilitate users' quick access to this basic information and save battery power, the always-on display (AOD) function of electronic devices has emerged.
[0003] The principle behind AOD (Always-On Display) is that after the electronic device screen is off, some pixels on the screen are illuminated to display basic information such as time and notifications, while other pixels remain black. This allows users to conveniently view the information they need without turning on the entire screen, while also reducing the power consumption of the electronic device.
[0004] AOD (Always-On Display) functionality typically includes Smart Display mode, Timed Display mode, and All-Day Display mode. In Timed Display mode, the electronic device's screen remains on for a fixed period after it has been turned off. In All-Day Display mode, the screen remains on for an extended period after the electronic device's screen has been turned off. However, currently, there is a problem where the electronic device's screen may suddenly go black while continuously displaying AOD, which can severely impact the user experience. Summary of the Invention
[0005] This application provides a power-off detection method, an electronic device, a storage medium, and a program product, which enables the electronic device to power on its screen normally. The technical solution is as follows:
[0006] Firstly, a power-down detection method is provided, which is applied to an electronic device including a display driver and a display screen. In this method, when the power mode changes from a low-power suspend mode to an on mode, the display driver detects whether the display screen is powered on; if the display screen is not powered on, the display driver restores the display screen to power-on mode.
[0007] When an electronic device is in a timed screen-off display phase or a 24 / 7 screen-off display phase, its power mode is low-power suspend mode. A change in power mode from low-power suspend mode to on mode indicates that the electronic device has exited the timed screen-off display phase or the 24 / 7 screen-off display phase. When the electronic device is in a screen-on state, its power mode is on mode.
[0008] The timed always-on display phase refers to the phase in which a static image is displayed during the Always-On Display (AOD) function in timed display mode. The all-day always-on display phase refers to the phase in which a static image is displayed during the All-Day Display (AOD) function in all-day display mode.
[0009] In this application, the display driver can perform power-down detection on the display screen when the power mode changes from low-power suspend mode to on mode. That is, the display driver can perform power-down detection on the display screen when the electronic device exits the timed screen-off display phase or the all-day screen-off display phase, and then restore power to the display screen even when it is not powered on. Thus, even if the electronic device experiences an abnormal black screen problem during the timed screen-off display phase or the all-day screen-off display phase, it can be quickly repaired when the electronic device exits the timed screen-off display phase or the all-day screen-off display phase, restoring power to the display screen and ensuring that the electronic device can light up normally, thereby reducing the impact on the user experience.
[0010] Optionally, the electronic device also includes an AOD application and a PMS. In one possible implementation, after receiving a power button event, the AOD application sends an AOD exit command to the PMS; after receiving the AOD exit command, the PMS updates the power mode to the ON mode and sends first power mode information to the display driver, the first power mode information being used to indicate updating the power mode to the ON mode; after receiving the first power mode information, the display driver updates the power mode to the ON mode.
[0011] If an electronic device experiences an abnormal black screen while displaying a static, off-screen image, the user can turn the screen back on by pressing the power button. In this case, pressing the power button changes the power mode from low-power suspend mode to on mode. The display driver can then detect the power loss of the display and restore power to the screen even when it is not powered on. Therefore, when an electronic device experiences an abnormal black screen while displaying a static, off-screen image, the user can simply press the power button to turn on the screen, thus reducing the impact of this black screen issue on the user experience.
[0012] In one possible implementation, the AOD application sends an AOD start command to the PMS; after receiving the AOD start command, the PMS updates the power mode to low power mode and sends second power mode information to the display driver, which is used to indicate that the power mode should be updated to low power mode; after receiving the second power mode information, the display driver updates the power mode to low power mode.
[0013] The AOD (Always-On Display) command is used to instruct the user to enable screen-off display. Upon receiving the AOD command, the PMS determines that screen-off display is required and can therefore update the power mode to low-power mode.
[0014] Optionally, the electronic device also includes SurfaceFlinger service and HWC. After the AOD application sends the AOD start command to the PMS, it can also generate layer data of the i-th frame image in the screen-off animation; after the SurfaceFlinger service obtains the layer data of the i-th frame image, it obtains the i-th frame image through HWC based on the layer data of the i-th frame image, where i is a positive integer; HWC sends the i-th frame image to the display driver; the display driver sends the i-th frame image to the display screen.
[0015] In this application, the AOD application can generate each frame of the screen-off animation in sequence, and the display screen can present the corresponding animation effect after displaying these images in sequence.
[0016] Optionally, after the AOD application generates the layer data of the last frame image in the screen-off animation, it sends an AOD freeze command to the PMS; after receiving the AOD freeze command, the PMS updates the power mode to low power suspend mode and sends third power mode information to the display driver, which is used to indicate that the power mode should be updated to low power suspend mode; after receiving the third power mode information, the display driver updates the power mode to low power suspend mode.
[0017] The AOD (Always On Display) command is used to instruct either a timed screen-off display or a 24 / 7 screen-off display. In other words, the AOD command indicates whether to enter a timed screen-off display phase or a 24 / 7 screen-off display phase.
[0018] In this application, after sending the last frame of the screen-off animation to the display screen, the display driver will not send any more images to the display screen when the power mode is in low-power suspend mode. In this case, the display screen will continuously display the last frame of the screen-off animation, thereby achieving a static display of the screen-off image.
[0019] Optionally, after the AOD application sends an AOD pause command to the PMS, the AOD application can also send an AOD update command to the PMS when the timer expires. After receiving the AOD update command, the PMS updates the power mode to low power mode and sends fourth power mode information to the display driver. The fourth power mode information is used to indicate that the power mode should be updated to low power mode. After receiving the fourth power mode information, the display driver updates the power mode to low power mode.
[0020] This AOD update command is used to instruct the user to update the always-on display image.
[0021] Optionally, when the AOD application reaches the scheduled time, it can also generate layer data of the target image; after the SurfaceFlinger service obtains the layer data of the target image, it obtains the target image through HWC based on the layer data of the target image; HWC sends the target image to the display driver; the display driver sends the target image to the display screen.
[0022] The target image here differs from the image previously generated by the AOD application. For example, the target image may have the same main content as the previously displayed image, but the position of the main content has changed.
[0023] For example, an AOD application can fine-tune the position of the main content in the always-on display image every minute or every few minutes to obtain a new always-on display image. For instance, an AOD application can slightly move content such as the time and icons in the always-on display image every minute or every few minutes to reduce the risk of screen burn-in.
[0024] As an example, the display driver detects whether the display is powered on when the power mode changes from low power suspend mode to low power mode; if the display is not powered on, the display driver restores the display to power on.
[0025] As another example, after receiving an image sent by HWC, the display driver detects whether the display is powered on, whether it is currently in a timed screen-off display phase or a 24-hour screen-off display phase; if the display is not powered on, the display driver restores the display to power on.
[0026] In this application, the display driver can detect power loss of the display while updating the image on the screen-off screen, and can quickly restore power to the display if it is not powered on. This ensures normal operation of the screen-off display while saving power, thereby minimizing the impact on the user experience.
[0027] Optionally, the operation of the display driver to detect whether the display screen is powered on can be as follows: the display driver obtains the GPIO status, which is used to indicate whether the GPIO pin connected to the power supply terminal of the display panel is in a high-level state or a low-level state; the display driver determines whether the display screen is powered on based on the GPIO status.
[0028] For example, the power supply terminal of the display panel can be the port in the display screen where the PMIC powers the display panel, such as the ELVDD output terminal of the PMIC.
[0029] For example, a GPIO pin of a chip can be pre-connected to the power supply of the display panel via appropriate voltage divider resistors. The chip can determine the voltage level of the GPIO pin. If the GPIO pin is high, the chip sets the GPIO state to a first value (e.g., 1); if the GPIO pin is low, the chip sets the GPIO state to a second value (e.g., 0). The display driver can obtain the GPIO state from this chip.
[0030] For example, the input mode of this GPIO pin can be a floating input mode. In this case, the display driver can determine that the display is powered on if the GPIO state indicates that the GPIO pin is in a high-level state, such as if the GPIO state is a first state value; and determine that the display is not powered on if the GPIO state indicates that the GPIO pin is in a low-level state, such as if the GPIO state is a second state value.
[0031] Optionally, the electronic device includes an HWC, and the operation of the display driver to restore the display screen to power-on can be as follows: the display driver sends a recovery event to the HWC, which is used to request the display screen to be restored to power-on; after receiving the recovery event, the HWC sends a target instruction to the display driver, which is used to instruct the display screen to be powered down and then powered on; after receiving the target instruction, the display driver controls the display screen to be powered down and then powered on.
[0032] Secondly, a power failure detection device is provided, which has the function of implementing the power failure detection method described in the first aspect. The power failure detection device includes at least one module for implementing the power failure detection method provided in the first aspect.
[0033] Thirdly, an electronic device is provided, comprising: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, wherein the one or more processors invoke the computer instructions to cause the electronic device to perform the power-down detection method provided in the first aspect.
[0034] Fourthly, a chip system is provided, which is applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to execute the power-down detection method provided in the first aspect.
[0035] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the power-down detection method provided in the first aspect.
[0036] In a sixth aspect, a computer program product is provided that, when the computer program product is run on an electronic device, causes the electronic device to perform the power failure detection method provided in the first aspect.
[0037] The technical effects achieved by the second, third, fourth, fifth, and sixth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0038] Figure 1 This is a schematic diagram of an application settings interface provided in an embodiment of this application.
[0039] Figure 2 This is a schematic diagram of another settings application interface provided in an embodiment of this application.
[0040] Figure 3 This is a schematic diagram of the interface of a control center provided in an embodiment of this application.
[0041] Figure 4 This is a schematic diagram of the triggering process for an always-on display provided in an embodiment of this application.
[0042] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0043] Figure 6 This is a block diagram of a software system for an electronic device provided in an embodiment of this application.
[0044] Figure 7 This is a schematic diagram of a power mode provided in an embodiment of this application.
[0045] Figure 8 This is a flowchart illustrating the implementation process of an AOD function provided in an embodiment of this application.
[0046] Figure 9 This is a flowchart illustrating another implementation process of the AOD function provided in this application embodiment.
[0047] Figure 10 This is a flowchart of a screen-off image display process provided in an embodiment of this application.
[0048] Figure 11 This is a flowchart of another screen-off image display process provided in an embodiment of this application.
[0049] Figure 12 This is a flowchart of a power failure detection method provided in an embodiment of this application.
[0050] Figure 13This is a flowchart of another power failure detection method provided in the embodiments of this application.
[0051] Figure 14 This is a flowchart of another power failure detection method provided in the embodiments of this application. Detailed Implementation
[0052] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details.
[0053] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0054] It should be understood that "one or more" as mentioned in this application refers to one, two, or more, and "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of 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, and B existing alone.
[0055] To facilitate a clear description of the technical solutions of this application, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" do not necessarily imply that they are different.
[0056] The terms "one embodiment" or "some embodiments" used in this application mean that one or more embodiments of this application include the specific features, structures, or characteristics described in that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0057] The AOD function involved in the embodiments of this application will be described next.
[0058] To help users quickly view basic information such as time, date, SMS messages, and call reminders, and to save battery power, electronic devices offer an AOD (Away From Home) function.
[0059] The principle behind AOD (Always-On Display) is as follows: after the electronic device screen is off, some pixels on the screen are illuminated to display basic information such as time, date, SMS messages, and call reminders, while other pixels remain black. This allows users to conveniently view the information they need without turning on the entire screen, while also reducing the power consumption of the electronic device.
[0060] Optionally, the AOD function can have multiple display modes, such as intelligent display mode, timed display mode, and all-day display mode.
[0061] For example, intelligent display mode refers to the ability to display the screen when touched or a face is detected after the electronic device's screen is turned off. Timed display mode refers to the ability to display the screen at fixed time intervals after the electronic device's screen is turned off. All-day display mode refers to the ability to display the screen at all times of the day after the electronic device's screen is turned off.
[0062] It should be noted that the "always-on display" mentioned in the embodiments of this application refers to the display operation of the AOD function, that is, the display operation of lighting up some pixels in the screen to display some basic information while keeping other pixels black.
[0063] In some embodiments, enabling and disabling the AOD function can be achieved through controls provided by a settings application. In other embodiments, enabling and disabling the AOD function can be achieved through a separate AOD application. In still other embodiments, enabling and disabling the AOD function can be achieved through controls provided by a control center. Of course, enabling and disabling the AOD function can also be achieved in other ways, and this application embodiment does not limit this.
[0064] The following is combined Figure 1 and Figure 2 This document provides an exemplary description of the process for enabling and disabling the AOD (Action on Demand) function based on controls provided by the settings application.
[0065] like Figure 1 As shown in Figure (a), the electronic device displays interface 11. Interface 11 can display icons for multiple applications, such as the icon 111 for the settings application, as well as icons for applications such as telephone, messaging (SMS application), gallery, camera, clock, calendar, memo, music, file management, video, calculator, weather, email, voice recorder, and browser. In some embodiments, interface 11 may also be referred to as the main interface or desktop.
[0066] Afterwards, the user can click the settings application icon 111 in interface 11. In response to this click, such as... Figure 1 As shown in Figure (b), the electronic device can launch the settings application to display the settings application interface 12. The interface 12 can display multiple function entries (also referred to as options or controls), such as the desktop and personalization settings entry 122, as well as settings entries for functions such as wireless local area networks (WLAN), Bluetooth, mobile networks, smart connectivity, more connections, display and brightness, sound and vibration, notifications and status bar.
[0067] Afterwards, the user can click the desktop and personalization settings entry 122 in interface 12. In response to this click, such as... Figure 1 As shown in Figure (c), the electronic device can display an interface 13 for desktop and personalization functions. The interface 13 can display multiple function entries, such as the setting entry 131 for the always-on display function (hereinafter referred to as the AOD function), as well as setting entries for functions such as lock screen style, magazine lock screen, font, icons, theme, desktop settings, and desktop style.
[0068] Afterwards, the user can click the AOD function settings entry 131 in interface 13. In response to this click, such as... Figure 1 As shown in Figure (d), the electronic device can display the AOD function interface 14. The interface 14 can display the control 143 (also called a switch) corresponding to the AOD function, as well as the setting entry 144 for the display mode of the AOD function. Here, it is assumed that the control 143 is in the off state.
[0069] In some embodiments, a user can click on a control 143 that is in a closed state on interface 14. In response to this click operation, such as... Figure 1 As shown in Figure (e), the electronic device can set control 143 to the on state and enable the AOD (Ahead-of-Date) function. Understandably, if the user needs to disable the AOD function, they can click... Figure 1 The control 143 shown in Figure (e) is in the open state. In response to the click operation, the electronic device can set the control 143 to the closed state and disable the AOD function.
[0070] In some embodiments, after enabling the AOD (Ahead-of-Demand) function, the user can also choose how the AOD function is displayed. For example, such as... Figure 1 As shown in Figure (e), the user can click the display mode setting entry 144 in interface 14. In response to this click operation, as shown... Figure 1As shown in Figure (f), the electronic device can display interface 15. Interface 15 can display controls 151 corresponding to the intelligent display mode, 152 corresponding to the timed display mode, and 153 corresponding to the all-day display mode. It is assumed that controls 151, 152, and 153 are all unselected. In this case, the user can select one of the display modes according to their needs.
[0071] For example, if the user wants to choose a timed display method, then as follows: Figure 2 As shown in Figure (a), the user can click on control 152. In response to this click, the electronic device can set control 152 to the selected state and set the AOD function to timed display mode. Furthermore, the electronic device can display a start time setting entry 1521 and an end time setting entry 1522 on interface 15. The user can set the start time through setting entry 1521 and the end time through setting entry 1522. The electronic device can set the time period between the start time and the end time as the screen-off display time period (hereinafter referred to as the preset time period).
[0072] For example, if a user wants to select an all-day display mode, then as follows: Figure 2 As shown in Figure (b), the user can click on control 153. In response to this click, the electronic device can set control 153 to the selected state and set the AOD function to the all-day display mode.
[0073] Optionally, in some other embodiments, the AOD function setting entry 131 can also be directly set in the interface 12. In this way, when the user clicks the AOD function setting entry 131 in the interface 12, they can directly enter the interface 14 to set the AOD function, thereby reducing the number of human-computer interactions.
[0074] The following is combined Figure 1 An illustrative explanation is provided of the process for enabling and disabling AOD functionality based on a separate AOD application.
[0075] like Figure 1 As shown in Figure (a), the electronic device displays interface 11, which can display an icon 112 for the AOD application. The user can then click the AOD application icon 112 on interface 11. In response to this click, the electronic device can launch the AOD application and display its interface, as shown below. Figure 1The interface shown is 14. Afterwards, users can turn the AOD function on or off using the controls in the AOD application's interface, and set the display mode of the AOD function when it is on. For example, users can turn the AOD function on or off using control 143 in interface 14, and when the AOD function is on, they can access the display mode interface 15 through the settings entry 144 in interface 14, and set the display mode of the AOD function using controls 151, 152, or 153 in interface 15. The specific operations have been explained in detail above and will not be repeated here.
[0076] The following is combined Figure 3 This document provides an example of how to enable and disable the AOD (Action on Demand) function using controls provided by the control center.
[0077] For example, when the electronic device's interface is any interface after unlocking, the user swipes down from a preset position on the screen (such as the top), and in response to this swipe operation, such as... Figure 3 As shown in Figure (a), the electronic device can display the control center interface 21. Interface 21 can display multiple controls, such as a control 211 for enabling the AOD function, as well as WLAN controls, ringing controls, auto-rotate controls, wireless sharing controls, airplane mode controls, mobile data controls, location information controls, screenshot controls, eye protection mode controls, Bluetooth controls, screen recording controls, near field communication (NFC) controls, flashlight controls, dark mode controls, and do-not-disturb controls.
[0078] In some embodiments, the control 211 can be a switch, as assumed here. Figure 3 The control 211 shown in Figure (a) is in the closed state.
[0079] For example, a user can click Figure 3 In Figure (a), the control 211 in the closed state of the interface 21, in response to the click operation, such as Figure 3 As shown in Figure (b), the electronic device can set control 211 to the on state and enable the AOD function, such as enabling the AOD function in timed display mode or all-day display mode by default.
[0080] Understandably, if a user needs to disable the AOD (Away From Demand) function, they can click [here]. Figure 3 The control 211 shown in Figure (b) is in the open state. In response to the click operation, the electronic device can set the control 211 to the closed state and disable the AOD function.
[0081] In other embodiments, control 211 can be a function entry point.
[0082] For example, a user can click Figure 3 In Figure (a), control 211 in interface 21 responds to the click operation, allowing the electronic device to display the AOD (Action-On Demand) function interface, such as... Figure 1 The interface shown is 14. Afterwards, users can turn the AOD function on or off using the controls in the AOD function interface, and set the display mode of the AOD function when it is on. For example, users can turn the AOD function on or off using control 143 in interface 14, and when the AOD function is on, they can access the display mode interface 15 through the settings entry 144 in interface 14, and set the display mode of the AOD function using controls 151, 152, or 153 in interface 15. Specific operations have been explained in detail above and will not be repeated here.
[0083] Understandably, the above text Figures 1 to 3 The descriptions of enabling and disabling the AOD function in the embodiments are merely illustrative examples for better understanding of the embodiments of this application and do not constitute a limitation on the embodiments of this application.
[0084] It should be noted that, in addition to the above methods, the AOD function can also be turned on or off in other ways, such as by using preset gestures or actions. This application embodiment does not limit this.
[0085] For example, users can long-press the screen with two fingers to enable the AOD function in either timed display mode or all-day display mode; and double-tap the screen with two fingers to disable the AOD function.
[0086] For example, users can use a three-finger long press on the screen to enable the AOD function in either timed display mode or all-day display mode; and use a three-finger double tap on the screen to disable the AOD function.
[0087] In some embodiments, when the AOD function is enabled, the electronic device can trigger an always-on display when the screen is turned off due to timeout or when the screen is turned off by pressing the power button.
[0088] like Figure 4 As shown, when an electronic device changes from a lit screen to a lit screen, it will automatically trigger an always-on display.
[0089] As an example, if a user does not operate an electronic device for an extended period while the screen is on, or if a user presses the power button on an electronic device while the screen is on, then... Figure 4 As shown in Figure (a), electronic devices can trigger an always-on display after a brief period of screen-off, meaning they can display an always-on image after a short screen-off. A portion of the always-on image includes information such as the time, date, text messages, and call reminders, while the remaining area is black.
[0090] As another example, if a user does not operate an electronic device for an extended period while the screen is on, or if a user presses the power button on an electronic device while the screen is on, then... Figure 4 As shown in Figure (b), electronic devices can directly trigger the always-on display, that is, they can directly display the always-on image.
[0091] It should be noted that if the electronic device is using the timed display mode of AOD (Always-On Display), the screen will remain displayed for a preset period after the AOD is triggered. If the electronic device is using the all-day display mode of AOD, the screen will remain displayed for the entire day after the AOD is triggered.
[0092] However, in current AOD (Always-On Display) scenarios with timed and all-day display capabilities, electronic devices may suddenly go black, causing the always-on display image to disappear and impacting the user experience. Furthermore, in these scenarios, after the screen suddenly goes black, users cannot turn it back on by touching the screen or pressing the power button, causing significant inconvenience.
[0093] Therefore, this application provides a power failure detection method that can detect power failure of the display screen in both timed display scenarios and all-day display scenarios of the AOD function, so as to promptly detect and repair abnormal black screen problems of electronic devices, thereby ensuring the normal use of electronic devices and improving the user experience.
[0094] The power failure detection method provided in this application can be applied to electronic devices. For example, the electronic device may be a mobile phone, tablet computer, wearable device, digital camera, in-vehicle device, augmented reality (AR) device, virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), laptop, etc., and this application does not limit the scope of the application.
[0095] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. See also... Figure 5The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0096] It is understood that the structures illustrated in the embodiments of this application 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.
[0097] 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, memory, 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.
[0098] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0099] 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 this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves system efficiency.
[0100] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions, such as saving music, video, and other files on the external memory card.
[0101] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 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 by electronic device 100 during use (such as audio data, phonebook, etc.). Furthermore, internal memory 121 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.
[0102] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0103] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D and application processor.
[0104] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0105] Electronic device 100 can realize display function through GPU, display screen 194 and application processor.
[0106] A GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU performs mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0107] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can 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 minimized display, a micro-led display, a micro-oled display, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is an integer greater than 1.
[0108] Touch sensor 180K, also known as a touch panel (TP) sensor, can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also called a "touchscreen". Touch sensor 180K detects touch operations applied to or near it. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0109] Buttons 190 include power buttons, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0110] For example, the power button is used to turn the display 194 on or off. For instance, when the display 194 is on, pressing the power button will turn the display 194 off. Or, when the display 194 is off, pressing the power button will turn the display 194 on.
[0111] The software system of the electronic device will be explained next.
[0112] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the layered architecture of the Android system as an example to illustrate the software system of an electronic device. It should be noted that although this application uses the Android system as an example, its basic principles are equally applicable to electronic devices based on operating systems such as iOS or Windows.
[0113] Figure 6 This is a block diagram of a software system for an electronic device provided in an embodiment of this application. See also... Figure 6 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 the application layer, application framework layer, Android Runtime, system layer, hardware abstraction layer (HAL), and kernel layer.
[0114] The application layer can include a series of applications. For example... Figure 6 As shown, the application layer can include applications such as camera, calendar, map, WLAN, music, SMS, gallery, call, navigation, Bluetooth, and AOD.
[0115] 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.
[0116] like Figure 6 As shown, the application framework layer may include a power management service (PMS), a Surfaceflinger service, and an input manager.
[0117] The Power Management System (PMS) is used to manage the power-on and power-off of the display screen and can record the power mode. For example, if the PMS records the power mode as "On", it can power on the display screen; if the PMS records the power mode as "Off", it can power off the display screen.
[0118] The Surfaceflinger service is a system service primarily used to implement functions such as layer creation, control, and management. For example, the Surfaceflinger service can obtain layer data from one or more sources (i.e., applications), that is, obtain layer data for one or more layers, and then composite these layers to obtain a frame of image data for display.
[0119] The input manager is used to handle input events. After receiving an input event reported by the input subsystem, the input manager can send the input event to the corresponding application or system service.
[0120] like Figure 6 As shown, the application framework layer may also include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0121] The window manager manages windowed applications. It can determine the screen size, the presence of a status bar, screen lock, and screen capture. The content provider stores and retrieves data, making it accessible to applications. This data can include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, and phone books. The view system includes visual controls, such as controls for displaying text and images. The view system is used to build the application's display interface, which can consist of one or more views, such as a view displaying SMS notification icons, a view displaying text, and a view displaying images. The phone manager provides communication functionality for electronic devices, such as managing call status (including connection and disconnection). The resource manager provides applications with various resources, such as localized strings, icons, images, layout files, and video files. The notification manager allows applications to display notifications in the status bar. These notifications can be used to convey informational messages and can disappear automatically after a short pause without user interaction. For example, the notification manager can be used to notify of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications. The notification manager can also display notifications as dialog boxes on the screen, such as text messages in the status bar, sound alerts, vibrations of electronic devices, and flashing indicator lights.
[0122] The Android Runtime comprises the core libraries and the virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system. The core libraries consist of two parts: one part contains the functionalities that Java calls, and the other part is the core Android library itself. The application layer and application framework layer run in the 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.
[0123] The system layer can include multiple functional modules, such as 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 fusion of two-dimensional (2D) and three-dimensional (3D) layers for multiple applications. The media libraries support playback and recording of various common audio and video formats, as well as still image files. The media libraries can support various audio and video coding formats, such as Moving Picture Experts Group (MPEG) 4, H.264 (also known as Advanced Video Coding, AVC), Moving Picture Experts Group Audio Layer III (MP3), Advanced Audio Coding (AAC), Adaptive Multi-rate (AMR), Joint Photographic Experts Group (JPG), and Portable Network Graphics (PNG). 3D graphics processing libraries are used to implement 3D graphics drawing, image rendering, compositing, and layer processing. 2D graphics engines are drawing engines for 2D graphics.
[0124] HAL is used to provide a generic, call-driven interface to the application framework layer. For example... Figure 6 As shown, HAL can include hardware composers (HWC), etc. HWC is used for layer composition and display, providing hardware support for the SurfaceFlinger service.
[0125] The kernel layer is the layer between hardware and software. For example... Figure 6 As shown, the kernel layer can include display driver, input subsystem, camera driver, audio driver, sensor driver, etc.
[0126] The input subsystem manages events from various input devices (such as buttons, touch sensors, etc.) and can report received input events to the input manager.
[0127] In addition, the hardware layer of an electronic device may include a GPU, a display screen, a power button, etc. For example, the display screen may include a power management integrated circuit (PMIC), a display driver integrated circuit (DDIC), and a display panel. The PMIC is used to power the DDIC and the display panel. The DDIC is used to control the image display on the display panel.
[0128] Understandably, Figure 6 The layers in the software system shown, and the functional modules included in each layer, do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer layers than shown, and each layer may include more or fewer functional modules; this application does not limit this.
[0129] The above embodiments illustrate the power-down detection of electronic devices using the aforementioned functional modules as examples. In practical applications, these functions can be assigned to different functional modules as needed, meaning the internal structure of the electronic device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the specific names of each functional module are merely for easy differentiation and are not intended to limit the scope of protection of the embodiments of this application.
[0130] This application does not specifically limit the structure of the execution subject of the power-down detection method. As long as the code containing the power-down detection method provided in this application is run, the processing can be performed according to the power-down detection method provided in this application. For example, the execution subject of the power-down detection method provided in this application can be a functional module in an electronic device that can call and execute a program, or it can be a processing device applied in an electronic device, such as a chip.
[0131] The implementation process of AOD function is illustrated below using the above software system as an example.
[0132] For example, such as Figure 7As shown, during the implementation of the AOD function, the power mode can be switched between four modes, which can include: On, Off, Doze, and DozeSuspend.
[0133] For example, when the power mode is On, it means the display is on. In this mode, all applications will run normally.
[0134] For example, when the power mode is Off, it means the display is off. In this mode, the system reduces resource usage to maintain basic functionality.
[0135] For example, when the power mode is set to Doze, it indicates that the display is in a low-power mode. In this mode, the system restricts network access for background applications to reduce power consumption.
[0136] For example, when the power mode is Doze Suspend, it means the display is in sleep mode and the application processor is suspended. In this mode, the system imposes stricter restrictions on the activity of background applications, or even suspends their execution, thereby further reducing power consumption.
[0137] In some embodiments, when the electronic device screen is on, if the user presses the power button or if the user does not operate the electronic device for a period of time, the electronic device screen will turn off, and the power mode will change from On to Off. After a brief period of screen off, the electronic device can automatically turn off the screen, and the power mode will change from Off to Doze. Alternatively, in other embodiments, when the electronic device screen is on, if the user presses the power button or if the user does not operate the electronic device for a period of time, the electronic device can directly turn off the screen, and the power mode will change from On to Doze.
[0138] If the AOD (Always-On Display) function is in Smart Display mode, the electronic device will automatically turn off the screen after a period of screen-off display (such as displaying a screen-off animation), at which point the power mode changes from Doze to Off. After the electronic device's screen is off, if the user touches the screen or moves the electronic device, the screen can re-enable the AOD, at which point the power mode changes from Off to Doze. Similarly, the electronic device will automatically turn off the screen again after a period of screen-off display, at which point the power mode changes from Doze to Off.
[0139] If the AOD function is set to timed display mode, the electronic device can continuously display the screen off for a preset time period. In this case, the electronic device can first display a screen-off animation, at which point the power mode is Doze. After the screen-off animation ends, a static screen-off image is displayed, and the power mode changes from Doze to Doze Suspend while the static screen-off image is displayed.
[0140] If the AOD function is set to all-day display mode, the electronic device can maintain a screen-off display throughout the day. In this case, the electronic device can first display a screen-off animation, with the power mode set to Doze. After the screen-off animation ends, a static screen-off image is displayed, during which the power mode changes from Doze to Doze Suspend.
[0141] In some cases, if a user touches the screen while the electronic device is displaying a static always-on display image, the device can display a screen-off animation, during which the power mode changes from Doze Suspend to Doze. After the animation ends, the static always-on display image is shown, and the power mode changes from Doze to Doze Suspend. In other cases, while the electronic device is displaying a static always-on display image, it can periodically (e.g., every minute) update the always-on display image. Each time the image is updated, the power mode changes from Doze Suspend to Doze, and after the update is complete, the power mode changes from Doze to Doze Suspend.
[0142] In some situations, when an electronic device is displaying a screen-off animation, if the user presses the power button, unlocks the device with their fingerprint, or taps (such as double-tap or single-tap) the screen, the electronic device can exit the screen-off display and turn on the screen. At this time, the power mode changes from Doze to On.
[0143] In some situations, when an electronic device is displaying a static, off-screen image, if the user presses the power button, unlocks the device with their fingerprint, or taps the screen, the device can exit the off-screen display and turn on the screen. In this case, the power mode changes from Doze Suspend to On.
[0144] Optionally, the aforementioned static screen-off image can be the last frame of the displayed screen-off animation.
[0145] In some embodiments, the display needs to be powered down when the power mode changes from On to Off. The display needs to be powered on when the power mode changes from Off to On. The display does not need to be powered on or off when the power mode changes from On to Doze. The display does not need to be powered on or off when the power mode changes from Doze to Doze Suspend or On. The display does not need to be powered on or off when the power mode changes from Doze Suspend to Doze or On.
[0146] The following section explains the specific implementation process of the AOD function based on the aforementioned power modes.
[0147] Figure 8 This is a flowchart illustrating the implementation process of an AOD (Action-Oriented Discharge) function provided in an embodiment of this application. See also... Figure 8 The process may include the following steps:
[0148] Step 801: A power button event is generated when the power button is pressed.
[0149] Users can press the power button to turn off the screen when it is on on an electronic device. After the user presses the power button, a power button event is generated.
[0150] For example, the power button event may include one or more of the following: keyCode, action, eventTime, repeatCount, etc.
[0151] The key code indicates the pressed key; for example, the key code in this power button event could indicate the power button. The action indicates the action performed on the key, which could be key press (ACTION_DOWN), key release (ACTION_UP), or multiple key presses (ACTION_MULTIPLE); for example, the action in this power button event could indicate key press. The timestamp indicates the time the event occurred, optionally in milliseconds. The repetition count indicates the number of times the key was pressed; for example, the repetition count in this power button event could be 1 time.
[0152] Step 802: The power button sends the power button event to the input subsystem.
[0153] Step 803: After receiving the power button event, the input subsystem sends the power button event to the input manager.
[0154] Step 804: After receiving the power button event, the input manager sends the power button event to the PMS.
[0155] After receiving the power button event, the input manager can determine that the power button event is used to trigger the screen to turn off if the electronic device is currently in a screen-on state. Therefore, the input manager can send the power button event to the PMS, and the PMS can implement the relevant screen-off logic.
[0156] Step 805: After receiving the power button event, the PMS updates the power mode to Off.
[0157] After receiving the power button event, if the electronic device is currently in a screen-on state (i.e., the power mode is currently on), the PMS determines that the screen needs to be turned off and can then update the power mode to Off.
[0158] Step 806: PMS sends the first control command to the Surfaceflinger service.
[0159] The first control command includes power mode information and a power-down command. The power mode information indicates that the power mode should be updated to Off. The power-down command indicates that the display screen should be powered off.
[0160] Optionally, the first control instruction may further include a first backlight instruction. The first backlight instruction is used to instruct the backlight of the display to be turned off. For example, the first backlight instruction may include backlight parameters of the display, and the backlight parameters in the first backlight instruction may be 0. When the backlight parameters of the display are 0, the backlight of the display is turned off.
[0161] When the power mode changes from On to Off, the PMS determines that it is necessary to control the display screen to power down and to control the display screen to turn off the backlight. Therefore, the PMS can send a first control command that includes a power-down command and a first backlight command.
[0162] Step 807: After receiving the first control command, the Surfaceflinger service sends the first control command to HWC.
[0163] Optionally, after receiving the first control command, the Surfaceflinger service can update the power mode to Off.
[0164] Step 808: After receiving the first control command, HWC sends the first control command to the display driver.
[0165] Optionally, after receiving the first control command, the HWC can update the power mode to Off.
[0166] Step 809: After receiving the first control command, the display driver updates the power mode to Off, controlling the display screen to power off.
[0167] For example, after receiving the first control command, the display driver can update the power mode to Off and send a first backlight command and a power-down command to the display screen. Upon receiving the first backlight command and the power-down command, the display screen turns off its backlight and powers down, then sends a completion message to the display driver. Upon receiving the completion message, the display driver determines that the display screen has turned off its backlight and powered down. Once the display screen has turned off its backlight and powered down, the electronic device is turned off.
[0168] Step 810: The AOD application detects a power mode change to Off.
[0169] The AOD application can monitor power mode changes recorded in the PMS. When the AOD application detects a power mode change to Off, it can initiate the AOD process; if it does not detect a power mode change to Off, it can take no action.
[0170] It should be noted that after step 805, that is, after the PMS updates the power mode to Off, the AOD application can detect the change to Off. In this case, the AOD application can initiate the AOD process. The AOD process includes a power mode update process, which may include steps 811 to 816 below, and an always-on display process, which may include steps 817 to 821 below.
[0171] Step 811: The AOD application sends an AOD start command to the PMS.
[0172] This AOD activation command is used to instruct the screen to be off.
[0173] Step 812: After receiving the AOD startup command, PMS updates the power mode to Doze.
[0174] After receiving the AOD start command, PMS determines that screen-off display is required, and therefore can update the power mode to Doze.
[0175] Step 813: PMS sends a second control command to the Surfaceflinger service.
[0176] The second control command includes power mode information and a power-on command. The power mode information indicates that the power mode should be updated to Doze. The power-on command indicates that the display screen should be powered on.
[0177] When the power mode changes from Off to Doze, the PMS determines that the display needs to be powered on, and can therefore send a second control command that includes a power-on instruction.
[0178] Step 814: After receiving the second control command, the Surfaceflinger service sends the second control command to HWC.
[0179] Optionally, upon receiving the second control command, the Surfaceflinger service can update the power mode to Doze.
[0180] Step 815: After receiving the second control command, HWC sends the second control command to the display driver.
[0181] Optionally, after receiving the second control command, HWC can update the power mode to Doze.
[0182] Step 816: After receiving the second control command, the display driver updates the power mode to Doze and controls the display screen to power on.
[0183] For example, the operation of the display driver controlling the power-on of the display screen can be as follows: the display driver sends a power-on command to the display screen. After receiving the power-on command, the display screen powers on and sends a completion message to the display driver upon completion. The display driver determines that the display screen has completed power-on upon receiving the completion message.
[0184] Step 817: The AOD application generates layer data for a frame of image to be displayed.
[0185] A frame of image to be displayed may include one or more layers, and the layer data of the frame image may include the layer data of each of the one or more layers of the frame image. Each of the one or more layers may be drawn by an AOD application. Optionally, each of the one or more layers may have layer attributes, which may include one or more of the following: layer position, size, level, etc.
[0186] It should be noted that the image to be displayed can be a single frame from the screen-off animation to be displayed by the AOD application, such as the i-th frame, where i is a positive integer. The AOD application can generate each frame of the screen-off animation in sequence, and the display screen will present the corresponding animation effect after displaying these images in sequence.
[0187] In some cases, a screen-off animation may consist of only one frame; in others, it may consist of multiple frames.
[0188] Step 818: The Surfaceflinger service retrieves the layer data of the frame image.
[0189] Step 819: The Surfaceflinger service obtains the frame image through HWC based on the layer data of the frame image.
[0190] In some embodiments, after obtaining the layer data of each layer in one or more layers of the frame image, the SurfaceFlinger service can composite all layers using GPU compositing to obtain a first layer. Then, the first layer and all layers using HWC compositing are sent to HWC for compositing to obtain a second layer, which is the frame image to be displayed. For example, the second layer can be stored in the frame buffer.
[0191] GPU compositing refers to compositing layers using the GPU. HWC compositing refers to compositing layers using HWC (Heated Walls).
[0192] Step 820: HWC sends the frame image to the display driver.
[0193] Step 821: After receiving the frame image, the display driver sends the frame image to the display screen.
[0194] For example, the display driver can send the frame image to the display screen via the Mobile Industry Processor Interface (MIPI).
[0195] After receiving the frame image, the display screen can display the frame image. After the display screen continuously displays multiple frames of the screen-off animation, the corresponding screen-off animation effect can be presented.
[0196] The above text Figure 8 The embodiment illustrates the process of the electronic device turning off its screen after the user presses the power button while the screen is on. In this process, after the user presses the power button, the electronic device displays a screen-off animation after a brief period of screen-off.
[0197] In other embodiments of this application, when the electronic device screen is on, the electronic device can directly display a screen-off animation after the user presses the power button. The following describes how... Figure 9 This will be illustrated by example.
[0198] Figure 9 This is a flowchart illustrating the implementation process of an AOD (Action-Oriented Discharge) function provided in an embodiment of this application. See also... Figure 9 The process may include the following steps:
[0199] Step 901: A power button event is generated when the power button is pressed.
[0200] Step 902: The power button sends the power button event to the input subsystem.
[0201] Step 903: After receiving the power button event, the input subsystem sends the power button event to the input manager.
[0202] Step 904: After receiving the power button event, the input manager sends the power button event to the PMS.
[0203] Step 905: After receiving the power button event, the PMS sends an AOD trigger message to the AOD application.
[0204] After receiving the power button event, if the electronic device is currently in a screen-on state (i.e., the power mode is currently on), the PMS determines that screen-off display is required. At this time, it can send an AOD trigger message to the AOD application to trigger screen-off display.
[0205] After receiving the AOD trigger message, the AOD application can initiate the AOD process. The AOD process includes a power mode update process, which may include steps 906 to 911 below, and an always-on display process, which may include steps 912 to 916 below.
[0206] Step 906: After receiving the AOD trigger message, the AOD application sends an AOD start command to the PMS.
[0207] Step 907: After receiving the AOD startup command, PMS updates the power mode to Doze.
[0208] Step 908: PMS sends a third control command to the Surfaceflinger service.
[0209] The third control command includes power mode information, which indicates that the power mode should be updated to Doze.
[0210] Optionally, the third control command may also include a first backlight command. The first backlight command is used to instruct the backlight of the display screen to be turned off.
[0211] When the power mode changes from On to Doze, the PMS determines that it is not necessary to power on or off the display, but the display backlight needs to be turned off. Therefore, the PMS can send a third control command that includes the first backlight command.
[0212] Step 909: After receiving the third control command, the Surfaceflinger service sends the third control command to HWC.
[0213] Optionally, the Surfaceflinger service can update the power mode to Doze after receiving a third control command.
[0214] Step 910: After receiving the third control command, HWC sends the third control command to the display driver.
[0215] Optionally, after receiving a third control command, HWC can update the power mode to Doze.
[0216] Step 911: After receiving the third control command, the display driver updates the power mode to Doze.
[0217] Optionally, after receiving the third control command, the display driver can also send a first backlight command to the display screen. Upon receiving the first backlight command, the display screen can turn off its backlight and, upon completion, send a completion message to the display driver. The display driver, upon receiving the completion message, determines that the display screen has turned off its backlight.
[0218] Step 912: After receiving the AOD trigger message, the AOD application generates layer data for a frame of image to be displayed.
[0219] Step 913: The Surfaceflinger service retrieves the layer data of the frame image.
[0220] Step 914: The Surfaceflinger service obtains the frame image through HWC based on the layer data of the frame image.
[0221] Step 915: HWC sends the frame image to the display driver.
[0222] Step 916: After receiving the frame image, the display driver sends the frame image to the display screen.
[0223] The above text Figure 9 The embodiment illustrates the process of the electronic device turning off its screen after the user presses the power button while the screen is on. In this process, the electronic device can directly display a screen-off animation after the user presses the power button.
[0224] It should be noted that the above text Figures 8 to 9 The embodiments illustrate the process of an electronic device turning off its screen after a user presses the power button. The process of turning off the screen when the electronic device has not been operated for a timeout is similar, and will not be described again in this embodiment.
[0225] Understandably, the embodiments in this application are only examples of... Figures 8 to 9 The process shown in the embodiment is used as an example to illustrate the implementation process of always-on display. In actual applications, it is not limited to this and always-on display can also be implemented in other ways. This application embodiment does not limit this.
[0226] from above Figures 8 to 9As can be seen from the screen-off display process described in the embodiment, when the electronic device changes from a screen-on state to a screen-off display state, the power mode changes from On to Doze.
[0227] In some embodiments, if the AOD function is a timed display mode and is currently within a preset time period where screen-off display is possible, or if the AOD function is an all-day display mode, then after generating the last frame of the screen-off animation, the AOD application can enter the AOD static display process, specifically in conjunction with... Figure 10 An example is provided.
[0228] Figure 10 This is a flowchart illustrating a screen-off image display process according to an embodiment of this application. See also... Figure 10 The process may include the following steps:
[0229] Step 1001: After the AOD application generates the layer data of the last frame image in the screen-off animation, it sends an AOD freeze command to the PMS.
[0230] The AOD (Always On) command is used to indicate whether to enable screen-off display in timed display mode or in all-day display mode.
[0231] Step 1002: After receiving the AOD quiescent command, the PMS updates the power mode to Doze Suspend.
[0232] After receiving the AOD freeze command, PMS determines that there is no need to process the screen-off image anymore, and therefore can update the power mode to Doze Suspend.
[0233] Step 1003: PMS sends power mode information to the Surfaceflinger service, which indicates that the power mode should be updated to Doze Suspend.
[0234] When the power mode changes from Doze to Doze Suspend, the PMS determines that there is no need to power on or off the display, and therefore can send only the power mode information.
[0235] Step 1004: After receiving the power mode information, the Surfaceflinger service sends the power mode information to HWC.
[0236] Optionally, after receiving the power mode information, the Surfaceflinger service can update the power mode to Doze Suspend.
[0237] Step 1005: After receiving the power mode information, HWC sends the power mode information to the display driver.
[0238] Optionally, after receiving the power mode information, HWC can update the power mode to Doze Suspend.
[0239] Step 1006: After receiving the power mode information, the display driver updates the power mode to Doze Suspend.
[0240] After sending the last frame of the screen-off animation to the display, the display driver will not send any more images to the display when the power mode is DozeSuspend. In this case, the display will continue to show the last frame of the screen-off animation, thus achieving a static display of the screen-off image.
[0241] In some embodiments, after receiving the AOD (Always-On Display) halt command, the PMS can also record the AOD stage information as either a timed screen-off display stage or a full-day screen-off display stage. In this case, the PMS can also send the AOD stage information at the same time as sending the power mode information, so that the Surfaceflinger service, HWC, and display driver can all record the AOD stage information.
[0242] The AOD (Always-On Display) stage information indicates that the AOD function is currently in a timed display mode, displaying a static image. The AOD stage information also indicates that the AOD function is currently in a 24 / 7 display mode, displaying a static image.
[0243] from above Figure 10 As can be seen from the screen-off display process described in the embodiment, during the process of the electronic device changing from displaying a screen-off animation to displaying a static screen-off image, the power mode changes from Doze to Doze Suspend.
[0244] In some embodiments, while an electronic device is displaying a static always-on display image, a user can trigger the display of an always-on display animation by touching the screen. In this case, after the user touches the screen, the touch sensor generates a touch event and sends it to the input subsystem. Upon receiving the touch event, the input subsystem sends it to the input manager. Upon receiving the touch event, the input manager sends it to the Always-On Display (AOD) application. Upon receiving the touch event, the AOD application determines whether the always-on display animation needs to be shown.
[0245] In this case, the screen-off animation can be displayed through operations similar to steps 906 to 916 described above. During this process, after receiving the AOD start command, the PMS can delete the recorded AOD stage information. Furthermore, the PMS can send this deletion information simultaneously with the power mode information, so that the Surfaceflinger service, HWC, and display driver can all delete the AOD stage information.
[0246] After the screen-off animation ends, a static screen-off image can be displayed through operations similar to steps 1001 to 1006 described above. During this process, after receiving the AOD still command, the PMS can record the AOD stage information as either a timed screen-off display stage or a full-day screen-off display stage. Furthermore, the PMS can also send this AOD stage information simultaneously with the power mode information, so that the Surfaceflinger service, HWC, and display driver can all record this AOD stage information.
[0247] It should be noted that when the power mode changes to Doze Suspend, the application processor will be suspended, thereby limiting the execution of most capabilities in system services such as PMS, Surfaceflinger, HWC, and display drivers in order to maintain low power consumption.
[0248] In some embodiments, to prevent screen burn-in caused by displaying the same always-on image for an extended period, the AOD application can also periodically update the always-on image, specifically in conjunction with... Figure 11 The following is an illustrative example. Burn-in refers to the phenomenon where a static image remains on a display screen after it has been displayed for an extended period.
[0249] Figure 11 This is a flowchart illustrating a screen-off image display process according to an embodiment of this application. See also... Figure 11 The process may include the following steps:
[0250] Step 1101: When the scheduled time arrives, the AOD application sends an AOD update command to the PMS.
[0251] The timer can be preset. For example, it can be set to the start time of every whole minute, ensuring that the AOD application automatically updates the always-on display image at the start of each whole minute, such as 00:00, 00:01, 00:02, etc.
[0252] This AOD update command is used to instruct the user to update the always-on display image.
[0253] Step 1102: After receiving the AOD update command, PMS updates the power mode to Doze.
[0254] Step 1103: PMS sends power mode information to the Surfaceflinger service, which indicates that the power mode should be updated to Doze.
[0255] When the power mode changes from Doze Suspend to Doze, the PMS determines that there is no need to power on or off the display, and therefore can send only the power mode information.
[0256] Step 1104: After receiving the power mode information, the Surfaceflinger service sends the power mode information to HWC.
[0257] Optionally, after receiving the power mode information, the Surfaceflinger service can update the power mode to Doze.
[0258] Step 1105: After receiving the power mode information, HWC sends the power mode information to the display driver.
[0259] Optionally, after receiving the power mode information, HWC can update the power mode to Doze.
[0260] Step 1106: After receiving the power mode information, the display driver updates the power mode to Doze.
[0261] It should be noted that when the power mode changes to Doze, the application processor is woken up, which allows some capabilities of system services such as PMS, Surfaceflinger, HWC, and display driver to be executed in order to update the display of the screen-off image.
[0262] When the scheduled time arrives, the AOD application can perform the power mode update process described in steps 1101 to 1106 above, and can also perform the screen-off image display process, which may include the following steps 1107 to 1111.
[0263] Step 1107: When the timer expires, the AOD application generates layer data for the frame of image to be displayed.
[0264] This frame image (which may be referred to as the target image) differs from the image previously generated by the AOD application. In some embodiments, the frame image has the same main content as the previously displayed image, but the position of the main content has changed.
[0265] For example, an AOD application can fine-tune the position of the main content in the always-on display image every minute or every few minutes to obtain a new always-on display image. For instance, an AOD application can slightly move content such as the time and icons in the always-on display image every minute or every few minutes to reduce the risk of screen burn-in.
[0266] Step 1108: The Surfaceflinger service obtains the layer data of the frame image.
[0267] Step 1109: The Surfaceflinger service obtains the frame image through HWC based on the layer data of the frame image.
[0268] Step 1110: HWC sends the frame image to the display driver.
[0269] Step 1111: After receiving the frame image, the display driver sends the frame image to the display screen.
[0270] In this way, the image displayed on the screen changes periodically when the screen is off, thereby reducing the risk of screen burn-in.
[0271] It should be noted that in the above text Figure 11 During the timed update of the always-on display image in the embodiment, the AOD stage information recorded in PMS, Surfaceflinger service, HWC and display driver does not change, and it is still either the timed always-on display stage or the all-day always-on display stage.
[0272] After generating a new frame image in step 1107, the AOD application can enter the AOD still display process. For specific instructions, please refer to the above text. Figure 10 The relevant descriptions in the embodiments will not be repeated here.
[0273] from above Figure 11 As can be seen from the always-on display process described in the embodiment, during the process of updating the always-on display image, the power mode of the electronic device first changes from Doze Suspend to Doze, and then changes from Doze to Doze Suspend.
[0274] As described in the above embodiments, during the preset time period in the timed display mode, or throughout the entire day in the all-day display mode, the electronic device continuously displays a screen-off image. When continuously displaying the screen-off image, the power mode is typically Doze Suspend. Since the application processor is in a suspended state when the power mode is Doze Suspend, power loss detection is usually difficult. Therefore, currently, when an electronic device suddenly goes black in a timed display or all-day display scenario, the user cannot turn on the screen by touching the screen or pressing the power button, severely impacting the user experience.
[0275] Therefore, this application provides a power failure detection method that can detect power failure of the display screen in both timed display and all-day display scenarios of the AOD function, so as to promptly detect and repair abnormal black screen problems of electronic devices, thereby ensuring the normal use of electronic devices and improving the user experience. This will be described in detail below.
[0276] In some embodiments, this application can detect power loss and restore the display screen accordingly when updating the always-on display image. The following description further details this process. Figure 12 Examples and Figure 13 The examples are described below.
[0277] Figure 12 This is a flowchart of a power-off detection method provided in an embodiment of this application. See also... Figure 12 The method may include the following steps:
[0278] Step 1201: When the scheduled time arrives, the AOD application sends an AOD update command to the PMS.
[0279] Step 1202: After receiving the AOD update command, the PMS updates the power mode to Doze.
[0280] Step 1203: PMS sends power mode information to the Surfaceflinger service, which indicates that the power mode should be updated to Doze.
[0281] When the power mode changes from Doze Suspend to Doze, the PMS determines that there is no need to power on or off the display, and therefore can send only the power mode information.
[0282] Step 1204: After receiving the power mode information, the Surfaceflinger service sends the power mode information to HWC.
[0283] Optionally, after receiving the power mode information, the Surfaceflinger service can update the power mode to Doze.
[0284] Step 1205: After receiving the power mode information, HWC sends the power mode information to the display driver.
[0285] Optionally, after receiving the power mode information, HWC can update the power mode to Doze.
[0286] Step 1206: After receiving the power mode information, the display driver updates the power mode to Doze.
[0287] It should be noted that in the relevant technology, after receiving the power mode information, the display driver updates the power mode from DozeSuspend to Doze and does not perform any other operations. In this case, even if the display screen has lost power, the display driver cannot detect it.
[0288] Therefore, in this embodiment of the application, when the power mode changes from Doze Suspend to Doze, the display driver can perform power failure detection on the display screen to restore it in a timely manner when the display screen loses power, as described in steps 1207 to 1208 below:
[0289] Step 1207: The display driver detects whether the display is powered on when the power mode changes from Doze Suspend to Doze.
[0290] In some embodiments, the operation of the display driver to detect whether the display screen is powered on can be: the display driver obtains the general-purpose input / output (GPIO) status, and the display driver determines whether the display screen is powered on based on the GPIO status.
[0291] This GPIO status is used to indicate whether the GPIO pin connected to the power supply terminal of the display panel is in a high-level or low-level state.
[0292] The power supply terminal of the display panel can be the port in the PMIC that powers the display panel, for example, it can be the ELVDD output terminal of the PMIC.
[0293] For example, a GPIO pin of a chip can be pre-connected to the power supply of the display panel via appropriate voltage divider resistors. The chip can determine the voltage level of the GPIO pin. If the GPIO pin is high, the chip sets the GPIO state to a first value (e.g., 1); if the GPIO pin is low, the chip sets the GPIO state to a second value (e.g., 0). The display driver can obtain the GPIO state from this chip.
[0294] It should be noted that the high-level and low-level states described in the embodiments of this application are relative. For example, a voltage value can be preset, such as a preset voltage value set based on the resistance value of the voltage divider resistor and the estimated voltage value of the power supply terminal of the display panel. If the voltage value of the GPIO pin is greater than or equal to the preset voltage value, the chip can determine that the GPIO pin is in a high-level state; if the voltage value of the GPIO pin is less than the preset voltage value, the chip can determine that the GPIO pin is in a low-level state.
[0295] For example, the input mode of this GPIO pin can be a floating input mode. In this case, the display driver can determine that the display is powered on if the GPIO state indicates that the GPIO pin is in a high-level state, such as if the GPIO state is a first state value; and determine that the display is not powered on if the GPIO state indicates that the GPIO pin is in a low-level state, such as if the GPIO state is a second state value.
[0296] In other embodiments, the operation of the display driver to detect whether the display screen is powered on can be: the display driver obtains the power supply status of the display screen from the display screen, and the display driver determines whether the display screen is powered on based on the power supply status.
[0297] Display screens typically store their own power supply status. For example, a display screen can undergo an electrostatic discharge (ESD) process to detect its power supply status, which indicates whether the display screen is powered on.
[0298] The display driver does not operate when the display is powered on. When the display is not powered on, step 1208 can be performed.
[0299] Step 1208: When the display screen is not powered on, the display driver restores the display screen to power-on state.
[0300] In some embodiments, the operation of the display driver to restore the display screen to power-on can be as follows: the display driver sends a recovery event to the HWC, which is used to request the display screen to be restored to power-on; after receiving the recovery event, the HWC sends a target instruction to the display driver, which is used to instruct the display screen to be powered down and then powered on; after receiving the target instruction, the display driver controls the display screen to be powered down and then powered on.
[0301] As an example, the operation of the display driver controlling the display screen to power down and then power on can be as follows: the display driver sends a target command to the display screen; after receiving the target command, the display screen first powers down and then powers on, and after completion, it can send a completion message to the display driver; after receiving the completion message, the display driver can determine that the display screen has resumed power-on.
[0302] As another example, the operation of the display driver controlling the display screen to power down and then power on can be as follows: the display driver sends a power-down command to the display screen; after receiving the power-down command, the display screen powers down and sends a completion message to the display driver after completion; after receiving the completion message, the display driver sends a power-on command to the display screen; after receiving the power-on command, the display screen powers on and sends a completion message to the display driver after completion; after receiving the completion message, the display driver determines that the display screen is powered on again.
[0303] In this way, when the power mode changes from Doze Suspend to Doze, the display driver can detect power loss of the display and quickly restore power to the display if it is not powered on. This ensures the normal operation of the screen-off display, thereby minimizing the impact on the user experience.
[0304] Figure 13 This is a flowchart of a power-off detection method provided in an embodiment of this application. See also... Figure 13 The method may include the following steps:
[0305] Step 1301: When the timer expires, the AOD application generates layer data for a frame of image to be displayed.
[0306] Step 1302: The Surfaceflinger service obtains the layer data of the frame image.
[0307] Step 1303: The Surfaceflinger service obtains the frame image through HWC based on the layer data of the frame image.
[0308] Step 1304: HWC sends the frame image to the display driver.
[0309] It should be noted that in the relevant technology, after the display driver receives the frame image, it will directly send the frame image to the display screen. However, if the display screen has lost power at this time, the display screen will still be black after the display driver sends the frame image to the display screen, resulting in the inability to display the image normally when the screen is off, which seriously affects the user experience.
[0310] Therefore, in this embodiment of the application, after receiving the frame image, the display driver can perform power failure detection on the display screen when it is currently in a timed screen-off display phase or a 24-hour screen-off display phase, so as to restore the display screen in a timely manner when the power is lost, as described in steps 1305 to 1307 below:
[0311] Step 1305: After receiving the frame image, the display driver checks whether the display screen is powered on, whether it is currently in the timed screen-off display stage or the all-day screen-off display stage.
[0312] The operation of the display driver detecting whether the display screen is powered on is similar to the operation of the display driver detecting whether the display screen is powered on in step 1207 above, and will not be described again in this embodiment.
[0313] When the display is powered on, the display driver can send the frame image to the display so that the display shows the frame image. When the display is not powered on, steps 1306 to 1307 can be performed.
[0314] Step 1306: If the display screen is not powered on, the display driver restores the display screen to power-on state.
[0315] The operation of step 1306 is similar to that of step 1208 above, and will not be described again in this embodiment.
[0316] Step 1307: The display driver sends the frame image to the display screen.
[0317] In this way, the image displayed on the screen changes periodically when the screen is off, thereby reducing the risk of screen burn-in.
[0318] After generating a new frame image in step 1301, the AOD application can enter the AOD still display process. For specific instructions, please refer to the above text. Figure 10 The relevant descriptions in the embodiments will not be repeated here.
[0319] In this way, the display driver can detect power loss of the display while updating the image on a screen-off device, and quickly restore power to the display if it is not powered on. This ensures normal operation of the screen-off display while saving power, thus minimizing the impact on the user experience.
[0320] It should be noted that, in some embodiments, the display driver can perform the above... Figure 12 The power failure detection process described in the embodiments, or the above-described process, can be performed. Figure 13 The power failure detection process described in this embodiment. In other embodiments, the display driver executes the above... Figure 12 In addition to the power failure detection process described in the embodiments, the above-mentioned procedures can also be executed. Figure 13 The power failure detection process described in the embodiment.
[0321] The above text Figure 12 Examples and Figure 13 The embodiments illustrate the power failure detection process of the display screen when updating the always-on display image in timed display scenarios or all-day display scenarios with AOD function. In addition, in some embodiments, the embodiments of this application can also implement the power failure detection process of the display screen after the user presses the power button, as described below. Figure 14 This process will be explained.
[0322] Figure 14 This is a flowchart of a power-off detection method provided in an embodiment of this application. See also... Figure 14 The method may include the following steps:
[0323] Step 1401: A power button event is generated when the power button is pressed.
[0324] In some embodiments, if the electronic device suddenly goes black during a timed display scenario or an all-day display scenario of the AOD function, the user is very likely to try to turn on the screen by pressing the power button.
[0325] Step 1402: The power button sends the power button event to the input subsystem.
[0326] Step 1403: After receiving the power button event, the input subsystem sends the power button event to the input manager.
[0327] Step 1404: After receiving the power button event, the input manager sends the power button event to the AOD application.
[0328] After receiving the power button event, the input manager can determine that the power button event is used to trigger the exit from the always-on display if the electronic device is currently in the always-on display state, and therefore can send the power button event to the AOD application.
[0329] Step 1405: After receiving the power button event, the AOD application sends an AOD exit command to the PMS.
[0330] When the AOD application receives the power button event, it determines that it needs to exit the always-on display if the electronic device is currently in the always-on display state, and therefore can send an AOD exit command to the PMS.
[0331] Step 1406: After receiving the AOD exit command, the PMS updates the power mode to On.
[0332] In this embodiment of the application, when the PMS receives the AOD exit command, assuming the power mode is Doze Suspend, the PMS can update the power mode from Doze Suspend to On.
[0333] Step 1407: PMS sends the fourth control command to the Surfaceflinger service.
[0334] The fourth control command may include power mode information and the second backlight command.
[0335] This power mode information is used to indicate whether to update the power mode to On.
[0336] The second backlight command is used to instruct the backlight of the display screen to be turned on. Optionally, the second backlight command may include backlight parameters of the display screen, and the backlight parameters in the second backlight command may be any value in the range [1, 255]. When the backlight parameters of the display screen are any value in the range [1, 255], the backlight of the display screen is turned on.
[0337] When the power mode changes from Doze Suspend to On, the PMS determines that it is not necessary to power on or off the display, but it is necessary to turn on the display backlight. Therefore, it can send a fourth control command that includes a second backlight command.
[0338] Step 1408: After receiving the fourth control command, the Surfaceflinger service sends the fourth control command to HWC.
[0339] Optionally, upon receiving the fourth control command, the Surfaceflinger service can update the power mode to On.
[0340] Step 1409: After receiving the fourth control command, HWC sends the fourth control command to the display driver.
[0341] Optionally, after receiving the fourth control command, the HWC can update the power mode to On.
[0342] Step 1410: After receiving the fourth control command, the display driver updates the power mode to On.
[0343] It should be noted that in the relevant technology, after the display driver receives the power mode information and updates the power mode from DozeSuspend to On, it will directly send a second backlight command to the display to instruct the display to turn on the backlight. However, if the display has already lost power at this time, the display will still be in a black screen state after the display driver sends the second backlight command, which will prevent the user from turning on the screen even if they press the power button, seriously affecting the user experience.
[0344] Therefore, in this embodiment, when the power mode changes from Doze Suspend to On, the display driver can perform power-off detection on the display screen to restore it promptly when the screen loses power, as described in steps 1411 to 1414 below. This ensures the normal operation of the screen-off display, thereby reducing the impact on the user experience.
[0345] Step 1411: When the power mode changes from Doze Suspend to On, the display driver detects whether the display is powered on.
[0346] The operation of the display driver detecting whether the display screen is powered on is similar to the operation of the display driver detecting whether the display screen is powered on in step 1207 above, and will not be described again in this embodiment.
[0347] When the display is powered on, the display driver can send a second backlight command to the display to turn on the display's backlight. When the display is not powered on, steps 1412 to 1413 can be performed.
[0348] Step 1412: When the display screen is not powered on, the display driver restores the display screen to power-on state.
[0349] The operation of step 1412 is similar to that of step 1208 above, and will not be described again in this embodiment.
[0350] Step 1413: The display driver sends a second backlight command to the display screen.
[0351] After receiving the second backlight command, the display screen can turn on its backlight.
[0352] In this way, when the power mode changes from Doze Suspend to On, the display driver can detect power loss of the display and quickly restore power to the display if it is not powered on, ensuring that the display can light up normally in the future.
[0353] In this embodiment, when the power mode changes from Doze Suspend to On, the display driver can perform power-down detection on the display screen. That is, the display driver can detect power-down when the electronic device exits the timed screen-off display phase or the all-day screen-off display phase, and then restore power to the display screen even when it is not powered on. Thus, even if the electronic device experiences an abnormal black screen problem during the timed screen-off display phase or the all-day screen-off display phase, it can be quickly repaired when the electronic device exits the timed screen-off display phase or the all-day screen-off display phase, restoring power to the display screen and ensuring that the electronic device can normally illuminate the screen, thereby reducing the impact on the user experience.
[0354] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0355] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0356] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the various method embodiments described above.
[0357] This application also provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0358] This application also provides a chip system including a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the steps of any method embodiment of this application. The chip system can be a single chip or a chip module composed of multiple chips.
[0359] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic cable, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (such as floppy disks, hard disks, magnetic tapes, etc.), optical media (such as Digital Versatile Discs (DVDs), etc.) or semiconductor media (such as Solid State Disks (SSDs), etc.).
[0360] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0361] The above-described embodiments are optional embodiments provided by this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the technical scope disclosed in this application should be included within the protection scope of this application.
Claims
1. A power failure detection method, characterized in that, Applied to an electronic device, the electronic device including a display driver and a display screen, the method includes: When the power mode changes from low power consumption suspend mode to on mode, the display driver detects whether the display screen is powered on. The change from low power consumption suspend mode to on mode indicates exiting the timed screen-off display stage or the all-day screen-off display stage. The display driver restores the power to the display screen when the display screen is not powered on.
2. The method as described in claim 1, characterized in that, The electronic device also includes an Always-On Display (AOD) application and a Power Management Service (PMS). Before detecting whether the display screen is powered on when the power mode changes from low-power suspend mode to on mode, the display driver further includes: After receiving the power button event, the AOD application sends an AOD exit command to the PMS; After receiving the AOD exit command, the PMS updates the power mode to the on mode and sends first power mode information to the display driver. The first power mode information is used to indicate that the power mode is updated to the on mode. After receiving the first power mode information, the display driver updates the power mode to the on mode.
3. The method as described in claim 2, characterized in that, Before the AOD application sends the AOD exit command to the PMS, it also includes: The AOD application sends an AOD start command to the PMS; After receiving the AOD start command, the PMS updates the power mode to low power consumption mode and sends second power mode information to the display driver. The second power mode information is used to indicate that the power mode is updated to the low power consumption mode. After receiving the second power mode information, the display driver updates the power mode to the low power consumption mode.
4. The method as described in claim 3, characterized in that, The electronic device also includes the SurfaceFlinger service and the hardware synthesizer HWC. After the AOD application sends the AOD launch command to the PMS, it also includes: The AOD application generates layer data for the i-th frame of the screen-off animation; After the SurfaceFlinger service obtains the layer data of the i-th frame image, it obtains the i-th frame image through the HWC based on the layer data of the i-th frame image, where i is a positive integer; The HWC sends the i-th frame image to the display driver; The display driver sends the i-th frame image to the display screen.
5. The method as described in claim 4, characterized in that, The method further includes: After generating the layer data for the last frame of the screen-off animation, the AOD application sends an AOD freeze command to the PMS. After receiving the AOD freeze command, the PMS updates the power mode to the low power consumption suspension mode and sends third power mode information to the display driver. The third power mode information is used to indicate that the power mode is updated to the low power consumption suspension mode. After receiving the third power mode information, the display driver updates the power mode to the low power consumption suspend mode.
6. The method as described in claim 5, characterized in that, After the AOD application sends the AOD inactivity command to the PMS, it also includes: When the scheduled time arrives, the AOD application sends an AOD update command to the PMS. After receiving the AOD update instruction, the PMS updates the power mode to the low power consumption mode and sends fourth power mode information to the display driver. The fourth power mode information is used to indicate that the power mode is updated to the low power consumption mode. After receiving the fourth power mode information, the display driver updates the power mode to the low power consumption mode.
7. The method as described in claim 6, characterized in that, The method further includes: The display driver detects whether the display screen is powered on when the power mode changes from the low power consumption suspend mode to the low power consumption mode; The display driver restores the power to the display screen when the display screen is not powered on.
8. The method as described in claim 6, characterized in that, The method further includes: The AOD application generates layer data of the target image when the timed period arrives; After obtaining the layer data of the target image, the SurfaceFlinger service obtains the target image through the HWC based on the layer data of the target image; The HWC sends the target image to the display driver; The display driver sends the target image to the display screen.
9. The method as described in claim 8, characterized in that, The method further includes: After receiving the image sent by the HWC, the display driver detects whether the display screen is powered on, whether it is currently in a timed screen-off display phase or a full-day screen-off display phase. The display driver restores the power to the display screen when the display screen is not powered on.
10. The method according to any one of claims 1 to 9, characterized in that, The display driver detects whether the display screen is powered on, including: The display driver acquires the general purpose input / output (GPIO) status, which indicates whether the GPIO pin connected to the power supply terminal of the display panel is in a high-level or low-level state. The display driver determines whether the display screen is powered on based on the GPIO status.
11. The method according to any one of claims 1 to 10, characterized in that, The electronic device includes an HWC, and the display driver performs power-on recovery on the display screen, including: The display driver sends a recovery event to the HWC, the recovery event being used to request a power-on recovery of the display screen; After receiving the recovery event, the HWC sends a target instruction to the display driver, the target instruction being used to instruct the display screen to be powered down and then powered on again. After receiving the target instruction, the display driver controls the display screen to power off and then power on.
12. An electronic device, characterized in that, The electronic device includes: one or more processors, and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 11.
14. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 11.