Method and device for preventing accidental touch

By detecting the distance between the mobile phone and the user's head and displaying a pop-up prompt, the problem of call interruption caused by accidental touch operation is solved and the user's call experience is improved.

CN116668581BActive Publication Date: 2024-10-25HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211521705.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2024-10-25
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

When the user is using the mobile phone to make a call, accidental touch operation causes the call to be interrupted, affecting the user experience.

Method used

By detecting the distance between the electronic device and the user's head, and when detecting the user's operation to hang up the current call, a pop-up window is displayed to prompt the user whether they really need to end the call, thus avoiding interruption of the call due to misoperation.

Benefits of technology

It effectively avoids the problem of call interruption caused by misoperation and improves the user's call experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116668581B_ABST
    Figure CN116668581B_ABST
Patent Text Reader

Abstract

A method and device for preventing accidental touches, the method is applied to the field of terminal technology. The method includes: when the user makes the call, obtaining a first distance, the first distance is used to characterize the distance between the electronic device and the user's head, and the first distance is less than a first distance threshold; detecting a first operation of the user, the first operation is used to hang up the current call; in response to the first operation, displaying a first window, the first window is used to prompt the user whether to end the current call, the first window includes a first control and a second control; in response to detecting that the user clicks on the first control, continuing the call; or, in response to detecting that the user clicks on the second control, ending the call. In the embodiment of the present application, after the user makes an erroneous operation, a pop-up window is used to remind the user to confirm whether to end the call, which can effectively solve the problem of call interruption caused by accidental touches and greatly improve the user's calling experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular, to a method and device for preventing accidental touches. Background Art

[0002] With the rapid development of smart terminals, smart terminals play an important role in people's daily lives. In particular, it is common for users to use mobile phones to make calls. When using a mobile phone to make a call, the user brings the phone close to the head (such as next to the ear). At this time, the phone is usually in an off-screen state. However, during a call, the phone screen may light up due to some reasons, such as accidentally touching the phone or the user moving the phone away from the head. After the screen lights up, if the user accidentally touches the phone, the call will be directly hung up, affecting the user experience. Summary of the invention

[0003] In view of this, the present application provides a method, device, computer-readable storage medium and computer program product for preventing accidental touches, which can effectively solve the problem of call interruptions caused by accidental touches and greatly improve the user's call experience.

[0004] In a first aspect, a method for preventing accidental touch is provided, the method being applied to an electronic device, the method comprising:

[0005] In response to detecting that the user answers the incoming call, a call is made with the calling terminal, or in response to detecting that the outgoing call is connected, a call is made with the called terminal;

[0006] When the user makes the call, a first distance is acquired, where the first distance is used to represent the distance between the electronic device and the user's head, wherein the first distance is less than a first distance threshold;

[0007] Detecting a first operation of the user, where the first operation is used to hang up the current call;

[0008] In response to the first operation, displaying a first window, the first window being used to prompt the user whether to end the current call, the first window comprising a first control and a second control;

[0009] In response to detecting that the user clicks the first control, continuing the call;

[0010] Alternatively, in response to detecting that the user clicks on the second control, the call is ended.

[0011] The above method can be executed by a terminal device or a chip in the terminal device. Based on the above solution, when a user uses an electronic device to make a call, by detecting the distance between the electronic device and the user's head, and when detecting the user's operation of hanging up the current call, a pop-up window is displayed in the interface to remind the user whether he really needs to end the call, thereby avoiding the problem of call interruption caused by misoperation and greatly improving the user's call experience.

[0012] The first operation may be a user's erroneous operation. Optionally, the first operation is an operation of pressing a power button, or an operation of clicking a hang-up button.

[0013] The function of hanging up a call by pressing the power button can be preset. For example, a user can turn on the switch option of "Press the power button to end the call" in the electronic device. If the user turns on the switch option of "Press the power button to end the call", the call will be disconnected after the user presses the power button.

[0014] In a possible implementation, while the first window is displayed on the call interface, the method further includes:

[0015] Sending a prompt tone to the user, wherein the prompt tone is used to remind the user to check the first window; and / or,

[0016] A vibration event is triggered, where the vibration event is used to remind the user to check the first window.

[0017] Therefore, in addition to reminding the user through a pop-up window, the user can also be reminded to pay attention to the pop-up window content through further means (prompt sound and / or vibration event) to assist the user in choosing whether to really end the call.

[0018] In a possible implementation, the method further includes:

[0019] Get the ambient illumination value;

[0020] Wherein, the sending of a prompt sound to the user includes: if the ambient illumination value is greater than or equal to a first illumination threshold, sending a prompt sound to the user;

[0021] The triggering of the vibration event includes: if the ambient illumination value is less than the first illumination threshold, triggering the vibration event.

[0022] Exemplarily, if it is daytime, a prompt sound is used to remind the user to pay attention to the pop-up window (ie, the first window); if it is night, a vibration event (or vibration event + prompt sound) is used to remind the user to pay attention to the pop-up window.

[0023] In a possible implementation, the operation of the user clicking the first control or the operation of the user clicking the second control is detected within a first preset time period.

[0024] In a possible implementation, the method further includes:

[0025] If no user operation on the first control or the second control is detected within a first preset time period, the first window is cancelled and the call is continued.

[0026] Therefore, if the user has not selected whether to end the call or continue the call, the call will be continued by default to avoid call interruption due to an accidental touch operation. In addition, by setting the first preset time, the problem of power consumption waste caused by presenting the first window for a long time can also be avoided.

[0027] In a possible implementation manner, before detecting the first operation, the method further includes:

[0028] determining whether the first distance is less than a second distance threshold, wherein the second distance threshold is less than the first distance threshold;

[0029] When the first distance is less than or equal to the second distance threshold, performing screen off processing;

[0030] When the first distance is greater than the second distance threshold and less than the first distance threshold, screen lighting processing is performed.

[0031] The embodiment of the present application introduces a second distance threshold and a first distance threshold to change the screen state (screen on or off). When the first distance is less than or equal to the second distance threshold, the electronic device turns off the screen; when the first distance is greater than the second distance threshold and less than the first distance threshold, the electronic device turns on the screen. In both scenarios, if the first operation is detected, a pop-up window reminder is provided to the user for the user to choose whether to really end the call.

[0032] In a possible implementation manner, when the first distance is less than or equal to the second distance threshold, before detecting the first operation, the method further includes:

[0033] Detecting a second operation of the user;

[0034] In response to the second operation, screen lightening processing is performed.

[0035] That is to say, for a scenario where the first distance is less than or equal to the second distance threshold, if the second operation is detected, the screen is switched from off to on.

[0036] In a possible implementation, the method further includes:

[0037] If the first operation is not detected within the second preset time period, the screen is turned off.

[0038] Therefore, for the scenario where the first distance is less than or equal to the second distance threshold, if the first operation has not been detected within the second preset time period, the electronic device turns off the screen to avoid wasting power by keeping the screen on.

[0039] In a second aspect, a device for preventing accidental touch is provided, comprising a unit for executing any one of the methods in the first aspect. The device may be an electronic device (e.g., a terminal or a terminal device), or a chip in an electronic device (e.g., a terminal or a terminal device). The device comprises an input unit, a display unit, and a processing unit.

[0040] When the device is a terminal, the processing unit may be a processor, the input unit may be a communication interface, and the display unit may be a graphics processing module and a screen; the electronic device may further include a memory for storing computer program code, and when the processor executes the computer program code stored in the memory, the electronic device executes any one of the methods in the first aspect.

[0041] When the device is a chip in an electronic device, the processing unit may be a logic processing unit inside the chip, the input unit may be an output interface, a pin or a circuit, etc., and the display unit may be a graphics processing unit inside the chip; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the methods of the first aspect.

[0042] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code, and when the computer program code is executed by a device for preventing accidental touches, the device executes any one of the methods in the first aspect.

[0043] In a fourth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed by a device for preventing accidental touches, the device executes any one of the methods in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is an example diagram of an application scenario of an embodiment of the present application;

[0045] Figure 2 is an example diagram of another application scenario of an embodiment of the present application;

[0046] Figure 3is a schematic diagram of a hardware system of an electronic device applicable to the present application;

[0047] Figure 4 is a schematic diagram of a software system for an electronic device applicable to the present application;

[0048] Figure 5 is a schematic flow chart of a method for preventing accidental touches according to an embodiment of the present application;

[0049] Figure 6 This is an example of an interface when a user is using a handheld terminal to make a call;

[0050] Figure 7 This is an example diagram of an interface of a user operation pop-up window in an embodiment of the present application;

[0051] Figure 8 This is another example of the interface when the user is talking on a phone with a handheld terminal;

[0052] Fig. 9 is a specific flow chart of the method for preventing accidental touches in an embodiment of the present application;

[0053] Fig.10 is another specific flow chart of the method for preventing accidental touch;

[0054] Fig.11 It is a schematic block diagram of a device for preventing accidental touch according to an embodiment of the present application. DETAILED DESCRIPTION

[0055] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0056] The method for preventing accidental touch provided in the embodiment of the present application can be applied to electronic devices with touch screens. The electronic devices can be mobile phones, smart screens, tablet computers, wearable electronic devices, vehicle-mounted electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), projectors, etc.

[0057] The technical solution of the embodiment of the present application is applied to a scenario in which a user uses a terminal to make a call.

[0058] In some implementations, the technical solution of the embodiments of the present application can be applied to: a call scenario in which a user uses a mobile phone to answer a call or make a call.

[0059] In some implementations, the technical solutions of the embodiments of the present application may be applied to scenarios where users answer or initiate calls in other social software, such as WeChat voice calls.

[0060] The following combination Figure 1 and Figure 2 The following example illustrates the scenario.

[0061] Figure 1 An example diagram of an application scenario of an embodiment of the present application is shown. When a user uses a mobile phone to make a call (such as answering a call), the user can place the mobile phone close to the ear or face. Figure 1 As shown in (1), the user holds the mobile phone to make a call. When the distance between the user's head and the mobile phone is less than the set distance, the screen is turned off, that is, the mobile phone interface is turned off, for example Figure 1 The interface shown in (1).

[0062] Here is a unified explanation. In the embodiments of the present application, "the distance between the user's head and the mobile phone" is used to generally refer to the proximity of the electronic device to the user. This description does not limit the protection scope of the embodiments of the present application. It is understandable that "the distance between the user's head and the mobile phone" can also be replaced by "the distance between the user's face and the electronic device", "the distance between the user's ear and the electronic device", and other descriptions used to characterize the proximity of the electronic device to the user's head.

[0063] In a possible implementation, during a call, the user may accidentally press the power button to light up the phone screen. Figure 1 The power button 101 shown in (1) turns on the screen of the mobile phone and displays the current call interface. For example, the interface displays as follows Figure 1 The interface shown in (2).

[0064] like Figure 1 As shown in (2), the current call interface is displayed in the mobile phone interface. For example, the user is calling the customer service hotline and the call duration is 45 seconds.

[0065] In a possible implementation, when a user presses the power button to turn on the screen of the mobile phone, the current call may be hung up due to an accidental touch. Figure 1 The hang-up button 102 shown in (2) is pressed, or the power button 101 is pressed by mistake, resulting in the current call being hung up. After the current call is hung up, the interface displays the following Figure 1 The interface shown in (3).

[0066] It should be understood that, for a unified explanation here, the function of hanging up a call by pressing the power button 101 can be preset. For example, the user can turn on the switch option of "press the power button to end the call" in the mobile phone. If the user turns on the switch option of "press the power button to end the call", then after the user presses the power button, the call will be disconnected.

[0067] like Figure 1 As shown in (3), the mobile phone interface displays the phone interface after the current call is ended. Figure 1 The telephone interface shown in (3) may include a call log bar, a 9-grid number input key, contacts, favorites and other controls. The call log bar is used to display the user's recent call records. For example, the call log bar displays the call record of "the customer service hotline just dialed" and the call record of "calling Xiao Zhang on November 25". The 9-grid number input key is used for the user to enter the phone number for dialing. The contact control is used to switch the current phone interface to the display interface of the mobile phone address book. The favorite control is used to switch the current phone interface to the display page of the favorite address book.

[0068] exist Figure 1 In the scenario shown, when the user accidentally touches Figure 1 Pressing the hang-up button 102 shown in (2) or accidentally pressing the power key 101 will end the call, but this does not mean that the user really wants to end the current call.

[0069] Figure 2 Another example diagram of an application scenario of an embodiment of the present application is shown. When a user uses a mobile phone to make a call (such as answering a call), the user can place the mobile phone close to the ear. Figure 2 As shown in (1), the user holds the mobile phone to make a call. When the distance between the head and the mobile phone is less than the set distance, the screen is turned off, that is, the mobile phone interface is turned off, for example Figure 2 The interface shown in (1).

[0070] In a possible implementation, during a call, the user may move the phone away from the ear. When the distance between the head and the phone is greater than a set distance, the screen is turned on, that is, the phone interface is in a bright screen state. For example, when the user moves the phone away from the head, the phone screen turns on and displays the current call interface. For example, the interface displays as follows: Figure 2 The interface shown in (2).

[0071] like Figure 2 As shown in (2), the current call interface is displayed in the mobile phone interface. For example, the user is calling the customer service hotline and the call duration is 45 seconds.

[0072] In a possible implementation, when the user moves the phone away from the head and the screen lights up, the current call may be hung up due to an accidental touch. Figure 2 The hang-up button 102 shown in (2) is pressed, or the power button 101 is pressed by mistake, resulting in the current call being hung up. After the current call is hung up, the interface displays the following Figure 2 The interface shown in (3).

[0073] like Figure 2 As shown in (3), the mobile phone interface displays the phone interface after the current call is ended. Figure 2 The telephone interface shown in (3) may include a call log bar, a 9-grid number input key, contacts, favorites and other controls. The call log bar is used to display the user's recent call records. For example, the call log bar displays the call record of "the customer service hotline just dialed" and the call record of "calling Xiao Zhang on November 25". The 9-grid number input key is used for the user to enter the phone number for dialing. The contact control is used to switch the current phone interface to the display interface of the mobile phone address book. The favorite control is used to switch the current phone interface to the display page of the favorite address book.

[0074] exist Figure 2 In the scenario shown, when the user accidentally touches Figure 2 The hang-up button 102 shown in (2) or the power key 101 being pressed accidentally will cause the call to end, but this does not mean that the current call is actually ended.

[0075] It should be understood that Figure 1 or Figure 2 The scenario shown is merely an exemplary description, and the embodiments of the present application are not limited thereto.

[0076] It should also be understood that the embodiments of the present application Figure 1 or Figure 2 The call scenario is not specifically limited to an incoming call scenario or an outgoing call scenario, and is applicable as long as the user is using a mobile phone to make a call.

[0077] It should also be understood that the embodiments of the present application are only Figure 1 or Figure 2 The telephone call scenario in is used as an example to illustrate, but the embodiments of the present application are not limited to this.

[0078] In one possible implementation, Figure 1 or Figure 2 The call scenario in the example is when a user answers a call and then uses their mobile phone to make a call. In other words, Figure 1 or Figure 2 The handset shown may be the called party during a call.

[0079] In another possible implementation, Figure 1 or Figure 2 The call scenario in the example is when a user makes a call and then uses the mobile phone to make a call. In other words, Figure 1 or Figure 2 The mobile phone shown can be the host side during a call.

[0080] In summary, when the distance between the user's head and the phone is less than the set distance, the screen will be turned off; when the distance between the user's head and the phone is greater than the set distance, the screen will be turned on. However, in both cases, there is the problem of call termination due to misoperation, which affects the user experience.

[0081] In view of this, the anti-mistouch method of the embodiment of the present application detects the distance between the electronic device and the user's head when the user is using the electronic device to make a call. When the user's operation of hanging up the current call is detected, a pop-up window is displayed in the interface to remind the user whether he really needs to end the call, thereby avoiding the problem of call interruption caused by misoperation and improving the user's calling experience.

[0082] Figure 3 A hardware system of an electronic device suitable for the present application is shown.

[0083] The electronic device 100 can be a mobile phone, a smart screen, a tablet computer, a wearable electronic device, an in-vehicle electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, etc. The embodiment of the present application does not impose any restrictions on the specific type of the electronic device 100.

[0084] 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, a proximity sensor 180N, etc.

[0085] It should be noted that Figure 3 The structure shown does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include Figure 3 More or fewer components than those shown, or the electronic device 100 may include Figure 3 A combination of some of the components shown, or the electronic device 100 may include Figure 3 Subcomponents of some of the components shown. For example, Figure 3 The illustrated proximity light sensor 180G may be optional. Figure 3 The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0086] The processor 110 may include one or more processing units. For example, the processor 110 may include at least one of the following processing units: an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and a neural-network processing unit (NPU). Different processing units may be independent devices or integrated devices.

[0087] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0088] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0089] Figure 3 The connection relationship between the modules shown is only a schematic illustration and does not constitute a limitation on the connection relationship between the modules of the electronic device 100. Optionally, the modules of the electronic device 100 may also adopt a combination of multiple connection modes in the above embodiments.

[0090] The electronic device 100 can realize the display function through the GPU, the display screen 194 and the application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

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

[0092] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.

[0093] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can perform algorithm optimization on the noise, brightness and color of the image. The ISP can also optimize the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0094] 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 optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted 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 red green blue (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.

[0095] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

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

[0097] The audio module 170 is used to convert digital audio information into analog audio signal output, and can also be 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 or some functional modules of the audio module 170 can be arranged in the processor 110.

[0098] The speaker 170A, also called a horn, is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or make a hands-free call through the speaker 170A.

[0099] The receiver 170B, also called an earpiece, is used to convert an audio electrical signal into a sound signal. When a user uses the electronic device 100 to answer a call or voice message, the user can listen to the voice by placing the receiver 170B close to the ear.

[0100] Microphone 170C, also called a microphone or a speaker, is used to convert sound signals into electrical signals. When a user makes a call or sends a voice message, the user can input the sound signal into microphone 170C by speaking close to microphone 170C.

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

[0102] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, for example, they can be resistive pressure sensors, inductive pressure sensors or capacitive pressure sensors. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When the force acts on the pressure sensor 180A, the capacitance between the electrodes changes, and the electronic device 100 determines the intensity of the pressure according to the change in capacitance. When the touch operation acts on the display screen 194, the electronic device 100 detects the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on a short message application icon, an instruction to view the short message is executed; when a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on a short message application icon, an instruction to create a new short message is executed.

[0103] The gyro 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., the x-axis, the y-axis, and the z-axis) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro 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 gyro sensor 180B can also be used in scenes such as navigation and somatosensory games.

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

[0105] 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 leather 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 according to the magnetic sensor 180D. The electronic device 100 can set features such as automatic unlocking of the flip cover according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover.

[0106] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally the x-axis, y-axis and z-axis). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. The acceleration sensor 180E can also be used to identify the posture of the electronic device 100 as an input parameter for applications such as horizontal and vertical screen switching and pedometers.

[0107] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, for example, in a shooting scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0108] The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When reflected light is detected, the electronic device 100 can determine that there is an object nearby. When no reflected light is detected, the electronic device 100 can determine that there is no object nearby. The electronic device 100 can use the proximity light sensor 180G to detect whether 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 for automatic unlocking and automatic screen locking in holster mode or pocket mode. It should be understood that Figure 3 The proximity light sensor 180G described in the foregoing may be an optional component. In some scenarios, an ultrasonic sensor may be used to replace the proximity light sensor 180G to detect proximity light.

[0109] The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed brightness of the ambient light. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.

[0110] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to realize functions such as unlocking, accessing application locks, taking photos, and answering calls.

[0111] The touch sensor 180K is also called a touch control device. The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, which is also called a touch control screen. The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor 180K can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100 and set at a different position from the display screen 194.

[0112] The proximity sensor 180N is used to assist in determining the proximity between the device surface and the object. Exemplarily, the proximity sensor 180N is used to detect the distance between the user's head and the surface of the electronic device. For example, when a user uses an electronic device to make or answer a call, the proximity sensor 180N can be used to detect the distance between the user's head and the electronic device in real time. In some embodiments, the proximity sensor 180N is used to obtain a first distance when the user makes the call, and the first distance is used to characterize the distance between the electronic device and the user's head.

[0113] The key 190 includes a power key and a volume key. The key 190 can be a mechanical key or a touch key. The electronic device 100 can receive a key input signal and implement a function related to the case input signal.

[0114] Motor 191 can generate vibration. Motor 191 can be used for incoming call reminders and can also be used for touch feedback. Motor 191 can generate different vibration feedback effects for touch operations acting on different applications. Motor 191 can also generate different vibration feedback effects for touch operations acting on different areas of the display screen 194. Different application scenarios (for example, time reminders, receiving messages, alarm clocks, and games) can correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0115] In some embodiments, the processor 110 is used to, in response to detecting an operation of a user answering an incoming call, conduct a call with a terminal on the calling side, or, in response to detecting that an outgoing call is connected, conduct a call with a terminal on the called side; it is also used to call the proximity sensor 180N to obtain a first distance when the user is making the call, and the first distance is used to characterize the distance between the electronic device and the user's head, wherein the first distance is less than a first distance threshold; it is also used to detect a first operation of the user, and the first operation is used to hang up the current call; in response to the first operation, call the display screen 194 to display a first window, and the first window is used to prompt the user whether to end the current call, and the first window includes a first control and a second control; in response to detecting an operation of a user clicking the first control, continue the call; or, in response to detecting an operation of a user clicking the second control, end the call.

[0116] The hardware system of the electronic device 100 is described in detail above, and the software system of the electronic device 100 is introduced below. The software system can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the layered architecture as an example to exemplarily describe the software system of the electronic device 100.

[0117] like Figure 4 As shown, the software system using a layered architecture is divided into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the software system can be divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android Runtime) and the system library, and the kernel layer.

[0118] The application layer may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0119] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer may include some predefined functions.

[0120] For example, the application framework layer includes the window manager, content provider, view system, telephony manager, resource manager, and notification manager.

[0121] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, and capture the screen.

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

[0123] The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0124] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (connected or hung up).

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

[0126] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used for download completion notifications and message reminders. The notification manager can also manage notifications that appear in the system's top status bar in the form of icons or scrolling text, such as notifications from applications running in the background. The notification manager can also manage notifications that appear on the screen in the form of dialog windows, such as prompting text messages in the status bar, emitting reminder sounds, vibrating electronic devices, and flashing indicator lights.

[0127] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0128] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0129] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0130] The system library may include multiple functional modules, such as: surface manager, media library, 3D graphics processing library (such as open graphics library for embedded systems (OpenGL ES)) and 2D graphics engine (such as skia graphics library (SGL)).

[0131] The surface manager is used to manage the display subsystem and provide the fusion of 2D layers and 3D layers for multiple applications.

[0132] The media library supports playback and recording of multiple audio formats, playback and recording of multiple video formats, and still image files. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, moving picture experts group audio layer III (MP3), advanced audio coding (AAC), adaptive multi-rate (AMR), joint photographic experts group (JPG) and portable network graphics (PNG).

[0133] The 3D graphics processing library can be used to implement 3D graphics drawing, image rendering, compositing and layer processing.

[0134] A 2D graphics engine is a drawing engine for 2D drawings.

[0135] The kernel layer is a layer between hardware and software. The kernel layer may include driver modules such as display driver, camera driver, audio driver, and sensor driver. Exemplarily, the sensor driver includes a proximity sensor driver.

[0136] The following is an illustrative description of the workflow of the software system and the hardware system of the electronic device 100 in conjunction with a call scenario.

[0137] Exemplarily, when a user answers an incoming call, the electronic device 100 checks whether it is allowed to change the audio and select a device for the communication use case. Subsequently, the electronic device 100 creates a sensor management object and checks permissions. Next, the electronic device 100 calls up the sensor service application and obtains services. The electronic device creates an instance for the proximity sensor and initializes it, and then registers a listener for the initialized proximity sensor. The listener is used to obtain changes in the sensor accuracy value collected by the proximity sensor (mainly changes in the distance between the electronic device and the user's head) and changes in the sensor light intensity. The proximity sensor reports the collected distance between the electronic device and the user's head (such as the first distance) to the upper layer, such as the view system of the framework layer. The electronic device 100 determines whether to perform a screen-on operation or a screen-off operation based on the size relationship between the first distance and the first distance threshold, and / or the size relationship between the first distance and the second distance threshold, and displays a first window after detecting the user's first operation, the first operation is used to hang up the current call, the first window is used to prompt the user whether to end the current call, and the first window includes a first control and a second control. Then, the event of hanging up the call is responded to according to the touch event input by the user through the touch sensor 180K, and the state of the screen is updated accordingly. If the user clicks the first control, the call continues; if the user clicks the second control, the call ends.

[0138] Exemplarily, when a user performs a touch operation on the touch sensor 180K, the corresponding hardware interrupt is sent to the kernel layer, and the kernel layer processes the touch operation into a raw input event, which includes, for example, information such as touch coordinates and a timestamp of the touch operation. The raw input event is stored in the kernel layer, and the application framework layer obtains the raw input event from the kernel layer, identifies the control corresponding to the raw input event, and notifies the application (APP) corresponding to the control. For example, the above touch operation is an operation of clicking on the first control, and the APP corresponding to the first control is a call APP. The current call can be continued, and the display driver of the kernel layer is called through the API to cancel the display of the first window on the screen.

[0139] It should be understood that the above examples are merely example descriptions, and the embodiments of the present application are not limited thereto.

[0140] The following combination Figures 5 to 9 The method for preventing accidental touch according to an embodiment of the present application is described.

[0141] refer to Figure 5 , Figure 5 FIG. 4 is a schematic flow chart of a method 400 for preventing accidental touches according to an embodiment of the present application. It can be understood that Figure 5The proximity sensor involved in the description is only an exemplary description, and the present application is not limited thereto. It is understood that the proximity sensor can also be replaced by a sensor with the same function. The method can be applied to Figure 1 The method 400 includes:

[0142] Step 401, in response to detecting that a user answers an incoming call, a conversation is made with a terminal on the calling side, or in response to detecting that an outgoing call is connected, a conversation is made with a terminal on the called side.

[0143] That is to say, when a user uses an electronic device to make a call, the call can be made by the user answering an incoming call, or by the user making an outgoing call and the called party terminal answering the call. In other words, no matter whether the electronic device is on the host side or the called party side, as long as the user uses the electronic device to make a call, the method for preventing accidental touches in the embodiments of the present application is applicable.

[0144] During a call, the distance between the user's head and the electronic device can be detected in real time.

[0145] Step 402: When the user makes the call, a first distance is obtained, where the first distance is used to characterize the distance between the electronic device and the user's head, wherein the first distance is less than a first distance threshold.

[0146] Optionally, acquiring the first distance includes: detecting the first distance through a proximity sensor. That is, when the user uses the electronic device to make a call, the proximity sensor detects the distance between the user's head and the electronic device in real time.

[0147] After obtaining the first distance, the embodiment of the present application determines the relationship between the first distance and the set distance threshold. If the first distance is less than the first distance threshold, when the user's operation of hanging up the current call is detected, a pop-up window will be used to remind the user to confirm whether the user really needs to end the call.

[0148] The first distance threshold is a set distance threshold. The specific value of the first distance threshold can be determined according to actual needs. The embodiment of the present application does not specifically limit the value of the first distance threshold. Exemplarily, the first distance threshold is 21 cm.

[0149] Step 403: Detect a first operation of the user, where the first operation is used to hang up the current call.

[0150] The first operation may be understood as an erroneous operation by the user, which may cause the current call to be hung up.

[0151] Optionally, the first operation is an operation of clicking a hang-up button.

[0152] For example, in some possible implementations, the first operation is an accidental touch. Figure 6 The hang-up button 602 shown in (2) in FIG. 1 is used, or the first operation is an accidental touch. Figure 8 The hang-up button 802 shown in (2) .

[0153] Alternatively, the first operation is the operation of pressing the power button. It is understandable that in the case where the first operation is the operation of pressing the power button, the user can pre-set a switch option to turn on "press the power button to end the call".

[0154] For example, in some possible implementations, the first operation is to accidentally press Figure 6 The power key 601 shown in (2) in the figure, or the first operation is to press the power key 601 by mistake. Figure 8 The power button 801 shown in (2).

[0155] Step 404, in response to the first operation, displaying a call interface, the call interface including a first window, the first window being used to prompt the user whether to end the current call, the first window including a first control and a second control.

[0156] The first window can be understood as a pop-up window for reminding the user whether to end the current call. Exemplarily, the first window can display the text "Do you want to end the call?"

[0157] In addition, the first window may include a first control and a second control so that the user can confirm whether the current call really needs to be ended. The first control is a control for continuing the current call. The second control is a control for ending the current call.

[0158] In some possible implementations, the first window may be Figure 6 Window 603 shown in (3), or, Figure 8 Window 803 shown in (3).

[0159] Step 405-1, in response to detecting that the user clicks the first control, continuing the current call;

[0160] Alternatively, in step 405-2, in response to detecting that the user clicks on the second control, the current call is ended.

[0161] For example, in the first window, the first control is a "No" control. When the user clicks the first control, it indicates that the current call does not need to be ended. When the first control is clicked, it can be considered that the first operation is an erroneous operation, and the current call will continue, avoiding call interruption caused by an erroneous touch.

[0162] In some possible implementations, the first control may be Figure 6 The control 604 shown in (3) or Figure 7When the user clicks on the control 604, the current call continues, for example, the interface displays the following Figure 7 The interface shown in (2).

[0163] For example, in the first window, the second control is a "yes" control. When the user clicks the second control, the current call is ended. When the second control is clicked, it can be considered that the user really needs to end the current call, and the current call will be hung up.

[0164] In some possible implementations, the second control may be Figure 6 When the user clicks on the control 605, the current call ends. For example, the interface displays the following Figure 1 The interface shown in (3).

[0165] In an embodiment of the present application, when the electronic device is making a call, by detecting the first distance between the electronic device and the user's head, wherein the first distance is less than the first distance threshold, when the user's operation of hanging up the current call (such as the first operation) is detected, a first window is presented to the user to prompt the user whether to end the current call. Subsequently, based on the user's specific operation on the first window, a decision is made as to whether to end the current call. If the user clicks the first control in the first window, the current call continues. If the user clicks the second control in the first window, the current call ends. Compared to the solution in the prior art of directly hanging up the current call after detecting the user's erroneous operation of hanging up the current call, the anti-mistouch method of the embodiment of the present application will not end the call immediately after detecting the user's erroneous operation of hanging up the current call, but will provide a pop-up window to the user for the user to choose whether to really end the call, thereby reducing the probability of call interruption due to erroneous operation and improving the user's call experience.

[0166] In the embodiment of the present application, in addition to reminding the user through a pop-up window, the user can also be reminded to pay attention to the content of the pop-up window in a further manner to assist the user in choosing whether it is really necessary to end the call.

[0167] Optionally, in a possible implementation, while the call interface displays the first window, the method 400 further includes:

[0168] Sending a prompt tone to the user, wherein the prompt tone is used to remind the user to check the first window; and / or,

[0169] A vibration event is triggered, where the vibration event is used to remind the user to check the first window.

[0170] The reminder tone is a sound or audio used to remind the user to check the first window. The reminder tone can be similar to other notification sounds.

[0171] Exemplarily, when the first window pops up in the electronic device, a prompt sound may be emitted to remind the user to pay attention to the first window to choose whether to end the current call.

[0172] The embodiment of the present application does not specifically limit the specific content or sound effect of the prompt tone. The prompt tone can be set by the user or by the system default.

[0173] Optionally, the vibration event can be implemented by calling a vibration component. For example, the vibration component is a motor.

[0174] Exemplarily, when the first window pops up in the electronic device, a vibration event may be invoked to remind the user to pay attention to the first window to choose whether to end the current call.

[0175] The specific implementation method of providing a prompt sound or a vibration event can also be determined in combination with the ambient illumination of the external environment. If it is daytime, a prompt sound is used to remind the user to pay attention to the pop-up window (i.e., the first window); if it is night, a vibration event (or a vibration event + a prompt sound) is used to remind the user to pay attention to the pop-up window.

[0176] Optionally, in a possible implementation, the method 400 further includes:

[0177] Get the ambient illumination value;

[0178] Wherein, the sending of a prompt sound to the user includes: if the ambient illumination value is greater than or equal to a first illumination threshold, sending a prompt sound to the user;

[0179] The triggering of the vibration event includes: if the ambient illumination value is less than the first illumination threshold, triggering the vibration event.

[0180] Exemplarily, if the ambient illumination value is greater than or equal to the first illumination threshold, it means that the external environment is daytime when the user is using the electronic device to make a call, and the user is reminded through a prompt sound so that the user pays attention to the first window.

[0181] Exemplarily, if the ambient illumination value is less than the first illumination threshold, it means that the external environment is night when the user is using the electronic device to make a call, and the user is reminded through a vibration event, or the user is reminded through a vibration event and a prompt sound at the same time, so that the user pays attention to the first window.

[0182] It should be understood that the above is to use the ambient illuminance value to represent whether the external environment is daytime or nighttime, and the embodiments of the present application are not limited thereto. In fact, other factors can also be used to represent the illuminance of the external environment.

[0183] To prevent the first window from being constantly displayed on the display screen of the electronic device, a first preset duration may be introduced to determine the display duration of the first window in the call interface. For example, after the user sees the first window, if the user neither clicks the first control nor the second control within the first preset duration, the first window will be cancelled.

[0184] Optionally, as a possible implementation manner, the operation of the user clicking the first control or the operation of the user clicking the second control is detected within a first preset time period.

[0185] Exemplarily, the user clicks the first control within the first preset time period to continue the current call; or the user clicks the second control within the first preset time period to end the current call.

[0186] Optionally, as a possible implementation manner, the method further includes:

[0187] If no user operation on the first control or the second control is detected within a first preset time period, the first window is cancelled and the call is continued.

[0188] For example, if the electronic device has not detected the user's selection within the first preset time length when the first window pops up, it means that the user has not performed any relevant operation on the first control or the second control, then the first window will no longer be displayed, that is, the presentation of the first window on the screen will be canceled, and the current call will continue. That is, if the user has not selected whether to end the call or continue the call, the call will be continued by default to avoid call interruption caused by accidental touch operation. In addition, by setting the first preset time length, the problem of power consumption waste caused by long-term presentation of the first window can also be avoided.

[0189] Optionally, the first preset duration may also be reflected in the first window as a time control (such as a timer control).

[0190] Exemplarily, the first window includes a countdown control. The countdown control can count down according to a first preset time. If the countdown ends and the user still does not operate the first control or the second control, the first window can be automatically hidden, that is, not displayed on the screen of the electronic device. In this way, the time control determined by the first preset time can provide the user with a more intuitive time experience.

[0191] It should be understood that the first preset duration is not specifically limited in the present embodiment. Those skilled in the art can select a reasonable value based on actual needs. For example, the first preset duration can be 4 seconds or other values.

[0192] It should also be understood that setting a countdown control in the first window is only an optional implementation method and does not limit the examples of this application. In other words, from the perspective of interface simplicity, the countdown control can also be omitted in the first window. The first window includes a "yes" control and a "no" control to achieve the basic function of reminding the user.

[0193] It should be noted that, in the embodiment of the present application, when the first distance is less than the first distance threshold, a first window will pop up to remind the user to choose whether to end the call. When the first distance is greater than or equal to the first distance threshold, the screen of the electronic device turns on. Moreover, by default, when the first distance is greater than or equal to the first distance threshold, the user can make a correct judgment (or a real judgment) on whether to end the call, so there will be no accidental touch or erroneous operation.

[0194] For example, in the case where the first distance is greater than or equal to 21 cm, it is assumed that the user can make a correct judgment on whether to end the call.

[0195] When the first distance is less than the first distance threshold, the embodiment of the present application further introduces a second distance threshold for further judgment. The second distance threshold is a value smaller than the first distance threshold.

[0196] Optionally, as a possible implementation manner, before detecting the first operation, the method 400 further includes:

[0197] Determining whether the first distance is less than a second distance threshold, wherein the second distance threshold is less than the first distance threshold;

[0198] When the first distance is less than or equal to the second distance threshold, the electronic device performs screen-off processing;

[0199] When the first distance is greater than the second distance threshold and less than the first distance threshold, screen lighting processing is performed.

[0200] The embodiment of the present application introduces a second distance threshold and a first distance threshold to change the screen state (screen on or off). When the first distance is less than or equal to the second distance threshold, the electronic device turns off the screen; when the first distance is greater than the second distance threshold and less than the first distance threshold, the electronic device turns on the screen. In both scenarios, if the first operation is detected, a pop-up window reminder is provided to the user for the user to choose whether to really end the call.

[0201] Taking the second distance threshold of 6cm and the first distance threshold of 21cm as an example: when the first distance is detected to be less than or equal to 6cm, it means that the mobile phone is relatively close to the user's head during the call, and the screen of the mobile phone is turned off; when the first distance is detected to be greater than 6cm and less than 21cm, it means that the user may have moved the mobile phone away from the head for some distance (and the distance between the mobile phone and the head exceeds 6cm) during the call, and the screen of the mobile phone is turned on.

[0202] Further, optionally, in the case where the first distance is less than or equal to the second distance threshold, before detecting the first operation, the method 400 further includes:

[0203] A second user operation is detected;

[0204] In response to the second operation, screen lightening processing is performed.

[0205] The second operation refers to an operation that triggers the electronic device to turn on the screen. For example, the second operation is an operation in which the user presses the power button.

[0206] Still taking the second distance threshold of 6cm as an example, when it is detected that the first distance is less than or equal to 6cm, it means that the mobile phone is close to the user's head during a call, and the screen of the mobile phone is turned off; further, after detecting that the user presses the power button, the screen is changed from off to on.

[0207] Optionally, when the first distance is less than or equal to the second distance threshold, the method further includes:

[0208] If the first operation is not detected within the second preset time period, the screen is turned off.

[0209] It should be understood that the embodiment of the present application does not limit the specific value of the second preset time length, and the value can be determined based on actual needs. For example, the second preset time length can be 6 seconds.

[0210] Therefore, for the scenario where the first distance is less than or equal to the second distance threshold, if the first operation has not been detected within the second preset time period, the electronic device turns off the screen to avoid wasting power by keeping the screen on.

[0211] The following combination Figure 6 Describes a situation where the first distance is less than or equal to the second distance threshold.

[0212] Figure 6 This is an example interface diagram of an embodiment of the present application. Figure 6 As shown, when a user is using a mobile phone to make a call, if it is detected that the first distance is less than the second distance threshold, the mobile phone screen is turned off. For example, the mobile phone displays the following Figure 6 The interface shown in (1).

[0213] In a possible implementation, when the user presses the power button, the screen of the mobile phone turns on. For example, when the user presses the power button 601 by mistake (corresponding to the second operation above), the screen of the mobile phone turns on. For example, the mobile phone displays the following Figure 6 The interface shown in (2) is shown in the figure. Figure 6 As shown in (2), the current call interface is displayed in the mobile phone interface. For example, the user is calling the customer service hotline and the call duration is 45 seconds.

[0214] In a possible implementation, when the user presses the power button or the hang-up button (or the hang-up button, the hang-up control, etc.), the mobile phone pops up a first window, and the first window includes a "yes" control and a "no" control.

[0215] For example, the user accidentally touches Figure 6 After the hang-up button 602 (corresponding to the first operation) shown in (2) is pressed, or the power button 601 (corresponding to the first operation) is pressed by mistake, the interface displays as follows Figure 6 The interface shown in (3) is shown in the figure. Figure 6 As shown in (3), a window 603 (corresponding to the first window) is displayed in the call interface, and the window 603 is used to remind the user to choose whether to end the current call. The window 603 includes a "No" control 604 (corresponding to the first control) and a "Yes" control 605 (corresponding to the second control). If the user clicks the "No" control 604, the current call continues; if the user clicks the "Yes" control 605, the current call ends. Figure 7 Describe the interface after the user clicks "No".

[0216] Figure 7 An example of an interface in which a user clicks “No” is shown. Figure 7 As shown in (1), the user clicks the "No" control 604 in the window 603, and the interface displays as follows Figure 7 As shown in (2). Figure 7 In the interface shown in (2), the mobile phone continues the current call, for example, the current call time is displayed as 1 minute.

[0217] In some possible implementations, when the first distance is less than or equal to the second distance threshold, after the user chooses to continue the current call, if the user does not perform any further operations within the third preset time, the mobile phone enters the screen-off state to save power consumption of the mobile phone. It should be understood that the embodiment of the present application does not limit the specific value of the third preset time, which can be selected based on actual needs. For example, the third preset time can be 4 seconds.

[0218] For example, if the user Figure 7 If there is no further operation in the interface shown in (2), the mobile phone automatically turns off the screen after the third preset time. That is, the mobile phone screen status is Figure 7 As shown in (3).

[0219] certainly, Figure 7 The screen turning off shown in (3) is an example for the case where the first distance is less than or equal to the second distance threshold. For the case where the first distance is greater than the second distance threshold and less than the first distance threshold, the mobile phone can continue to keep the screen on.

[0220] The following combination Figure 8 The example in describes a case where the first distance is greater than the second distance threshold and less than the first distance threshold.

[0221] Figure 8 is another example interface diagram of the embodiment of the present application. Figure 8 As shown, when the user is using the mobile phone to make a call, if it is detected that the first distance is less than the second distance threshold, the mobile phone screen is turned off. For example, the mobile phone displays the following Figure 8 The interface shown in (1).

[0222] When the user is talking on the phone, the phone may be moved, causing the first distance to change. If it is detected that the first distance is greater than the second distance threshold and less than the first distance threshold, the phone screen turns on, for example, the phone displays Figure 8 The interface shown in (2) is shown in the figure. Figure 8 In the interface shown in , the current call interface includes a hang-up button 802.

[0223] In a possible implementation, when the user presses the power button or the hang-up button, the mobile phone pops up a first window, which includes a "yes" control and a "no" control.

[0224] For example, the user accidentally touches Figure 8 After the hang-up button 802 (corresponding to the first operation) shown in (2) is pressed, or the power button 801 (corresponding to the first operation) is pressed by mistake, the interface displays as follows Figure 8 The interface shown in (3) is shown in the figure. Figure 8 As shown in (3), a window 803 (corresponding to the first window) is displayed in the call interface, and the window 803 is used to remind the user to choose whether to end the current call. The window 803 includes a "No" control 804 (corresponding to the first control) and a "Yes" control 805 (corresponding to the second control). If the user clicks the "No" control 804, the current call continues and the window 803 interface is canceled, that is, the mobile phone interface can continue to display the following Figure 8 The interface shown in (2); if the user clicks the "Yes" control 805, the current call ends.

[0225] Fig. 9 A logic example diagram of the method for preventing accidental touches according to an embodiment of the present application is shown. Fig. 9For some of the terms or concepts involved in the description, please refer to the previous description and will not be repeated below. Fig. 9 As shown, including:

[0226] Step 0: The call starts.

[0227] Step 1: Get the first distance.

[0228] The description of the first distance can refer to the above description, and will not be repeated here for the sake of brevity.

[0229] Step 2A, determining whether the first distance is less than or equal to a second distance threshold.

[0230] If the first distance is greater than the second distance threshold, then execute step 2B. If the first distance is less than or equal to the second distance threshold, then execute step 3A, that is, turn off the screen.

[0231] The description of the second distance threshold can refer to the above description, and will not be repeated here for the sake of brevity.

[0232] Step 3A, turn off the screen of the electronic device.

[0233] Exemplarily, if the first distance is less than 6 cm, the screen of the electronic device is turned off.

[0234] Step 4A, detecting a second operation.

[0235] For example, the second operation is that the user presses the power button.

[0236] Step 5A: The screen of the electronic device lights up and a prompt sound is emitted.

[0237] That is, after the user presses the power button, the screen of the electronic device lights up and is accompanied by a prompt sound, wherein the prompt sound may be optional.

[0238] Step 6A, determining whether there is any operation within the second preset time period.

[0239] If an operation is detected within the second preset time period, for example, the first operation is detected. If the first operation is not detected within the second preset time period, step 12A is performed, that is, the screen is turned off.

[0240] Step 7A, detecting a first operation.

[0241] For example, the first operation is to press the power button or click the hang-up button.

[0242] Step 8A: a pop-up window is displayed to remind the user whether to end the current call.

[0243] The pop-up window can correspond to the first window in the previous text, for example, Figure 6The pop-up window includes a "yes" control and a "no" control. If the user clicks the "yes" control, step 9A is executed, i.e., the current call is ended. If the user clicks the "no" control, step 10A is executed, i.e., the pop-up window is canceled and the current call is continued.

[0244] Step 9A, end the call.

[0245] Step 10A, cancel the pop-up window.

[0246] Optionally, if the user clicks the "yes" control or the "no" control within the first preset time period, if the user does not perform any operation on the pop-up window after the first preset time period has expired, such as not clicking the "yes" control or the "no" control, then step 10A is also performed, i.e., the pop-up window is canceled and the current call is continued by default.

[0247] After the pop-up window is canceled, you can continue to determine whether there are further operations.

[0248] Step 11A, determining whether there is any operation within a third preset time period.

[0249] If no user operation is detected within the third preset time, step 12A is executed, that is, the mobile phone screen is turned off. If the user operation is detected within the third preset time, the electronic device will not turn off the screen, and will respond accordingly based on the user operation.

[0250] Step 12A, the electronic device turns off the screen.

[0251] The above steps 2A to 12A describe the relevant implementation method in the scenario where the first distance is less than or equal to the second distance threshold.

[0252] Step 2B, determining whether the first distance is greater than the second distance threshold and less than the first distance threshold.

[0253] If the first distance is greater than the second distance threshold and less than the first distance threshold, step 3B is executed, that is, the electronic device turns on the screen. If the first distance is greater than or equal to the first distance threshold, step 3C is executed.

[0254] Step 3B, the electronic device turns on the screen.

[0255] Step 4B, detecting a first operation.

[0256] The description of the first operation can be found in the previous text and will not be repeated here.

[0257] Step 5B: prompt the user through a pop-up window whether to end the current call.

[0258] For a detailed description of step 5B, please refer to the description of step 8A above. If the user clicks the "Yes" control, step 6B is executed, that is, the current call is ended. If the user clicks the "No" control in the pop-up window, step 7B is executed, that is, the pop-up window is canceled and the current call is continued.

[0259] Step 6B, end the call.

[0260] Step 7B, cancel the pop-up window.

[0261] Similarly, if the user clicks the "yes" control or the "no" control within the first preset time period, if the user does not perform any operation on the pop-up window after the first preset time period has expired, such as not clicking the "yes" control or the "no" control, then step 7B is also executed, i.e., the pop-up window is canceled and the current call is continued by default.

[0262] After the pop-up window is canceled, you can continue to determine whether there are further operations.

[0263] The above steps 2B to 7B describe the relevant implementation method in the scenario where the first distance is greater than the second distance threshold and less than the first distance threshold.

[0264] Step 3C: the electronic device turns on the screen.

[0265] That is, if the first distance is greater than or equal to the first distance threshold, it is considered that the user can make a correct judgment on whether to end the current call in this scenario without making an accidental touch.

[0266] The following will Fig.10 The specific implementation process shown in Fig. 9 Further explanation is given. It should be understood that Fig. 9 and Fig.10 Can be implemented in combination. When implemented in combination, Fig.10 Steps 911 to 916 in can be replaced by Fig. 9 Steps 1 to 3C in the above procedure can be used to obtain a specific anti-touch solution. Fig.10 The specific implementation process is described in .

[0267] Step 900, the call starts.

[0268] Step 901, check and update audio.

[0269] Exemplarily, the update audio is checked through the HwAudioService module.

[0270] Step 902, setting the client communication route.

[0271] Exemplarily, the client communication route is set through the AudioDeviceBroker module.

[0272] Step 903: Create a sensor management object and check permissions.

[0273] Exemplarily, a sensor management object is created through the IServiceManager module, and permissions are checked.

[0274] Step 904: Start the sensor service application.

[0275] Exemplarily, the sensor service application is called up through the Sensor Service module.

[0276] Step 905: Obtain sensor manager service.

[0277] Exemplarily, the sensor manager service is obtained through the StartActivity module.

[0278] Step 906: Create an instance of the proximity sensor and initialize the proximity sensor.

[0279] Exemplarily, an instance of the proximity sensor is created through the FragmentWithPreview module, and the proximity sensor is initialized.

[0280] Step 907: Obtain an instance of the sensor service, and use the instance of the sensor service.

[0281] Exemplarily, the instance of the sensor is obtained through the SystemStateHelper module, and the instance of the sensor service is used.

[0282] Step 908: register a listener for the sensor.

[0283] Exemplarily, a listener is registered for the sensor through the SystemStateHelper module.

[0284] For example, you can register a listener for a proximity sensor to detect changes in the distance between the electronic device and the user's head. For another example, you can register a listener for a proximity light sensor to detect changes in light intensity.

[0285] Step 909, obtaining the change of sensor accuracy.

[0286] For example, the change in sensor accuracy includes: a change in the distance value detected by the proximity sensor.

[0287] Exemplarily, the change in sensor accuracy is obtained through the SystemStateHelper module.

[0288] Step 910, obtaining the change of the sensor light intensity.

[0289] Exemplarily, the change of the sensor light intensity is obtained through the SystemStateHelper module.

[0290] Step 911, processing proximity sensor events.

[0291] Exemplarily, the proximity sensor event is processed through the DisplayPoewrController module.

[0292] Step 912: The sensor starts reporting.

[0293] Reporting a point can be understood as reporting the detected value. For example, a proximity sensor reports the detected distance value to the upper layer.

[0294] Exemplarily, through the Proximity module, the sensor starts reporting.

[0295] Step 913: If the distance is short, then send a broadcast. In some embodiments, the short distance means that the first distance is less than or equal to the second distance threshold.

[0296] Exemplarily, through the HwDisplayPoewrControllerEx module, a broadcast is sent if the distance is close.

[0297] Step 914, release the new proximity sensor reading.

[0298] Exemplarily, new proximity sensor readings are released through the DisplayPoewrController module.

[0299] Step 915, deregister the listener.

[0300] Exemplarily, the listener is unregistered through the AppRTCProximitySensor module.

[0301] Step 916, sending screen status.

[0302] Exemplarily, the screen status is sent by calling a function through the DisplayPoewrController module.

[0303] Step 917, start the power manager.

[0304] Exemplarily, the power manager is called up through the PowerManagerService module.

[0305] Step 918, update the screen status.

[0306] Exemplarily, the screen status is updated through the PowerManagerService module.

[0307] Step 919, detect timeout.

[0308] Exemplarily, the timeout is detected through the PowerManagerService module.

[0309] Step 920: asynchronously update the display power status.

[0310] Exemplarily, the power status is displayed by asynchronously updating through the PowerManagerService module.

[0311] Step 921, end the call.

[0312] It should be understood that Fig.10 The modules involved are merely exemplary descriptions, and the embodiments of the present application are not limited thereto.

[0313] Combination of the above Figures 1 to 10 , describes in detail the method for preventing accidental touches provided by the embodiments of the present application. Fig.11 It should be understood that the device for preventing accidental touches in the embodiments of the present application can execute the method for preventing accidental touches in the embodiments of the present application, that is, the specific working processes of the following various products can refer to the corresponding processes in the embodiments of the methods.

[0314] Fig.11 FIG. 1 is a schematic block diagram of an apparatus 1000 for preventing accidental touches according to an embodiment of the present application. It should be understood that the apparatus 1000 may execute Figures 5 to 9 The method of preventing accidental touch is shown.

[0315] like Fig.11 As shown, the device 1000 includes: an input unit 1010 , a processing unit 1020 and a display unit 1030 .

[0316] In a possible implementation, the input unit 1010 is used to make a call with the calling terminal in response to detecting that the user answers an incoming call, or to make a call with the called terminal in response to detecting that the outgoing call is connected;

[0317] The processing unit 1020 is used to obtain a first distance when the user makes the call, where the first distance is used to represent the distance between the electronic device and the user's head, wherein the first distance is less than a first distance threshold;

[0318] The input unit 1010 is also used to detect a first operation of the user, where the first operation is used to hang up the current call;

[0319] The display unit 1030 is used to display a first window in response to the first operation, where the first window is used to prompt the user whether to end the current call, and the first window includes a first control and a second control;

[0320] The processing unit 1020 is further configured to continue the call in response to detecting that the user clicks on the first control; or end the call in response to detecting that the user clicks on the second control.

[0321] Optionally, as a possible embodiment, the processing unit 1020 is also used to issue a prompt sound to the user while displaying the first window on the call interface, and the prompt sound is used to remind the user to view the first window; and / or trigger a vibration event, and the vibration event is used to remind the user to view the first window.

[0322] Optionally, as a possible embodiment, the processing unit 1020 is also used to obtain the ambient illumination value; if the ambient illumination value is greater than or equal to a first illumination threshold, a prompt sound is issued to the user; if the ambient illumination value is less than the first illumination threshold, the vibration event is triggered.

[0323] Optionally, as a possible embodiment, the operation of the user clicking the first control or the operation of the user clicking the second control is detected within a first preset time period.

[0324] Optionally, as a possible embodiment, the processing unit 1020 is also used to cancel the first window displayed in the display unit 1030 and continue the call if no user operation on the first control or the second control is detected within a first preset time period.

[0325] Optionally, as a possible embodiment, the processing unit 1020 is also used to determine whether the first distance is less than a second distance threshold before detecting the first operation, wherein the second distance threshold is less than the first distance threshold; when the first distance is less than or equal to the second distance threshold, the screen is turned off; when the first distance is greater than the second distance threshold and less than the first distance threshold, the screen is turned on.

[0326] Optionally, as a possible embodiment, the input unit 1010 is further configured to detect a second operation of the user before detecting the first operation when the first distance is less than or equal to the second distance threshold;

[0327] The processing unit 1020 is further configured to perform screen light processing in response to the second operation.

[0328] Optionally, as a possible embodiment, the processing unit 1020 is also used to turn off the screen if the first operation has not been detected within a second preset time period.

[0329] Optionally, as a possible embodiment, the first operation is an operation of pressing a power button, or an operation of clicking a hang-up button.

[0330] In a possible example, the input unit 1010 and the processing unit 1020 may be implemented by a processor or a processing unit. The display unit 1030 may be implemented by a display screen. It should be understood that the above-mentioned device 1000 is embodied in the form of a functional unit. The term "unit" here may be implemented in the form of software and / or hardware, and the embodiments of the present application do not specifically limit this.

[0331] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two to implement the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) that executes one or more software or firmware programs and a memory, an integrated logic circuit, and / or other suitable devices that can provide the above functions. In a simple embodiment, a person skilled in the art can imagine that the device 1000 can be used Figure 3 The form shown.

[0332] From the above, it can be seen that the method for preventing accidental touches provided by the present application detects the distance between the electronic device and the user's head during a call using an electronic device, and when it detects the user's operation of hanging up the current call, a pop-up window is displayed in the interface to remind the user whether he really needs to end the call, thereby avoiding the problem of call interruption caused by accidental operation and greatly improving the user's calling experience.

[0333] The present application also provides a computer program product, which, when executed by a processor, implements the method described in any method embodiment of the present application.

[0334] The computer program product can be stored in a memory, and is finally converted into an executable target file that can be executed by a processor after preprocessing, compiling, assembling and linking.

[0335] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.

[0336] The computer-readable storage medium may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM).

[0337] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described devices and equipment and the technical effects produced can refer to the corresponding processes and technical effects in the aforementioned method embodiments, and will not be repeated here.

[0338] In several embodiments provided in the present application, the disclosed systems, devices and methods can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not performed. The device embodiments described above are merely schematic, and the division of units is only a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.

[0339] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0340] In addition, the terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0341] The terms (or numbers) "first", "second", ..., etc. that appear in the embodiments of the present application are only used for descriptive purposes, that is, only to distinguish different objects, such as different "distance thresholds", etc., and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first", "second", ..., etc. may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, "at least one (item)" refers to one or more. "Multiple" means two or more. "At least one of the following (items)" or similar expressions thereof refers to any combination of these items, including any combination of a single (item) or a plurality of (items).

[0342] For example, the meaning of the expression similar to "the item includes at least one of the following: A, B, and C" in the embodiments of the present application, unless otherwise specified, generally means that the item can be any one of the following: A; B; C; A and B; A and C; B and C; A, B and C; A and A; A, A and A; A, A and B; A, A and C, A, B and B; A, C and C; B and B, B, B and B, B, B and C, C and C; C, C and C, and other combinations of A, B and C. The above is an example of three elements, A, B and C, to illustrate the optional items of the item. When it is expressed as "the item includes at least one of the following: A, B, ..., and X", that is, when there are more elements in the expression, the items that can be applied to the item can also be obtained according to the above rules.

[0343] In short, the above is only a preferred embodiment of the technical solution of this application, and is not intended to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application should be included in the protection scope of this application.

Claims

1. A method for preventing accidental touches, It is characterized in that The method is applied to an electronic device, and the method comprises: In response to detecting that the user answers the incoming call, a call is made with the calling terminal, or in response to detecting that the outgoing call is connected, a call is made with the called terminal; When the user makes the call, a first distance is detected in real time by a proximity sensor, where the first distance is used to represent the distance between the electronic device and the user's head; wherein the first distance is detected in real time by the proximity sensor, including: creating a proximity sensor instance and initializing it, registering a listener for the proximity sensor, where the listener is used to obtain the first distance; and the proximity sensor reports the first distance to the view system of the framework layer; Detecting a first operation of the user, where the first operation is used to hang up the current call; In response to the first operation, when the first distance is less than a first distance threshold, displaying a first window, the first window being used to prompt the user whether to end the current call, the first window comprising a first control and a second control; In response to detecting that the user clicks the first control, continuing the call; Alternatively, in response to detecting that the user clicks on the second control, ending the call; The method further comprises: Acquire the ambient illumination value through the monitor; while displaying the first window on the call interface, If the ambient illumination value is greater than or equal to the first illumination threshold, a prompt sound is issued to the user, wherein the prompt sound is used to remind the user to check the first window; and / or, If the ambient illumination value is less than the first illumination threshold, a vibration event is triggered, and the vibration event is used to remind the user to check the first window; The operation of the user clicking the first control or the operation of the user clicking the second control is detected within a first preset time period; The method further comprises: If no user operation on the first control or the second control is detected within a first preset time period, canceling the first window and continuing the call; Before detecting the first operation, the method further includes: determining whether the first distance is less than a second distance threshold, wherein the second distance threshold is less than the first distance threshold; When the first distance is less than or equal to the second distance threshold, performing screen off processing; When the first distance is greater than the second distance threshold and less than the first distance threshold, screen lighting processing is performed.

2. The method according to claim 1, It is characterized in that When the first distance is less than or equal to the second distance threshold, before detecting the first operation, the method further includes: Detecting a second operation of the user; In response to the second operation, screen lightening processing is performed.

3. The method according to claim 1, It is characterized in that The method further comprises: If the first operation is not detected within the second preset time period, the screen is turned off.

4. The method according to claim 1, It is characterized in that The first operation is an operation of pressing a power button, or an operation of clicking a hang-up button.

5. An electronic device, It is characterized in that The electronic device comprises a processor and a memory, wherein the processor and the memory are coupled, and the memory is used to store a computer program. When the computer program is executed by the processor, the electronic device executes the method according to any one of claims 1 to 4.

6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor calls instructions so that the electronic device executes the method according to any one of claims 1 to 4.

7. A chip, It is characterized in that The chip is applied to an electronic device, and the chip includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the method as claimed in any one of claims 1 to 4.