Screen-off display control method, chip system, device and readable storage medium
By only awakening when needed in the screen-off display state and using the front camera to detect the brightness of the ambient light, the problem of high power consumption of the target camera is solved, and the equipment is long-term standby and power management is achieved.
Patent Information
- Application Number
- CN202410852539.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-06-28
AI Technical Summary
In the state of off-screen display, the prior art is difficult to effectively reduce the operating power consumption of the target camera, resulting in the system being unable to be in standby state for a long time, affecting power consumption and equipment performance.
By waking up the target camera for ambient light detection when needed, using the front camera instead of the ambient light detection device, subscribe and detect the ambient light brightness only when obtaining the ambient light brightness, and power off when no need is needed to achieve the system's dormant state .
It effectively reduces the operating power consumption of the target camera, ensures that the device can be in standby state for a long time in the screen-off display mode, and improves power management and user experience.
Smart Images

Figure CN118567467B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a method for controlling off-screen display, a chip system, a device, and a readable storage medium. Background Art
[0002] At present, many electronic devices such as smartphones and tablets have an always on display (AOD) function. Off-screen display means that after the electronic device is turned off, without lighting up the entire display screen of the electronic device, the electronic device can display limited information by lighting up some pixels of the display screen, such as time, date, notification icons, etc.
[0003] In the off-screen display mode, the electronic device can adjust the display brightness according to the ambient light brightness to adapt to the light intensity in different environments, thereby improving the user experience. In the related art, the electronic device generally detects the ambient light brightness through an ambient light detection device, and then adjusts the display brightness of the electronic device based on the detected ambient light brightness. Summary of the invention
[0004] The present application provides a method for controlling off-screen display, a chip system, a device, and a readable storage medium, which can detect ambient light through a target camera in the off-screen display state and reduce the operating power consumption of the target camera as much as possible. The technical solution is as follows:
[0005] In a first aspect, a method for controlling screen-off display is provided, which is applied to an electronic device, and the method includes:
[0006] The electronic device meets the ambient light acquisition condition and controls the target camera to power on. The ambient light acquisition condition refers to the condition for obtaining the ambient light brightness in the AOD state, and the target camera has the light source detection capability; the first ambient light brightness is obtained through the target camera; according to the first ambient light brightness, the AOD interface is displayed, wherein the brightness of the display screen of the electronic device when the AOD interface is displayed is the target brightness, and the target brightness is determined according to the first ambient light brightness; the target camera is controlled to power off.
[0007] As an example of the present application, the target camera may be a front-facing camera.
[0008] In this way, the system will be woken up only when it is necessary to obtain the ambient light brightness, and the ambient light brightness will be detected by the target camera. When it is not needed, the target camera will be powered off, thereby realizing that in the AOD state, the ambient light brightness can be detected by the target camera instead of the ambient light detection device.
[0009] As an example of the present application, the screen-off display mode of the electronic device is a user-triggered mode, which means that in the screen-off state, when a first user operation is detected, the electronic device performs screen-off display, and the electronic device enters the screen-off state after a first preset time. In this case, the electronic device meets the ambient light acquisition conditions, and the specific implementation of controlling the target camera to power on may include: in the screen-off state, after receiving the first user operation, controlling the target camera to power on. Accordingly, according to the first ambient light brightness, the AOD interface is displayed, including: determining the target brightness according to the first ambient light brightness; displaying the AOD interface, and controlling the brightness of the display screen to the target brightness.
[0010] In this way, in the user trigger mode, when the first user operation is received, the target camera is controlled to power on to control the target camera to detect the ambient light brightness, that is, the ambient light brightness will be subscribed only when needed, to avoid the target camera being in operation for a long time, so that the ambient light can be detected by the target camera in the AOD state, and the system can enter the sleep state.
[0011] As an example of the present application, before controlling the target camera to power off, the method further includes: controlling the display screen to turn off after a first preset time period. Accordingly, controlling the target camera to power off includes: controlling the target camera to power off after the display screen turns off.
[0012] In this way, the target camera is controlled to be powered off after the screen is turned off to avoid the target camera being in operation for a long time, so that the system can enter a sleep state after the screen is turned off.
[0013] As an example of the present application, the screen-off display mode of the electronic device is an all-weather mode, and the all-weather mode means that the screen is always off in the screen-off state. In this case, the electronic device meets the ambient light acquisition conditions and controls the target camera to power on, including: during the screen-off display process, the target camera is controlled to power on every second preset time. Accordingly, according to the first ambient light brightness, the screen-off display AOD interface is displayed, including: according to the first ambient light brightness, the target brightness is determined; in the process of displaying the AOD interface, the brightness of the display screen is controlled to be the target brightness.
[0014] In this way, in the all-weather mode, the target camera will be powered on only at second preset time intervals to detect the ambient light brightness through the target camera. That is, the ambient light brightness will be subscribed only when needed to avoid keeping the target camera in operation for a long time, so that the ambient light can be detected through the target camera in the AOD state, and the system can enter the sleep state.
[0015] As an example of the present application, the method further includes: after the AOD application is started, obtaining the attribute value of the target attribute, the target attribute is used to indicate whether the electronic device supports detecting the ambient light brightness through the target camera, and the AOD application is used to realize the off-screen display; according to the attribute value of the target attribute, judging whether the electronic device supports detecting the ambient light brightness through the target camera. Accordingly, the electronic device meets the ambient light acquisition condition, and controls the target camera to power on, including: when the electronic device meets the ambient light acquisition condition, if it is determined according to the attribute value of the target attribute that the electronic device supports detecting the ambient light brightness through the target camera, then controlling the target camera to power on.
[0016] In this way, the attribute value of the target attribute is obtained through the AOD application after it is started, so that when the screen is off, it can be judged whether the electronic device supports detecting the ambient light brightness through the target camera based on the attribute value of the target attribute, thereby deciding which registration strategy to adopt to obtain the ambient light brightness.
[0017] As an example of the present application, judging whether the electronic device supports detecting the ambient light brightness through the target camera according to the attribute value of the target attribute includes: when the attribute value of the target attribute is a first identifier, determining that the electronic device supports detecting the ambient light brightness through the target camera.
[0018] In this way, by querying whether the attribute value of the target attribute is the first identifier, it can be determined whether the electronic device supports detecting the ambient light brightness through the target camera, thereby deciding which registration strategy to adopt to obtain the ambient light brightness.
[0019] As an example of the present application, the method also includes: during the boot process, obtaining a target configuration file; if the designated field of the target configuration file is a second identifier, modifying the attribute value of the target attribute to the first identifier.
[0020] In this way, by configuring the attribute value of the target attribute, after the AOD application is started, by querying the attribute value of the target attribute, it can be determined that the electronic device supports detecting the ambient light brightness through the target camera, thereby realizing the control method of off-screen display provided in the embodiment of the present application.
[0021] As an example of the present application, an electronic device includes an AOD application, a sensor service module, a sensor control module, a camera service module and a camera control module, and the AOD application is used to realize off-screen display. Accordingly, the electronic device meets the ambient light acquisition condition and controls the target camera to power on, including: when the electronic device meets the ambient light acquisition condition, the AOD application sends a registration request to the sensor service module, and the registration request is used to request to subscribe to the ambient light brightness; the sensor service module sends an ambient light monitoring instruction to the sensor control module; in response to the ambient light monitoring instruction, the sensor control module sends a first control instruction to the camera service module; in response to the first control instruction, the camera service module calls the first function in the camera control module to control the target camera to power on. In this way, by establishing inter-core communication between the sensor control module and the camera service module, it is possible to detect the ambient light brightness through the target camera, avoiding the need for adding new modules, thereby ensuring the stability of the system.
[0022] As one of the present applications, controlling the target camera to power off includes: the AOD application sends a deregistration request to the sensor service module, the deregistration request is used to request to cancel the subscription of the ambient light brightness; the sensor service module sends a termination ambient light monitoring instruction to the sensor control module; in response to the termination ambient light monitoring instruction, the sensor control module sends a second control instruction to the camera service module; in response to the second control instruction, the camera service module calls the second function in the camera control module to control the target camera to power off. In this way, through the inter-core communication between the sensor control module and the camera service module, the target camera of the electronic device can be powered off by issuing the second control instruction, that is, the ambient light brightness is not performed, thereby reducing the operating power consumption of the target camera.
[0023] In a second aspect, 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 is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions so that the electronic device executes a method as described in any one of the first aspects.
[0024] In a third aspect, a chip system is provided, which is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes a method as described in any one of the first aspects.
[0025] According to a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes instructions, and when the instructions are executed on an electronic device, the electronic device executes the method as described in any one of the first aspects.
[0026] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method described in the first aspect.
[0027] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 is a schematic diagram showing an application scenario according to an exemplary embodiment;
[0029] Figure 2 is a schematic diagram of an application scenario according to another exemplary embodiment;
[0030] Figure 3 is a schematic structural diagram of an electronic device according to an exemplary embodiment;
[0031] Figure 4 is a schematic diagram of the architecture of a software system of an electronic device according to an exemplary embodiment;
[0032] Figure 5 is a flowchart of a method for controlling screen-off display according to an exemplary embodiment;
[0033] Figure 6 is a flowchart of a method for initializing target attributes according to an exemplary embodiment;
[0034] Figure 7 is a flowchart of a method for controlling screen-off display according to an exemplary embodiment;
[0035] Figure 8 It is a flowchart of a method for controlling screen-off display according to another exemplary embodiment. DETAILED DESCRIPTION
[0036] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0037] It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, the words "first" and "second" are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not limit them to be different.
[0038] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0039] 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, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0040] At present, more and more electronic devices have the function of off-screen display. Off-screen display is a function of smart devices that can display limited information in part of the display screen when the electronic device is in standby mode, so that users can view this limited information in time without manually lighting up the display screen. For example, the limited information includes time, date, notification icons, battery level, off-screen wallpaper, etc., that is, the interface content of the off-screen display is less than the interface content of the normal display screen. The off-screen display function is widely used in electronic devices such as Android phones.
[0041] When the screen is off, the electronic device is in Doze state (also known as nap state). In Doze state, the electronic device can delay the network access of the background of the APP (application) and the sensitive services of the central processor to achieve the purpose of reducing power consumption. It should be noted that here it is only delayed but not killed.
[0042] As an example of the present application, the screen-off display includes the following exemplary scenarios:
[0043] Scenario 1: After the user triggers the electronic device to turn off the screen, the electronic device automatically turns off the screen display.
[0044] See also Figure 1 In (a), the electronic device has its screen on and the user presses the power button of the electronic device. Figure 1 In (b), in response to the user pressing the power button, the electronic device turns off the screen (off). After a period of time (such as 0.2s), the electronic device turns off the screen through the AOD application, that is, displays the AOD interface, for example, see Figure 1 In (c), the electronic device displays information such as clock, date, notification, battery level, and screen-off wallpaper in a local area of the display screen for user viewing.
[0045] It should be noted that since a series of operations need to be performed after the electronic device is turned off, such as starting the AOD application, creating an AOD view through the AOD application, controlling the display screen to switch from the off state to the Doze state, etc., and this series of operations takes a certain amount of time, so from a visual point of view, after the electronic device is turned off, the AOD interface is displayed after a period of time (such as 0.2s).
[0046] For scenario 1, the user can set the screen off time period in the electronic device. In one example, the user can set the screen off time period to be all-day screen off through the electronic device. Figure 1 In the scenario 1 shown, after the electronic device displays the AOD interface, it is displayed all day, that is, the screen is always off until the screen is off. In another example, the user can also set the screen off time period to a preset time period through the electronic device. In this case, Figure 1 In the scenario 1 shown, the electronic device turns off the screen only during the preset time period, that is, after the screen is turned off, if the electronic device is within the preset time period, the electronic device displays the following Figure 1 The AOD interface shown in (c) in the figure, otherwise, if it is not within the preset time period, the electronic device is in the screen-off state.
[0047] The preset time period can be set according to needs, for example, the preset time period can be from 8 am to 11 pm.
[0048] Scenario 2: When the screen is off, the electronic device turns off the screen after the user touches or clicks the display screen.
[0049] For example, see Figure 2 In (a), the electronic device is in the screen-off state. If the user touches or clicks the display screen, the electronic device can realize the screen-off display through the AOD application, that is, display the AOD interface, such as displaying information such as clock, date, notification, battery level and screen-off wallpaper, such as Figure 2 After the screen is off for a first preset time, the electronic device may enter the screen-off state. Optionally, the AOD application is still in operation at this time, so that the AOD application can respond in time when the user touches or clicks the display screen next time, so as to turn off the screen again.
[0050] The first preset time length can be set according to demand, for example, the first preset time length can be set to 5s.
[0051] It should be noted that the above two application scenarios are only exemplary and do not limit the application scenarios of the embodiments of the present application. In another example, the screen off display may be triggered by other methods, which are not limited by the embodiments of the present application.
[0052] During the screen-off display process, the electronic device can obtain the ambient light brightness, and adjust the display brightness according to the ambient light brightness to adapt to the light intensity in different environments. In one example, the electronic device can detect the ambient light brightness through an ambient light detection device (such as an ambient light sensor). During the screen-off display process, the ambient light detection device can always be in operation, and the AOD application can always maintain a subscription to the ambient light brightness. In this way, when the display brightness needs to be adjusted according to the ambient light brightness, the ambient light brightness detected by the ambient light detection device can be obtained by issuing an ambient light monitoring instruction (such as a batch instruction), so as to adjust the display brightness according to the obtained ambient light brightness.
[0053] For example, taking scenario 1 as an example, after the screen is turned off, the AOD application always keeps subscribing to the ambient light brightness. In this way, every second preset time, the AOD application obtains the ambient light brightness detected by the ambient light detection device, thereby adjusting the display brightness according to the obtained ambient light brightness. The second preset time can be set according to demand. As an example but not a limitation, the second preset time can be 1 minute, etc., which is not limited in the embodiment of the present application.
[0054] For example, taking scenario 2 as an example, the AOD application always maintains a subscription to the ambient light brightness after it runs. In this way, whenever it detects a user's touch or single-click operation on the display screen, the AOD application obtains the ambient light brightness detected by the ambient light detection device, and adjusts the display screen brightness according to the obtained ambient light brightness.
[0055] The above method requires an additional ambient light detection device to detect the ambient light brightness, which increases the cost of the electronic device. In some embodiments, considering that electronic devices are equipped with cameras, and the cameras can have a light source detection function, in order to save costs, the electronic device uses a camera instead of an ambient light detection device to detect the ambient light brightness, and then adjusts the display brightness based on the ambient light brightness detected by the camera. The camera can be a front camera of the electronic device or a rear camera of the electronic device. Considering that the display screen and the front camera are located on the same side, and the ambient light brightness on different sides of the electronic device is different, in order to make the adjusted display screen brightness more in line with the current environment, the ambient light brightness is usually detected by the front camera. The embodiment of the present application is described by taking the detection of ambient light brightness by the front camera as an example.
[0056] However, when detecting the ambient light brightness through the front camera, since the system needs to be awake when the front camera is running, if the AOD application always keeps subscribing to the ambient light brightness when the screen is off, the front camera needs to be running all the time, which will cause the system to be unable to sleep, and the system cannot be in standby mode for a long time when the screen is off.
[0057] To this end, an embodiment of the present application provides a control method for off-screen display. When an electronic device detects ambient light brightness through a front camera, the AOD application subscribes to the ambient light brightness only when it needs to obtain the ambient light brightness, rather than continuously maintaining the subscription status, so as to prevent the camera from being in operation for a long time, thereby solving the problem that the system cannot be in standby mode for a long time when the screen is off.
[0058] Next, the electronic device involved in the embodiment of the present application is introduced. Figure 3 , Figure 3 1 is a schematic diagram of the structure of an electronic device 100 according to an exemplary embodiment. The electronic device 100 may be a mobile phone, a personal computer (PC), a tablet computer, an AR (Augmented Reality) device, a VR (Virtual Reality) device, a vehicle-mounted computer, a wearable device, a smart home device, etc.
[0059] See also Figure 3The 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration 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.
[0060] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0061] The processor 110 may include one or more processing units, for example, the processor 110 includes an application processor (AP), an advanced digital signal processor (ADSP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0062] The communication between AP and ADSP can be realized through the Qualcomm Messaging Interface (QMI), which is an architecture and protocol for communication between the hardware architecture and the application software architecture on the mobile platform. It provides a standardized multi-processor inter-process communication function interface, enabling applications to communicate with the hardware architecture and implement various functions such as data transmission, network connection, phone calls and text messages.
[0063] ADSP includes one or more drivers, exemplarily including ambient light driver, proximity light driver, etc. The ambient light driver is used to drive the ambient light sensor to obtain the ambient light brightness through the ambient light sensor, and the proximity light driver is used to drive the proximity light sensor to obtain proximity light data through the proximity light sensor.
[0064] Sensors such as the proximity light sensor 180G and the ambient light sensor 180L can be mounted on the ADSP. These sensors are directly connected to the corresponding drivers in the ADSP. For example, the ambient light sensor is connected to the ambient light driver. After the ambient light sensor collects the ambient light brightness, it is transmitted to the ambient light driver.
[0065] It should be noted that, with the architecture of independent ADSP settings, even if the AP enters a dormant state when the electronic device turns off the screen, since all kinds of sensors for detecting status are running or mounted in ADSP, all kinds of sensors can still continue to collect corresponding sensor data and report it to the corresponding driver. For example, taking the ambient light sensor as an example, the ambient light sensor can be in a working state while the electronic device is turned on, or, when the electronic device turns on the function of automatically adjusting the screen brightness by sensing the ambient light brightness, the ambient light sensor starts and periodically or non-periodically detects the ambient light brightness, and reports the detected ambient light brightness to the ambient light driver.
[0066] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0067] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0068] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 is charging the battery 142, it can also power the electronic device 100 through the power management module 141. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and powers the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193 and the wireless communication module 160.
[0069] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0070] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor.
[0071] 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 or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is an integer greater than 1.
[0072] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0073] The camera 193 is used to capture still images or videos. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is an integer greater than 1. For example, the camera may include a front camera and a rear camera. As an example of the present application, the camera 193 has a light source detection capability, that is, it can be used not only to capture still images or videos, but also to detect the ambient light brightness.
[0074] The external memory 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 memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0075] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created by the electronic device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0076] The electronic device 100 can implement audio functions, such as music playback, recording, etc., through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D and the application processor.
[0077] Optionally, the ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touch. Optionally, the electronic device may not include the ambient light sensor 180L, but use a front camera instead of the ambient light sensor 180L to detect the brightness of the ambient light.
[0078] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor 180K can pass 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 the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0079] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0080] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. In addition, the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above-mentioned embodiments, or a combination of multiple interface connection methods.
[0081] Next, the software system of the electronic device 100 will be described.
[0082] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software system of the electronic device 100.
[0083] Figure 4 1 is a block diagram of a software system of an electronic device 100 provided in an embodiment of the present application. Figure 4 The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into multiple layers, exemplarily including the application layer, the application framework layer (framework, FWK), the hardware abstraction layer (hardware abstraction layer, HAL) layer and the kernel layer from top to bottom.
[0084] The application layer can include a series of application packages. Figure 4 As shown, the application package may include AOD applications, camera, gallery, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications. It is used to interact directly with the user. These applications can be system built-in applications or non-system level applications. And these applications can have icons and application interfaces, or have application interfaces without icons, or have neither icons nor application interfaces.
[0085] The AOD application can be used to create an AOD view, which includes the AOD interface data to be displayed, that is, the AOD application is used to provide the AOD interface data to realize the AOD interface display. The AOD application can also determine the display brightness according to the ambient light brightness by subscribing to the ambient light brightness, and then instruct the display driver to control the display to adjust the display brightness to the determined value.
[0086] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 4 As shown, as an example of the present application, the application programming interface provided by the application framework layer may include camera service-related interfaces, sensor-related interfaces, and other service-related interfaces. Interfaces related to different services can be defined as different service modules. For example, interfaces related to sensor services can be defined as sensor service modules, interfaces related to camera services can be defined as camera service modules, and interfaces related to other services can be defined as other service modules (not shown in the figure), etc. Among them, the sensor service module can be used to implement communication between related applications (such as AOD applications) that need to call sensors in the application layer and the Sensor HAL. Optionally, the sensor service module can be used as an independent process. The camera service module can be used to implement communication between related applications that need to call cameras in the application layer and the Camera HAL. Optionally, the camera service module can be used as an independent process.
[0087] The hardware abstraction layer is located between the application framework layer and the kernel layer, and its purpose is to abstract the hardware. The hardware abstraction layer hides the hardware interface details of a specific platform and provides a virtual hardware platform for the software system, making it hardware-independent and portable on multiple platforms. According to the functions implemented, the hardware abstraction layer can be further refined into a camera-related hardware abstraction layer (i.e., the Camera HAL described in the embodiment of the present application), a sensor-related hardware abstraction layer (i.e., the Sensor HAL described in the embodiment of the present application), and the like. The camera-related hardware abstraction layer can be defined as a camera control module, and the sensor-related hardware abstraction layer can be defined as a sensor control module. Optionally, the camera control module can be used as an independent process, and the sensor control module can also be used as an independent process. As an example of the present application, the camera control module can be used to turn on or off the ambient light detection function of the front camera. The camera control module can also obtain the ambient light brightness detected by the front camera when the front camera is used as an ambient light detection device, and send the ambient light brightness detected by the front camera to the sensor control module, so that the sensor control module reports the ambient light brightness to the sensor service module.
[0088] As an example of the present application, the sensor control module includes a virtual ambient light sensor module, which is used to receive the ambient light brightness reported by the camera control module and report the ambient light brightness to the sensor service module. Optionally, the virtual ambient light sensor module can be a thread in the sensor control module.
[0089] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver. These drivers can drive the display screen, front / rear camera, audio player, sensor, etc.
[0090] The present application embodiment provides a method for controlling the off-screen display. In different scenarios, the implementation process of the method is different. Figure 5 and Figure 7 Two embodiments are provided to introduce the implementation process of the method in different scenarios. As an example but not a limitation, the method provided in the embodiment of the present application can be implemented by Figure 4 The software system shown is executed by the electronic device 100.
[0091] See also Figure 5 , Figure 5 The method is described by taking the application of the method in scenario 1 as an example. The method provided in the embodiment of the present application may include part or all of the following contents:
[0092] S501: In response to a second user operation, the electronic device starts an AOD application.
[0093] The second user operation may be a pressing operation of a power button by the user.
[0094] In one example, when the electronic device is in the screen-on state, if it detects that the user presses the power button, the electronic device turns off the screen. Thereafter, the electronic device starts the AOD application so that the screen can be turned off through the AOD application.
[0095] S502: The electronic device queries the attribute value of the target attribute through the AOD application.
[0096] In scenario 1, the electronic device will automatically turn off the screen after turning off the screen. When the screen is turned off, the display brightness needs to be set. As an example of this application, the electronic device can obtain the ambient light brightness to set the display brightness according to the ambient light brightness. The electronic device can obtain the ambient light brightness by registration, and the ambient light registration strategy used when detecting the ambient light brightness through the front camera is different from the ambient light registration strategy used when detecting the ambient light brightness through the sensor detection device. Therefore, in order to determine which ambient light registration strategy to use, after the AOD application is started, the electronic device queries the attribute value of the target attribute through the AOD application.
[0097] The target attribute can be used to indicate whether the electronic device supports detecting the ambient light brightness through the front camera. In one example, when the attribute value of the target attribute is the first identifier, it is used to indicate that the electronic device supports detecting the ambient light brightness through the front camera, otherwise, if the attribute value of the target attribute is not the first identifier, it is used to indicate that the electronic device does not support detecting the ambient light brightness through the front camera, but detects the ambient light brightness through the ambient light detection device.
[0098] The first identifier can be set according to requirements, for example, the first identifier is honor_light.
[0099] By way of example and not limitation, the target attribute may be a vendor attribute.
[0100] Normally, the attribute value of the vendor attribute is customized by the supplier of the ambient light detection device, and is generally named using information such as the supplier name and / or version number, rather than the first identifier. For example, for the ambient light detection device provided by supplier A, the attribute value of the vendor attribute is generally defined as vendor_A, and for the ambient light detection device provided by supplier B, the attribute value of the vendor attribute is generally defined as vendor_A. As an example of the present application, in the case where an electronic device supports detecting ambient light brightness through a front camera, the electronic device can modify the attribute value of the vendor attribute to the first identifier each time it is turned on (or during the boot process), that is, initialize the vendor attribute.
[0101] For example, see Figure 6 The initialization process of the vendor attribute can include the following steps:
[0102] 61. After being turned on, the electronic device reads the target configuration file.
[0103] The target configuration file can be set according to the requirements, for example, the target configuration file can be a DTS configuration file. As an example but not a limitation, the target configuration file is set in the ADSP. The electronic device can read the target configuration file from the ADSP through the Sensor HAL.
[0104] 62. Read the specified field in the target configuration file.
[0105] After reading the target configuration file, the electronic device determines whether the electronic device supports detecting the ambient light brightness through the front camera according to the target configuration file. As an example, the electronic device can make the determination according to a specified field in the target configuration file.
[0106] The designated field can be set according to requirements, for example, the designated field can be a camlight field.
[0107] 63. Specifies whether the field is a secondary identifier.
[0108] The second identifier can be set according to requirements, for example, the second identifier can be true.
[0109] When the specified field is the second identifier, it is used to indicate that the electronic device supports detecting the ambient light brightness through the front camera. Otherwise, if the specified field is not the second identifier, it is used to indicate that the electronic device does not support detecting the ambient light brightness through the front camera. For example, when the specified field is false, it is used to indicate that the electronic device does not support detecting the ambient light brightness through the front camera.
[0110] If the designated field is the second identifier, the operation of the following step 64 is performed; otherwise, if the designated field is not the second identifier, the operation of the following step 65 is performed.
[0111] 64. Modify the attribute value of the target attribute to the first identifier.
[0112] That is, when it is determined according to the specified field in the target configuration file that the electronic device supports detecting the ambient light brightness through the front camera, the attribute value of the target attribute is modified to the first identifier.
[0113] As an example and not limitation, if it is determined based on a specified field in a target configuration file that the electronic device supports detecting ambient light brightness through a front camera, the electronic device may modify the attribute value of the target attribute to the first identifier when initializing the virtual ambient light sensor module in the Sensor HAL.
[0114] 65. End the process.
[0115] That is, when it is determined according to the specified field in the target configuration file that the electronic device does not support detecting the ambient light brightness through the front camera, the attribute value of the target attribute is not modified.
[0116] As an example but not a limitation, the initialization process of the attribute value of the target attribute can be implemented using the following code:
[0117] if (get_dts == support_camlight) {
[0118] vendor = camlight
[0119] } else {
[0120] vendor = sensor_vendor (eg vendor name)
[0121] }
[0122] When the AOD application needs to use the ambient light brightness, it can obtain the attribute value of the target attribute through the getVendor() interface. Then, according to the attribute value of the target attribute, the corresponding ambient light registration strategy is executed. The specific implementation can be seen below.
[0123] It should be noted that in scenario 1, after the AOD application is started, in addition to querying the attribute values of the target attributes, an AOD view can also be created. The AOD view includes limited information to be displayed, so that the electronic device can draw the AOD interface based on the AOD view. In addition, the AOD application will also issue relevant instructions to enable the display driver to control the display screen to switch from the off state to the Doze state so that the display screen can be powered on.
[0124] S503: The electronic device determines, through the AOD application, whether the attribute value of the target attribute is the first identifier.
[0125] If the attribute value of the target attribute is the first identifier, it means that the electronic device supports detecting the ambient light brightness through the front camera. In this case, the electronic device enters the operation of S504; otherwise, if the attribute value of the target attribute is not the first identifier, it means that the electronic device does not support collecting the ambient light brightness through the front camera. In this case, the electronic device generally detects the ambient light brightness through the ambient light detection device, that is, executes the operation of S507.
[0126] S504: Whenever the ambient light acquisition opportunity arrives, the electronic device subscribes to the ambient light brightness through the AOD application.
[0127] Exemplarily, for the above scenario 1, the time to obtain ambient light is determined every second preset time. Optionally, since the screen will be turned off after switching from the screen-on state to the screen-off state, the display brightness can be adjusted according to the ambient light brightness. Therefore, the time to obtain ambient light is also determined after switching from the screen-on state to the screen-off state.
[0128] When the ambient light acquisition timing is reached, the electronic device meets the ambient light acquisition condition, and only when the ambient light acquisition condition is met will the electronic device subscribe to the ambient light brightness. As an example of the present application, the electronic device subscribes to the ambient light brightness, including: the electronic device controls the front camera to power on, so as to detect the ambient light brightness through the front camera. In this way, the electronic device can obtain the ambient light brightness detected by the front camera.
[0129] It is worth mentioning that since the front camera powers on quickly, the electronic device can obtain a frame of ambient light brightness in time, so that the display brightness can be set in a shorter time. Usually, the display brightness can be calculated within 30ms, thereby ensuring the timeliness of the screen off display.
[0130] S505: The electronic device displays the AOD interface according to the subscribed ambient light brightness.
[0131] In implementation, the electronic device controls the display screen to switch from the off state to the Doze state, the display screen is powered on, and after obtaining the ambient light brightness, the electronic device determines the display screen brightness according to the ambient light brightness, and controls the backlight brightness of the display screen according to the determined display screen brightness, thereby setting the display screen brightness. In this way, the user can see the AOD interface that suits the environment.
[0132] As an example but not limitation, the AOD scene may include three levels of backlight brightness, such as high brightness, medium brightness and low brightness, where different levels of backlight brightness correspond to different backlight brightness values. Optionally, the high brightness level may be identified by a backlight brightness value of 1, the medium brightness level may be identified by a backlight brightness value of 6, and the low brightness level may be identified by a backlight brightness value of 3.
[0133] As an example but not limitation, the electronic device may store a correspondence between an ambient light brightness range and a backlight brightness value, for example, see Table 1, which shows a correspondence between an ambient light brightness range and a backlight brightness value according to an exemplary embodiment. Thus, in the process of adjusting the backlight brightness of the display screen, the AOD application queries the backlight brightness value corresponding to the ambient light brightness range to which the ambient light brightness belongs from the correspondence, and then controls the backlight brightness of the display screen to be the queried backlight brightness value.
[0134] Table 1
[0135]
[0136] It should be noted that the embodiment of the present application is only described by recording the corresponding relationship between the ambient light brightness range and the backlight brightness value in the form of a table. In another example, it can also be recorded in other ways, such as by a collection, etc., and the embodiment of the present application is not limited to this.
[0137] S506: The electronic device cancels the subscription to the ambient light brightness.
[0138] That is, when the ambient light acquisition conditions are met, the electronic device subscribes to the ambient light brightness. After acquiring a frame of ambient light brightness, the electronic device cancels the subscription to the ambient light brightness. At this time, the electronic device controls the front camera to power off to avoid long-term subscription so that the front camera is always in operation, thereby solving the problem that the electronic device cannot sleep in the off-screen display mode. In addition, since the front camera is not always in operation, the operating power consumption of the front camera is reduced.
[0139] S507: The electronic device subscribes to the ambient light brightness, obtains the ambient light brightness when the ambient light acquisition timing is reached, and displays the AOD interface according to the obtained ambient light brightness.
[0140] That is, when the electronic device does not support detecting ambient light brightness through the front camera, the electronic device can always subscribe to the ambient light brightness. In this way, when the ambient light brightness needs to be obtained, a frame of ambient light brightness detected by the ambient light sensor can be obtained by issuing an ambient light monitoring instruction, and the AOD interface can be displayed based on the obtained ambient light brightness. For specific implementation, please refer to step S505.
[0141] It should be noted that the embodiments of the present application are described by taking an electronic device equipped with an ambient light sensor as an example.
[0142] It should be noted that the embodiment of the present application is described by taking the adjustment of the display brightness according to the ambient light brightness when switching from the on screen state to the off screen state as an example. In another example, when switching from the on screen state to the off screen state, the display brightness may not be adjusted according to the ambient light brightness, but the default display brightness may be used, and after the screen is off, the display brightness is adjusted according to the ambient light brightness every second preset time, and the embodiment of the present application is not limited to this.
[0143] In the embodiment of the present application, when the electronic device meets the ambient light acquisition condition, the front camera is controlled to be powered on, the ambient light brightness is acquired through the front camera, the AOD interface is displayed according to the acquired ambient light brightness, and then the front camera is controlled to be powered off. In this way, the system is awakened only when it is necessary to acquire the ambient light brightness, the ambient light brightness is detected through the front camera, and the front camera is controlled to be powered off when it is not needed, thereby realizing that the ambient light brightness can be detected by the front camera instead of the ambient light detection device in the AOD state.
[0144] See also Figure 7 , Figure 7 The method is described by taking the application of the method in scenario 2 as an example. The method provided in the embodiment of the present application may include part or all of the following contents:
[0145] S701: In response to a second user operation, the electronic device starts an AOD application.
[0146] For specific implementation, see Figure 5 S501 in the illustrated embodiment.
[0147] S702: The electronic device queries the attribute value of the target attribute through the AOD application.
[0148] For its specific implementation, please refer to Figure 5 S502 in the illustrated embodiment.
[0149] It should be noted that in scenario 2, after the electronic device switches from the on screen state to the off screen state, the off screen display interface is not automatically displayed, so after the AOD application is started, it is not necessary to create an AOD view, nor to trigger the electronic device to switch the display from the off state to the Doze state. For example, the AOD application can only query the attribute value of the target attribute.
[0150] S703: The electronic device determines, through the AOD application, whether the attribute value of the target attribute is the first identifier.
[0151] For its specific implementation, please refer to Figure 5 S503 in the illustrated embodiment.
[0152] When the attribute value of the target attribute is the first identifier, it means that the electronic device supports detecting the ambient light brightness through the front camera. In this case, the electronic device enters the following operation S704; otherwise, when the attribute value of the target attribute is not the first identifier, it means that the electronic device does not support detecting the ambient light brightness through the front camera. In this case, the electronic device enters the following operation S709.
[0153] S704: After receiving the first user operation, the electronic device subscribes to the ambient light brightness through the AOD application.
[0154] The first user operation is used to trigger the electronic device to switch from the screen-off state to the AOD state. For example, the first user operation may be a light touch or a single click operation of the user on the display screen.
[0155] In the screen-off state, when receiving the first user operation, the electronic device determines that the ambient light acquisition condition is met, and in this case, the electronic device subscribes to the ambient light brightness through the AOD. Specifically, the electronic device controls the front camera to power on to detect the ambient light brightness through the front camera, thereby obtaining the ambient light brightness detected by the front camera.
[0156] S705: The electronic device creates an AOD view through the AOD application, and draws an AOD interface according to the AOD view.
[0157] That is, after receiving the first user operation, in addition to subscribing to the ambient light brightness, the electronic device also creates an AOD view through the AOD application, and draws the AOD interface based on the AOD view created by the AOD application, such as by synthesizing the AOD view created by the AOD application and other views through a drawing tool (SurfaceFlinger) to obtain the AOD interface.
[0158] S706: The electronic device displays the AOD interface according to the subscribed ambient light brightness.
[0159] As an example, the electronic device controls the display screen to switch from the off state to the Doze state, so that the display screen displays the AOD interface, and the electronic device determines the backlight brightness of the display screen according to the subscribed ambient light brightness, and sets the display screen brightness to the determined backlight brightness.
[0160] The specific implementation of the electronic device determining the backlight brightness of the display according to the subscribed ambient light brightness can be found in Figure 5 S505 in the embodiment.
[0161] S707: After a first preset time period, the electronic device controls the display screen to turn off.
[0162] For example, after 5 seconds, the electronic device controls the display screen to switch from the Doze state to the off state.
[0163] S708: The electronic device cancels the subscription to the ambient light brightness.
[0164] That is, after the electronic device controls the display screen to turn off, it cancels the subscription to the ambient light brightness. For specific implementation, see Figure 5 S506 in the illustrated embodiment.
[0165] S709: The electronic device subscribes to the ambient light brightness, and whenever receiving a first user operation, obtains the ambient light brightness, and displays the AOD interface according to the obtained ambient light brightness.
[0166] For its specific implementation, please refer to Figure 5 S507 in the embodiment.
[0167] In the embodiment of the present application, when the electronic device meets the ambient light acquisition condition, the front camera is controlled to be powered on, the ambient light brightness is acquired through the front camera, the AOD interface is displayed according to the acquired ambient light brightness, and then the front camera is controlled to be powered off. In this way, the system is awakened only when it is necessary to acquire the ambient light brightness, the ambient light brightness is detected through the front camera, and the front camera is controlled to be powered off when it is not needed, thereby realizing that the ambient light brightness can be detected by the front camera instead of the ambient light detection device in the AOD state.
[0168] To facilitate understanding, the internal implementation process of the electronic device is introduced below.
[0169] First, the communication between modules is described. Figure 4For the electronic device of the software system shown, the camera service module can control the opening and closing of the front camera by issuing instructions to the camera control module, and the sensor service module can control the opening and closing of the ambient light detection device by issuing instructions to the sensor control module. When the front camera is used instead of the ambient light detection device, the opening and closing of the front camera needs to be controlled by the instructions issued by the sensor service module. Since the sensor control module cannot pass the instructions issued by the sensor service module to the front camera, and the camera control module can pass the instructions issued by the camera service module to the front camera, in order to realize the front camera replacing the ambient light detection device, it is necessary to establish a control path between the sensor control module and the camera service module, so as to realize the control of the front camera with the help of the camera service module. The sensor control module of the HAL layer of the embodiment of the present application can be used as an independent process, and the camera service module of the FWK layer can also be used as an independent process. Therefore, when establishing the control path between the sensor control module of the HAL layer and the camera service module of the FWK layer, it can be established based on the hardware abstraction layer interface definition language (HAL interface definition language, HIDL) service. Among them, HIDL is used to define the interface between the HAL layer and the FWK layer of the Android system based on Binder communication.
[0170] After opening the control path between the sensor control module and the camera service module, it is also necessary to establish a data path between the sensor control module and the camera control module, so that after turning on the ambient light detection function of the front camera, the camera control module can transmit the ambient light brightness detected by the front camera to the sensor control module, and then the sensor control module sends it to the sensor service module, thereby adjusting the brightness of the display screen. As an example of the present application, the data path between the sensor control module and the camera control module can be established through inter-core communication, such as through AIDL (Android Interface Definition Language), where AIDL is used to define the interface between the client and the server of the Android system based on Binder communication. Binder is a cross-process communication mechanism of the Android system, which allows communication between different processes and even across devices.
[0171] See also Figure 8 , Figure 8 This is a flowchart of a method for controlling screen-off display according to another exemplary embodiment. As an example but not a limitation, the embodiment of the present application is introduced by taking the interactive execution of multiple modules by an electronic device as an example, and may mainly include some or all of the following contents:
[0172] S801: After the AOD application is running, it sends an attribute query instruction to the sensor service module. The attribute query instruction is used to request to query the attribute value of the target attribute.
[0173] For the specific implementation of AOD application operation, please refer to Figure 5 S501 in the illustrated embodiment.
[0174] After the AOD application is running, it can send an attribute query instruction to the sensor service module to request to query the attribute value of the target attribute.
[0175] S802: The sensor service module sends a property query instruction to the sensor control module.
[0176] According to the previous records, the attribute values of the target attributes are generally set in the ADSP, and the AP of the electronic device interacts with the ADSP through the sensor control module. Therefore, the sensor service module sends an attribute query instruction to the sensor control module to query the attribute values of the target attributes through the sensor control module.
[0177] S803: The sensor control module queries the attribute value of the target attribute from the ADSP.
[0178] S804: The sensor control module sends the attribute value of the target attribute to the sensor service module.
[0179] S805: The sensor service module sends the attribute value of the target attribute to the AOD application.
[0180] In this way, the AOD application can obtain the attribute value of the target attribute.
[0181] In S804 to S805, after acquiring the attribute value of the target attribute, the sensor control module feeds back the attribute value of the target attribute to the AOD application through the sensor service module.
[0182] As an example of the present application, after the AOD application queries the attribute value of the target attribute through the above process, it can cache the attribute value of the target attribute during operation. In this way, when it is necessary to determine which ambient light registration strategy to use to obtain the ambient light brightness during operation, the AOD application can make a judgment based on the attribute value of the target attribute in the cache space, avoiding the need to obtain it from the bottom layer every time, which can improve the query speed and reduce the interaction between modules.
[0183] S806: When it is determined according to the attribute value of the target attribute that the electronic device supports detecting the ambient light brightness through the front camera, if the ambient light acquisition condition is met, the AOD application sends a registration request to the sensor service module.
[0184] Register request to subscribe to ambient light brightness.
[0185] As an example but not a limitation, the registration request includes configuration parameters such as a target frequency, where the target frequency is the frequency at which the front camera detects changes in the intensity of ambient light. For example, the target frequency is 200 Hz.
[0186] In one example, when the ambient light acquisition timing is reached, it is determined that the ambient light acquisition condition is met. For details, see Figure 5 The embodiment shown.
[0187] In another example, when the first user operation is received, it is determined that the ambient light acquisition condition is met. For details, see Figure 7 The embodiment shown.
[0188] S807: The sensor service module sends an ambient light monitoring instruction to the sensor control module.
[0189] For example, the ambient light monitoring command is a batch command.
[0190] As an example but not limitation, the ambient light monitoring instruction carries a target frequency.
[0191] After receiving the registration request, the sensor service module determines that the AOD application needs to obtain a frame of ambient light brightness. In this case, the sensor service module can send a batch instruction to the sensor control module to instruct the sensor control module to obtain a frame of ambient light brightness.
[0192] S808: After receiving the ambient light monitoring instruction, the sensor control module calls the first interface based on the AIDL service and registers the data callback function in the camera control module.
[0193] According to the previous records, the sensor control module and the camera control module can communicate through the AIDL service. For two processes based on AIDL service communication, one process is used to generate data and can be used as an AIDL server; the other process is used to issue control instructions and receive data, and can be used as an AIDL client. In an embodiment of the present application, when the front camera is used instead of the ambient light detection device, the camera control module (Camera HAL) is used to provide ambient light brightness and can be used as an independent process, therefore, it can be regarded as an AIDL server; the sensor control module (SensorHAL) is used to receive ambient light brightness, therefore, it can be regarded as an AIDL client.
[0194] The first interface may be an Active interface, that is, the sensor control module may call the Active interface and register a data callback function in the camera control module, so that the camera control module may send the ambient light brightness detected by the front camera to the sensor control module through the data callback function, thereby opening up a data path between the camera control module and the sensor control module.
[0195] In the embodiment of the present application, the sensor control module calls the Active interface, and before registering the data callback function in the camera control module, the Active interface needs to be declared first. Since the Active interface belongs to the AIDL interface, its declaration usually contains two parameters, one of which can be the process ID (Process Identifier, PID) of the AIDL client, that is, the process ID of the corresponding process of the sensor control module (Sensor HAL) as the AIDL client; the other can be the callback object (CallBack) of the AIDL client, that is, the object in the sensor control module for receiving the ambient light brightness. Optionally, the callback object can be ReportLusStatus.
[0196] Among them, the declaration of the Active interface can be implemented using the following code:
[0197] interface ILuxService {
[0198] void RegisterLuxCallback(in int pid, in vendor.XXX.hardware.camlight .ILuxCallback callback);
[0199] void SetCalidata(in float calidata);
[0200] …
[0201] Furthermore, based on the declaration content of the Active interface, the sensor control module and the camera control module can respectively register callback interfaces on the local side. When the callback interface registration in the sensor control module and the camera control module is completed, the registration of the data callback function in the camera control module is completed.
[0202] It should be noted that step S808 is optional, and may not be performed if a data callback function exists.
[0203] S809: The sensor control module sends a first control instruction to the camera service module.
[0204] In the case of replacing the ambient light detection device with the front camera, since the front camera needs to be controlled to turn on, and the control of the front camera is performed by the camera service module, the sensor control module can send a first control instruction to the camera service module to instruct the camera service module to control the front camera to perform ambient light detection.
[0205] As an example but not limitation, the sensor control module can call the second interface to generate a first control instruction, and then send the first control instruction to the camera service module through the second interface. The second interface belongs to the interface of the HIDL service. The camera service module can be an independent process, and the independent process can be defined as a camera service process. The first control instruction can be an Open Camera instruction.
[0206] Usually, the camera includes two types: front camera and rear camera, and the number of front camera and rear camera is at least one respectively. Moreover, the front camera and rear camera have multiple functions respectively, including at least one of the photo taking function, face unlocking function, ambient light detection function, etc. In order to distinguish different types of cameras and different functions of the same type of camera, the embodiment of the present application abstracts multiple logical cameras according to the type and function of the camera, and each logical camera corresponds to an identifier. For example, according to the photo taking function of the front camera, logical camera A can be abstracted, and according to the ambient light detection function of the front camera, logical camera B can be abstracted. Logical camera A and logical camera B can correspond to the same front camera or different front cameras. For the photo taking function of logical camera A, i.e., the front camera, the identifier set is Camera ID=1, and for the ambient light detection function of logical camera B, i.e., the front camera, the identifier set is Camera ID=4.
[0207] As an example, the first control instruction may include a target frequency, and optionally, may also include a first identifier, where the first identifier corresponds to an ambient light detection function of a front camera, and may be Camera ID=4.
[0208] It should be noted that there is no strict execution order between S808 and S809. In one example, S808 and S809 can be executed in parallel.
[0209] S810: In response to the first control instruction, the camera service module calls a first function in the camera control module to control the camera driver to power on the front camera.
[0210] The first function is used to open any function of any camera in the electronic device, and the first function may be an Open Camera function.
[0211] After receiving the first control instruction, the camera service module can call the first function in the camera control module and execute the first function according to the first identifier. According to the first identifier, it can be determined that the ambient light detection function of the front camera needs to be turned on. At this time, the front camera will replace the ambient light detection device. When the front camera replaces the ambient light detection device, the front camera needs to detect the ambient light brightness without collecting images. In order to reduce the power consumption of the front camera, the camera service module executes the necessary processes in the first function to turn on the ambient light detection function of the front camera according to the first identifier, such as applying for CSL resource cache, powering on the front camera, initializing camera registers, creating a thread for reading ambient light brightness, etc.
[0212] By executing the first function, a corresponding control instruction can be generated, and the control instruction is sent to the camera driver, so as to control the camera driver to apply for CSL resource cache for the front camera, power on the front camera, initialize the camera register, create a reading thread, etc. The created reading thread is used to read and calculate the ambient light brightness detected by the front camera.
[0213] Optionally, the reading thread may be an asynchronous reading thread. Based on the initialization of the camera register, the frequency (ie, target) of the front camera detecting the ambient light brightness and the like may be written into the front register, thereby controlling the front camera to work.
[0214] S811: The camera control module obtains the ambient light brightness output by the front camera.
[0215] S812: The camera control module sends the ambient light brightness to the sensor control module through the data callback function.
[0216] Optionally, the camera control module can send the acquired one frame of ambient light brightness to the sensor control module through a pre-registered data callback function. Specifically, the camera control module can fill the acquired one frame of ambient light brightness into the pre-registered data callback function, and send the ambient light brightness to the sensor control module through the data callback function.
[0217] It should be noted that the brightness of a frame of ambient light in the embodiment of the present application is not a brightness value, but represents a type of brightness value. For example, the ambient light brightness represents the brightness value output by the front camera at different times.
[0218] S813: The sensor control module sends the ambient light brightness to the sensor service module.
[0219] Optionally, the virtual ambient light sensor module in the sensor control module may receive the ambient light brightness sent by the camera control module, and then send the ambient light brightness to the sensor service module.
[0220] As an example of the present application, when the sensor service module sends an ambient light monitoring instruction to the sensor control module, a callback function can be registered in the sensor control module, and the sensor control module can send the ambient light brightness to the sensor service module through the callback function. Optionally, the sensor control module can fill the ambient light brightness into the callback function, and send the ambient light brightness to the sensor service module through the callback function.
[0221] S814: The sensor service module reports the ambient light brightness to the AOD application.
[0222] S815: The AOD application displays the AOD interface according to the ambient light brightness.
[0223] In a possible implementation, adjusting the display brightness may be setting the backlight brightness of the display. Specifically, the AOD application may determine the backlight brightness of the display based on the ambient light brightness, and then set the backlight brightness of the display to a determined value. For specific implementation, see the above.
[0224] Optionally, when the AOD application adjusts the brightness of the display screen according to the ambient light brightness, it can generate a brightness adjustment instruction, and then send the brightness adjustment instruction to the sensor control module through the sensor service module. The sensor control module sends the brightness adjustment instruction to the display driver, so that the display driver executes the brightness adjustment instruction to adjust the brightness of the display screen.
[0225] S816: The AOD application sends a deregistration request to the sensor service module.
[0226] In one possible scenario, if the screen is off all day, the AOD application can immediately send a deregistration request to the sensor service module after adjusting the display brightness, so that the sensor service module triggers the bottom layer to control the front camera to power off.
[0227] In another possible case, if it is in scenario 2, the AOD application can send a deregistration request to the sensor service module after the screen is turned off, so that the sensor service module triggers the bottom layer to control the front camera to power off.
[0228] S817: The sensor service module sends an instruction to terminate ambient light monitoring to the sensor control module.
[0229] That is, for the sensor service module, after receiving the deregistration request, it indicates that the AOD application does not need to continue to subscribe to the ambient light brightness. Therefore, the sensor service module sends a termination ambient light monitoring instruction to the sensor control module.
[0230] S818: In response to terminating the ambient light monitoring instruction, the sensor control module sends a second control instruction to the camera service module.
[0231] As an example but not limitation, the sensor control module calls the third interface based on the AIDL service, and then calls the third interface to send the second control instruction to the camera service module.
[0232] After receiving the stop brightness monitoring instruction, the sensor control module can call the third interface to generate a second control instruction, and then call the third interface to send the second control instruction to the camera service module. The third interface can be a DeActive interface, which is used to turn off the ambient light detection function of the front camera.
[0233] The second control instruction may be a Close Camera instruction, which may include a first identifier and the like.
[0234] S819: After receiving the second control instruction, the camera service module calls the second function in the camera control module, and executes the second function according to the first identifier to control the camera driver to power off the front camera.
[0235] After receiving the second control instruction, the camera service module calls the second function in the camera control module, and executes the second function according to the first identifier. By executing the second function, a corresponding shutdown instruction can be generated, and the generated shutdown instruction is sent to the camera driver. Based on the shutdown instruction, the camera driver closes the reading thread, stops reading the ambient light brightness, powers off the front camera, and then releases the CSL cache resources applied for the front camera.
[0236] After the camera driver closes the reading thread, the camera control module will no longer send the ambient light brightness to the sensor control module through the data callback function.
[0237] As an example of the present application, in the process of shutting down the front camera, the sensor control module and the camera control module can release the registered data callback function to release resources and avoid wasting resources.
[0238] As another example of the present application, during the process of turning off the front camera, the sensor control module and the camera control module may not release the registered data callback function, so that the next time the AOD application subscribes to the ambient light brightness, the camera control module can continue to use the data callback function to send the ambient light brightness to the sensor control module.
[0239] It should be noted that the above is explained by taking the electronic device supporting the detection of ambient light brightness through the front camera as an example. In another example, if the electronic device does not support the detection of ambient light brightness through the front camera, that is, the AOD application determines that the electronic device does not support the detection of ambient light brightness through the front camera by querying the attribute value of the target attribute, then after the AOD application is started, the ambient light brightness is registered according to the conventional registration strategy.
[0240] Exemplarily, the specific implementation may include: the AOD application sends a registration request to the sensor service module, and then the sensor service module sends a batch instruction to the sensor control module. The sensor control module obtains a frame of ambient light brightness from the ADSP, and then feeds back the ambient light brightness to the AOD application through the sensor service module. The AOD application adjusts the display brightness according to the obtained ambient light brightness. Afterwards, the AOD application does not cancel the subscription to the ambient light brightness, that is, does not send a deregistration request to the sensor service module, and always maintains the subscription to the ambient light brightness. In this way, when the AOD application needs to obtain a frame of ambient light brightness next time, for example, when the ambient light acquisition condition is met next time, a deregistration request can be sent to the sensor service module first, and then a registration request can be sent to the sensor service module, so that the sensor service module determines that the AOD application needs to obtain the ambient light brightness again. At this time, the sensor service module sends a batch instruction to the sensor control module, so that the sensor control module obtains a frame of ambient light brightness from the ADSP again, and then feeds back the obtained ambient light brightness to the AOD application through the sensor service module.
[0241] It is worth noting that in the process of implementing ambient light detection through an ambient light detection device, since there may be one or more different applications in the application layer calling the sensor service module to request to obtain the ambient light brightness, in order to enable the sensor service module to determine that it is the AOD application requesting to obtain the ambient light brightness, the AOD application can first deregister and then register the ambient light brightness again, so that the sensor service module can send the batch instruction to the sensor control module, and then the AOD application can obtain the ambient light brightness.
[0242] As an example but not a limitation, the judgment logic of the above embodiment can be seen in the following code:
[0243] If(get_vendor() == sensor_vendor){
[0244] If (touch the display screen || get one frame of data in 1 minute in all-weather mode) {
[0245] unregister_als(); Unregister ambient light
[0246] register_als(); Register ambient light
[0247] batch_to_sensorhub(); Send a request for a frame of data
[0248] report_last_lux(); Complete the reporting of the latest frame of data (
[0249] } else if (screen off) {
[0250] Turn off the screen to keep registration;
[0251] }
[0252] } eles if (get_vendor() == honor_light) {
[0253] If (touch the display screen || get one frame of data per minute in all-weather mode) {
[0254] register_als(); Register ambient light
[0255] report_firstlux(); Report a frame of ambient light brightness
[0256] } else if (screen off) {
[0257] unregister_als(); Unregister ambient light
[0258] }
[0259] }
[0260] In the embodiment of the present application, when the electronic device meets the ambient light acquisition condition, the front camera is controlled to be powered on, the ambient light brightness is acquired through the front camera, the AOD interface is displayed according to the acquired ambient light brightness, and then the front camera is controlled to be powered off. In this way, the system is awakened only when it is necessary to acquire the ambient light brightness, the ambient light brightness is detected through the front camera, and the front camera is controlled to be powered off when it is not needed, thereby realizing that the ambient light brightness can be detected by the front camera instead of the ambient light detection device in the AOD state.
[0261] Of course, it should be noted that the above is based on the example of subscribing to ambient light brightness according to a conventional registration strategy when the electronic device does not support detecting ambient light brightness through the front camera, but detects ambient light through an ambient light detection device. In another optional example, when the ambient light is detected through an ambient light detection device, the electronic device can also subscribe to the ambient light brightness according to the conventional registration strategy. Figure 8 The process shown subscribes to the ambient light brightness, that is, the ambient light brightness is subscribed only when it is needed to obtain the ambient light brightness. When it is not needed to obtain the ambient light brightness, the subscription to the ambient light brightness is canceled. That is, when the AOD application does not need to obtain the ambient light brightness, it can trigger the ambient light detection device to stop working. In this way, the operating power consumption of the ambient light detection device can be reduced.
[0262] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (such as: infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital versatile disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)).
[0263] The above are optional embodiments provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the technical scope disclosed in the present application shall be included in the protection scope of the present application.
Claims
1. A method for controlling off-screen display, characterized in that: Applied to an electronic device, the electronic device includes an AOD application, a sensor service module, a sensor control module, a camera service module and a camera control module, the AOD application is used to realize off-screen display, and the method includes: The electronic device meets the ambient light acquisition condition. If it is determined according to the attribute value of the target attribute that the electronic device supports detecting the ambient light brightness through the target camera, the target camera is controlled to be powered on. The ambient light acquisition condition refers to the condition for obtaining the ambient light brightness in the AOD state when the screen is off. The target camera has a light source detection capability. The target attribute is used to indicate whether the electronic device supports detecting the ambient light brightness through the target camera. Acquiring a first ambient light brightness through the target camera; Displaying an AOD interface according to the first ambient light brightness, wherein the brightness of the display screen of the electronic device when displaying the AOD interface is a target brightness, and the target brightness is determined according to the first ambient light brightness; Controlling the target camera to power off; Wherein, the electronic device meets the ambient light acquisition condition, and if it is determined according to the attribute value of the target attribute that the electronic device supports detecting the ambient light brightness through the target camera, controlling the target camera to power on includes: In the case where the electronic device meets the ambient light acquisition condition, if it is determined according to the attribute value of the target attribute that the electronic device supports detecting the ambient light brightness through the target camera, the AOD application sends a registration request to the sensor service module, and the registration request is used to request to subscribe to the ambient light brightness; the sensor service module sends an ambient light monitoring instruction to the sensor control module; in response to the ambient light monitoring instruction, the sensor control module sends a first control instruction to the camera service module; in response to the first control instruction, the camera service module calls a first function in the camera control module to control the target camera to power on; The controlling the target camera to power off includes: The AOD application sends a deregistration request to the sensor service module, and the deregistration request is used to request to cancel the subscription to the ambient light brightness; the sensor service module sends an instruction to terminate ambient light monitoring to the sensor control module; in response to the instruction to terminate ambient light monitoring, the sensor control module sends a second control instruction to the camera service module; in response to the second control instruction, the camera service module calls a second function in the camera control module to control the target camera to power off.
2. The method according to claim 1, characterized in that The screen-off display mode of the electronic device is a user-triggered mode, which means that when a first user operation is detected in the screen-off state, the electronic device turns off the screen display, and after a first preset time, the electronic device enters the screen-off state; The electronic device meets the ambient light acquisition condition, and if it is determined according to the attribute value of the target attribute that the electronic device supports detecting the ambient light brightness through the target camera, controlling the target camera to power on, including: In the screen-off state, after receiving the first user operation, if it is determined according to the attribute value of the target attribute that the electronic device supports detecting the ambient light brightness through the target camera, controlling the target camera to power on; The displaying the AOD interface according to the first ambient light brightness includes: Determining the target brightness according to the first ambient light brightness; The AOD interface is displayed, and the brightness of the display screen is controlled to be the target brightness.
3. The method according to claim 2, characterized in that Before controlling the target camera to power off, the method further includes: After the first preset time has passed, controlling the display screen to turn off; The controlling the target camera to power off includes: After the display screen is turned off, the target camera is controlled to be powered off.
4. The method according to claim 1, characterized in that The screen-off display mode of the electronic device is an all-weather mode, and the all-weather mode means that the screen is always off in the screen-off state; The electronic device meets the ambient light acquisition condition, and if it is determined according to the attribute value of the target attribute that the electronic device supports detecting the ambient light brightness through the target camera, controlling the target camera to power on, including: During the screen-off display process, if it is determined according to the attribute value of the target attribute that the electronic device supports detecting the ambient light brightness through the target camera, the target camera is controlled to be powered on every second preset time period; The displaying the AOD interface according to the first ambient light brightness includes: Determining the target brightness according to the first ambient light brightness; During displaying the AOD interface, the brightness of the display screen is controlled to be the target brightness.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: After the AOD application is started, the attribute value of the target attribute is obtained, and the AOD application is used to realize the off-screen display; According to the attribute value of the target attribute, it is determined whether the electronic device supports detecting the ambient light brightness through the target camera.
6. The method according to claim 5, characterized in that The determining, according to the attribute value of the target attribute, whether the electronic device supports detecting ambient light brightness through the target camera includes: When the attribute value of the target attribute is the first identifier, it is determined that the electronic device supports detecting ambient light brightness through the target camera.
7. The method according to claim 6, characterized in that The method further comprises: During the boot process, obtain the target configuration file; If the designated field of the target configuration file is the second identifier, the attribute value of the target attribute is modified to the first identifier.
8. The method according to any one of claims 1 to 4, characterized in that The target camera is the front camera of the electronic device.
9. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method described in any one of claims 1-8.
10. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Display brightness adjusting method, mobile terminal and storage medium
CN108494974A
Method for acquiring ambient light brightness, electronic equipment, storage medium and chip
CN117956290A