| CPC H04M 1/724631 (2022.02) [G06F 1/1694 (2013.01); G06F 3/0346 (2013.01); G06F 3/0412 (2013.01); H04M 1/72454 (2021.01)] | 19 Claims |

|
1. A method for preventing an accidental touch, comprising:
obtaining a quaternion of a terminal by using an acceleration sensor and a gyro sensor, wherein the quaternion is used to represent an attitude of the terminal;
determining first information and attitude angle information of the terminal based on the quaternion of the terminal, wherein the first information is used to identify whether the terminal is in a head-down state, and the attitude angle information is used to identify an attitude of the terminal;
detecting motion information of the terminal by using the acceleration sensor, wherein the motion information is used to identify a motion status of the terminal;
detecting ambient light information of the terminal by using an ambient light sensor, wherein the ambient light information is used to identify light intensity of an environment in which the terminal is located;
determining, based on the first information, the attitude angle information, the motion information, and the ambient light information, that the terminal is in a first mode, wherein the first mode is used to identify that status information of the terminal meets a corresponding preset condition of the terminal; and
entering, by the terminal, a screen-off state.
|