Screen display mode control method, electronic device and storage medium
By maintaining a preset application list on the electronic device and adjusting the screen display mode according to the user's face tilt angle, the problem that the screen display mode in the prior art does not meet user expectations is solved, improving the user experience and maintaining compatibility.
Patent Information
- Application Number
- CN202311793071.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2043-12-22
AI Technical Summary
Electronic devices in existing Android systems cannot flexibly adjust the screen display mode according to the user's actual perspective and needs, resulting in the screen display mode not meeting users' expectations and habits, affecting the user experience.
The preset application list is pre-stored and maintained on the electronic device. When the application is in the preset application list, the screen display mode is controlled according to the tilt angle of the user's face relative to the electronic device, rather than directly based on the accelerometer data.
By adjusting the screen display mode to match the user's expectations and habits, the user's user experience is improved, and no third-party applications need to modify the code, which has good practicality and compatibility.
Smart Images

Figure CN118444868B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a method for controlling a screen display mode, an electronic device, and a storage medium. Background Art
[0002] At present, electronic devices such as mobile phones and tablet computers using the Android system are generally equipped with accelerometers, and the Android system also provides a direction monitoring interface. Applications (applications, APPs) running on the Android system can monitor the posture changes of electronic devices, that is, the rotation angle of the electronic device relative to the ground plane, by calling the direction monitoring interface, and then combine the APP's own screen rotation logic and the screen display mode set by the user (such as automatic rotation, locking the vertical screen or locking the horizontal screen, etc.) to decide whether to trigger the change of the screen display mode to adapt to different usage scenarios and user needs.
[0003] However, since the interface can only decide whether to trigger a change in the screen display mode based on the current rotation angle and direction of the electronic device and the screen display mode set by the user, and cannot flexibly adjust the screen display mode based on the user's actual viewing angle and needs, this may cause the screen display mode to not meet the user's expectations and habits, thereby affecting the user's experience. For example, after the user sets the screen display mode of the electronic device to automatic rotation, the user wants the screen to be displayed in a horizontal direction when lying on his side, but the screen display mode of the electronic device often automatically switches to a vertical direction, which fails to meet the user's expectations. Summary of the invention
[0004] In order to solve the above problems, the present application provides a method for controlling a screen display mode, an electronic device and a storage medium, which can make the screen display mode meet the user's expectations and habits and improve the user's usage experience.
[0005] In a first aspect, the present application provides a method for controlling a screen display mode, the method comprising:
[0006] Determine whether the application currently calling the direction monitoring interface is in the preset application list. When the direction monitoring interface is called by the application, the rotation angle of the electronic device is provided to the application. Each application in the preset application list obtains the rotation angle of the electronic device through the direction monitoring interface. When the application is in the preset application list, determine the tilt angle of the user's face relative to the electronic device; and control the electronic device to be in the first screen display mode according to the tilt angle.
[0007] The solution provided by the present application is to pre-store and maintain a preset application list on the electronic device, and the preset application list includes one or more applications. The common point of these applications is that they all obtain the rotation angle of the electronic device through the direction monitoring interface, that is, the listener of the direction monitoring interface is registered. When the electronic device determines that the application currently calling the direction monitoring interface is in the preset application list, it is no longer directly determined based on the accelerometer data, but the screen display mode of the electronic device is controlled based on the tilt angle of the user's face relative to the electronic device, thereby avoiding the determined screen display mode from being inconsistent with the user's expectations and habits. Therefore, the solution of the present application improves the user's experience.
[0008] In addition, in the present application solution, the screen display mode decision strategy of the electronic device can be adapted without the need for the third-party application to modify its own application code, so it has good practicality and compatibility.
[0009] In a possible implementation, determining whether the application currently calling the direction listening interface is in a preset application list specifically includes:
[0010] When the application calls the direction monitoring interface, the package name of the application is obtained;
[0011] When the package name of the application program matches the corresponding package names of the various application programs included in the preset application program list, it is determined that the application program is in the preset application program list.
[0012] In a possible implementation, the electronic device includes a front camera, and determining the tilt angle of the user's face relative to the electronic device specifically includes:
[0013] Get the shooting data of the front camera;
[0014] The tilt angle of the user's face relative to the electronic device is determined according to the photographing data.
[0015] The front camera can obtain 2D facial image data. The electronic device combines the face orientation algorithm to determine the 2D face orientation, that is, to determine the tilt angle of the face relative to the electronic device. The tilt angle is used by the electronic device to decide the screen display mode.
[0016] In a possible implementation, the electronic device includes a time-of-flight (ToF) device, and determining a tilt angle of a user's face relative to the electronic device specifically includes:
[0017] Acquire 3D facial data of the user using a ToF device;
[0018] The tilt angle of the user's face relative to the electronic device is determined based on the 3D face data.
[0019] ToF devices can acquire 3D facial data and are not affected by the illumination value of the environment in which the electronic device is located.
[0020] In one possible implementation, the electronic device includes a time-of-flight ToF device and a front camera, and determines the tilt angle of the user's face relative to the electronic device, specifically including: determining the illumination value of the environment in which the electronic device is currently located; when the illumination is greater than or equal to a preset illumination value, obtaining shooting data of the front camera, and determining the tilt angle of the user's face relative to the electronic device based on the shooting data. At this time, under high illumination conditions, 2D face image data is obtained through the front camera with lower power consumption, and the ToF device is not used, which can reduce the power consumption of the device; when the illumination is less than the preset illumination value, the ToF device is used to obtain the user's 3D face data, and the tilt angle of the user's face relative to the electronic device is determined based on the 3D face data.
[0021] In a possible implementation, controlling the electronic device to be in the first screen display mode according to the tilt angle specifically includes:
[0022] Determining an equivalent rotation angle of the electronic device according to the tilt angle;
[0023] The equivalent rotation angle of the electronic device is used as data provided to the application by the direction monitoring interface to control the electronic device to adopt the first screen display mode.
[0024] In this implementation, the determined equivalent rotation angle is used as the output of the direction monitoring interface. At this time, the rotation angle output by the direction monitoring interface is no longer the rotation angle directly determined according to the accelerometer data.
[0025] In a possible implementation, controlling the electronic device to be in the first screen display mode according to the tilt angle specifically includes:
[0026] Generate equivalent accelerometer data corresponding to the tilt angle; replace the accelerometer data obtained by the direction monitoring interface with the equivalent accelerometer data, so that the direction monitoring interface generates the rotation angle of the electronic device corresponding to the first screen display mode according to the equivalent accelerometer data and sends it to the application to control the electronic device to adopt the first screen display mode.
[0027] In this implementation, the electronic device determines the equivalent accelerometer data corresponding to the tilt angle, and uses the equivalent accelerometer data as the input data of the direction monitoring interface, replacing the accelerometer data, so that the direction monitoring interface determines the rotation angle corresponding to the first screen display mode based on the input data, and sends the rotation angle to the application.
[0028] In a possible implementation, the method further includes: when the tilt angle of the user's face relative to the electronic device is not acquired, determining an equivalent rotation angle of the electronic device according to the accelerometer data;
[0029] The equivalent rotation angle of the electronic device is used as data provided to the application by the direction monitoring interface to control the electronic device to be in the second screen display mode.
[0030] In a possible implementation, the method further includes:
[0031] Update the default application list.
[0032] By updating the preset application list, when an exception occurs in the application selection screen display mode, the application can be deleted from the preset application list, or a new application that needs to use the control method of the screen display mode of the present application can be added.
[0033] In a possible implementation, updating the preset application list specifically includes:
[0034] Receive update data sent by the server;
[0035] Update the list of preset applications according to the updated data.
[0036] In this implementation, the preset application list is updated using the cloud push capability of the server.
[0037] In a possible implementation, updating the preset application list specifically includes:
[0038] When the first application registers a listener of the direction monitoring interface, the identification of the first application is displayed on the setting interface of the electronic device;
[0039] In response to a selection operation by the user, the first application is added to a preset application list.
[0040] In this implementation, all applications that have registered listeners for the direction monitoring interface can be listed in the settings interface of the electronic device. Users can add any application to the preset application list or delete any application from the preset application list according to their own needs, which has a high degree of autonomy. In addition, when the user finds that an application in the preset application list has an abnormality when selecting the screen display mode, the user can actively delete the abnormal application from the preset application list in a timely manner, which is more timely and does not rely on the cloud push capability of the server.
[0041] In a second aspect, the present application also provides an electronic device, which includes a processor and a memory, the memory being used to store a program, and when the program is executed by the processor, the method for controlling the screen display mode provided in the first aspect and any one of the implementation methods of the first aspect is implemented.
[0042] In a possible implementation, the electronic device includes a front camera, and the electronic device first obtains shooting data of the front camera; and then determines the tilt angle of the user's face relative to the electronic device according to the shooting data.
[0043] In one possible implementation, the electronic device includes a time-of-flight ToF device, which may be a ToF sensor. In this case, the electronic device uses the ToF device to obtain 3D facial data of the user; and determines the tilt angle of the user's face relative to the electronic device based on the 3D facial data.
[0044] In a possible implementation, the electronic device may be a mobile phone or a tablet computer.
[0045] In a third aspect, the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor of an electronic device, the method for controlling the screen display mode provided by the first aspect and any one of the implementation methods of the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 Scenario illustration provided for this application Figure 1 ;
[0047] Figure 2 Scenario illustration provided for this application Figure 2 ;
[0048] Figure 3 A flowchart of a method for controlling a screen display mode provided in an embodiment of the present application;
[0049] Figure 4 Scenario diagram provided for the embodiment of this application Figure 3 ;
[0050] Figure 5 Scenario diagram provided for the embodiment of this application Figure 4 ;
[0051] Figure 6 Schematic diagram of the software architecture provided in the embodiment of the present application Figure 1 ;
[0052] Figure 7 A flowchart of another method for controlling a screen display mode provided in an embodiment of the present application;
[0053] Figure 8Scenario diagram provided for the embodiment of the present application Figure 5 ;
[0054] Fig. 9A Schematic diagram of the software architecture provided in the embodiment of the present application Figure 2 ;
[0055] Fig. 9B Scenario diagram provided for the embodiment of the present application Figure 6 ;
[0056] Fig.10 A flowchart of another method for controlling a screen display mode provided in an embodiment of the present application;
[0057] Fig.11 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to enable persons skilled in the art to more clearly understand the solution of the present application, the application scenario of the technical solution of the present application is first described below.
[0059] Android is an open source operating system based on the Linux kernel, mainly used in electronic devices such as smartphones and tablets. The Android system provides a variety of application programming interfaces (APIs) for third-party application developers (hereinafter referred to as third-party applications) to use in order to achieve various functions and effects.
[0060] Among them, the Android system provides an orientation monitoring interface called "OrientationEventListener" to monitor the device's posture changes, that is, the device's rotation angle relative to the ground plane. The OrientationEventListener interface can read the three-axis acceleration data of the accelerometer, calculate the device's rotation angle and pass it to the application. The application can obtain the rotation angle and the screen display mode set by the user (for example, the user can set automatic rotation, lock the vertical screen or lock the horizontal screen, etc.) to decide whether to trigger a change in the screen display mode.
[0061] Third-party applications can register listeners for this interface to implement their own screen rotation logic to adapt to different usage scenarios and user needs. For example, take the example of a user running a video player software on an electronic device and playing a video. Figure 1 and Figure 2 Schematic diagram of the scene shown.
[0062] Figure 1In the embodiment, the electronic device is in a vertical posture, the screen display mode of the electronic device is a vertical screen mode, and the video display window is a small window.
[0063] After the user sets the screen orientation mode to auto-rotate, if the electronic device is Figure 1 Switch to posture Figure 2 When the video player is in the horizontal posture shown, the video player software calls the rotation angle through the "OrientationEventListener" interface, determines that the screen display mode needs to be switched, and then switches to the horizontal screen mode for full-screen video playback.
[0064] However, the above screen display mode control method relies on the rotation angle obtained from the direction monitoring interface, and cannot flexibly adjust the screen direction according to the actual viewing angle and needs of the user.
[0065] This can lead to situations that are not in line with user expectations and habits, affecting the user experience. For example, when a user is lying on a bed or sofa playing a video, assuming that the user wants the current screen display mode to be in portrait mode, but if the rotation angle of the electronic device exceeds a certain threshold, the screen display mode will easily switch from portrait mode to landscape mode. For another example, when a user holds the device sideways, the natural orientation of the device is Figure 1 As shown, the screen display mode is maintained in the portrait mode, but the user hopes that the screen display mode at this time is the landscape mode to achieve full-screen video playback.
[0066] It can be seen that the current third-party applications have the problem that the screen display mode does not match the user's expectations, which cannot meet the user's expectations and reduces the user's experience.
[0067] In order to solve the above technical problems, the present application provides a method for controlling a screen display mode, an electronic device and a storage medium. The solution pre-stores and maintains a preset application list on the electronic device, and the preset application list includes one or more applications. The common point of these applications is that they all obtain the rotation angle of the electronic device through the direction monitoring interface, that is, the listener of the direction monitoring interface is registered. When the electronic device determines that the application currently calling the direction monitoring interface is in the preset application list, the screen display mode is no longer determined directly based on the accelerometer data, but the screen display mode of the electronic device is controlled based on the tilt angle of the user's face relative to the electronic device, thereby avoiding the determined screen display mode from being inconsistent with the user's expectations and habits. Therefore, the solution of the present application improves the user experience.
[0068] The terms "first", "second", etc. in the description of this application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.
[0069] The implementation method of the present application scheme is described in detail below with reference to the accompanying drawings.
[0070] See also Figure 3 , which is a flow chart of a method for controlling a screen display mode provided in an embodiment of the present application.
[0071] The method comprises the following steps:
[0072] S11: Determine whether the application currently calling the direction monitoring interface is in the preset application list.
[0073] Currently, an application running on an electronic device can call the orientation listening interface "OrientationEventListener" to obtain the rotation direction of the electronic device, and then control the screen display mode of the electronic device in combination with the screen display mode selection strategy of the application itself.
[0074] However, in the scheme of the present device, a preset application list is pre-stored and maintained on the electronic device. The preset application list may include one or more applications, and the common point of these applications is that they all obtain the rotation angle of the electronic device through the direction monitoring interface, that is, the listener of the direction monitoring interface is registered. In the scheme of the present application, when the application is in the preset application list, the application is no longer directly determined by the accelerometer data to determine the screen display mode. Instead, the tilt angle of the face relative to the electronic device is used to determine the screen display mode that is more in line with the user's expectations and habits, triggering a change in the screen direction. Therefore, it is necessary to first determine whether the application currently calling the direction monitoring interface is in the preset application list.
[0075] If so, execute S12, otherwise execute S14.
[0076] S12: Determine the tilt angle of the user's face relative to the electronic device.
[0077] In order to make the determined screen display mode consistent with the user's expectations and habits, it is not possible to only use the detection data of the accelerometer, but it is also necessary to consider the tilt angle of the current user's face relative to the electronic device, that is, whether the user's viewing angle matches the screen display mode.
[0078] In the embodiment of the present application, the display modes of the screen include Figure 1 The vertical display mode shown and Figure 2 Landscape display mode shown.
[0079] See also Figure 4 The scene shown is schematic Figure 3 ,as well as Figure 5 The scene shown is schematic Figure 4 .
[0080] The following first introduces the coordinate axes of the electronic device and the coordinate axes of the human face.
[0081] Taking a mobile phone as an example, when the mobile phone is placed vertically, the front camera is generally located at the top of the mobile phone. At this time, the long axis of the mobile phone corresponds to the Y1 axis, and the short axis corresponds to the X1 axis.
[0082] For a human face, when a person stands vertically, the vertical direction is the Y1 axis of the human face, and the horizontal direction is the X2 axis of the human face.
[0083] The tilt angle α of the face relative to the electronic device, that is, the angle between the Y2 axis and the Y1 axis, may range from [0,360°].
[0084] S13: Controlling the electronic device to be in the first screen display mode according to the tilt angle.
[0085] The rotation angle of the electronic device can be determined based on the acquired accelerometer data, and is used to characterize the angle between the current Y1 axis of the electronic device and the vertical upward direction. The rotation angle of the electronic device can range from [0,360°].
[0086] At this time, the first screen display mode is determined according to the tilt angle, with reference to the user's current posture, so it is more likely to be consistent with the user's expectations and habits.
[0087] For example, for Figure 4 In the scenario shown, when the electronic device plays a video through the video playback software, it is first in the vertical screen state, and the user quickly shakes the phone to the angle shown in the figure, so that there is an angle α between the phone and the vertical direction.
[0088] In the existing solution, a large X1-axis acceleration may be generated, causing the interface to misjudge that the phone has been rotated from portrait to landscape, thereby triggering a change in the screen display mode. This will interrupt the user's viewing or reading process, causing unnecessary trouble and interference to the user, and affecting the user's viewing or reading experience.
[0089] However, for the solution of the present application, after determining that the video playback software running on the electronic device is in the preset application list, the screen display mode is no longer determined based solely on the accelerometer data. Instead, the screen direction that best suits the user is determined based on the tilt angle α of the face relative to the electronic device. As shown in the figure, although the electronic device rotates rapidly, the rotation angle is small, and the tilt angle α of the face relative to the electronic device is small, so the first screen display mode of the electronic device is controlled to be the portrait mode, and the electronic device is not controlled to be in the landscape mode.
[0090] For example, Figure 5 In the scenario shown, the user holds the mobile phone device sideways, and the electronic device is in a vertical state. In the existing solution, the rotation direction of the electronic device is provided by the direction monitoring interface, which can only determine that the electronic device is in a vertical state, and then control the screen display mode to a vertical screen mode, which is obviously inconsistent with the user's usage expectations.
[0091] As for the technical solution of the present application, after determining that the video playback software running on the electronic device is in the preset application list, the tilt angle α of the face relative to the electronic device is obtained, and then the screen display mode is determined in combination with the rotation angle of the electronic device. That is, according to the accelerometer data, it is determined that the current electronic device is in a vertical state, but it is determined that the tilt angle α of the current face relative to the electronic device is about 90°. Therefore, in order to match the user's viewing angle and the screen display mode, it is necessary to control the electronic device to display horizontally, that is, control the first screen display mode of the electronic device to be the horizontal screen mode.
[0092] S14: Determine a screen display mode of the electronic device according to the rotation angle of the electronic device obtained from the direction monitoring interface.
[0093] At this time, the current application is not in the preset application list. In order to avoid anomalies when triggering screen direction changes, this application follows the current technical solution, allowing the application to obtain the rotation angle of the electronic device provided by the direction monitoring interface to determine the screen display mode of the electronic device.
[0094] To sum up, using the solution provided by the present application, when the electronic device determines that the application currently calling the direction monitoring interface is in the preset application list, it no longer directly determines the screen display mode based on the accelerometer data, but instead controls the electronic device to be in the first screen display mode based on the tilt angle of the user's face relative to the electronic device, thereby avoiding the screen display mode determined after calling the direction monitoring interface being inconsistent with the user's expectations and habits. Therefore, the solution of the present application improves the user experience.
[0095] In addition, by utilizing the solution provided in the embodiment of the present application, third-party applications are no longer completely dependent on the "OrientationEventListener" interface provided by the Android system, and each third-party application does not need to modify its own application code to adapt to the screen display mode decision strategy of the electronic device, fundamentally solving the user experience problem that exists when third-party applications determine the screen display mode, and therefore has good practicality and compatibility.
[0096] The following is an explanation in conjunction with a specific implementation method.
[0097] See also Figure 6 and Figure 7.in, Figure 6 Schematic diagram of the software architecture provided in the embodiment of the present application Figure 1 ; Figure 7 A flowchart of another method for controlling a screen display mode provided in an embodiment of the present application.
[0098] The electronic device in the present application includes a front camera and a time of flight (ToF) device as an example for explanation.
[0099] The environment in which the Android operating system (OS) is run on electronic devices is a Rich Execution Environment (REE). Electronic devices also include a Trusted Execution Environment (TEE). TEE is an independent execution environment that runs alongside REE, has its own execution space, and has a higher level of security. The operating systems running in the TEE environment are called TEE OS.
[0100] For the operating system running in the REE environment, taking the layered architecture Android system as an example, in some embodiments, the Android system is composed of the application layer, application framework layer, Android runtime (Android runtime) and system library, hardware abstraction layer (Hardware Abstraction Layer, HAL) and kernel layer from top to bottom.
[0101] The application layer can include a series of application packages, such as video playback APP, etc.
[0102] 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 includes some predefined functions. The application framework layer may include a window manager (WindowManagerService, WMS) and an OrientationEventListener interface.
[0103] A window manager is used to manage window programs.
[0104] In the embodiment of the present application, the OrientationEventListener interface of the electronic device is improved and a screen display mode decision module is configured. The screen display mode decision module includes four parts: cloud parameter update, dynamic switching module, sensor service and intelligent rotation module.
[0105] The cloud parameter update is used to update the preset application list using the update data pushed by the server, such as adding an application to the preset application list or deleting an application from the preset application list.
[0106] The sensor service is used to determine the rotation angle of the electronic device using accelerometer data. When an application that is not in the preset application list calls the OrientationEventListener interface, the OrientationEventListener interface sends the rotation angle of the electronic device determined by the sensor service to the application.
[0107] The smart rotation module is used to determine the rotation angle of the electronic device according to the screen orientation data sent by the smart rotation orientation service. For example, the screen orientation data is used to indicate the screen display orientation of the electronic device, such as horizontal screen display or vertical screen display.
[0108] The dynamic switching module is used to dynamically select the rotation angle of the output electronic device, that is, when the application is in the preset application list, the rotation angle determined by the intelligent rotation module is selected as the output of the OrientationEventListener interface, and when the application is not in the preset application list, the rotation angle determined by the sensor service is selected as the output of the OrientationEventListener interface.
[0109] The intelligent rotation direction service can generate corresponding screen direction data according to the display direction of the screen determined by the intelligent fusion function in the hardware abstraction layer.
[0110] The hardware abstraction layer (HAL) is a routine package of the software layer. It is an interface layer between the operating system kernel and the hardware circuit. Its purpose is to abstract the hardware and simulate the details of a specific system platform so that the program can directly access the hardware resources.
[0111] An intelligent fusion function is added to the HAL layer in the software architecture of this application, which can determine the display direction of the screen according to the tilt angle of the face relative to the electronic device and the rotation angle of the electronic device.
[0112] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, sensor driver, etc.
[0113] The smart sensor hub can acquire, integrate and process data from different sensors, separating sensor data processing from the application processor (AP) to save power and improve performance.
[0114] For the convenience of explanation, the software architecture diagram also shows the main hardware layer devices involved, which are explained below.
[0115] The 2D RGB device, also known as the front camera, is used to obtain flat face shooting data. The front camera uses Always-On technology, which can detect in real time that the current user is viewing the electronic device and obtain face shooting data with low power consumption.
[0116] An accelerometer can detect the magnitude of the acceleration of an electronic device in all directions (generally three axes). When the electronic device is stationary, it can detect the magnitude and direction of gravity and can also be used to identify the posture of the electronic device.
[0117] The ambient light sensor is used to sense the ambient light brightness.
[0118] ToF devices are also called ToF sensors. ToF sensors emit infrared light and measure the time it takes from the emitted light to the reflected light from the object. This can measure the distance between the TOF sensor and the object being detected. ToF devices can obtain 3D face data.
[0119] In an embodiment of the present application, the TEE OS running in the TEE environment is mainly used to achieve secure caching of the ToF device detection results, that is, to save the data detected by the ToF device in a secure buffer, and to achieve secure acquisition of the data in the secure buffer.
[0120] The method comprises the following steps:
[0121] S21: When the application calls the direction monitoring interface, the package name of the application is obtained.
[0122] When the application is running, the electronic device can obtain the package name (Package Name) and class name of the currently running application through the interface of the system layer, and determine whether the application has registered a listener of the OrientationEventListener interface, as well as the name and parameters of the callback method of the listener.
[0123] S22: When the package name of the application program matches the corresponding package names of the applications included in the preset application program list, it is determined that the application program is in the preset application program list.
[0124] A preset application list is pre-maintained on the electronic device, and each application in the preset application list obtains the rotation angle of the electronic device through the direction monitoring interface.
[0125] The list of preset applications can be updated.
[0126] In a possible implementation, the electronic device can receive update data sent by the server, and then update the preset application list according to the update data. This implementation uses the cloud push capability to update the list, and can quickly delete the application from the preset application list when an abnormality occurs after the application uses the control method of the screen display mode of the electronic device, and subsequently add an application to the preset application list online.
[0127] In another possible implementation, the user can independently select an application on the electronic device to add to the preset application list, or independently delete an application from the preset application list, which is described in detail below with reference to the accompanying drawings.
[0128] See also Figure 8 , which is a schematic diagram of a scenario provided by an embodiment of the present application Figure 5 .
[0129] The system of the electronic device may include an interface of "Smart Rotation Application List Settings", which includes listener applications registered with the OrientationEventListener interface. Users can add any application to the preset application list or delete any application from the preset application list according to their own needs, which has a high degree of autonomy. In addition, when the user finds that an application in the preset application list has an abnormality when selecting the screen display mode, the user can immediately and proactively delete the abnormal application from the preset application list in a timely manner, which is more timely and does not rely on the cloud push capability of the server, that is, when the electronic device has no network connection, it can also update the preset application list.
[0130] Each application included in the preset application list has its corresponding package name. When the package name of the application currently calling the direction monitoring interface is the same as one of the corresponding package names of the applications included in the preset application list, the electronic device can determine that the current application is in the preset application list.
[0131] S23: Determine whether the illumination value of the environment where the electronic device is currently located is greater than or equal to a preset illumination value.
[0132] If yes, execute S24; otherwise, execute S31.
[0133] In an embodiment of the present application, the electronic device includes a front camera and a front ToF device. In a possible implementation, the front ToF device is generally arranged near the front camera, for example, both are arranged in the middle or left position above the screen.
[0134] The solution of the present application can determine the tilt angle of the face relative to the electronic device with the help of a front camera or a ToF device.
[0135] Specifically, the front camera can apply the Always-On technology, which can detect in real time that the current user is viewing the electronic device and obtain face shooting data with low power consumption. However, the application condition of the front camera is that the illumination value of the environment where the current electronic device is located is high, otherwise the front camera may have difficulty in obtaining effective data under dim lighting conditions, which may lead to misjudgment.
[0136] The working principle of ToF devices determines that ToF devices can obtain 3D face data under any lighting conditions, but the power consumption of ToF devices is relatively high.
[0137] Therefore, in order to achieve a balance between the accuracy of the detection results and power consumption, the present application determines the activated device according to the lighting conditions. When the illumination is high, the front camera with low power consumption is used to obtain shooting data, which can characterize the 2D facial features. When the illumination is low, the ToF device is used to obtain 3D facial data.
[0138] S24: Acquire shooting data of the front camera.
[0139] S25: Whether the photographed data including the face is obtained.
[0140] In actual applications, there may be no user in front of the current electronic device. For example, the user fixes the electronic device and then leaves, or the user is at the back of the electronic device. In this case, there may be no face shooting data in the shooting data. At this time, the electronic device can continue to use the strategy of determining the screen display mode in the prior art, that is, use the rotation angle of the electronic device to determine the screen display mode and execute S29.
[0141] If the captured data including the face of a person is acquired, S26 is executed.
[0142] S26: Determine the tilt angle of the user's face relative to the electronic device according to the photographed data.
[0143] After the front camera obtains the shooting data including 2D face data, it determines the tilt angle of the current user's face relative to the electronic device according to the face orientation algorithm. For specific scene diagrams, please refer to Figure 4 or Figure 5 .
[0144] In one possible implementation, the electronic device may include a neural network (NN) computing processor, or the electronic device processor may include a neural network computing unit, which can quickly process input information and continuously self-learn by drawing on the biological neural network structure, such as the transmission mode between neurons in the human brain. The NPU can realize intelligent cognition of electronic devices, such as face recognition and confirmation of tilt angle.
[0145] S27: Determine an equivalent rotation angle of the electronic device according to the tilt angle.
[0146] In a possible implementation, the equivalent rotation angles may be 0°, 90°, 180°, and 270°. The screen display modes corresponding to 0° and 180° are vertical screen display. The screen display modes corresponding to 90° and 180° are horizontal screen display. Figure 4 and Figure 5 , taking the tilt angle as the angle between the human face and the Y2 axis of the electronic device in the clockwise direction as an example, the value range of the tilt angle is [0°, 360°].
[0147] The following example illustrates the corresponding relationship between the tilt angle and the equivalent rotation angle.
[0148] Table 1: Correspondence table of tilt angle and equivalent rotation angle
[0149] Tilt angle range Equivalent rotation angle [0°,45°),[315°,360°) 0° [45°,135°) 90° [135°,225°) 180° [225°,315°) 270°
[0150] The corresponding relationship in the above table is only for illustration and does not constitute a limitation on the technical solution of the present application.
[0151] In another possible implementation, when determining the equivalent rotation angle of the electronic device, the rotation angle of the electronic device can also be combined. For example, when the tilt angle is about 45°, this angle belongs to the critical angle between the equivalent rotation angle of 0° and 90°. In order to avoid misjudgment, it can be combined with the rotation angle of the current electronic device for further determination. For example, when the rotation angle of the current electronic device is 0, it can be determined that the current electronic device is placed vertically. In this scenario, the tilt angle of 45° of the user's face relative to the electronic device may only be caused by a short head movement of the user. For example, if the user is looking sideways to observe the surrounding environment, then the equivalent rotation angle can be determined to be 0°.
[0152] S28: Using the equivalent rotation angle of the electronic device as data provided by the direction monitoring interface to the application.
[0153] At this time, the dynamic switching module switches the output path of the OrientationEventListener interface to the intelligent rotation module. When the intelligent rotation module determines the equivalent rotation angle, the equivalent rotation angle is used as data provided by the orientation monitoring interface to the application. The application can control the electronic device to adopt the first screen display mode according to the equivalent rotation angle.
[0154] The following examples illustrate the technical effects of the present application.
[0155] At the first moment, the tilt angle between the user's face and the electronic device is 20°, and the corresponding equivalent rotation angle is 0°.
[0156] The electronic device is in a stationary state, but the user's face rotates at the second moment. The tilt angle between the user's face and the electronic device is 100°, and the corresponding equivalent rotation angle is 90°.
[0157] In the prior art, the application directly calls the OrientationEventListener interface to output the rotation angle of the electronic device. If it is found that the current rotation angle of the electronic device is zero, the application maintains the screen display mode unchanged, that is, the display mode at the second moment is the same as the display mode at the first moment.
[0158] However, after adopting the technical solution of the present application, the equivalent rotation angle determined by the intelligent rotation module at the second moment is 90°, that is, the equivalent rotation angle output by the OrientationEventListener interface is 90°. This makes the rotation angle obtained by the application no longer zero, but 90°, and further determines that the screen display mode should be switched from the portrait mode to the landscape mode at this time, so that the display mode at the second moment is different from the display mode at the first moment, and the user's perspective is followed.
[0159] S29: Determine an equivalent rotation angle of the electronic device according to the accelerometer data.
[0160] When there is no user in front of the electronic device, the electronic device can use the strategy of determining the screen display mode in the prior art, that is, determine the screen display mode using the rotation angle of the electronic device.
[0161] The electronic device obtains accelerometer data through the accelerometer, determines the direction of gravity in combination with the gravity rotation algorithm, and then determines the rotation angle of the electronic device.
[0162] The rotation angle is then converted to an equivalent rotation angle, as shown below with an example.
[0163] Table 2: Correspondence table of rotation angle and equivalent rotation angle
[0164] The rotation angle range Equivalent rotation angle [0°,45°),[315°,360°) 0° [45°,135°) 90° [135°,225°) 180° [225°,315°) 270°
[0165] The corresponding relationship in the above table is only for illustration and does not constitute a limitation on the technical solution of the present application.
[0166] S30: Use the equivalent rotation angle as data provided by the direction monitoring interface to the application.
[0167] Continue to see Figure 6 ,In this scenario, the application is already in the preset application list, and the ,dynamic switching module selects the equivalent rotation angle determined by the ,smart rotation module as the output of the OrientationEventListener interface.
[0168] S31: Use the ToF device to obtain the user's 3D face data.
[0169] When the illumination is low, the front camera cannot obtain valid face data, and the ToF device is used to obtain 3D face data. At this time, the ToF switch decision module in the intelligent fusion function turns on the ToF device. After the ToF device is started, the acquired data frame is stored in the secure buffer in the TEE environment, and then the secure data acquisition service in the TEE environment provides the data frame to the face recognition daemon.
[0170] The face recognition daemon is a special process that runs in the background. It is independent of the control terminal and waits for face recognition events to be processed.
[0171] S32: Whether data including human face is obtained.
[0172] In actual applications, there may be no user in front of the current electronic device. For example, the user fixes the electronic device and then leaves, or the user is at the back of the electronic device. In this case, there may be no face data in the data acquired by the ToF device. At this time, the electronic device can continue to use the strategy of determining the screen display mode in the prior art, that is, use the rotation angle of the electronic device to determine the screen display mode and execute S36.
[0173] If data including a human face is acquired, S33 is executed.
[0174] S33: Determine the tilt angle of the user's face relative to the electronic device according to the 3D face data.
[0175] In a possible implementation, the electronic device may include a neural network computing processor, or the electronic device processor includes a neural network computing unit, and a 3D face recognition algorithm may be used to determine the tilt angle of the face relative to the electronic device based on the acquired 3D face data. For specific scene diagrams, see Figure 4 or Figure 5 .
[0176] S34: Determine an equivalent rotation angle of the electronic device according to the tilt angle.
[0177] For the description of this step, please refer to S27, which will not be repeated here.
[0178] S35: Using the equivalent rotation angle of the electronic device as data provided by the direction monitoring interface to the application.
[0179] At this time, the dynamic switching module switches the output path of the OrientationEventListener interface to the intelligent rotation module. After the intelligent rotation module determines the equivalent rotation angle, the equivalent rotation angle is used as data provided by the direction monitoring interface to the application.
[0180] S36: Determine an equivalent rotation angle of the electronic device according to the accelerometer data.
[0181] When there is no user in front of the electronic device, the electronic device can use the strategy of determining the screen display mode in the prior art, that is, determine the screen display mode using the rotation angle of the electronic device.
[0182] The electronic device obtains accelerometer data through the accelerometer, determines the direction of gravity in combination with the gravity rotation algorithm, and then determines the rotation angle of the electronic device.
[0183] The rotation angle is then converted to an equivalent rotation angle.
[0184] S37: Use the equivalent rotation angle as data provided by the direction monitoring interface to the application.
[0185] The dynamic switching module selects the equivalent rotation angle determined by the intelligent rotation module as the output of the OrientationEventListener interface.
[0186] It is understandable that the division of the above steps is only for the convenience of explanation and does not constitute a limitation on the technical solution of the present application. For example, in actual applications, if the electronic device only includes a front camera but not a front ToF device, do not perform the judgment of step S23 and directly execute S24. For another example, in actual applications, if the electronic device does not include a front camera but only includes a front ToF device, do not perform the judgment of step S23 and directly execute S31.
[0187] In summary, by utilizing the technical solution provided by the embodiment of the present application, when the electronic device determines that the application currently calling the direction monitoring interface is in the preset application list, the screen display mode is no longer determined directly based on the accelerometer data, but the equivalent rotation angle is determined based on the tilt angle of the user's face relative to the electronic device, and the equivalent rotation angle is used as the output of the direction monitoring interface, so that the screen display mode determined by the application is consistent with the user's expectations and habits. The preset application list in this solution can be updated in a timely manner, so that third-party applications are no longer completely dependent on the direction monitoring interface provided by the Android system, but can adapt to the screen display mode decision strategy of the electronic device, fundamentally solving the user experience problem that exists when third-party applications determine the screen display mode, and therefore has good practicality and compatibility.
[0188] In the above embodiments, taking the replacement of the rotation angle output by the direction monitoring interface as an example, in another possible implementation method, the accelerometer data obtained by the direction monitoring interface can be replaced, thereby changing the rotation angle determined by the direction monitoring interface, and the purpose of changing the rotation angle output by the direction monitoring interface can also be achieved. The following is a detailed explanation with reference to the accompanying drawings.
[0189] See also Fig. 9A , which is a schematic diagram of the software architecture provided in the embodiment of the present application Figure 2 .
[0190] Fig. 9A The software architecture shown is similar to Figure 6 The difference lies in the different improvements to the OrientationEventListener interface of the electronic device, and the addition of an accelerometer data generation module and an accelerometer output selection module in the HAL layer.
[0191] In an embodiment of the present application, the screen display mode decision module configured by the OrientationEventListener interface includes cloud parameter updates and sensor services.
[0192] The cloud parameter update is used to update the preset application list using the update data pushed by the server, such as adding an application to the preset application list or deleting an application from the preset application list.
[0193] The sensor service is used to determine the rotation angle of the electronic device using accelerometer data. The OrientationEventListener interface sends the rotation angle of the electronic device determined by the sensor service to the application.
[0194] The accelerometer data generation module is used to generate equivalent accelerometer data.
[0195] The accelerometer output selection module is used to switch the output path of the accelerometer. When the application is in the preset application list, the equivalent accelerometer data generated by the accelerometer data generation module is output to the sensor service. When the application is not in the preset application list, the accelerometer data is output to the sensor service.
[0196] See also Fig.10 , which is a flow chart of another method for controlling a screen display mode provided in an embodiment of the present application.
[0197] The method comprises the following steps:
[0198] S41: When the application calls the direction monitoring interface, the package name of the application is obtained.
[0199] When the application is running, the electronic device can obtain the package name and class name of the currently running application through the interface of the system layer, and determine whether the application has registered a listener of the OrientationEventListener interface, as well as the name and parameters of the callback method of the listener.
[0200] S42: When the package name of the application program matches the corresponding package names of the applications included in the preset application program list, it is determined that the application program is in the preset application program list.
[0201] A preset application list is pre-maintained on the electronic device, and each application in the preset application list obtains the rotation angle of the electronic device through the direction monitoring interface.
[0202] The list of preset applications can be updated.
[0203] In a possible implementation, the electronic device can receive update data sent by the server, and then update the preset application list according to the update data. This implementation uses the cloud push capability to update the list, and can quickly delete the application from the preset application list when an abnormality occurs after the application uses the control method of the screen display mode of the electronic device, and subsequently add an application to the preset application list online.
[0204] In another possible implementation, the user can select an application on the electronic device to add to the preset application list, or delete an application from the preset application list. Figure 8 And the corresponding instructions will not be repeated here.
[0205] Each application included in the preset application list has its corresponding package name. When the package name of the application currently calling the direction monitoring interface is the same as one of the corresponding package names of the applications included in the preset application list, the electronic device can determine that the current application is in the preset application list.
[0206] S43: Determine whether the illumination value of the environment where the electronic device is currently located is greater than or equal to a preset illumination value.
[0207] If yes, execute S44; otherwise, execute S51.
[0208] In an embodiment of the present application, the electronic device includes a front camera and a front ToF device. In a possible implementation, the front ToF device is generally arranged near the front camera, for example, both are arranged in the middle or left position above the screen.
[0209] The front camera can apply Always-On technology, which can detect in real time that the current user is viewing the electronic device and obtain face shooting data with low power consumption. However, the application condition of the front camera is that the illumination value of the environment where the current electronic device is located is high, otherwise the front camera may have difficulty in obtaining effective data under dim lighting conditions, which may lead to misjudgment.
[0210] The working principle of ToF devices determines that ToF devices can obtain 3D face data under any lighting conditions, but the power consumption of ToF devices is relatively high.
[0211] Therefore, in order to achieve a balance between the accuracy of the detection results and power consumption, the present application determines the activated device according to the lighting conditions. When the illumination is high, the front camera with low power consumption is used to obtain shooting data, which can characterize the 2D facial features. When the illumination is low, the ToF device is used to obtain 3D facial data.
[0212] S44: Acquire shooting data of the front camera.
[0213] S45: Whether the photographed data including the face is obtained.
[0214] If yes, execute S46; otherwise, execute S49.
[0215] S46: Determine the tilt angle of the user's face relative to the electronic device according to the photographing data.
[0216] After the front camera obtains the shooting data including 2D face data, it determines the tilt angle of the current user's face relative to the electronic device according to the face orientation algorithm. For specific scene diagrams, please refer to Figure 4 or Figure 5 .
[0217] In one possible implementation, the electronic device may include a neural-network (NN) computing processor, or the electronic device processor may include a neural-network computing unit, which can perform face recognition using a face recognition algorithm and determine the tilt angle using a face orientation algorithm.
[0218] S47: Generate equivalent accelerometer data corresponding to the tilt angle.
[0219] The equivalent accelerometer data is used to replace the real data acquired by the accelerometer.
[0220] In a possible implementation, the equivalent accelerometer data includes four groups, specifically [x1, y1, z1], [x2, y2, z2], [x3, y3, z3] and [x4, y4, z4]. Among them, the screen display mode corresponding to [x1, y1, z1] and [x3, y3, z3] is vertical screen display. The screen display mode corresponding to [x2, y2, z2] and [x4, y4, z4] is horizontal screen display. Figure 4 and Figure 5 , taking the tilt angle as the angle between the human face and the Y2 axis of the electronic device in the clockwise direction as an example, the value range of the tilt angle is [0°, 360°].
[0221] The following example illustrates the corresponding relationship between the tilt angle and the equivalent rotation angle.
[0222] Table 3: Correspondence table of tilt angle and equivalent accelerometer data
[0223] Tilt angle range Equivalent accelerometer data [0°,45°),[315°,360°) [x1, y1, z1] [45°,135°) [x2, y2, z2] [135°,225°) [x3, y3, z3] [225°,315°) [x4, y4, z4]
[0224] The corresponding relationship in the above table is only for illustration and does not constitute a limitation on the technical solution of the present application.
[0225] The specific values of the above groups of acceleration data can be calibrated in advance through testing and then stored in the memory of the electronic device, as illustrated below with an example.
[0226] See also Fig. 9B , which is a schematic diagram of a scenario provided by an embodiment of the present application Figure 6 .
[0227] For the sake of convenience, let's take the current user standing vertically with the face in the vertical direction as an example. If only the electronic device is rotated, the rotation angle of the electronic device is numerically equal to the tilt angle between the face and the electronic device. The pre-calibrated equivalent accelerometer data of each group are as follows:
[0228] [x1, y1, z1] = [0, 9.8, 0], control the electronic device to be in vertical screen display mode;
[0229] [x2, y2, z2] = [-9.8, 0, 0], control the electronic device to be in horizontal screen display mode;
[0230] [x3, y3, z3] = [0, -9.8, 0], control the electronic device to be in vertical screen display mode;
[0231] [x4, y4, z4] = [9.8, 0, 0], controls the electronic device to be in horizontal screen display mode.
[0232] In another possible implementation, when determining the equivalent rotation angle of the electronic device, the rotation angle of the electronic device can also be combined. For example, when the tilt angle is about 45°, this angle belongs to the critical angle between [x1, y1, z1] and [x2, y2, z2]. In order to avoid misjudgment, it can be combined with the rotation angle of the current electronic device for further determination. For example, when the rotation angle of the current electronic device is 0, it can be determined that the current electronic device is placed vertically. In this scenario, the tilt angle of 45° of the user's face relative to the electronic device may only be caused by the user's brief head movement. For example, the user is briefly looking sideways to observe the surrounding environment. At this time, the equivalent accelerometer data can be determined to be [x1, y1, z1].
[0233] S48: Replace the accelerometer data obtained by the direction monitoring interface with the equivalent accelerometer data.
[0234] At this time, the accelerometer output selection module outputs the equivalent accelerometer data to the sensor service.
[0235] By replacing the accelerometer data obtained by the direction monitoring interface, the direction monitoring interface generates the rotation angle of the electronic device corresponding to the first screen display mode according to the equivalent accelerometer data and sends it to the application to control the electronic device to adopt the first screen display mode.
[0236] The following examples illustrate the technical effects of the present application.
[0237] At the first moment, the electronic device is in a vertical state, the tilt angle between the user's face and the electronic device is 20°, and the corresponding equivalent accelerometer data is [x1, y1, z1].
[0238] The electronic device is in a stationary state, but the user's face rotates at the second moment. The tilt angle between the user's face and the electronic device is 100°, and the corresponding equivalent accelerometer data is [x2, y2, z2].
[0239] In the prior art, the application directly calls the electronic device rotation angle output by the OrientationEventListener interface, and the rotation angle is determined according to the accelerometer data, so the rotation angle at the first moment is zero, and the rotation angle at the second moment is also zero. The application maintains the screen display mode unchanged at the second moment, that is, the display mode at the second moment is the same as the display mode at the first moment.
[0240] However, after adopting the technical solution of the present application, the equivalent accelerometer data [x2, y2, z2] generated by the accelerometer data generation module at the second moment replaces the original accelerometer input and is input into the sensor service. The rotation angle corresponding to [x2, y2, z2] is 90 degrees, and the corresponding screen display mode is the horizontal mode. At this time, the rotation angle output by the OrientationEventListener interface is 90°. This makes the rotation angle obtained by the application no longer zero, but 90°, and then determines that the screen display mode should be switched from the portrait mode to the landscape mode at this time, so that the display mode at the second moment is different from the display mode at the first moment, thereby achieving the tracking of the user's perspective.
[0241] S49: Determine equivalent accelerometer data of the electronic device according to the accelerometer data.
[0242] When there is no user in front of the electronic device, the electronic device can use the strategy of determining the screen display mode in the prior art, that is, determine the screen display mode using the rotation angle of the electronic device.
[0243] The electronic device obtains accelerometer data through the accelerometer, determines the direction of gravity in combination with the gravity rotation algorithm, and then determines the rotation angle of the electronic device.
[0244] The rotation angle is then converted to an equivalent rotation angle, as shown below with an example.
[0245] Table 4: Correspondence table of rotation angle and equivalent accelerometer data
[0246] The rotation angle range Equivalent accelerometer data [0°,45°),[315°,360°) [x1, y1, z1] [45°,135°) [x2, y2, z2] [135°,225°) [x3, y3, z3] [225°,315°) [x4, y4, z4]
[0247] The corresponding relationship in the above table is only for illustration and does not constitute a limitation on the technical solution of the present application.
[0248] S50: Replace the accelerometer data obtained by the direction monitoring interface with equivalent accelerometer data.
[0249] At this time, the accelerometer output selection module outputs the equivalent accelerometer data generated by the accelerometer data generation module to the sensor service, so that the direction monitoring interface generates the rotation angle of the electronic device corresponding to the first screen display mode according to the equivalent accelerometer data and sends it to the application to control the electronic device to adopt the first screen display mode.
[0250] S51: Acquire 3D facial data of the user using the ToF device.
[0251] When the illumination is low, the front camera cannot obtain valid face data, and the ToF device is used to obtain 3D face data. At this time, the ToF switch decision module in the intelligent fusion function turns on the ToF device. After the ToF device is started, the acquired data frame is stored in the secure buffer in the TEE environment, and then the secure data acquisition service in the TEE environment provides the data frame to the face recognition daemon.
[0252] The face recognition daemon is a special process that runs in the background. It is independent of the control terminal and waits for face recognition events to be processed.
[0253] S52: Whether data including human face is obtained.
[0254] If yes, execute S53; otherwise, execute S56.
[0255] S53: Determine the tilt angle of the user's face relative to the electronic device according to the 3D face data.
[0256] In a possible implementation, the electronic device may include a neural network computing processor, or the electronic device processor includes a neural network computing unit, and a 3D face recognition algorithm may be used to determine the tilt angle of the face relative to the electronic device based on the acquired 3D face data. For specific scene diagrams, see Figure 4 or Figure 5 .
[0257] S54: Generate equivalent accelerometer data corresponding to the tilt angle.
[0258] For the description of this step, please refer to S47, which will not be repeated here.
[0259] S55: Replace the accelerometer data obtained by the direction monitoring interface with equivalent accelerometer data.
[0260] By replacing the accelerometer data obtained by the direction monitoring interface, the direction monitoring interface generates the rotation angle of the electronic device corresponding to the first screen display mode according to the equivalent accelerometer data and sends it to the application to control the electronic device to adopt the first screen display mode.
[0261] S56: Determine equivalent accelerometer data of the electronic device according to the accelerometer data.
[0262] For the description of this step, please refer to S49, which will not be repeated here.
[0263] S57: Replace the accelerometer data obtained by the direction monitoring interface with equivalent accelerometer data.
[0264] It is understandable that the division of the above steps is only for the convenience of explanation and does not constitute a limitation on the technical solution of the present application. For example, in actual applications, if the electronic device only includes a front camera but not a front ToF device, do not perform the judgment of step S43 and directly execute S44. For another example, in actual applications, if the electronic device does not include a front camera but only includes a front ToF device, do not perform the judgment of step S43 and directly execute S51.
[0265] In summary, by utilizing the technical solution provided by the embodiment of the present application, when the electronic device determines that the application currently calling the direction monitoring interface is in the preset application list, the screen display mode is no longer determined directly based on the accelerometer data, but the equivalent accelerometer data is determined based on the tilt angle of the user's face relative to the electronic device, and the equivalent accelerometer data is used as the input data of the direction monitoring interface. The direction monitoring interface determines the rotation angle of the electronic device based on the equivalent accelerometer data and outputs it to the application, so that the screen display mode determined by the application is consistent with the user's expectations and habits. The preset application list in this solution can be updated in a timely manner, so that third-party applications are no longer completely dependent on the direction monitoring interface provided by the Android system, but can adapt to the screen display mode decision strategy of the electronic device, fundamentally solving the user experience problem when third-party applications determine the screen display mode, and therefore have good practicality and compatibility.
[0266] Based on the screen display mode control method provided in the above embodiments, the embodiment of the present application further provides an electronic device, which is described in detail below with reference to the accompanying drawings.
[0267] The electronic device may be a wireless terminal device or a wired terminal device, and may be a personal communication service (PCS) phone, a mobile phone, a tablet computer, a computer with a wireless transceiver function, etc. The following description takes the mobile phone device as an example.
[0268] See also Fig.11 , which is a schematic diagram of an electronic device provided in an embodiment of the present application.
[0269] 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.
[0270] The sensor module 180 may include an accelerometer 180A, an ambient light sensor 180B, and a ToF device 180C.
[0271] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0272] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0273] The processor 110 may also be provided with a memory for storing instructions and data.
[0274] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor, etc. For example, the electronic device communicates with the server through the wireless communication function to update the preset application list.
[0275] The display screen 194 of the electronic device is used to display images, videos, etc. The processor 110 can control the screen display mode of the display screen 194, and the screen display mode can be a horizontal screen mode or a vertical screen mode.
[0276] The camera 193 of the electronic device is used to capture images or videos. The electronic device in the embodiment of the present application may include one or more front cameras 193 and may also include one or more rear cameras 193.
[0277] The accelerometer 180A can detect the magnitude of acceleration of the electronic device 1 in various directions (generally three axes). When the electronic device is stationary, it can detect the magnitude and direction of gravity, and can also be used to identify the posture of the electronic device and switch the screen display mode.
[0278] The ambient light sensor 180B 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, and determine whether the ToF device 180C is currently enabled to obtain 3D face data.
[0279] The ToF device 180C measures the time from emitting light to receiving reflected light from an object, thereby measuring the distance between the TOF sensor and the detected object.
[0280] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 implements the screen display mode control method provided in the above embodiments of the present application by running the instructions stored in the internal memory 121 and / or the instructions stored in the memory provided in the processor.
[0281] The electronic device provided by the embodiment of the present application pre-stores and maintains a preset application list, which includes one or more applications. The common point of these applications is that they all obtain the rotation angle of the electronic device through the direction monitoring interface, that is, the listener of the direction monitoring interface is registered. When the electronic device determines that the application currently calling the direction monitoring interface is in the preset application list, it is no longer directly determined based on the accelerometer data. Instead, the screen display mode of the electronic device is controlled based on the tilt angle of the user's face relative to the electronic device, thereby avoiding the determined screen display mode from being inconsistent with the user's expectations and habits. Therefore, the solution of the present application improves the user's experience.
[0282] In addition, the preset application list can be updated in a timely manner, for example, by the user in the setting interface of the electronic device, or by the electronic device according to the update data sent by the server. When an abnormality occurs after the third-party application uses the screen display mode control method of the present application, the third-party application can be quickly removed from the preset application list, or the third-party application can be added in a timely manner subsequently.
[0283] This electronic device enables third-party applications to no longer rely entirely on the direction monitoring interface provided by the Android system, but can adapt to the screen display mode decision strategy of the electronic device, fundamentally solving the user experience problem that exists when third-party applications determine the screen display mode, and therefore has good practicality and compatibility.
[0284] The present application also provides a storage medium having a program stored thereon. When the program is executed by a processor of an electronic device, the method for controlling the screen display mode provided in the above embodiment is implemented.
[0285] Storage media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, parameter random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically-erasable programmable read-only memory (EEPROM), flash memory or other memory technologies.
[0286] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0287] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for controlling a screen display mode, It is characterized in that Applied to electronic equipment, the method comprises: Determine whether the application currently calling the direction monitoring interface is in a preset application list, wherein the direction monitoring interface, when called by the application, provides the application with the rotation angle of the electronic device, and each application in the preset application list obtains the rotation angle of the electronic device through the direction monitoring interface; When the application is in the preset application list, determining a tilt angle of the user's face relative to the electronic device; Determining an equivalent rotation angle of the electronic device according to the tilt angle, and using the equivalent rotation angle as the rotation angle of the electronic device provided by the direction monitoring interface to the application to control the application to be in the first screen display mode; Alternatively, equivalent accelerometer data corresponding to the tilt angle is generated, and the accelerometer data obtained by the direction monitoring interface is replaced by the equivalent accelerometer data, so that the direction monitoring interface generates the rotation angle of the electronic device corresponding to the first screen display mode according to the equivalent accelerometer data and sends it to the application to control the application to be in the first screen display mode.
2. The method according to claim 1, It is characterized in that The step of determining whether the application currently calling the direction monitoring interface is in the preset application list specifically includes: When the application calls the direction monitoring interface, obtaining the package name of the application; When the package name of the application program matches the corresponding package names of the applications included in the preset application program list, it is determined that the application program is in the preset application program list.
3. The method according to claim 1, It is characterized in that The electronic device includes a front camera, and determining the tilt angle of the user's face relative to the electronic device specifically includes: Acquire shooting data of the front camera; The tilt angle of the user's face relative to the electronic device is determined according to the shooting data.
4. The method according to claim 1, It is characterized in that The electronic device includes a time-of-flight (ToF) device, and determining the tilt angle of the user's face relative to the electronic device specifically includes: Acquire 3D facial data of the user using the ToF device; Determine the tilt angle of the user's face relative to the electronic device based on the 3D face data.
5. The method according to claim 1, It is characterized in that The electronic device includes a time-of-flight ToF device and a front camera, and determining the tilt angle of the user's face relative to the electronic device specifically includes: Determining the illumination value of the environment in which the electronic device is currently located; When the illumination is greater than or equal to a preset illumination value, acquiring shooting data of the front camera, and determining a tilt angle of the user's face relative to the electronic device according to the shooting data; When the illumination is less than a preset illumination value, the ToF device is used to obtain 3D facial data of the user, and the tilt angle of the user's face relative to the electronic device is determined based on the 3D facial data.
6. The method according to any one of claims 1 to 5, It is characterized in that The method further comprises: When the tilt angle of the user's face relative to the electronic device is not obtained, determining an equivalent rotation angle of the electronic device according to the accelerometer data; The equivalent rotation angle of the electronic device is used as the rotation angle of the electronic device provided by the direction monitoring interface to the application program, so as to control the electronic device to be in the second screen display mode.
7. The method according to claim 1, It is characterized in that The method further comprises: The preset application list is updated.
8. The method according to claim 7, It is characterized in that The updating of the preset application list specifically includes: Receive update data sent by the server; The preset application list is updated according to the update data.
9. The method according to claim 7, It is characterized in that The updating of the preset application list specifically includes: When the first application registers a listener of the direction monitoring interface, displaying the logo of the first application on the setting interface of the electronic device; In response to the user's selection operation, the first application is added to the preset application list.
10. An electronic device, It is characterized in that The electronic device includes a processor and a memory, the memory is used to store a program, and when the program is executed by the processor, the method for controlling the screen display mode according to any one of claims 1 to 9 is implemented.
11. A storage medium, It is characterized in that The storage medium stores a program, and when the program is executed by the electronic device, the method for controlling the screen display mode according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Method and device for rotating picture displayed by terminal screen
CN106293303A
Screen adjusting method and device, storage medium and processor
CN111866275A