Speech message playing method and electronic device

Through algorithms, the posture and motion state of electronic devices are calculated, and false alarms of close-light sensors are corrected, and playback mode is correctly switched in the scene of answering in the ear, which solves the user experience problem caused by the false alarms of close-light sensors and improves voice message playback Accuracy and reliability.

WO2024255380A1PCT designated stage expired Publication Date: 2024-12-19HONOR DEVICE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/083255
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-13
Filing Date
2024-03-22
Publication Date
2024-12-19

AI Technical Summary

Technical Problem

When existing terminal devices play voice messages, false alarms may occur due to close-light sensors, causing chat applications to be turned off incorrectly and touch-proof process, which affects the user experience. Especially when users answer voice messages in their ears, the phone may accidentally switch to the speaker. Playback mode and screen light.

Method used

The algorithm obtains the detection results of the proximity light sensor, calculates the posture and motion state of the electronic device, determines the correct proximity state, and corrects the sensor false alarm, thereby controlling the playback mode, ensuring that the voice message is played with the earpiece while answering the scene in the ear and is turned off screen to avoid accidentally touching.

Benefits of technology

Improve the accuracy and user experience of voice messages to prevent false triggers, ensure the correct switching of playback mode in the answering scene, and enhance the reliability of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083255_19122024_PF_FP_ABST
    Figure CN2024083255_19122024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a speech message playing method and an electronic device. The method comprises: when an electronic device plays a speech message, controlling a speech message playing mode of the electronic device on the basis of a proximity light state determined by a proximity light sensor and a proximity light state determined by means of state data. Thus, when the proximity light sensor detects an abnormality, an abnormal proximity light state can be corrected on the basis of the proximity light state calculated by means of the state data, so that the electronic device can control the speech message playing mode of the electronic device on the basis of a correct proximity light state.
Need to check novelty before this filing date? Find Prior Art

Description

Voice message playing method and electronic device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on June 13, 2023, with application number 202310697883.5 and application name “Voice Message Playing Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal devices, and in particular to a method for playing a voice message and an electronic device. Background Art

[0003] At present, with the development of terminal technology, the functions of terminal applications are becoming more and more powerful. For example, users can use chat applications for text communication and voice communication. Among them, voice communication includes but is not limited to video calls, voice calls, and voice messages. When the user picks up the phone and answers a voice message to his ear, the chat application obtains the proximity sensor detecting the proximity state, starts the anti-false touch process, automatically switches from the speaker playback mode to the receiver playback mode, and turns off the screen to prevent accidental touch. Correspondingly, when the user puts down the phone, the chat application obtains the proximity sensor detecting the distance state, turns off the anti-false touch process, automatically switches from the receiver playback mode to the speaker playback mode, and turns on the screen.

[0004] However, since the proximity light sensor may generate false alarms, the chat application may mistakenly close the anti-accidental touch process when the user answers a voice message at their ear. As a result, when the phone is still at the user's ear, the chat application has switched to speaker playback mode and the screen is on, affecting the user experience.

[0005] Summary of the Invention

[0006] The present application provides a method for playing a voice message and an electronic device. In this method, the electronic device can obtain the proximity light state based on an algorithm and correct the proximity light state detected by the proximity light sensor to avoid false alarms that affect the user experience.

[0007] In a first aspect, the present application provides a method for playing a voice message. The method includes: in response to a received click operation on a voice message, the electronic device calls a speaker to play the voice message, and the display screen of the electronic device is in a bright screen state. During the process of the electronic device playing the voice message, the electronic device obtains a first proximity light state based on the detection result of the proximity light sensor, and the electronic device obtains a second proximity light state based on the first state data; wherein the state data includes posture data and motion data, the posture data is used to describe the current posture of the electronic device, and the motion data is used to describe the current motion state of the electronic device. The electronic device detects that both the first proximity light state and the second proximity light state indicate a distance state, continues to call the speaker to play the voice message, and the display screen of the electronic device is in a bright screen state. When the user raises his hand and places the electronic device to his ear to listen to the voice message, the third proximity light state is obtained based on the detection result of the proximity light sensor. The electronic device obtains a fourth proximity light state based on the second state data. When the electronic device detects that the third proximity light state indicates a distant state, and the fourth proximity light state indicates a close state, the electronic device determines that the third proximity light state is an abnormal state, and based on the fourth proximity light state, the electronic device determines that the electronic device is in an ear-to-ear listening scenario, calls the handset to play a voice message, and the display screen of the electronic device is in an off-screen state. In this way, the electronic device in the present application can calculate the proximity light state of the electronic device by the posture and motion state of the electronic device, so as to correct the detection result of the proximity light sensor in the event of a false alarm from the proximity light sensor to obtain the correct proximity light state. This enables the electronic device to control the mode of the electronic device when playing voice messages based on the correct proximity light state. In addition, the gesture assistance algorithm continuously obtains status data after the speaker is turned on, so that the gesture assistance algorithm can obtain the corresponding proximity light state in real time. Accordingly, the electronic device can also call the proximity light state calculated by the algorithm in real time.

[0008] For example, the state data is ACC data. The posture data includes but is not limited to pitch angle and roll angle. The motion data includes but is not limited to handupJudge parameters.

[0009] In one possible implementation, the method further includes: while the user continues to place the electronic device next to the ear to answer the voice message, the electronic device obtains a fifth proximity light state based on the detection result of the proximity light sensor. The electronic device obtains a sixth proximity light state based on the third state data. The electronic device detects that the fifth proximity light state indicates a distant state, and the sixth proximity light state indicates a close state, determines that the fifth proximity light state is an abnormal state, and, based on the sixth proximity light state, determines that the electronic device is still in the ear-answering scenario, continues to call the earpiece to play the voice message, and the display screen of the electronic device is in an off-screen state. In this way, after the earpiece is turned on, the electronic device can obtain the accurate motion state of the electronic device based on the state parameters obtained before the earpiece is turned on and the currently obtained state parameters, so as to obtain the accurate proximity light state based on the algorithm.

[0010] In one possible implementation, it is detected that both the first proximity light state and the second proximity light state indicate a far state, the speaker is continued to be called to play the voice message, and the electronic device display is in a bright screen state, including: the electronic device detects whether the receiver is in an on state. The electronic device detects that the receiver is in a closed state, and determines whether the first proximity light state indicates a far state. The electronic device determines that the first proximity light state indicates a far state, and determines whether the second proximity light state indicates a near state. The electronic device determines that the second proximity light state indicates a far state, and determines that the current target proximity light state of the electronic device is a far state. Based on the target proximity light state, the electronic device continues to call the speaker to play the voice message, and the electronic device display is in a bright screen state. In this way, the electronic device can determine whether it is necessary to combine the proximity light state obtained by the algorithm for determination based on the result of the proximity light sensor. If it is necessary to combine the algorithm, the proximity light state calculated by the algorithm is called again to further determine whether there is a false alarm in the result detected by the proximity light sensor.

[0011] In one possible implementation, the electronic device detects that the third proximity light state indicates a distant state, and the fourth proximity light state indicates a near state, and determines that the third proximity light state is an abnormal state, including: the electronic device detects whether the earpiece is in an open state. The electronic device detects that the earpiece is in a closed state, and determines whether the third proximity light state indicates a distant state. The electronic device determines that the third proximity light state indicates a distant state, and determines whether the fourth proximity light state indicates a near state. The electronic device determines that the fourth proximity light state indicates a near state, and based on the third proximity light state and the fourth proximity light state, determines that the third proximity light state is an abnormal state. The electronic device determines that the fourth proximity light state is a target proximity light state. In this way, the electronic device can determine whether it is necessary to combine the proximity light state obtained by the algorithm for determination based on the result of the proximity light sensor. If it is necessary to combine the algorithm, the proximity light state calculated by the algorithm is called again to further determine whether there is a false alarm in the result detected by the proximity light sensor.

[0012] In one possible implementation, based on the fourth proximity light state, determining that the electronic device is in an ear-to-ear listening scenario, invoking the earpiece to play a voice message, and the electronic device's display screen is in an off-screen state includes: the electronic device determines, based on the target proximity light state, that the electronic device is in an ear-to-ear listening scenario, invoking the earpiece to play a voice message, and the electronic device's display screen is in an off-screen state. In this way, the electronic device can determine whether the electronic device is currently in the ear-to-ear listening state based on the algorithm and the results of the proximity light sensor to obtain an accurate result, and control the mode in which the electronic device plays the voice message based on the ultimately determined target proximity light state.

[0013] In one possible implementation, detecting that the fifth proximity light state indicates a distant state and the sixth proximity light state indicates a near state, and determining that the fifth proximity light state is an abnormal state, includes: the electronic device detecting whether the earpiece is in an open state. The electronic device detects that the earpiece is in an open state, and determines whether the sixth proximity light state indicates a near state. The electronic device determines that the sixth proximity light indicates a near state, and based on the fifth proximity light state and the sixth proximity light state, determines that the fifth proximity light state is an abnormal state. The electronic device determines that the sixth proximity light state is a target proximity light state. In this way, the electronic device can obtain status data before the earpiece is turned on, and based on the status data, lock the gesture lock, that is, lock the proximity light state, so that in a scenario where the electronic device answers the call at the ear, even if the proximity light sensor falsely reports, the proximity light state finally obtained by the electronic device is still the near state based on the gesture lock having locked the proximity state, and will not be affected by the sensor false report.

[0014] In one possible implementation, the electronic device determines, based on the sixth proximity light state, that the electronic device is still in the ear-to-ear listening scenario, continues to invoke the earpiece to play the voice message, and the electronic device's display is in the off-screen state, including: determining, based on the target proximity light state, that the electronic device is in the ear-to-ear listening scenario, continues to invoke the earpiece to play the voice message, and the electronic device's display is in the off-screen state. In this way, the electronic device can correct abnormal reporting of the proximity light sensor based on the proximity light state obtained by the algorithm, and control the electronic device's voice message playback mode based on the correct proximity light state.

[0015] In a second aspect, the present application provides an electronic device comprising: one or more processors, a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: in response to a received click operation on a voice message, calling a speaker to play the voice message, and the display screen of the electronic device is in a bright screen state; based on the detection result of a proximity light sensor, obtaining a first proximity light state; based on the first state data, obtaining a second proximity light state; wherein the state data includes posture data and motion data, the posture data is used to describe the current posture of the electronic device, and the motion data is used to describe the current motion state of the electronic device; detecting that both the first proximity light state and the second proximity light state indicate a distance state, continuing to call the speaker to play the voice message, and the display screen of the electronic device is in a bright screen state; when the user raises his hand and places the electronic device to his ear to answer the voice message, based on the detection result of the proximity light sensor, Obtain a third proximity light state; based on the second state data, obtain a fourth proximity light state; detect that the third proximity light state indicates a distant state, and the fourth proximity light state indicates a close state, determine that the third proximity light state is an abnormal state, and, based on the fourth proximity light state, determine that the electronic device is in an ear listening scenario, call the earpiece to play a voice message, and the display screen of the electronic device is in an off state.

[0016] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: while the user continues to place the electronic device next to the ear to listen to voice messages, a fifth proximity light state is obtained based on the detection result of the proximity light sensor; a sixth proximity light state is obtained based on the third state data; it is detected that the fifth proximity light state indicates a distant state and the sixth proximity light state indicates a close state, the fifth proximity light state is determined to be an abnormal state, and, based on the sixth proximity light state, it is determined that the electronic device is still in the ear listening scenario, the earpiece continues to be called to play the voice message, and the display screen of the electronic device is in the off state.

[0017] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: detecting whether the earpiece is in the on state; detecting that the earpiece is in the off state, determining whether the first proximity light state indicates a away state; determining that the first proximity light state indicates a away state, determining whether the second proximity light state indicates a proximity state; determining that the second proximity light state indicates a away state, determining that the current target proximity light state of the electronic device is the away state; based on the target proximity light state, continuing to call the speaker to play the voice message, and the electronic device display is in the bright screen state.

[0018] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: detecting whether the earpiece is in an on state; detecting that the earpiece is in a off state, and determining whether the third proximity light state indicates a away state; determining that the third proximity light state indicates a away state, and determining whether the fourth proximity light state indicates a near state; determining that the fourth proximity light state indicates a near state, and based on the third proximity light state and the fourth proximity light state, determining that the third proximity light state is an abnormal state; and determining that the fourth proximity light state is a target proximity light state.

[0019] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: based on the target proximity light state, determining that the electronic device is in an ear listening scenario, calling the earpiece to play a voice message, and the display screen of the electronic device is in an off state.

[0020] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: detecting whether the earpiece is in an on state; detecting that the earpiece is in an on state, determining whether the sixth proximity light state indicates a proximity state; determining that the sixth proximity light indicates a proximity state, and based on the fifth proximity light state and the sixth proximity light state, determining that the fifth proximity light state is an abnormal state; and determining that the sixth proximity light state is a target proximity light state.

[0021] In one possible implementation, when the computer program is executed by one or more processors, the electronic device performs the following steps: based on the target proximity light state, determining that the electronic device is in an ear listening scenario, continuing to call the earpiece to play the voice message, and the display screen of the electronic device is in an off state.

[0022] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.

[0023] In a third aspect, the present application provides a computer-readable medium for storing a computer program, wherein the computer program includes instructions for executing the method in the first aspect or any possible implementation of the first aspect.

[0024] In a fourth aspect, the present application provides a computer program comprising instructions for executing the method in the first aspect or any possible implementation of the first aspect.

[0025] In a fifth aspect, the present application provides a chip comprising a processing circuit and a transceiver pin. The transceiver pin and the processing circuit communicate with each other via an internal connection path, and the processing circuit executes the method of the first aspect or any possible implementation of the first aspect to control the receive pin to receive a signal and to control the transmit pin to send a signal. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] FIG1 is a schematic diagram showing a hardware structure of an electronic device;

[0027] FIG2 is a schematic diagram illustrating a software structure of an electronic device;

[0028] FIG3 is a schematic diagram of an exemplary user interface;

[0029] FIG4a is a schematic diagram illustrating an exemplary application scenario;

[0030] FIG4b is a schematic diagram illustrating an exemplary application scenario;

[0031] Figures 4c to 4d are schematic diagrams illustrating exemplary module interactions;

[0032] FIG5 is a flow chart showing an exemplary method for playing a voice message;

[0033] FIG6 is a flow chart showing an exemplary method for playing a voice message;

[0034] FIG7 is a schematic diagram of a state value calculation process of an exemplary gesture assistance algorithm;

[0035] FIG8 is a flow chart showing an exemplary method for playing a voice message;

[0036] 9a and 9b are flowcharts illustrating an exemplary method for playing a voice message;

[0037] FIG10 is a schematic diagram illustrating an exemplary gesture lock calculation process;

[0038] FIG11 is a flow chart showing an exemplary method for voice playback;

[0039] FIG12 is a schematic diagram illustrating an exemplary voice message playback process;

[0040] FIG13 is a schematic structural diagram of an exemplary device. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0042] The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0043] In the description and claims of the embodiments of this application, the terms "first" and "second" are used to distinguish different objects, rather than to describe a specific order of objects. For example, the terms "first target object" and "second target object" are used to distinguish different objects, rather than to describe a specific order of objects.

[0044] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0045] In the description of the embodiments of this application, unless otherwise specified, "multiple" means two or more. For example, "multiple processing units" means two or more processing units; "multiple systems" means two or more systems.

[0046] FIG1 shows a schematic diagram of the structure of an electronic device 100. It should be understood that the electronic device 100 shown in FIG1 is merely an example of an electronic device, and that the electronic device 100 may have more or fewer components than shown, may combine two or more components, or may have a different component configuration. The various components shown in FIG1 may be implemented in hardware, including one or more signal processing and / or application-specific integrated circuits, software, or a combination of hardware and software.

[0047] The 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. 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.

[0048] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), 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). The different processing units may be independent devices or integrated into one or more processors.

[0049] 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.

[0050] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0051] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0052] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.

[0053] 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 provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0054] 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.

[0055] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0056] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0057] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0058] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0059] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0060] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0061] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0062] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0063] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise and brightness. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0064] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0065] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0066] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0067] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0068] 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 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0069] 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 can 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 can store data created during the use of the electronic device 100 (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.

[0070] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0071] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0072] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0073] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0074] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0075] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0076] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0077] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0078] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

[0079] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.

[0080] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0081] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0082] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0083] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.

[0084] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0085] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.

[0086] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. 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 applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0087] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals from the vibrating bones of the human body. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulse signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bones of the human body obtained by the bone conduction sensor 180M to implement voice functions. The application processor can parse heart rate information based on the blood pressure pulse signals obtained by the bone conduction sensor 180M to implement heart rate detection functions.

[0088] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. 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.

[0089] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0090] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0091] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0092] FIG2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application.

[0093] The layered architecture of electronic device 100 divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other via software interfaces. In some embodiments, the Android system is divided into four layers: from top to bottom, the application layer, the application framework layer, the hardware abstraction layer (HAL), and the kernel layer.

[0094] The application layer can include a series of application packages.

[0095] As shown in Figure 2, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, chat, etc. Among them, the chat application can be an application pre-installed on the electronic device or a third-party application, which is not limited in this application. In the embodiments of this application, only the chat application is used as an example for explanation. In other embodiments, the method in the embodiments of this application can be applied to any application that can send voice messages, which is not limited in this application.

[0096] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0097] As shown in FIG2 , the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a sensor service, an audio service, and the like.

[0098] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0099] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0100] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0101] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0102] Sensorservice is used to provide sensor-related services and provide service interfaces for upper-layer applications.

[0103] Audioservice is used to provide audio-related services and provide service interfaces for upper-layer applications.

[0104] The HAL layer is an interface layer between the operating system kernel and the hardware circuit. The HAL layer includes but is not limited to: SensorHal (Sensor Hardware Abstraction Layer), AudioHal (Audio Hardware Abstraction Layer), etc.

[0105] Among them, the Audio HAL is used to process the audio stream, for example, to perform noise reduction, directional enhancement and other processing on the audio stream.

[0106] SensorHal is used to process events reported by sensor drivers.

[0107] The kernel layer is the layer between hardware and software. The kernel layer includes at least the display driver, Sensorevent module, audio driver, Bluetooth driver, Wi-Fi driver, etc.

[0108] The display driver is used to control the display of the display.

[0109] Sensorevent is used to record the status of the receiver or speaker.

[0110] Audio drivers are used to control audio devices, including but not limited to receivers and speakers.

[0111] The SensorHub (sensor component) layer includes but is not limited to: gesture assistance module and sensor driver.

[0112] The gesture assist module is used to control the gesture lock. The gesture lock can also be understood as a proximity lock, which is used to lock the proximity state. If the gesture lock is locked, that is, the proximity state is locked, the proximity state reported by the proximity driver is the proximity state. If the gesture lock is unlocked, that is, the proximity state is unlocked, the proximity driver reports the actual detected proximity state (which can be either far or close).

[0113] The sensor driver is used to control the state of the sensor (for example, open or close) and receive the sensor parameters reported by the sensor. Optionally, the sensor driver may further include sensor drivers corresponding to different sensors. For example, in an embodiment of the present application, the sensor driver may include a proximity light driver to control the proximity light sensor and receive the sensor parameters uploaded by the proximity light sensor. Optionally, the sensor driver may also include an acceleration sensor, etc., which is not limited in this application.

[0114] It is understood that the layers in the software structure shown in FIG2 and the components contained in each layer do 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 layers than shown, and each layer may include more or fewer components, and this application does not limit this.

[0115] FIG3 is a schematic diagram of an exemplary user interface. Referring to FIG3 , the display interface 300 includes a chat application interface 310. The chat application interface includes, but is not limited to, a chat box and an input box. The chat box is used to display received and sent chat messages. In this embodiment of the present application, chat messages include, but are not limited to, voice chat messages 311 (hereinafter referred to as voice messages) and text chat messages (hereinafter referred to as text messages).

[0116] As shown in Figure 3, the user can click on the voice message 311 to instruct the mobile phone to play the voice message. It should be noted that in the embodiments of this application, only the electronic device is a mobile phone as an example for description. In other embodiments, the electronic device can also be a wearable device (such as a smart watch or bracelet), a tablet, etc., and this application does not limit it.

[0117] Exemplary, as shown in the scenario diagram of Figure 4a, in an embodiment of the present application, when the user clicks on the voice message 311, the mobile phone is usually in a away state. In an embodiment of the present application, the away state can be understood as a non-ear listening state. In the scenario shown in Figure 4a, if the user needs to click on the voice message 311, the posture is usually to hold the mobile phone with one hand (it can be the left hand or the right hand), and the user can observe the display interface of the mobile phone to click on the voice message 311. In an embodiment of the present application, after the user clicks on the voice message 311, the mobile phone (specifically a chat application) responds to the received user operation and plays the voice message 311 through the speaker. It can also be understood that in the away state, the mobile phone plays the audio content in the voice message 311 through the speaker, and the display interface 300 is in a bright screen state, that is, the interface shown in Figure 3 is displayed.

[0118] In the embodiment of the present application, the state corresponding to the away state is the approach state, which can also be understood as the state of answering the call at the ear. Figure 4b is a schematic diagram of the scene of answering the call at the ear. In Figure 4b, the user can move from the away state of the handheld mobile phone shown in Figure 4a to the side of the user's ear, so that the receiver of the mobile phone is close to the side of the user's ear, which is the approach state. In this scenario, the mobile phone detects that it is currently in the approach state, and it can start the anti-false touch process, that is, play the voice message through the receiver, and turn off the screen (that is, the display interface 300 turns black). In the embodiment of the present application, after the mobile phone turns off the screen, the touch event is locked, that is, the touch sensor no longer detects the touch event to prevent false touches.

[0119] In combination with the scenarios shown in Figures 4a and 4b, Figures 4c to 4d are schematic diagrams of module interactions shown as examples. Referring to Figure 4c, when answering a voice message, the chat application will register to monitor proximity light events. Specifically, the chat application can send a registration monitoring message to Sensorservice. Sersorservice receives the registration monitoring message and sends an activate (trigger) message to SersorHal. In response to the received activate message, SersorHal instructs the sensor driver (specifically, it can be a proximity light driver) to trigger (i.e., start) the proximity light sensor. The proximity light sensor detects proximity light. The specific detection method can refer to the existing technical embodiments, and this application does not limit it.

[0120] In an embodiment of the present application, the proximity light sensor may continuously report the detected sensor parameters to the proximity light driver, and the proximity light driver may determine the corresponding proximity light event based on the received sensor parameters, which is not limited in this application. Wherein, proximity light events include but are not limited to: proximity events and distance events. Optionally, the sensor driver may report the relevant event to the proximity light driver when it is determined that a proximity light event switch has occurred (for example, switching from a proximity event to a distance event, or switching from a distance event to a proximity event, which is not limited in this application).

[0121] Optionally, the proximity light sensor may also report proximity light events to the sensor driver based on detected parameters (which may be referred to as sensor parameters or proximity light parameters). Proximity light events include, but are not limited to, approach events and distance events. Optionally, the proximity light sensor may report related events to the proximity light driver only when a switching event occurs.

[0122] For example, after the sensor driver determines that a proximity light event (including a distance event or a proximity event) has occurred, it reports the proximity light event to SensorHal. In response to the received proximity light event, SensorHal sends the proximity light event to Sensorservice. Sensorsevice sends the proximity light event to the chat application.

[0123] In an embodiment of the present application, if the user picks up the phone to answer the call, the chat application receives the proximity event reported by the proximity light driver through other modules, which can also be understood as the proximity light driver reporting the proximity status. The chat application starts the anti-false touch process in response to the reported proximity status (i.e., proximity event). As shown in Figure 4d, illustratively, the chat application sends an instruction message to the PoserManager (power management) module to instruct the start of the screen off process. The PoserManager module sends a screen off instruction to the hardware synthesizer (Hardware Composer, HWC). The HWC sends the screen off instruction to the display driver. The display driver controls the display screen to turn off in response to the received screen off instruction.

[0124] For example, the chat application simultaneously sends an earpiece play instruction to AudioService, instructing it to call the earpiece to play the current voice message. AudioService sends the earpiece play instruction to AudioHal, which in turn sends the earpiece play instruction to the audio driver. In response to the received instruction, the audio driver calls the earpiece (i.e., the receiver shown in Figure 1) to play the current audio data, i.e., the voice content in the voice message.

[0125] In the processes shown in Figures 4b and 4c, whether the chat application initiates the anti-accidental touch process depends on the detection results of the proximity light sensor. In some embodiments, if the proximity light sensor detects an error, for example, detecting the proximity state as the distance state, the user's hair may block the proximity light sensor's detection signal. The user's hair may absorb the proximity light sensor's detection signal, causing the proximity light sensor to fail to receive the reflected detection signal. Accordingly, the detection result of the proximity light sensor will indicate that the current proximity light state is the distance state. As described above, the detection result may be determined by the proximity light sensor or the proximity light driver, and this application is not limited to this. In this abnormal scenario, due to the false alarm of the proximity light sensor, the chat application will disable the anti-accidental touch process. Specifically, referring still to Figure 4c, the chat application disables the anti-accidental touch process in response to the received proximity state. The chat application sends an instruction message to the PoserManager module to instruct it to disable the screen-off process. The PoserManager module sends a screen-on instruction to the HWC. The HWC sends the screen-on instruction to the display driver. In response to the received screen-lighting instruction, the display driver controls the display of the screen to light up, for example, displaying the display interface 300 in FIG. 3 .

[0126] For example, the chat application simultaneously sends a speaker play instruction to AudioService, instructing it to use the speaker to play the current voice message. AudioService sends the speaker play instruction to AudioHal, which in turn sends the speaker play instruction to the audio driver. In response to the received instruction, the audio driver uses the speaker to play the current audio data, namely the voice content in the voice message.

[0127] That is to say, when the user picks up the phone and answers the voice message by ear, due to the sensor-driven false alarm, the chat application shuts down the anti-mistouch process, causing the phone to play audio through the speaker, affecting the user experience. Moreover, since the screen is already on when the phone is next to the ear, the user may accidentally touch it.

[0128] An embodiment of the present application provides a voice message playback method that can lock the proximity light state through a gesture lock, so that when the algorithm detects that the mobile phone is still in the proximity state, the proximity light sensor can be corrected for the false alarm of the distance state, thereby avoiding false alarms and improving the accuracy of proximity light reporting.

[0129] FIG5 is a flowchart illustrating an exemplary method for playing a voice message. Referring to FIG5 , the method specifically includes but is not limited to:

[0130] S501: Play a voice message.

[0131] For example, as shown in FIG3 , the chat application receives a voice message and displays voice message 311 in the chat application interface. The user can click on voice message 311 to trigger the chat application to play voice message 311 through the speaker. In the embodiments of the present application, the default speaker is used as an example for description.

[0132] The chat application plays the voice message 311 in response to the received user operation.

[0133] S502, obtaining a proximity-to-light state.

[0134] Exemplarily, the proximity light driver determines the proximity light state based on the detection result of the proximity light sensor. To distinguish it from the proximity light state obtained by the algorithm, in the embodiment of the present application, the proximity light state obtained by the proximity light driver from the proximity light sensor is referred to as the physical proximity light state.

[0135] The proximity light state includes a distant state and a close state. If the proximity light sensor is blocked, it corresponds to the close state. If the proximity light sensor is not blocked, it corresponds to the distant state.

[0136] S503: Detect whether the handset is turned on.

[0137] Exemplarily, the proximity light drives the acquisition of the earpiece state to detect whether the earpiece is currently in an open state.

[0138] In one example, if the earpiece is in an open state, S508 is executed.

[0139] In another example, if the handset is in an off state, S504 is executed.

[0140] S504: Determine whether the approaching light state is the distant light state.

[0141] Exemplarily, the proximity light driver determines whether the acquired entity proximity light state is a distance state.

[0142] In one example, if the state is far away, S505 is executed.

[0143] In another example, if it is in the approaching state, S506 is executed.

[0144] S505: Determine whether the status value is true.

[0145] In the embodiment of the present application, the gesture assistance algorithm obtains the ACC (Accumulator) data of the mobile phone in real time after the earpiece or speaker is turned on, and calculates the state value based on the ACC data. The state value is used to indicate whether it is in the proximity state. In the embodiment of the present application, to distinguish it from the physical proximity light state described above, the proximity light state obtained by the algorithm is called the algorithmic proximity light state.

[0146] In one example, if the state value is true, it means that the gesture assistance algorithm, based on the ACC data, determines that the proximity state of the algorithm is close. In another example, if the state value is false, it means that the gesture assistance algorithm, based on the ACC data, determines that the proximity state of the algorithm is far.

[0147] In an embodiment of the present application, the proximity light driver reads the status value of the output of the gesture assistance algorithm. In one example, if the status value is true, step S506 is executed. In another example, if the status value is false, step S507 is executed.

[0148] S506: Determine to report the proximity status.

[0149] In the embodiment of the present application, if the physical proximity light state is a distant state, while the algorithmic proximity light state is a close state, this indicates a false alarm of the physical proximity light state. For example, the proximity light sensor described above mistakenly detects a close state as a distant state. The proximity light driver can correct the physical proximity light state based on the algorithmic proximity light state to report the correct proximity light state.

[0150] S507, reporting the proximity light status.

[0151] Exemplarily, the proximity light driver reports the proximity light status to the chat application according to the confirmed proximity light status.

[0152] S508: Acquire gesture lock status.

[0153] Exemplarily, the gesture assistance algorithm determines the gesture lock state based on ACC data. In an embodiment of the present application, the gesture lock state includes a locked state and an unlocked state. Among them, the locked state is used to lock the proximity state, that is, when the gesture lock is locked, the proximity light state reported by the proximity light driver is the proximity state. In the unlocked state, the proximity light state reported by the proximity light driver to the chat application is the actually detected proximity light state, that is, the physical proximity light state, which can include the proximity state or the distance state.

[0154] Exemplarily, the proximity light driver reads the gesture lock state output by the gesture assistance algorithm.

[0155] S509: Determine whether the gesture lock is in a locked state.

[0156] In one example, if the gesture lock state is the locked state, S506 is executed.

[0157] In another example, if the gesture lock state is the unlocked state, S510 is executed.

[0158] S510: Determine and report the current proximity light state.

[0159] For example, as described above, in the unlocked state, the proximity light state reported by the proximity light driver to the chat application is the actually detected proximity light state, that is, the physical proximity light state, which may include a proximity state or a distance state.

[0160] The following is a detailed description of the process shown in Figure 5 using a specific embodiment. Figure 6 is a flow chart showing an exemplary method for playing a voice message, which specifically includes but is not limited to the following steps:

[0161] S601, the application plays a voice message.

[0162] For example, as shown in FIG3 , the chat application receives a voice message and displays voice message 311 in the chat application interface. The user can click on voice message 311 to trigger the chat application to play voice message 311 through the speaker. In the embodiments of the present application, the default speaker is used as an example for description.

[0163] Exemplarily, the chat application plays the voice message in response to receiving the user's click operation on the voice message 311 .

[0164] S602a: The application sends a speaker-opening instruction to AudioHal.

[0165] For example, if a chat application determines that a voice message needs to be played, as shown in Figure 4c, the chat application sends a speaker play instruction to AudioService, instructing the speaker to play the current voice message. AudioService sends the speaker play instruction to AudioHal, which in turn sends the speaker play instruction to the audio driver. In response to the received instruction, the audio driver calls the speaker to play the current audio data, namely, the voice content in the voice message. The display is in the bright screen state.

[0166] S602b, AudioHal sends a command to write the speaker opening status to Sensorevent.

[0167] For example, after AudioHal indicates that the speaker is turned on, it can be confirmed that the speaker is currently in the turned-on state. AudioHal sends a write speaker turned-on state instruction to Sensorevent to instruct Sensorevent to record that the speaker is currently in the turned-on state.

[0168] S602c, Sensorevnet records the speaker on status.

[0169] Exemplarily, in response to a received instruction to write the speaker on state, Sensorevent records that the speaker is currently on. For example, Sensorevent may be provided with a flag bit corresponding to the speaker state, where "1" indicates on and "0" indicates off. Before Sensorevent receives the speaker on state instruction, the flag bit of the speaker state is "0", i.e., off. In response to a received instruction to write the speaker on state, Sensorevent switches the flag bit to "1" to indicate that the speaker is on.

[0170] S602, SenSorHal reads the speaker on status.

[0171] For example, SensorHal reads the data in Sensorevent in real time to obtain the status of the earpiece and speaker (including open or closed). In this example, after Sensorevent records the speaker on state, SensorHal can detect the speaker state switch recorded in Sensorevnet, that is, switching from the closed state to the open state.

[0172] S603: SensorHal sends instruction information to the gesture assistance algorithm.

[0173] Exemplarily, after SenSorHal detects that the speaker state is switched from off to on, it sends indication information to the gesture assistance algorithm, where the indication information includes speaker on state information for indicating that the speaker is turned on.

[0174] It should be noted that in the embodiment of the present application, SensorHal triggers an indication message when it detects a state switch between the speaker and / or earpiece. That is, after SensorHal sends the indication message, if the state of the speaker and earpiece remains unchanged, for example, if the earpiece is currently in the off state and the speaker is currently in the on state, SensorHal will not send an indication message to the gesture assistance algorithm.

[0175] S604: The gesture assistance algorithm records the speaker on state.

[0176] Exemplarily, the gesture-assisted algorithm, in response to the received indication, determines that the speaker is currently on. The gesture-assisted algorithm may record the speaker status as on. Optionally, the gesture-assisted algorithm may also set a flag to record the speaker status and the earpiece status. The recording method can be referred to as Sensorevent and will not be further described here.

[0177] S605: The gesture assistance algorithm outputs a status value based on the ACC data.

[0178] For example, FIG7 is an exemplary state value calculation process of the gesture assistance algorithm. Please refer to FIG7 , specifically including but not limited to:

[0179] S701, obtain ACC data

[0180] For example, the gesture assistance algorithm may send a request to the sensor driver to request ACC data. The sensor driver, in response to the gesture assistance algorithm's request, retrieves detection data from the accelerometer and gyroscope. Optionally, the accelerometer and gyroscope may be constantly enabled or enabled upon a call from the sensor driver, though this is not a limitation in this application.

[0181] S702, calculate the pitch (pitch angle), roll (roll angle) and handupJudge (handup judgement) values.

[0182] For example, pitch and roll can be used to describe the phone's posture. The handupJudge value is used to describe the process variables of the phone's dynamic-to-static or static-to-dynamic transition. The specific calculation method can be referenced in existing technologies and will not be detailed in this application.

[0183] S703: Determine whether pitch, roll, and handupJudge meet thresholds, and whether the receiver or speaker is turned on.

[0184] Exemplarily, the gesture assistance algorithm compares the calculated pitch, roll, and handupJudge with their respective corresponding threshold ranges. If pitch, roll, and handupJudge all meet the threshold ranges, for example, pitch and roll meet the threshold range corresponding to holding the phone with the left hand or the threshold range corresponding to holding the phone with the right hand, and handupJudge is greater than 0, then it is further determined whether the earpiece or speaker is on. As described above, the gesture assistance algorithm may record the status of the speaker and / or earpiece, and the gesture assistance algorithm may determine whether the earpiece or speaker is turned on based on the recorded status. If all the above conditions are met, execute S704. If any condition is not met, the status value output is false.

[0185] S704: Determine whether the last proximity light reporting state is a proximity state.

[0186] Exemplarily, the gesture assistance algorithm may read the proximity state last reported by the proximity light driver, which refers to the proximity light state actually reported by the proximity light driver to the chat application.

[0187] In one example, if the proximity light reporting state is proximity, the state value output is true.

[0188] In another example, if the approaching light reports a state of being far away, the state value output is false.

[0189] Still referring to Figure 6, in this example, the user is currently holding the phone, meaning it's in the Far state. Accordingly, the gesture assistance algorithm, based on ACC data, outputs a false state value if the pitch, roll, and handupJudge values ​​obtained do not meet the thresholds. This indicates that the algorithm has switched from the Approach Light state to the Far state.

[0190] S606a: The application registers with SensorHal to monitor proximity light events.

[0191] For example, at the same time as the application executes S601a (or in no particular order), the chat application sends a request to register and monitor proximity light to the Sensorservice. In response to the received request, the Sensorservice sends an activate message to the SensorHal.

[0192] S606b: SensorHal sends a triggering instruction for the proximity light sensor to the proximity light driver.

[0193] Exemplarily, in response to the received activate message, SensorHal sends a trigger proximity light sensor instruction to the proximity light driver, for instructing the sensor driver (specifically, the proximity light driver) to trigger (ie, start) the proximity light sensor.

[0194] S606c, the proximity light driver obtains the proximity light state.

[0195] Exemplarily, as shown in FIG4 a , the user currently holds the mobile phone, that is, the proximity light driver determines that the mobile phone is in a distant state based on the parameters detected by the proximity light sensor.

[0196] S607, the proximity light driver reads the earpiece status.

[0197] For example, as described above, the gesture-assisted recording includes the status of the earpiece and the speaker. The current status of the earpiece recorded by the gesture-assisted recording is off. In other words, the gesture-assisted algorithm records the status of both the speaker and the earpiece as off by default. For example, in step S604, the gesture-assisted algorithm records the speaker as on, while the earpiece remains off.

[0198] The proximity light driver can read the status of the earpiece and speaker recorded by the gesture assistance algorithm and obtain the current earpiece status.

[0199] S608: The proximity light driver determines whether the earpiece is turned on.

[0200] Exemplarily, the proximity light driver determines whether the earpiece is in an open state based on the earpiece state read from the gesture assistance algorithm.

[0201] As shown in S503 of FIG5 , if the handset is on, S508 is executed; if the handset is off, S504 is executed.

[0202] In this example, the proximity light driver detects that the earpiece is in the off state, and S609 is executed.

[0203] S609, the proximity light driver determines whether the state is far away.

[0204] Exemplarily, the proximity light driving is judged based on the physical proximity light state acquired in S606c. As shown in S504 in FIG5 , if the judgment is yes, S505 is executed, and if the judgment is no, S506 is executed.

[0205] As shown in FIG6 , in this example, in S606c , the physical proximity light state acquired by the proximity light driver is the distance state, the proximity light driver determines that the current state is the distance state (ie, the judgment is yes), and executes S610 .

[0206] S610 , the proximity light driver reads a status value from the gesture assistance algorithm.

[0207] Exemplarily, the process in Figure 5 goes to S505, corresponding to Figure 6, where the proximity light driver reads the state value from the gesture assistance algorithm. It should be noted that the gesture assistance algorithm continues to calculate the output state value after S603 until the speaker and the earpiece are turned off. The output state value read by the proximity light driver is the latest output state value calculated by the gesture assistance algorithm. Optionally, the gesture assistance algorithm can also set a calculation cycle, and its calculation cycle can be the same as the reading cycle of the proximity light driver, which is not limited in this application.

[0208] S611, the proximity light driver determines whether the state value is true.

[0209] For example, in S505 of FIG5 , if the judgment is yes, then S506 is executed, and if the judgment is no, then S510 is executed. As shown in FIG6 , the proximity light driver reads a state value of false. Accordingly, the process in FIG5 will proceed to S510.

[0210] S612a, the proximity light driver determines and reports the distance state.

[0211] For example, as shown in S510 in FIG5 , the approaching light will be reported as the current physical approaching light state. In other words, both the algorithm approaching light state and the physical approaching light state are the far away state.

[0212] S612b: The proximity light driver reports the distance status to SensorHal.

[0213] S612c: SensorHal reports the distance status to the application.

[0214] For example, referring to FIG4b , the proximity light driver determines that the distance state is reported to SensorHal. SensorHal reports the distance state to Sensorservice. Sensorsevice sends the distance state to the chat application.

[0215] If the chat application determines that the user is currently away, it will continue to keep the screen on and play the voice message through the speaker, that is, maintain the current voice message playback mode.

[0216] For example, when the user is playing the voice message, he / she keeps holding the phone in a distance state. In this process, each module cyclically executes the process in Figure 5. Figure 8 is a flow chart of an exemplary method for playing the voice message, which specifically includes but is not limited to the following steps:

[0217] S801: The gesture assistance algorithm outputs a status value based on the ACC data.

[0218] For example, as described above, the gesture assistance algorithm continuously obtains ACC data and calculates the corresponding state value. In this example, since the phone is in the far state, the calculation result in Figure 7 is still false.

[0219] S802: The proximity light driver obtains a proximity light state.

[0220] Exemplarily, as shown in FIG4 a , the user currently holds the mobile phone, that is, the proximity light driver determines that the mobile phone is in a distant state based on the parameters detected by the proximity light sensor.

[0221] S803, the proximity light driver reads the earpiece status.

[0222] For example, as described above, the gesture-assisted recording includes the status of the earpiece and speaker. The current status of the earpiece recorded by the gesture-assisted recording is off. In other words, the gesture-assisted algorithm records the status of both the speaker and earpiece as off by default. The gesture-assisted algorithm records the speaker as on, while the earpiece remains off.

[0223] The proximity light driver can read the status of the earpiece and speaker recorded by the gesture assistance algorithm and obtain the current earpiece status.

[0224] S804: The proximity light driver determines whether the earpiece is turned on.

[0225] Exemplarily, the proximity light driver determines whether the earpiece is in an open state based on the earpiece state read from the gesture assistance algorithm.

[0226] As shown in S503 of FIG5 , if the handset is on, S508 is executed; if the handset is off, S504 is executed.

[0227] In this example, the proximity light driver detects that the earpiece is in the off state, and executes S805.

[0228] S805, the proximity light driver determines whether the state is far away.

[0229] Exemplarily, the proximity light driving is judged based on the physical proximity light state acquired in S802. As shown in S504 in FIG5 , if the judgment is yes, S505 is executed, and if the judgment is no, S506 is executed.

[0230] As shown in FIG8 , in this example, in S802 , the entity proximity light state acquired by the proximity light driver is the distance state, and the proximity light driver determines that the current state is the distance state and executes S806 .

[0231] S806 , the proximity light driver reads a status value from the gesture assistance algorithm.

[0232] Exemplarily, the process in Figure 5 goes to S505, corresponding to Figure 6, where the proximity light driver reads the state value from the gesture assistance algorithm. It should be noted that the gesture assistance algorithm continues to calculate the output state value after the speaker is turned on until the speaker and the earpiece are turned off. The output state value read by the proximity light driver is the latest output state value calculated by the gesture assistance algorithm. Optionally, the gesture assistance algorithm can also set a calculation cycle, and its calculation cycle can be the same as the reading cycle of the proximity light driver, which is not limited in this application.

[0233] S807: The proximity light driver determines whether the state value is true.

[0234] For example, in S505 of FIG5 , if the judgment is yes, S506 is executed, and if the judgment is no, S510 is executed. As shown in FIG8 , the proximity light driver reads a state value of false. Accordingly, the process in FIG5 will proceed to S510.

[0235] S808a, the proximity light driver determines and reports the distance state.

[0236] For example, as shown in S510 in FIG5 , the approaching light will be reported as the current physical approaching light state. In other words, both the algorithm approaching light state and the physical approaching light state are the far away state.

[0237] S808b, the proximity light driver reports the distance status to SensorHal.

[0238] S808c, SensorHal reports the away status to the application.

[0239] For example, referring to FIG4b , the proximity light driver determines that the distance state is reported to SensorHal. SensorHal reports the distance state to Sensorservice. Sensorsevice sends the distance state to the chat application.

[0240] If the chat application determines that the user is currently away, it will continue to keep the screen on and play the voice message through the speaker, that is, maintain the current voice message playback mode.

[0241] For example, the user switches from the answering mode shown in FIG4a to the answering mode shown in FIG4b, that is, the user holds the phone to the ear to answer the voice message. FIG9a and FIG9b are flowcharts of an exemplary method for playing a voice message, and please refer to FIG9a and FIG9b, which specifically include but are not limited to:

[0242] S901: The gesture assistance algorithm outputs a status value based on the ACC data.

[0243] For example, as described above, the gesture assistance algorithm continuously acquires ACC data and calculates the corresponding status value. In this example, because the user lifts the phone to their ear to answer the call, the gesture assistance algorithm determines yes when executing S703, that is, all parameters meet the threshold and the speaker is turned on.

[0244] In this example, since the proximity light driver has not reported the proximity state, when S704 is executed, the proximity light driver determines that the last proximity light driver report was the distance state, and the output state value is still false.

[0245] S902: The proximity light driver obtains a proximity light state.

[0246] Exemplarily, the user brings the mobile phone to his ear, and accordingly, the proximity light driver determines that the current proximity light state is the proximity state based on the detection result of the proximity light sensor.

[0247] S903, approaching the light driver to read the earpiece status.

[0248] For example, as described above, the gesture-assisted recording includes the status of the earpiece and speaker. The current status of the earpiece recorded by the gesture-assisted recording is off. In other words, the gesture-assisted algorithm records the status of both the speaker and earpiece as off by default. The gesture-assisted algorithm records the speaker as on, while the earpiece remains off.

[0249] The proximity light driver can read the status of the earpiece and speaker recorded by the gesture assistance algorithm and obtain the current earpiece status.

[0250] S904: The proximity light driver determines whether the earpiece is turned on.

[0251] Exemplarily, the proximity light driver determines whether the earpiece is in an open state based on the earpiece state read from the gesture assistance algorithm.

[0252] As shown in S503 of FIG5 , if the handset is on, S508 is executed; if the handset is off, S504 is executed.

[0253] In this example, the proximity light driver detects that the earpiece is in the off state, and S905 is executed.

[0254] S905: Determine whether the low beam driving state is far away.

[0255] Exemplarily, the proximity light driving is judged based on the physical proximity light state acquired in S902. As shown in S504 in FIG5 , if the judgment is yes, S505 is executed, and if the judgment is no, S506 is executed.

[0256] As shown in FIG8 , in this example, in S902 , the proximity light driver obtains that the entity proximity light state is the proximity state, and the proximity light driver determines that the current state is the distance state (i.e., the judgment is no), and executes S906a . That is, corresponding to FIG5 , the process will proceed to S506 .

[0257] S906a: The proximity light driver determines and reports the proximity state.

[0258] For example, when the proximity light driver determines that the current state is far away, there is no need to read the algorithm proximity light state again, and the proximity state can be reported directly.

[0259] S906b: The proximity light driver reports the proximity status to the SensorHal.

[0260] S906c: SensorHal reports the proximity status to the application.

[0261] For example, referring to FIG4b , the proximity light driver determines that the proximity status is reported to SensorHal. SensorHal reports the proximity status to Sensorservice. Sensorsevice sends the proximity status to the chat application.

[0262] S907a: The application sends a handset-opening instruction to AudioHal.

[0263] For example, as shown in Figure 4b, an earpiece play instruction is sent to AudioService, instructing the earpiece to play the current voice message. AudioService sends the earpiece play instruction to AudioHal, and AudioHal sends the earpiece play instruction to the audio driver. In response to the received instruction, the audio driver calls the earpiece (i.e., the receiver shown in Figure 1) to play the current audio data, i.e., the voice content in the voice message.

[0264] At the same time, the chat application sends an instruction message to the PoserManager (power management) module, instructing it to start the screen-off process. The PoserManager module sends a screen-off instruction to the hardware composer (HWC). The HWC sends the screen-off instruction to the display driver. In response to the received screen-off instruction, the display driver controls the display screen to turn off.

[0265] S907b, AudioHal sends a write-earpiece-on-state instruction to Sensorevent.

[0266] For example, after AudioHal indicates that the earpiece is on, it can confirm that the earpiece is currently on. AudioHal sends a "write earpiece on status" command to Sensorevent, instructing Sensorevent to record that the earpiece is currently on. It should be noted that before receiving the speaker off command, the speaker status recorded by Sensorevent and the gesture assistance algorithm remains on.

[0267] S907c, Sensorevnet records the handset open status.

[0268] Exemplarily, in response to a received instruction to write the earpiece on state, Sensorevent records that the earpiece is currently on. For example, Sensorevent may be provided with a flag bit corresponding to the earpiece state, where "1" indicates on and "0" indicates off. Before Sensorevent receives the earpiece on state instruction, the flag bit for the speaker state is "0", i.e., off. In response to a received instruction to write the earpiece on state, Sensorevent switches the flag bit to "1" to indicate that the earpiece is on.

[0269] S908: SensorHal reads the handset opening status.

[0270] For example, SensorHal reads the data in Sensorevent in real time to obtain the status of the earpiece and speaker (including open or closed). In this example, after Sensorevent records the earpiece open state, SensorHal can detect the earpiece state switch recorded in Sensorevent, that is, switching from closed state to open state.

[0271] S909: SensorHal sends instruction information to the gesture assistance algorithm.

[0272] Exemplarily, after SenSorHal detects that the earpiece state is switched from off to on, it sends indication information to the gesture assistance algorithm, where the indication information includes earpiece on state information, which is used to indicate that the earpiece is in the on state.

[0273] It should be noted that in the embodiment of the present application, SensorHal triggers an indication message when it detects a state switch between the speaker and / or earpiece. That is, after SensorHal sends the indication message, if the state of the speaker and earpiece remains unchanged, for example, if the earpiece is currently in the off state and the speaker is currently in the on state, SensorHal will not send an indication message to the gesture assistance algorithm.

[0274] S910, the gesture assistance algorithm records the earpiece open state.

[0275] Exemplarily, the gesture-assisted algorithm, in response to the received indication, determines that the earpiece is currently on. The gesture-assisted algorithm may record the earpiece as being on. Optionally, the gesture-assisted algorithm may also set a flag to record the speaker status and earpiece status. The recording method can be found in Sensorevent and is not further described here.

[0276] S911a: The gesture assistance algorithm outputs a status value based on the ACC data.

[0277] Still referring to Figure 7 , as described above, the gesture assistance algorithm continuously acquires ACC data and calculates corresponding status values. In this example, because the user lifts the phone to their ear to answer the call, the gesture assistance algorithm determines a positive result when executing S703 , meaning that all parameters meet the thresholds and the speaker is on.

[0278] In this example, since the proximity light driver has reported the proximity state (i.e., S906a to S906c), when S704 is executed, the proximity light driver determines that the last proximity light driver reported was a proximity state, and the output state value is true, that is, the algorithm proximity light state calculated by the gesture assistance algorithm is the proximity state.

[0279] S911b: The gesture assistance algorithm outputs the gesture lock status based on the ACC data.

[0280] For example, the gesture assistance algorithm continuously acquires ACC data after the speaker is turned on. In the process described above, the gesture assistance algorithm can only calculate the state value. Optionally, the gesture assistance algorithm can also calculate the state value and gesture lock at the same time, which is not limited in this application.

[0281] In this example, the gesture assistance algorithm can start calculating the gesture lock state value after detecting that the handset is turned on. Optionally, the gesture assistance algorithm can also calculate the gesture lock state value when the proximity light driver needs to read the gesture lock state value (i.e., when executing S915), which is not limited in this application.

[0282] FIG10 is a schematic diagram illustrating an exemplary gesture lock calculation process. Referring to FIG10 , the process specifically includes but is not limited to the following steps:

[0283] S1001, obtain ACC data.

[0284] S1002, calculate pitch, roll and handupJudge values.

[0285] For example, as described above, the gesture assistance algorithm obtains ACC data in real time and calculates corresponding pitch, roll, and handupJudge values.

[0286] In one possible implementation, the gesture assistance algorithm may output a status value and a phone lock status value based on pitch, roll, and handupJudge.

[0287] In another possible implementation, the gesture assistance algorithm can execute the corresponding judgment process based on the calculation results of the pitch, roll and handupJudge values ​​when the light is approached and called, so as to output the status value and / or the phone lock status value.

[0288] In the embodiment of the present application, the gesture assistance algorithm is taken as an example to illustrate that it continuously obtains the gesture lock state after detecting that the handset is turned on.

[0289] S1003, determining whether the current approaching light is in an approaching state.

[0290] Exemplarily, the gesture assistance algorithm obtains whether the entity proximity light state obtained by the proximity light driver is a proximity state.

[0291] In one example, if the state is close, S1004 is executed.

[0292] In another example, if the state is far away, S1005 is executed.

[0293] S1004: Determine whether pitch, roll, and handupJudge meet the threshold.

[0294] The specific process can be referred to S703 and will not be repeated here.

[0295] In one example, if pitch, roll, and handupJudge meet the threshold, the gesture lock is locked, that is, the output gesture lock state is locked.

[0296] In another example, if pitch, roll, and handupJudge do not meet the threshold, the gesture lock is unlocked, that is, the output gesture lock state is unlocked.

[0297] S1005: Determine whether the status value is true.

[0298] Exemplarily, the gesture assistance algorithm may execute the process in FIG. 7 to obtain the state value.

[0299] In one example, if the state value is true, the gesture lock is locked, that is, the output gesture lock state is locked.

[0300] In another example, if the status value is false, S1006 is executed.

[0301] S1006, determine whether the current state is locked.

[0302] Exemplarily, the gesture assist algorithm detects whether the gesture lock is currently in a locked state (ie, the output result of the last gesture lock determination process).

[0303] In one example, if the judgment is yes, execute S100,7.

[0304] In another example, if the judgment is no, that is, the gesture lock is not locked, then the unlocked state is maintained.

[0305] S1007: Determine whether pitch and roll meet a threshold.

[0306] In one example, if pitch and roll meet the threshold, the gesture lock is locked, that is, the output gesture lock state is locked.

[0307] In another example, if pitch and roll do not meet the threshold, the gesture lock is unlocked, that is, the output gesture lock state is unlocked.

[0308] Continuing with Figure 9a, in this example, the user lifts the phone to their ear to answer the call. The gesture assistance algorithm executes the process shown in Figure 10. Specifically, the gesture assistance algorithm executes S1003, determines that the current proximity light state is the proximity state, and then executes S1004. As described above, the gesture assistance algorithm acquires and calculates the pitch, roll, and handupJudge values ​​in real time. Accordingly, after the user raises their hand, the gesture assistance algorithm can determine that the conditions for answering the call at the ear are met based on the pitch, roll, and handupJudge values ​​already acquired (i.e., acquired before the handset is turned on). In other words, if S1004 determines yes, the gesture lock is activated, locking the proximity light state to the proximity state. When the user lifts the phone to their ear to answer the call, the pitch and roll values ​​will change compared to their previous values, meeting the right-hand answering threshold range or the left-hand answering threshold range. Furthermore, because the user brings the phone to their ear from the away state, the handupJudge value is greater than 0, meaning it meets the preset threshold.

[0309] S912: The proximity light driver obtains a proximity light state.

[0310] For example, as shown in 4b, the user currently holds the mobile phone to his ear to answer the call, that is, the proximity light driver determines that the mobile phone is in a proximity state based on the parameters detected by the proximity light sensor.

[0311] S913, the proximity light driver reads the earpiece status from the gesture assistance algorithm.

[0312] For example, as described above, the gesture-assisted recording includes the status of the earpiece and speaker. The current status of the earpiece recorded by the gesture-assisted recording is off. In other words, the gesture-assisted algorithm records the status of both the speaker and earpiece as off by default. The gesture-assisted algorithm records the speaker as on, while the earpiece remains off.

[0313] The proximity light driver can read the status of the earpiece and speaker recorded by the gesture assistance algorithm and obtain the current earpiece status.

[0314] S914, the proximity light driver determines whether the earpiece is turned on.

[0315] Exemplarily, the proximity light driver determines whether the earpiece is in an open state based on the earpiece state read from the gesture assistance algorithm.

[0316] As shown in S503 of FIG5 , if the handset is on, S508 is executed; if the handset is off, S504 is executed.

[0317] In this example, the proximity light driver detects that the earpiece is in the on state, and then executes S914 , which corresponds to the process in FIG5 going to S508 .

[0318] S915, the proximity light driver reads the gesture lock status value.

[0319] Exemplarily, corresponding to S508 in FIG. 5 , if it is determined that the gesture lock state is the locked state, S506 is executed; if the gesture lock state is the unlocked state, S510 is executed.

[0320] 9 b , illustratively, as described above, the gesture assistance algorithm goes through the process shown in FIG10 and outputs the gesture lock state as the locked state, that is, the proximity light lock is the proximity state.

[0321] S916a: The proximity light driver determines and reports the proximity state.

[0322] For example, as described above, when the gesture lock is locked, the proximity light state is locked as the proximity state. That is, regardless of whether the physical proximity light state obtained by the proximity light driver is the proximity state or the distance state, the proximity light state reported by the proximity light driver to the chat application is the proximity state.

[0323] S916b: The proximity light driver reports the proximity status to the SensorHal.

[0324] S916c, SensorHal reports the proximity status to the application.

[0325] For example, referring to FIG4b , the proximity light driver determines that the proximity status is reported to SensorHal. SensorHal reports the proximity status to Sensorservice. Sensorsevice sends the proximity status to the chat application.

[0326] When the user listens to the voice message, each module repeatedly executes S911a to S916c, so that the mobile phone is continuously in the screen-off state and the voice message is played using the receiver.

[0327] In the embodiment of the present application, after the user brings the phone to his ear to answer the call, the phone enters the anti-accidental touch mode, that is, the screen is turned off, and the voice message is played through the earpiece. In some scenarios, if the user puts the phone down from his ear, the phone will turn off the anti-accidental touch mode, that is, the screen is turned on, and the voice message is played through the speaker. Figure 11 is a flow chart of an exemplary voice playback method, please refer to Figure 11, which specifically includes but is not limited to:

[0328] S1101a: The gesture assistance algorithm outputs a status value based on the ACC data.

[0329] For example, after the user takes the phone away from his ear, the pitch, roll, and handupJudge calculated by the gesture assistance algorithm will not meet the threshold. Accordingly, in the process shown in FIG7 , the gesture assistance algorithm outputs false.

[0330] S1001b: The gesture assistance algorithm outputs the gesture lock status based on the ACC data.

[0331] Exemplarily, in the process shown in Figure 10, the gesture assistance algorithm executes S1003. Due to the influence of device performance or the reporting cycle of the proximity light driver, the proximity light driver may not have obtained the away state after the user takes the mobile phone away from the ear. Accordingly, the gesture assistance algorithm determines that the current proximity light state is the away state and executes S1005. Exemplarily, the gesture assistance algorithm obtains the state value, and as described above, the state value is judged to be false. The gesture assistance algorithm continues to execute S1006. The gesture assistance algorithm is currently in the locked state, then executes S1007. Accordingly, the gesture assistance algorithm judges based on pitch, roll and handupJudge that the threshold is not met, then releases the locked state, that is, outputs the gesture lock state as the unlocked state.

[0332] S1002: Proximity light driving obtains proximity light status.

[0333] Exemplarily, the proximity light driver obtains that the physical proximity light state is the distance state.

[0334] S1003 , the proximity light driver reads the earpiece status from the gesture assistance algorithm.

[0335] For example, the current earpiece state recorded by the gesture assistant is an open state, and the proximity light driver reads that the earpiece is in an open state.

[0336] S1104: The proximity light driver determines whether the earpiece is turned on.

[0337] S1105 , the proximity light driver reads the gesture lock state from the gesture assistance algorithm.

[0338] S1106a, the proximity light driver determines and reports the distance state.

[0339] 5, the proximity light driver determines that the handset is on and the state obtained by the gesture is unlocked. The process goes to S510, and the proximity light driver can determine to report the currently obtained entity proximity light state, that is, the distance state.

[0340] S1106b: The proximity light driver reports the distance state to SensorHal.

[0341] S1106c: SensorHal reports the away status to the application.

[0342] Accordingly, in response to the received away state, the chat application may start executing from S601a of FIG. 6 , ie, turn on the speaker to continue playing the voice message using the speaker and light up the screen.

[0343] For example, as described above, the proximity light driver may report an abnormality, that is, when the user listens to a voice message at their ear, the proximity light sensor mistakenly detects the distance state. In this scenario, the proximity light driver can correct the physical proximity light detection result of the proximity light driver based on the gesture lock state of the gesture assistance algorithm to report the correct proximity state to the chat application to avoid false alarms. Figure 12 is an exemplary diagram of the voice message playback process. Please refer to Figure 12, which specifically includes but is not limited to the following steps:

[0344] S1201a: The gesture assistance algorithm outputs a status value based on the ACC data.

[0345] Exemplarily, the gesture assistance algorithm executes the process in Figure 7. In this example, based on the calculated pitch, roll, and handupJudge values, the gesture assistance algorithm determines that the threshold is met and the earpiece and speaker are turned on. The gesture assistance algorithm determines yes and executes S704. In this example, since the proximity light drive is a false alarm, and the previous report is still a proximity state, the gesture assistance algorithm accordingly determines that the last reported proximity light state is a proximity state, determines yes, and outputs a status value of true.

[0346] S1201b: The gesture assistance algorithm outputs the gesture lock state based on the ACC data.

[0347] Exemplarily, the gesture assistance algorithm executes the process in Figure 10 based on ACC data. Referring to Figure 10, the gesture assistance algorithm executes S1003. In one example, S1202 may be executed before S1201b is executed, that is, the proximity light driver has obtained that the current entity proximity state is far away (that is, a false detection state). Accordingly, the gesture assistance algorithm executes S1003, judges as no, and continues to execute S1005. The gesture assistance algorithm can obtain the output state value (that is, the value calculated in S1201a) as true. The gesture assistance algorithm determines that the gesture lock is locked.

[0348] In another example, due to device performance or the proximity light driver's reporting cycle, the proximity light driver may not have yet detected the physical proximity light state, and the current proximity light state is still the proximity state. Accordingly, the gesture assistance algorithm executes S1004 and determines based on pitch and roll that the threshold is met, further determining that the gesture lock is locked.

[0349] It should be noted that in this embodiment of the present application, after the gesture lock is engaged (that is, while the user is holding the phone to their ear), the phone's acceleration does not change, so handupJudge may remain 0. Accordingly, in this scenario, the gesture assistance algorithm can disregard handupJudge when executing the state value determination process and the gesture lock state determination process. For example, when executing S1004, only pitch and roll can be determined without further checking handupJudge.

[0350] S1202: The proximity light driver obtains a proximity light state.

[0351] For example, in this example, the case where the proximity light driving obtains an abnormal state, that is, it is actually a proximity state, while the proximity light driving obtains a distance state is taken as an example for description.

[0352] S1203 , the proximity light driver reads the earpiece status from the gesture assistance algorithm.

[0353] For example, the current earpiece state recorded by the gesture assistant is an open state, and the proximity light driver reads that the earpiece is in an open state.

[0354] S1204: The proximity light driver determines whether the earpiece is turned on.

[0355] S1205 , the proximity light driver reads the gesture lock state from the gesture assistance algorithm.

[0356] S1206a: The proximity light driver determines and reports the proximity state.

[0357] For example, in the process shown in Figure 5, the proximity light driver determines that the earpiece is turned on and the state obtained by the gesture is locked. The process goes to S506, and the proximity light driver can determine to report the proximity state. In other words, although the physical proximity light state obtained by the proximity light driver is the distant state, because the gesture lock locks the proximity state, the proximity light state will update the distant state to be reported to the proximity state when the gesture lock is detected. This achieves timely correction of the false detection of the proximity light state, avoiding the problem of false alarms causing the phone to be played through the speaker when it is next to the user's ear, and the screen to be accidentally touched.

[0358] S1206b: The proximity light driver reports the proximity status to SensorHal.

[0359] S1206c: SensorHal reports the proximity status to the application.

[0360] For detailed description, please refer to the relevant content above and will not be repeated here.

[0361] In an embodiment of the present application, after the voice message is finished playing, the chat application detects that the voice message is finished playing, and the chat application may stop calling the speaker or earpiece, that is, the chat application may send an instruction to AudioHal to turn off the speaker and / or earpiece. In response to the received instruction, AudioHal instructs the audio driver to turn off the earpiece or speaker. In addition, AudioHal sends an indication to Sensorevent that the speaker and earpiece are turned off. In response to the received indication, Sensorevent records that the status of the earpiece and the speaker are both in the off state. SensorHal reads from Sensorevent that the status of the speaker and / or earpiece is switched from the on state to the off state, and SensorHal sends a speaker off indication and / or earpiece off indication to the gesture assistance algorithm. The gesture assistance algorithm may record that the status of the earpiece and / or speaker is in the off state. In addition, the gesture assistance algorithm stops obtaining ACC data to reduce system power consumption.

[0362] In an embodiment of the present application, after the speaker is turned on, the gesture assistance algorithm starts to obtain ACC data and calculates the posture data (such as roll and pitch) and motion data (such as handup judge) of the electronic device to prepare in advance the data required for the gesture lock state calculation. When the user puts the mobile phone to his ear to answer the call, the proximity light driver detects the proximity state and reports it to the chat application. The chat application can then start the anti-false touch process based on the proximity state, that is, instruct the mobile phone to turn off the screen and switch to the earpiece to play the voice message. As mentioned above, the chat application needs to interact between the modules to call the earpiece. Due to performance impact, the proximity light driver may not have obtained the earpiece opening state. That is, in the process shown in Figure 5, the process continues to S504, and at this time the earpiece is already in the open state, that is, the earpiece plays the voice message, and the screen is in the off state.

[0363] Before the proximity light driver receives the handset-on message, the proximity light driver can continue to obtain the status value output by the gesture assistance algorithm. At this time, the gesture assistance algorithm has determined that the phone is in a proximity state based on the posture data (i.e., the posture of the phone) and motion data (i.e., the dynamic process of answering the call at the ear). As shown in Figure 7, the gesture assistance algorithm executes S703 and judges yes, and the process goes to S704. Since the proximity light driver has already reported the proximity state, the process also judges yes. Accordingly, the output status value is true, indicating that the result obtained by the algorithm proximity light state is a proximity state. In this example, if the entity proximity light abnormally reports the distance state, that is, in Figure 5, the process will go from S504 to S505. When executing S505, the proximity light driver can determine that the algorithm proximity light state is a proximity state based on the output status value of the gesture assistance algorithm. Accordingly, the proximity light driver will report the proximity state to correct the abnormal detection result of the entity proximity light state.

[0364] It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules that perform the corresponding functions. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of this application.

[0365] In an example, FIG13 shows a schematic block diagram of a device 1300 according to an embodiment of the present application. The device 1300 may include: a processor 1301 and a transceiver / transceiver pin 1302 , and optionally, a memory 1303 .

[0366] The various components of the device 1300 are coupled together via a bus 1304, wherein the bus 1304 includes, in addition to a data bus, a power bus, a control bus, and a status signal bus. However, for the sake of clarity, all buses are referred to as bus 1304 in the figure.

[0367] Optionally, the memory 1303 may be used for instructions in the aforementioned method embodiment. The processor 1301 may be used to execute instructions in the memory 1303 and control the receiving pin to receive a signal and control the transmitting pin to send a signal.

[0368] The apparatus 1300 may be the electronic device or a chip of the electronic device in the above method embodiment.

[0369] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0370] This embodiment further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment.

[0371] This embodiment further provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement the method in the above-mentioned embodiment.

[0372] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the methods in the above-mentioned method embodiments.

[0373] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0374] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for playing a voice message, characterized in that: Applied to electronic equipment, the method comprises: In response to a received click operation on a voice message, calling a speaker to play the voice message, and the display screen of the electronic device is in a light-on state; Based on the detection result of the proximity light sensor, acquiring a first proximity light state; Based on the first state data, a second proximity light state is acquired; wherein the state data includes posture data and motion data, the posture data is used to describe the current posture of the electronic device, and the motion data is used to describe the current motion state of the electronic device; Detecting that both the first approaching light state and the second approaching light state indicate a far away state, continuing to call the speaker to play the voice message, and the electronic device display screen is in a bright screen state; When the user raises his hand and places the electronic device to his ear to listen to the voice message, acquiring a third proximity light state based on the detection result of the proximity light sensor; Based on the second state data, acquiring a fourth proximity light state; It is detected that the third proximity light state indicates a distant state, and the fourth proximity light state indicates a proximity state, the third proximity light state is determined to be an abnormal state, and, based on the fourth proximity light state, it is determined that the electronic device is in an ear listening scenario, the earpiece is called to play the voice message, and the display screen of the electronic device is in an off state.

2. The method according to claim 1, characterized in that The method further comprises: When the user continues to place the electronic device near the ear to listen to the voice message, acquiring a fifth proximity light state based on the detection result of the proximity light sensor; Based on the third state data, acquiring a sixth proximity light state; It is detected that the fifth proximity light state indicates a away state, and the sixth proximity light state indicates a close state, and the fifth proximity light state is determined to be an abnormal state. Based on the sixth proximity light state, it is determined that the electronic device is still in an ear listening scenario, the earpiece continues to be called to play the voice message, and the display screen of the electronic device is in an off state.

3. The method according to claim 1, characterized in that The detecting that both the first approaching light state and the second approaching light state indicate a far away state, continuing to call the speaker to play the voice message, and the electronic device display screen is in a bright screen state, includes: Detecting whether the handset is in an open state; detecting that the handset is in an off state, and determining whether the first approaching light state indicates a distant state; determining that the first approach light state indicates a distant state, and determining whether the second approach light state indicates an approach state; determining that the second approaching light state indication is a far away state, and determining that the current target approaching light state of the electronic device is a far away state; Based on the target approaching light state, continue to call the speaker to play the voice message, and the phone The sub-device display is on.

4. The method according to claim 1, characterized in that: The detecting that the third approach light state indicates a far state and the fourth approach light state indicates an approach state, and determining that the third approach light state is an abnormal state, includes: Detecting whether the handset is in an open state; detecting that the handset is in an off state, and determining whether the third approaching light state indicates a distant state; determining that the third approach light state indicates a far state, and determining whether the fourth approach light state indicates an approach state; determining that the fourth approach light state indicates an approach state, and determining that the third approach light state is an abnormal state based on the third approach light state and the fourth approach light state; The fourth proximity light state is determined to be a target proximity light state.

5. The method according to claim 4, characterized in that The method of determining, based on the fourth proximity light state, that the electronic device is in an ear-to-ear listening scenario, calling the handset to play the voice message, and that the display screen of the electronic device is in an off-screen state, includes: Based on the target proximity light state, it is determined that the electronic device is in an ear listening scenario, the earpiece is called to play the voice message, and the display screen of the electronic device is in an off state.

6. The method according to claim 2, characterized in that The detecting that the fifth approach light state indicates a far state and the sixth approach light state indicates an approach state, and determining that the fifth approach light state is an abnormal state, includes: Detecting whether the handset is in an open state; detecting that the handset is in an on state, and determining whether the sixth proximity light state indicates a proximity state; determining that the sixth approach light indication is an approach state, and determining that the fifth approach light state is an abnormal state based on the fifth approach light state and the sixth approach light state; The sixth approach light state is determined as a target approach light state.

7. The method according to claim 6, characterized in that The method of determining, based on the sixth proximity light state, that the electronic device is still in the ear-to-ear listening scenario, continuing to call the handset to play the voice message, and the display screen of the electronic device is in an off-screen state, includes: Based on the target proximity light state, it is determined that the electronic device is in an ear listening scenario, the earpiece continues to be called to play the voice message, and the display screen of the electronic device is in an off state.

8. An electronic device, characterized in that: include: One or more processors, memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: In response to a received click operation on a voice message, calling a speaker to play the voice message, and the display screen of the electronic device is in a light-on state; Based on the detection result of the proximity light sensor, acquiring a first proximity light state; Based on the first state data, a second proximity light state is acquired; wherein the state data includes posture data and motion data, the posture data is used to describe the current posture of the electronic device, and the motion data is used to describe the current motion state of the electronic device; Detecting that both the first approaching light state and the second approaching light state indicate a far away state, continuing to call the speaker to play the voice message, and the electronic device display screen is in a bright screen state; When the user raises his hand and places the electronic device to his ear to listen to the voice message, acquiring a third proximity light state based on the detection result of the proximity light sensor; Based on the second state data, acquiring a fourth proximity light state; It is detected that the third proximity light state indicates a distant state, and the fourth proximity light state indicates a proximity state, the third proximity light state is determined to be an abnormal state, and, based on the fourth proximity light state, it is determined that the electronic device is in an ear listening scenario, the earpiece is called to play the voice message, and the display screen of the electronic device is in an off state.

9. The electronic device according to claim 8, characterized in that: When the computer program is executed by the one or more processors, the electronic device performs the following steps: When the user continues to place the electronic device near the ear to listen to the voice message, acquiring a fifth proximity light state based on the detection result of the proximity light sensor; Based on the third state data, acquiring a sixth proximity light state; It is detected that the fifth proximity light state indicates a away state, and the sixth proximity light state indicates a close state, and the fifth proximity light state is determined to be an abnormal state. Based on the sixth proximity light state, it is determined that the electronic device is still in an ear listening scenario, the earpiece continues to be called to play the voice message, and the display screen of the electronic device is in an off state.

10. The electronic device according to claim 8, characterized in that: When the computer program is executed by the one or more processors, the electronic device performs the following steps: Detecting whether the handset is in an open state; detecting that the handset is in an off state, and determining whether the first approaching light state indicates a distant state; determining that the first approach light state indicates a distant state, and determining whether the second approach light state indicates an approach state; determining that the second approaching light state indication is a far away state, and determining that the current target approaching light state of the electronic device is a far away state; Based on the target being close to the light, the speaker is continuously called to play the voice message, and the display screen of the electronic device is in a bright screen state.

11. The electronic device according to claim 8, characterized in that: When the computer program is executed by the one or more processors, the electronic device performs the following steps: Detecting whether the handset is in an open state; detecting that the handset is in an off state, and determining whether the third approaching light state indicates a distant state; determining that the third approach light state indicates a far state, and determining whether the fourth approach light state indicates an approach state; determining that the fourth approach light state indicates an approach state, and determining that the third approach light state is an abnormal state based on the third approach light state and the fourth approach light state; The fourth proximity light state is determined to be a target proximity light state.

12. The electronic device according to claim 11, characterized in that: When the computer program is executed by the one or more processors, the electronic device performs the following steps: Based on the target proximity light state, it is determined that the electronic device is in an ear listening scenario, the earpiece is called to play the voice message, and the display screen of the electronic device is in an off state.

13. The electronic device according to claim 9, characterized in that: When the computer program is executed by the one or more processors, the electronic device performs the following steps: Detecting whether the handset is in an open state; detecting that the handset is in an on state, and determining whether the sixth proximity light state indicates a proximity state; determining that the sixth approach light indication is an approach state, and determining that the fifth approach light state is an abnormal state based on the fifth approach light state and the sixth approach light state; The sixth approach light state is determined as a target approach light state.

14. The electronic device according to claim 13, characterized in that: When the computer program is executed by the one or more processors, the electronic device performs the following steps: Based on the target proximity light state, it is determined that the electronic device is in an ear listening scenario, the earpiece continues to be called to play the voice message, and the display screen of the electronic device is in an off state.

15. A computer storage medium, characterized in that The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 7.

16. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 7.

17. A chip, characterized in that: It comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, wherein the signal includes a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the method described in any one of claims 1 to 7.

18. A method for playing a voice message, characterized in that: Applied to electronic equipment, the method comprises: In response to a received click operation on a voice message, calling a speaker to play the voice message, and the display screen of the electronic device is in a light-on state; Based on the detection result of the proximity light sensor, acquiring a first proximity light state; Based on the first state data, a second proximity light state is acquired; wherein the state data includes posture data and motion data, the posture data is used to describe the current posture of the electronic device, and the motion data is used to describe the current motion state of the electronic device; Detecting that both the first approaching light state and the second approaching light state indicate a far away state, continuing to call the speaker to play the voice message, and the electronic device display screen is in a bright screen state; When the user raises his hand and places the electronic device to his ear to listen to the voice message, acquiring a third proximity light state based on the detection result of the proximity light sensor; Based on the second state data, locking the gesture lock into a proximity state; Detecting that the third proximity light state indication is a distance state and the gesture lock is locked in a proximity state, determining that the third proximity light state is an abnormal state, and determining that the electronic device is in an ear-to-ear listening scenario, calling the handset to play the voice message, and that the display screen of the electronic device is in an off state; When the user continues to place the electronic device near the ear to listen to the voice message, acquiring a seventh proximity light state based on the detection result of the proximity light sensor; Based on the fourth state data, locking the gesture lock to a proximity state; Based on the seventh proximity light state and the lock state of the gesture lock, determining that the first target proximity light state is a proximity state; Based on the first target being close to the light, continue to call the handset to play the voice message, and the display screen of the electronic device is in a screen-off state; When the user holds the electronic device away from the ear, acquiring an eighth proximity light state based on a detection result of the proximity light sensor, the eighth proximity light state indicating a distance state; Based on the fifth state data, updating the gesture lock to an unlocked state, wherein the unlocked state is used to indicate that the target proximity light state of the electronic device is consistent with the detection result of the proximity light sensor; Based on the unlocked state of the gesture lock, determining the eighth proximity light state as a second target proximity light state; Based on the second target being close to the light, it is determined that the electronic device is in a non-ear listening scenario, a speaker is called to play the voice message, and the display screen of the electronic device is in a bright screen state.

19. The method according to claim 18, characterized in that The method further includes: based on the first target being close to the light, continuing to call the handset to play the voice message, and after the display screen of the electronic device is in a screen-off state: When the user continues to place the electronic device near the ear to listen to the voice message, acquiring a fifth proximity light state based on the detection result of the proximity light sensor; Based on the third state data, determining that the gesture lock remains locked in the proximity state; Detect that the fifth proximity light state indication is the away state, and the gesture lock is locked in the proximity state, determine that the fifth proximity light state is an abnormal state, and determine that the electronic device is still in the ear answering scene, and continue to call The receiver plays the voice message, and the display screen of the electronic device is in an off state.

20. The method according to claim 18, characterized in that The detecting that both the first approaching light state and the second approaching light state indicate a far away state, continuing to call the speaker to play the voice message, and the electronic device display screen is in a bright screen state, includes: Detecting whether the handset is in an open state; detecting that the handset is in an off state, and determining whether the first approaching light state indicates a distant state; determining that the first approach light state indicates a distant state, and determining whether the second approach light state indicates an approach state; determining that the second approaching light state indication is a far away state, and determining that the current target approaching light state of the electronic device is a far away state; Based on the target being close to the light, the speaker is continuously called to play the voice message, and the display screen of the electronic device is in a bright screen state.

21. The method according to claim 18, characterized in that The detecting that the third proximity light state indicates a distance state and the gesture lock is locked in a proximity state, and determining that the third proximity light state is an abnormal state includes: Detecting whether the handset is in an open state; detecting that the handset is in an off state, and determining whether the third approaching light state indicates a distant state; determining that the third proximity light state indication is a distance state, and determining, based on the second state data, that the state value of the electronic device is a first state value; Based on the first state value, determining that the gesture lock is locked to a proximity state; Based on the lock state of the gesture lock, it is determined that the target proximity light state of the electronic device is a proximity state.

22. The method according to claim 21, characterized in that The step of determining that the electronic device is in an ear-to-ear listening scenario, calling the handset to play the voice message, and the display screen of the electronic device is in an off-screen state, includes: Based on the target proximity light state, it is determined that the electronic device is in an ear listening scenario, the earpiece is called to play the voice message, and the display screen of the electronic device is in an off state.

23. The method according to claim 19, characterized in that The detecting that the fifth proximity light state indicates a far state and the gesture lock is locked in a proximity state, and determining that the fifth proximity light state is an abnormal state includes: Detecting whether the handset is in an open state; Detecting that the handset is in an open state, determining whether the gesture lock is in a locked state; The gesture lock is determined to be in a locked state, and the target proximity light state of the electronic device is determined to be in a proximity state.

24. The method according to claim 23, characterized in that The step of determining that the electronic device is still in the ear-to-ear listening scenario, continuing to call the handset to play the voice message, and the display screen of the electronic device is in an off-screen state, includes: Based on the target proximity light state, it is determined that the electronic device is in an ear listening scenario, the earpiece continues to be called to play the voice message, and the display screen of the electronic device is in an off state.

Citation Information

Patent Citations

  • Method and device for controlling voice playing modes

    CN103811033A

  • Voice message playing method and mobile terminal

    CN106941564A

  • Control method of proximity light sensor and electronic equipment

    CN109547629A

  • Method for automatically playing voice message, smart phone and computer program product

    CN109995913A

  • Screen control method and device, storage medium and mobile terminal

    CN111405110A