Search

US-12626628-B2 - Ambient light and proximity detection method, photographing method, and terminal

US12626628B2US 12626628 B2US12626628 B2US 12626628B2US-12626628-B2

Abstract

This application relates to the field of communications technologies, and provides ambient light and optical proximity detection methods, a photographing method, and a terminal, so that an entire display screen of the terminal is used to display a user interface, and this improves user experience. The method specifically includes: controlling, by a terminal, some areas of a display screen to display a black picture for a plurality of times; and when the areas display the black picture, obtaining approaching data of the external object detected by an optical proximity sensor to control turning on or off of the display screen.

Inventors

  • Chenlong LI
  • Hongxia GUI
  • Xin Zhao

Assignees

  • HONOR DEVICE CO., LTD.

Dates

Publication Date
20260512
Application Date
20250115
Priority Date
20171229

Claims (20)

  1. 1 . A proximity detection method, comprising: displaying, by a terminal, a black picture for at least two times in a first area of a display area of a display screen of the terminal, wherein the terminal includes a first optical proximity sensor under the display screen, the display area of the display screen includes the first area and a second area, the first optical proximity sensor detects an external object through the first area, and the second area is outside the first area, and wherein the black picture is displayed for at least two times in the first area during refreshing of one frame of an image frame picture, wherein a size of an area for displaying the black picture is equal to a size of the first area; displaying, by the terminal, the image frame picture in the second area when the black picture is displayed in the first area; displaying, by the terminal, the image frame picture in the first area in an interval between displaying the black picture in the first area for two times; and obtaining, by the terminal, approaching data of the external object detected by the first optical proximity sensor when the first area displays the black picture.
  2. 2 . The method according to claim 1 , further comprising displaying, by the terminal, the black picture periodically in the first area, wherein the black picture continuously moves from one boundary of the display area to an opposite boundary of the display area on the display screen during refreshing of the image frame.
  3. 3 . The method according to claim 1 , wherein a display frequency of the terminal is f Hz, and the interval between displaying the black picture in the first area for two times is greater than or equal to 1/(a×f) seconds, wherein a is a positive integer greater than or equal to 2.
  4. 4 . The method according to claim 1 , wherein a duration of displaying the black picture each time is greater than or equal to a duration used by the first optical proximity sensor for detecting the proximity.
  5. 5 . The method according to claim 1 , wherein the image frame picture includes a display user interface presented by the terminal to a user.
  6. 6 . The method according to claim 1 , wherein the displaying, by a terminal, a black picture for at least two times in a first area comprises: displaying, by the terminal, N black pictures within a first time period T 1 in the first area; and obtaining, by the terminal using the first optical proximity sensor, the approaching data of the external object for M times, when M of the N black pictures are displayed, wherein M is less than or equal to N.
  7. 7 . The method according to claim 1 , wherein the method further comprises: displaying, by the terminal, the black picture for a plurality of times in the second area; displaying, by the terminal, the image frame picture in the first area when the black picture is displayed in the second area; and displaying, by the terminal, the image frame picture in the second area in an interval between displaying the black picture in the second area for two times.
  8. 8 . The method according to claim 7 , wherein the method further comprises: when the second area displays the black picture, displaying, by the terminal, in a first portion of the second area an nth frame of the image frame picture, and in a second portion of the second area at least one of an nth frame or an (n+1)th frame of the image frame picture.
  9. 9 . The method according to claim 7 , wherein when the black picture is displayed in the second area, the terminal turns off a light emitting unit in the second area of the display screen.
  10. 10 . The method according to claim 1 , wherein the first optical proximity sensor controls an emission lamp to emit an infrared ray to detect the external object through the first area when the first area displays the black picture.
  11. 11 . The method according to claim 1 , wherein the first optical proximity sensor is located in an edge portion of the display screen.
  12. 12 . The method according to claim 1 , wherein a grayscale value of the black picture is less than or equal to a preset threshold.
  13. 13 . The method according to claim 1 , wherein when the black picture is displayed in the first area, the terminal turns off a light emitting unit in the first area of the display screen.
  14. 14 . The method according to claim 1 , wherein the method further comprises: controlling, by the terminal, the display frequency and a frequency of a power-frequency current of the display screen to form a phase difference.
  15. 15 . The method according to claim 1 , wherein after the obtaining, by the terminal, the approaching data of the external object, the method further comprises: controlling, by the terminal, to turn off the display screen, when the first optical proximity sensor detects that the external object is approaching, and the terminal is in a call.
  16. 16 . The method according to claim 1 , wherein the method further comprises: detecting, by the first optical proximity sensor, the approaching data of the external object when the first area displays the black picture and the image frame picture; and reading, by the terminal, the approaching data of the external object detected by the first optical proximity sensor.
  17. 17 . The method according to claim 1 , wherein the method further comprises: detecting, by the first optical proximity sensor, the approaching data of the external object when the first area displays the black picture and the image frame picture; and using, by the terminal, the approaching data of the external object as detected data of the external object.
  18. 18 . The method according to claim 1 , wherein a period of time in which the terminal displays one black picture in the first area is less than a period of time in which the terminal displays one frame of image frame picture.
  19. 19 . A terminal, comprising: a processor; a memory; a display screen; and an optical proximity sensor, wherein the optical proximity sensor is located under the display screen, and a display area of the display screen comprises a first area and a second area, wherein the first area comprises an area used by the optical proximity sensor to detect approaching data of an external object, and the second area is a part of an area, other than the first area, in the display area; wherein the memory and the display screen are coupled to the processor, the memory is configured to store computer program code, the computer program code comprises computer instructions, and when the processor executes the computer instructions, the terminal is enabled to perform a proximity detection method, comprising: displaying a black picture for at least two times in the first area during refreshing of one frame of an image frame picture, wherein a size of an area for displaying the black picture is equal to a size of the first area; displaying the image frame picture in the second area when the black picture is displayed in the first area; displaying the image frame picture in the first area in an interval between displaying the black picture in the first area for two times; and obtaining approaching data of the external object detected by the optical proximity sensor when the first area displays the black picture.
  20. 20 . The terminal according to claim 19 , wherein the displaying the black picture for at least two times in the first area comprises displaying, in the first area, the black picture periodically.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation application of U.S. application Ser. No. 18/536,498, filed on Dec. 12, 2023, which is a continuation application of U.S. application Ser. No. 17/678,281, filed on Feb. 23, 2022 (now U.S. Pat. No. 11,881,137), which is a continuation application of U.S. application Ser. No. 16/959,059, filed on Jun. 29, 2020 (now U.S. Pat. No. 11,295,653), which is a national stage of International Application No. PCT/CN2018/099932, filed on Aug. 10, 2018, which claims priority to International Application No. PCT/CN2017/120319, filed on Dec. 29, 2017. All the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD This application relates to the field of communications technologies, and in particular, to ambient light and proximity detection methods, a photographing method, and a terminal. BACKGROUND When a user uses a mobile phone, there are naturally ambient light sources such as natural light and lamp light. The ambient light sources of the mobile phone affect a display effect of a display screen of the mobile phone. To improve the display effect of the display screen of the mobile phone, the mobile phone needs to detect ambient light, and adjust display luminance of the display screen of the mobile phone based on a detection result. Currently, ambient light may be detected by using an ambient light sensor installed on the display screen. However, a specific field of view (FOV) is required during detection by the ambient light sensor, and therefore a part that is of the display screen and that is located in an FOV area of the ambient light sensor cannot be used to display a picture. This affects user experience. In addition, an optical proximity sensor and a front-facing camera of the mobile phone also need to be located below a non-display area of the display screen. Therefore, disposing these components reduces a screen-to-body ratio of the mobile phone. SUMMARY Embodiments of this application provide ambient light and proximity detection methods, a photographing method, and a terminal, so that an entire display screen of the terminal is used to display a user interface, and this improves user experience. According to a first aspect, an embodiment of this application provides an ambient light detection method, and the method is applied to a terminal. The terminal includes a display screen and a first ambient light sensor. The first ambient light sensor is located under the display screen. A display area of the display screen includes a first area and a second area. The first area includes an area used by the first ambient light sensor to receive ambient light, and the second area is at least a part of an area, other than the first area, in the display area. The method includes: controlling, by the terminal, the first area to display a black picture for at least two times; controlling, by the terminal when the first area displays the black picture, the second area to display an image frame picture; controlling, by the terminal, the first area to display the image frame picture in an interval between consecutively displaying the black picture in the first area for two times; and when the first area displays the black picture, obtaining, by the terminal, an intensity of the ambient light detected by the first ambient light sensor. It should be noted that the terminal may be set, by default, to automatically adjust luminance of the screen based on the ambient light. Alternatively, the terminal may provide a setting option for a user to choose whether to enable a function of automatically adjusting luminance of the screen based on the ambient light. If the automatic ambient light-based adjustment function is disabled on the terminal, when the terminal works in a screen-on state, the terminal displays various user interfaces or content in all display areas of the display screen according to the prior art. If the automatic ambient light-based adjustment function is enabled on the terminal, when the terminal works in a screen-on state, the terminal displays by using the solution provided in this embodiment, so that the ambient light sensor can detect the ambient light, and the terminal displays various user interfaces or content in all display areas of the display screen. In other words, regardless of whether the user enables the automatic ambient light-based adjustment function, the user can view an entire display user interface in all the display areas of the display screen. In this way, disposing the ambient light sensor under the display screen does not affect a display effect, and the automatic ambient light-based adjustment function can be implemented. The terminal controls the first area of the display screen to display the black picture for a plurality of times. When the first area displays the black pictures, the terminal obtains the intensity of the ambient light detected by the ambient light senso