Screen attribute control method and device, electronic equipment and storage medium
By using a floating ball in a terminal device to set the screen brightness to a constant-lit mode, the conflict between the constant-lit-lit screen of the terminal device and the battery management strategy in the prior art is solved, ensuring the stable operation of RPA applications on different devices and system versions and users. Experience.
Patent Information
- Application Number
- CN202411214731.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-24
AI Technical Summary
The prior art violates battery management strategies when ensuring the terminal device screen is always on, and there are system compatibility and adaptability problems, especially in robot process automation (RPA) applications, resulting in interruption of automation operations.
By using a floating ball to display the indication in the front-end application and setting its screen brightness adjustment attribute to the constant-lit mode, keep the terminal device screen always lit, and adjust the screen brightness to the preset low brightness, avoiding direct dependence on the constant-lit sign provided by the system or Run the policy to ensure cross-platform compatibility.
It realizes keeping the terminal device screen always on various devices and system versions, reducing power loss, providing better user experience and system compatibility, and avoiding compatibility issues caused by system version upgrades.
Smart Images

Figure CN119179407A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of display control technology, and in particular to a screen attribute control method, device, electronic device and storage medium. Background Art
[0002] As an application, Robotic Process Automation (RPA) requires the screen of the terminal device to remain on when performing automated operations. Once the terminal device enters the lock screen state, the automated operation will be forced to be interrupted.
[0003] In order to ensure that the screen of the terminal device does not turn off, the existing methods usually need to configure the screen timeout property of the application in the terminal device to never turn off the screen, or wake up the lock through the power management service of the terminal device. However, the above methods are contrary to the battery management strategy of the terminal device, and with the iterative upgrade of the terminal device system version, the above methods also have problems such as system compatibility and adaptability. Summary of the invention
[0004] The purpose of this application is to provide a screen attribute control method, device, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, so as to solve the problems existing in the prior art that are inconsistent with the battery management strategy of the terminal device, as well as the problems of system compatibility and adaptability.
[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a screen attribute control method, the method comprising:
[0007] In response to a floating ball display instruction triggered in a front-end application, displaying a floating ball on a terminal device, wherein the front-end application runs on the terminal device;
[0008] In response to a startup operation on the floating ball, the screen brightness adjustment property of the floating ball is set to a constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0009] In a second aspect, an embodiment of the present application provides a screen attribute control device, the device comprising:
[0010] A display module, configured to display a floating ball on a terminal device in response to a floating ball display indication triggered in a front-end application, wherein the front-end application runs on the terminal device;
[0011] A setting module is used to respond to the startup operation of the floating ball, set the screen brightness adjustment property of the floating ball to the constant light mode to keep the screen of the terminal device always on, and adjust the screen brightness of the terminal device to a preset low brightness.
[0012] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the screen attribute control method as described in any one of the first aspects above.
[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the screen attribute control method as described in any one of the above-mentioned first aspects are executed.
[0014] According to the screen attribute control method, device, electronic device and storage medium of the embodiment of the present application, in response to the floating ball display indication triggered in the front-end application, the floating ball is displayed on the terminal device, and in response to the startup operation for the floating ball, the screen brightness adjustment attribute of the floating ball is set to the always-on mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness. According to the embodiment of the present application, on the basis of continuing the battery management strategy of the terminal device system, a new floating ball service is added, and the terminal device screen is requested to remain always on by opening an active floating ball window view on the front-end application, and the screen brightness is adjusted to a preset low brightness while the screen is always on, so as to reduce power consumption by dynamically adjusting the screen brightness when the front-end application is running. As a UI element that is always at the top layer of the screen, the floating ball is still visible and interacted even if the user performs other interface operations. Therefore, by using the floating ball to add the always-on attribute to the window view of the terminal device, the limitation that the always-on flag or operation strategy provided by the direct application system is inconsistent in different versions or systems can be avoided. And using the floating ball as an intermediary, the floating ball is usually regarded as a user-visible and interactive element, rather than a pure background activity, so that the front-end application can run stably under a variety of different system configurations and versions, improving cross-platform compatibility. Therefore, this application uses the floating ball to ensure that the front-end application can not only remain active and the screen is always on on various devices and system versions during the execution of automated operations, but also provide better user experience and system compatibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 A schematic diagram of a flow chart of a screen attribute control method provided in an embodiment of the present application is shown;
[0017] Figure 2 A schematic diagram showing the switching between the folded and unfolded states of a suspension ball provided in an embodiment of the present application is shown;
[0018] Figure 3 A schematic diagram of a flow chart of a method for creating and displaying a suspended ball provided in an embodiment of the present application is shown;
[0019] Figure 4 A schematic diagram of a process for dynamically setting screen window attributes provided by an embodiment of the present application is shown;
[0020] Figure 5 A schematic diagram of a process of adjusting screen brightness provided in an embodiment of the present application is shown;
[0021] Figure 6 A schematic diagram of the structure of a screen attribute control device provided in an embodiment of the present application is shown;
[0022] Figure 7 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0024] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0025] In order to enable those skilled in the art to use the content of this application, the following implementation is provided in conjunction with a specific application scenario "RPA automated operation". For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the screen attribute control method, it should be understood that this is only an exemplary embodiment.
[0026] It should be noted that the term "including" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0027] After the user turns on the Accessibility Service, when the RPA application needs to continue to run on the terminal device and perform the corresponding automated operations, or interact with a specific application, the screen of the terminal device needs to remain on to avoid the screen turning off the operation process of the terminal RPA application. For example, if the screen of the terminal device is locked, the RPA application may not be able to recognize the elements or touch operations on the screen, which will cause the automation task to fail. On this basis, the existing technology usually needs to configure the screen timeout setting time in the terminal settings application, but since the numerical settings of the screen timeout setting time by different manufacturers are mostly no more than thirty minutes, the terminal device is prevented from being on for a long time without operation and causing power loss. In addition, in order to keep the terminal device screen from turning off, the power management service of the terminal device system can also be used to obtain a wake-up lock when the RPA accessibility service is connected to keep the screen on and the CPU running, but this method is still contrary to the battery management strategy of the terminal device system, and with the iterative upgrade of the system version, this method has system compatibility and adaptation problems. For example, there are differences in the power management strategies of major manufacturers, and the screen will still be turned off even after requesting a wake-up lock or setting the screen timeout.
[0028] In order to solve the above problems, an embodiment of the present application provides a screen attribute control method. By using a floating ball, the RPA application can not only remain active and the screen is always on on various devices and system versions, but also provide a better user experience and system compatibility.
[0029] Figure 1 A schematic diagram of a screen attribute control method provided in an embodiment of the present application is shown. Figure 1 As shown, the method specifically comprises the following steps:
[0030] S101. In response to a floating ball display instruction triggered in a front-end application, a floating ball is displayed on a terminal device, wherein the front-end application runs on the terminal device.
[0031] Optionally, Figure 2 A schematic diagram showing the switching between the folded and unfolded states of a suspension ball provided in an embodiment of the present application is shown. Figure 2 As shown, a control that can persist is displayed on the screen of the terminal device, namely a floating ball. In response to a floating ball display indication triggered in a front-end application, the floating ball can stay on the screen all the time and remain visible no matter which application the user switches to.
[0032] For example, the front-end application can be the RPA application that the user is currently interacting with. After obtaining the floating window permission, the front-end application can display the floating ball UI element at the top level of the terminal device interface. The user enters the homepage of the front-end application and enters the floating ball display instruction on the homepage to display the floating ball on the screen of the terminal device. Furthermore, the user can control the switching of the floating ball display state by clicking on the floating ball, such as expanding or retracting. Specifically, when the floating ball is displayed, the function menu can be displayed, and when the floating ball is retracted, only the floating ball is displayed.
[0033] S102: In response to a startup operation on the floating ball, the screen brightness adjustment property of the floating ball is set to a constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0034] Optionally, when the user interacts with the floating ball, the user can trigger the adjustment of the terminal device screen brightness by starting operations such as clicking or long pressing. Based on the floating ball displayed on the terminal device screen, by setting a specific always-on flag or screen brightness adjustment attribute, the terminal device screen is controlled to remain on without being affected by the automatic screen timeout or lock screen policy.
[0035] For example, when the floating ball is activated and the screen brightness adjustment property of the floating ball is set to always on, the screen of the terminal device will remain always on, and will not automatically turn off even without user input. On this basis, in order to avoid unnecessary power waste and keep the screen always on, the screen brightness of the terminal device is adjusted to a preset low brightness, which is a brightness value pre-set based on a benchmark of low brightness but still readable.
[0036] Based on this, according to the screen attribute control method provided by the embodiment of the present application, on the basis of continuing the battery management strategy of the terminal device system, a new floating ball service is added, which requests the terminal device screen to remain always on by opening an active floating ball window view on the front-end application, and adjusts the screen brightness to a preset low brightness while keeping the screen always on, so as to reduce power consumption by dynamically adjusting the screen brightness when the RPA application is running. As a UI element that is always at the top of the screen, the floating ball is still visible and interacted with even if the user performs other interface operations. Therefore, by using the floating ball to add a constant-on attribute to the window view of the terminal device, the limitation of the constant-on flag or operation strategy provided by the direct application system being inconsistent in different versions or systems can be avoided. And using the floating ball as an intermediary, the floating ball is usually regarded as a user-visible and interactive element, rather than a pure background activity, so that the RPA application can run stably under a variety of different system configurations and versions, and improves cross-platform compatibility. Therefore, the present application ensures that the RPA application can not only remain active and the screen is always on on various devices and system versions, but also provide better user experience and system compatibility by using the floating ball.
[0037] As a possible implementation method, in order to control the screen brightness attribute based on the floating ball, you first need to create a floating ball. Figure 3 The flowchart of a method for creating and displaying a suspended ball provided in an embodiment of the present application is shown. Figure 3 As shown, the above step S101 responds to the floating ball display instruction triggered in the front-end application, and displays the floating ball on the terminal device specifically includes the following steps:
[0038] S301. In response to a floating ball display indication triggered in a front-end application, obtain window attribute information of the floating ball, where the window attribute information includes: window category, window position, window flag, and window size.
[0039] Optionally, the window attribute information of the floating ball can be created and obtained through the registration and construction service FloatWindowService. Among them, the window category is used to define the type of floating ball, for example, indicating that the floating ball is always displayed on the upper layer of all application interfaces. The window position is used to define the coordinate position of the floating ball on the screen, for example, it can be set by default to place the floating ball in the upper right corner of the terminal device. The window flag includes a series of flags used to control the behavior and appearance of the floating ball, such as controlling the display of the floating ball through the screen always-on display flag to keep the terminal device screen always on, or indicating the floating ball to handle external events by default through other window flags, the internal view of the floating ball can be set to intercept, and the floating ball window container can be set to cover the entire screen of the terminal device. The window size is used to define the width and height of the floating ball, for example, the width and height of the floating ball are determined by the floating ball content view to determine the display area. If the window flag sets the floating ball window container to cover the entire screen of the terminal device, when the floating ball is in the expanded state, the floating ball content view can also cover the entire screen, and when the floating ball is folded, only a fixed-size content area is displayed.
[0040] S302: Create and display a floating ball based on the window attribute information.
[0041] Optionally, after creating and obtaining the window attribute information of the floating ball, a floating ball window view can be created based on the window attribute information, and the floating ball window view will carry the UI elements of the floating ball. Once the floating ball is created and displayed on the screen of the terminal device, the front-end application needs to be associated with the floating ball, that is, the floating ball will listen to the events of the front-end application.
[0042] As a possible implementation method, the above step S302 creates and displays a floating ball based on the window attribute information, including: determining the floating ball layout information based on the window attribute information; registering the service class in the application system of the terminal device, and creating the floating ball based on the service class and the floating ball layout information.
[0043] Optionally, the window attribute information determines the layout information of the floating ball, such as the visual presentation of the floating ball, such as icon, button or text, etc. To create a floating ball, a service class Service needs to be registered in the application system of the terminal device. The registered service class ensures that the floating ball can remain running even when the user switches to other applications.
[0044] Exemplarily, the Window Manager service provided by the Android system for managing windows on the screen is obtained, and the window attribute information is used to create a LayoutParams object, which defines the window attribute information of the floating ball, such as the display position, size, and logo of the floating ball. Then, by loading the UI element of the floating ball, the layout of the floating ball is added to the WindowManager service, so that the floating ball is displayed on the screen of the terminal device.
[0045] Optionally, the above steps determine the floating ball layout information based on the window attribute information, including: determining the display level and display position of the floating ball based on the window category and window position; determining the response conditions of the floating ball and the view inside the floating ball, as well as the display area of the view inside the floating ball based on the window flag, wherein multiple functional components are displayed on the view inside the floating ball; determining the display size of the view inside the floating ball based on the window size, and determining the display size of the floating ball according to the display content of the view inside the floating ball.
[0046] Exemplarily, the floating ball includes two display states: expanded and collapsed. When the floating ball is in the "collapsed" display state, the floating ball is always displayed on the upper layer of all application interfaces based on the window category, and the display position of the floating ball is defined based on the window position, for example, it is displayed in the upper right corner of the screen. Figure 2 As shown in the left half of the diagram, the floating ball will be displayed in the upper right corner of the screen as a "circular" icon of a certain size, and for different user operations, application switching or system events, the floating ball is always displayed on the top layer of all application interfaces. Figure 2 The right half of the schematic diagram shows an internal view of the floating ball on the screen, and multiple functional components are displayed on the internal view of the floating ball. That is, when the floating ball is in the "expanded" state, a function menu will be displayed on the screen for user operation.
[0047] Exemplarily, the response conditions of the floating ball and the internal view of the floating ball can be determined based on the window flag. The response condition of the floating ball is to process external events by default, which means that the floating ball can respond to external touch events by default, that is, any click or touch by the user on the screen will be captured and processed by the floating ball. The response condition of the internal view of the floating ball is that the internal view of the floating ball can be set as required whether to intercept touch events. If interception is set, the internal view of the floating ball can give priority to handling touch events instead of letting the floating ball handle them as a whole. In addition, the display area of the internal view of the floating ball can be determined according to the window flag. For example, the internal view of the floating ball can be set to cover the entire screen. Because the window flag sets the internal view of the floating ball to cover the entire screen, the internal view of the floating ball can occupy the entire screen space when the floating ball is in the expanded state.
[0048] For example, the width and height of the floating ball can be set according to the window size, and the display size is determined by the display content of the floating ball content view, that is, the display size of the floating ball can be adjusted according to the display content of the internal view of the floating ball. If the internal view of the floating ball displays more content, the display size of the floating ball will become larger, otherwise it will be smaller. In addition, based on the setting of the window flag and the window size, when the floating ball is in the retracted state, only the floating ball of a fixed area size is displayed on the screen, and the floating ball will not cover the entire screen. When the floating ball is in the expanded state, the internal view of the floating ball can be expanded to present a full-screen mode.
[0049] Based on this, on the basis of determining the properties of the floating ball window, the WindowManager service is used to actually create and display the floating ball, and to ensure that the floating ball can be coordinated with the running status of the front-end application and user interaction, providing users with an efficient and intuitive interaction method. At the same time, the floating ball provides a screen always-on control method that is not affected by factors such as system version compatibility.
[0050] As a possible implementation, the above step S102 responds to the startup operation of the floating ball, sets the screen brightness adjustment attribute of the floating ball to the constant light mode to keep the screen of the terminal device always on, and adjusts the screen brightness of the terminal device to a preset low brightness, including:
[0051] In response to the activation operation of the first switch on the internal view of the floating ball, the screen brightness adjustment attribute of the floating ball is set to the constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness. The first switch is used to indicate that the screen brightness adjustment attribute of the floating ball is set to be always on.
[0052] Optionally, when the floating ball is in the unfolded state, an internal view of the floating ball can be displayed on the screen of the terminal device, and a plurality of functional components, such as buttons, switches, etc., are displayed on the internal view of the floating ball. Figure 2 As shown, the internal view of the suspended ball is Figure 2 The function menu shown in the figure provides users with a variety of user interface elements to control the screen display of the terminal device. The first switch is a user interface element provided by the function menu displayed by the floating ball, and its function is to allow the user to start or stop the function of the floating ball controlling the terminal device screen to be always on through the first switch. The display form of the first switch can be a slider, a button, etc., which is not specifically limited.
[0053] Exemplarily, when the user activates the first switch, the terminal device detects the user's activation behavior, such as responding to the user turning on the first switch, and responds according to the state of the first switch. For example, if the user turns on the first switch, a request is sent to the terminal device to request the system of the terminal device to keep the screen always on, that is, the screen will not turn off automatically. If the first switch is in the off state, the normal screen timeout / screen off time setting of the terminal device system is restored.
[0054] Optionally, in response to a startup operation on the first switch on the internal view of the floating ball, the currently active window object is obtained, and the screen brightness adjustment properties of the floating ball are obtained based on the window object, and a screen always-on display flag is added to the screen brightness adjustment properties to modify the flag bit of the screen brightness adjustment properties to obtain the modified screen brightness adjustment properties; the modified screen brightness adjustment properties are applied to the window object to set the screen brightness adjustment properties of the floating ball to always-on mode.
[0055] Exemplarily, to realize the screen always on in the Android system, it is necessary to inform the Android system to keep the screen in the always-on state by setting the flag of the window. Specifically, it is necessary to first obtain the currently active window object, obtain the screen brightness adjustment attribute of the floating ball through the window object, and in the window attribute of the screen brightness adjustment attribute, use the bitwise or operator to add the screen always-on display flag FLAG_KEEP_SCREEN_ON to modify the flag of the screen brightness adjustment attribute, and apply the modified screen brightness adjustment attribute back to the window object. In this way, in the process of setting the screen brightness adjustment attribute of the floating ball to the always-on mode based on the activation of the first switch, the screen always-on display flag FLAG_KEEP_SCREEN_ON is sent to the terminal device system and set, so as to realize the screen always on by adding the screen always-on display flag in the screen brightness adjustment attribute of the floating ball, so as to inform the terminal setting system not to dim the screen or lock the screen due to idleness.
[0056] Based on this, the screen brightness of the terminal device is adjusted to a preset low brightness while keeping the terminal device screen always on, which not only meets the functional requirements in application scenarios that require continuous screen display, but also takes into account the battery life and user experience of the terminal device.
[0057] As a possible implementation manner, a second switch is displayed on the internal view of the floating ball, and the second switch is used to indicate starting the automatic brightness adjustment function of the terminal device. The method also includes:
[0058] In response to the start-up operation of the second switch on the internal view of the floating ball, the screen brightness of the terminal device is adjusted to an initial screen brightness, and the initial screen brightness is greater than a preset low brightness.
[0059] Optionally, the second switch is used to start the automatic brightness adjustment function of the terminal device. When the user performs a startup operation of starting the second switch, the automatic brightness adjustment function of the terminal device is activated, so that the screen brightness of the terminal device is automatically adjusted according to the change of ambient light. The display form of the second switch can be a slider, a button, etc., which is not specifically limited.
[0060] Optionally, in response to a startup operation on a second switch on the internal view of the floating ball, an automatic brightness adjustment function of the application system of the terminal device is disabled, and the screen brightness of the terminal device is set to a brightness value corresponding to the initial screen brightness, and after the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, the automatic brightness adjustment function is re-enabled.
[0061] Exemplarily, the initial screen brightness refers to the brightness of the screen before the user operates the first switch to adjust the screen brightness to the preset low brightness, or the default brightness setting of the terminal device. When the second switch is turned on, the screen brightness of the terminal device is adjusted back to the initial screen brightness, and the automatic brightness adjustment function is enabled. Among them, the initial screen brightness is greater than the preset low brightness, which means that when the screen brightness is switched from the preset low brightness to the initial screen brightness, the screen brightness will be improved to a certain extent to adapt to a wider range of lighting environments.
[0062] Specifically, before adjusting the screen brightness of the terminal device to the initial screen brightness, the current screen brightness of the terminal device can be saved so that the brightness value can be restored when needed later. When the user clicks the second switch on the internal view of the floating ball, in order to ensure that the set screen brightness takes effect, the automatic brightness adjustment function of the Android system is first disabled, and then the screen brightness is set to the brightness value corresponding to the initial screen brightness. After adjusting the screen brightness, the automatic brightness adjustment function of the Android system is re-enabled.
[0063] Based on this, the start-up operation of the second switch enables the screen brightness of the terminal device to be automatically adjusted according to changes in the light of the surrounding environment, thereby providing users with a more comfortable experience under different lighting conditions.
[0064] As a possible implementation manner, the method further includes: in response to the running state of the front-end application reaching a preset state, adjusting the screen brightness of the terminal device to an initial screen brightness.
[0065] Optionally, the running state of the front-end application includes but is not limited to the currently executed task, the interaction state with the user, and the performance status of the application, etc. The preset state includes but is not limited to any of the following: the front-end application's automated operation is finished, and the front-end application does not have the running requirement of keeping the screen always on.
[0066] Optionally, the running status of the front-end application is monitored in real time, and it is determined whether the running status of the front-end application reaches a preset state; if so, the automatic brightness adjustment function of the application system of the terminal device is disabled, and the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, and after the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, the automatic brightness adjustment function is re-enabled.
[0067] Exemplarily, when the running state of the front-end application meets any of the above preset states, such as the front-end application no longer performs automated operations or the user has stopped interacting with the application, the terminal device system will automatically adjust the screen brightness of the terminal device and adjust the screen brightness of the terminal device to the initial screen brightness. Specifically, before adjusting the screen brightness of the terminal device to the initial screen brightness, the current screen brightness of the terminal device can be saved so that the brightness value can be restored when needed later. When it is monitored that the running state of the front-end application reaches any of the above preset states, in order to ensure that the set screen brightness takes effect, first disable the automatic brightness adjustment function of the Android system, then set the screen brightness to the brightness value corresponding to the initial screen brightness, and after adjusting the screen brightness, re-enable the automatic brightness adjustment function of the Android system.
[0068] Based on this, the screen brightness is adjusted dynamically in real time according to application requirements. When the automated operation of the front-end application is completed or the screen no longer needs to be kept on, the screen brightness is automatically adjusted back to the initial state. While ensuring a good visual experience for application scenarios with different brightness requirements, it saves power consumption of the terminal device and extends the battery life of the terminal device.
[0069] As a possible implementation, the method further includes: in response to the stop operation of the second switch on the internal view of the floating ball, setting the screen brightness adjustment property of the floating ball to a default brightness mode, in which the screen of the terminal device does not remain always on.
[0070] Optionally, in response to a stop operation on the second switch on the internal view of the floating ball, the currently active window object is obtained, and the screen brightness adjustment properties of the floating ball are obtained based on the window object, the screen always-on display flag in the screen brightness adjustment properties is removed to modify the flag bit of the screen brightness adjustment properties to obtain the modified screen brightness adjustment properties; the modified screen brightness adjustment properties are applied to the window object to set the screen brightness adjustment properties of the floating ball to the default brightness mode.
[0071] Exemplarily, when the first switch is in the on state, the floating ball will keep the screen brightness adjustment attribute in the always-on mode, ensuring that the screen of the terminal device will not automatically turn off, and the screen brightness remains at a preset low brightness. When the user performs a stop operation based on the internal view of the floating ball, the stop operation refers to the user switching the second switch displayed on the internal view of the floating ball from the "on" position to the "off" position, and by updating the window attribute information of the floating ball, the screen always-on display flag FLAG_KEEP_SCREEN_ON is removed, so as to set the screen brightness adjustment attribute of the floating ball to the default brightness mode. At this time, the screen of the terminal device will no longer remain always on. On this basis, the floating ball will lose the ability to keep the screen always on, and the floating ball will no longer request the terminal device system to maintain the screen always on. Instead, the screen of the running terminal device will automatically turn off according to the conventional timeout setting time.
[0072] Exemplarily, once the screen brightness adjustment property of the floating ball is set to the default brightness mode, the screen of the terminal device will follow the default timeout / screen off setting, that is, the screen of the terminal device will automatically turn off after a period of time to save battery power.
[0073] Based on this, through the user's interaction with the first switch on the floating ball, it is possible to dynamically control whether the terminal device screen remains always on. When the first switch is turned off, the floating ball will give up its control over the always-on state of the screen, allowing the terminal device screen to operate according to its normal behavior, that is, automatically turn off after a predetermined time, which helps save battery power.
[0074] As a possible implementation method, before the above step S102, the method also includes: the front-end application sends a permission acquisition request to the terminal device, and receives a result of processing the permission request, where the permission acquisition request is used to obtain processing permission for adjusting the screen brightness adjustment properties of the terminal device.
[0075] Optionally, in the Android system, adjusting the screen brightness of the terminal device or accessing system settings related to brightness usually requires the RPA application to have special permissions, that is, to obtain the permission to write system settings in Settings. Therefore, in order to ensure that the front-end application can adjust the screen brightness of the terminal device, the front-end application needs to send a permission acquisition request to the terminal device to request the terminal device system to obtain the processing permission to adjust the screen brightness adjustment properties of the terminal device.
[0076] Exemplarily, the result of processing the permission request is used to indicate whether the front-end application obtains the permission to adjust the screen brightness adjustment properties of the terminal device, and the result of processing the permission request generally includes two situations: the request is passed or not. Once the front-end application obtains the required permissions, it can use the API provided by Android to read or write system settings, such as using the methods in the Settings.System class to adjust the screen brightness.
[0077] Optionally, if the result of processing the permission request is passed, in response to the startup operation of the floating ball, the screen brightness adjustment attribute of the floating ball is set to the always-on mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0078] For example, if the result of processing the permission request is passed, it means that the front-end application has the permission to modify the brightness adjustment properties of the terminal device screen. After obtaining this permission, the floating ball display can be used to control the always-on state of the terminal device screen. At this time, even if there is no user input, the terminal device screen will not automatically turn off.
[0079] Based on this, in order to ensure that the front-end application can adjust the screen brightness of the terminal device, the front-end application must first obtain appropriate system permissions. This mechanism not only protects the security of the terminal device and user privacy, but also ensures that the front-end application can make system-level changes that may affect device performance and user experience only with permission.
[0080] As a possible implementation, Figure 4 FIG. 1 is a flow chart of a method for dynamically setting screen window attributes provided by an embodiment of the present application. Figure 4 As shown, after the floating ball service is enabled and created, the floating ball view is added to the screen display window to display a floating ball on the screen of the terminal device. On this basis, whether the current operating environment is an automated scene is determined based on whether the front-end application is currently performing automated operations. If the front-end application is performing an automated operation process, the screen always-on attribute is added to the floating ball using the screen always-on display flag, that is, the screen brightness adjustment attribute of the floating ball is set to the always-on mode to ensure that the floating ball display can control the terminal device screen to always be on. If the operating environment of the front-end application is not an automated scene, the screen always-on attribute is removed, that is, the screen always-on display flag is deleted, so that the screen brightness of the terminal device returns to the default brightness mode.
[0081] As a possible implementation, Figure 5 A schematic diagram of a screen brightness adjustment method provided in an embodiment of the present application is shown. Figure 5As shown, the embodiment of the present application also provides a screen brightness adjuster. In response to the user's operation on the second switch, the screen brightness adjuster can dynamically adjust the screen brightness according to the current screen brightness value and the second switch control. Specifically, after the front-end application is started, in response to the user's click operation on the floating ball, the function menu of the floating ball is displayed on the screen of the terminal device, and the floating ball is triggered to perform the corresponding automated function. On the basis of keeping the screen of the terminal device always on, the screen brightness is adjusted to a preset low brightness using the screen brightness adjuster, that is, the screen display mode of the terminal device enters a low brightness mode, further reducing invalid power consumption. After the automated operation process of the front-end application is completed, or the front-end application no longer has the operating requirement to keep the screen always on, the screen brightness configuration is restored based on the screen brightness adjuster, and the screen brightness is restored to the initial brightness before the brightness adjustment operation is performed.
[0082] Based on this, the embodiment of the present application sets the screen always-on window attribute FLAG_KEEP_SCREEN_ON through the floating ball device active in the foreground, adapts to the screen always-on strategy of each manufacturer, and uses the screen brightness adjuster to dynamically adjust the screen brightness on the basis of keeping the screen always on, so as to reduce the battery power loss caused by excessive screen brightness value when the front-end application is running, and restore the brightness after the automated operation of the front-end application is completed, so as to maintain the operating habits of the device user. In addition, the function menu of the floating ball in this application can be customized. In addition to supporting commonly used function entrances, the above-mentioned first switch, second switch and other RPA operation switches can also be added, and the operation switch can be linked with window attributes such as the screen always on to enhance the functional expansibility of the floating ball.
[0083] Based on the same inventive concept, a screen attribute control device corresponding to the screen attribute control method is also provided in the embodiment of the present application. Since the principle of solving the problem by the screen attribute control device in the embodiment of the present application is similar to the above-mentioned screen attribute control method in the embodiment of the present application, the implementation of the screen attribute control device can refer to the implementation of the screen attribute control method, and the repeated parts will not be repeated.
[0084] Reference Figure 6 , which is a schematic diagram of the structure of a screen attribute control device provided in an embodiment of the present application, the screen attribute control device 600 includes: a display module 601, a setting module 602, wherein:
[0085] The display module 601 is used to display the floating ball on the terminal device in response to the floating ball display instruction triggered in the front-end application, wherein the front-end application runs on the terminal device;
[0086] The setting module 602 is used to respond to the startup operation of the floating ball, set the screen brightness adjustment attribute of the floating ball to the constant light mode to keep the screen of the terminal device always on, and adjust the screen brightness of the terminal device to a preset low brightness.
[0087] Based on this, according to the screen attribute control device of the embodiment of the present application, on the basis of continuing the battery management strategy of the terminal device system, a new floating ball service is added, which requests the terminal device screen to remain always on by opening an active floating ball window view on the front-end application, and adjusts the screen brightness to a preset low brightness while keeping the screen always on, so as to reduce power consumption by dynamically adjusting the screen brightness when the RPA application is running. As a UI element that is always at the top of the screen, the floating ball is still visible and interacted with even if the user performs other interface operations. Therefore, by using the floating ball to add a constant-on attribute to the window view of the terminal device, the limitation of the constant-on flag or operation strategy provided by the direct application system being inconsistent in different versions or systems can be avoided. And using the floating ball as an intermediary, the floating ball is usually regarded as a user-visible and interactive element, rather than a pure background activity, so that the RPA application can run stably under a variety of different system configurations and versions, and improves cross-platform compatibility. Therefore, the present application ensures that the RPA application can not only remain active and the screen is always on on various devices and system versions, but also provide better user experience and system compatibility by using the floating ball.
[0088] In a possible implementation manner, the display module 601 is specifically used for:
[0089] In response to the floating ball display indication triggered in the front-end application, the window attribute information of the floating ball is obtained, and the window attribute information includes: window category, window position, window flag, and window size;
[0090] Create and display a floating ball based on the window attribute information.
[0091] In a possible implementation manner, the display module 601 is further used for:
[0092] Based on the window attribute information, determine the floating ball layout information;
[0093] The service class is registered in the application system of the terminal device, and a floating ball is created based on the service class and the floating ball layout information.
[0094] In a possible implementation manner, the display module 601 is further used for:
[0095] Based on the window type and window position, determine the display level and display position of the floating ball;
[0096] Based on the window flag, determining the response conditions of the floating ball and the view inside the floating ball, as well as the display area of the view inside the floating ball, wherein a plurality of functional components are displayed on the view inside the floating ball;
[0097] Based on the window size, the display size of the internal view of the floating ball is determined, and according to the display content of the internal view of the floating ball, the display size of the floating ball is determined.
[0098] In a possible implementation manner, the display module 601 is specifically used for:
[0099] In response to the start-up operation of the first switch on the internal view of the floating ball, the screen brightness adjustment property of the floating ball is set to the constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0100] In a possible implementation manner, the display module 601 is specifically used for:
[0101] In response to the start operation of the first switch on the internal view of the floating ball, the currently active window object is obtained, and the screen brightness adjustment attribute of the floating ball is obtained based on the window object, and a screen always-on display flag is added to the screen brightness adjustment attribute to modify the flag bit of the screen brightness adjustment attribute to obtain the modified screen brightness adjustment attribute;
[0102] Apply the modified screen brightness adjustment property to the window object to set the screen brightness adjustment property of the floating ball to the constant brightness mode.
[0103] In a possible implementation manner, the screen attribute control device 600 further includes an adjustment module, and the adjustment module is specifically used to:
[0104] In response to the start-up operation of the second switch on the internal view of the floating ball, the screen brightness of the terminal device is adjusted to an initial screen brightness, and the initial screen brightness is greater than a preset low brightness.
[0105] In a possible implementation manner, the adjustment module is specifically used to:
[0106] In response to the startup operation of the second switch on the internal view of the floating ball, the automatic brightness adjustment function of the application system of the terminal device is disabled, and the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, and after the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, the automatic brightness adjustment function is re-enabled.
[0107] In a possible implementation manner, the adjustment module is further used to:
[0108] In response to the running state of the front-end application reaching a preset state, the screen brightness of the terminal device is adjusted to the initial screen brightness.
[0109] In a possible implementation manner, the adjustment module is specifically used to:
[0110] Monitor the running status of the front-end application in real time and determine whether the running status of the front-end application reaches the preset state;
[0111] If so, disable the automatic brightness adjustment function of the terminal device's application system, set the screen brightness of the terminal device to the brightness value corresponding to the initial screen brightness, and re-enable the automatic brightness adjustment function after setting the screen brightness of the terminal device to the brightness value corresponding to the initial screen brightness.
[0112] In a possible implementation manner, the setting module 602 is further used to:
[0113] In response to the stop operation of the second switch on the internal view of the floating ball, the screen brightness adjustment attribute of the floating ball is set to a default brightness mode. In the default brightness mode, the screen of the terminal device does not remain always on.
[0114] In a possible implementation manner, the setting module 602 is further used to:
[0115] In response to a stop operation on the second switch on the internal view of the floating ball, a currently active window object is obtained, and a screen brightness adjustment property of the floating ball is obtained based on the window object, and a screen always-on display flag in the screen brightness adjustment property is removed to modify the flag bit of the screen brightness adjustment property to obtain the modified screen brightness adjustment property;
[0116] Apply the modified screen brightness adjustment property to the window object to set the screen brightness adjustment property of the floating ball to the default brightness mode.
[0117] In a possible implementation manner, the screen attribute control device 600 further includes a request module, and the request module is specifically used to:
[0118] The front-end application sends a permission request to the terminal device and receives a result of processing the permission request. The permission request is used to obtain processing permission to adjust the screen brightness adjustment attribute of the terminal device.
[0119] In a possible implementation manner, the setting module 602 is specifically used to:
[0120] If the result of processing the permission request is passed, in response to the startup operation of the floating ball, the screen brightness adjustment property of the floating ball is set to the always-on mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0121] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0122] The present application embodiment also provides an electronic device 700, such as Figure 7 As shown, it is a schematic diagram of the structure of the electronic device 700 provided in the embodiment of the present application, including: a processor 701, a memory 702, and optionally, a bus 703. The memory 702 stores machine-readable instructions executable by the processor 701. When the electronic device 700 is running, the processor 701 communicates with the memory 702 through the bus 703. When the machine-readable instructions are executed by the processor 701, the following processing is performed:
[0123] In response to a floating ball display instruction triggered in a front-end application, a floating ball is displayed on a terminal device, wherein the front-end application is running on the terminal device;
[0124] In response to the startup operation for the floating ball, the screen brightness adjustment property of the floating ball is set to the constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0125] In a possible implementation manner, when the processor 701 executes an instruction to display a floating ball on the terminal device in response to a floating ball display instruction triggered in the front-end application, the processor 701 is specifically configured to:
[0126] In response to the floating ball display indication triggered in the front-end application, the window attribute information of the floating ball is obtained, and the window attribute information includes: window category, window position, window flag, and window size;
[0127] Create and display a floating ball based on the window attribute information.
[0128] In a possible implementation manner, when the processor 701 executes the instruction to create and display the floating ball based on the window attribute information, it is specifically configured to:
[0129] Based on the window attribute information, determine the floating ball layout information;
[0130] The service class is registered in the application system of the terminal device, and a floating ball is created based on the service class and the floating ball layout information.
[0131] In a possible implementation manner, when the processor 701 executes the instruction to determine the floating ball layout information based on the window attribute information, it is specifically configured to:
[0132] Based on the window type and window position, determine the display level and display position of the floating ball;
[0133] Based on the window flag, determining the response conditions of the floating ball and the view inside the floating ball, as well as the display area of the view inside the floating ball, wherein a plurality of functional components are displayed on the view inside the floating ball;
[0134] Based on the window size, the display size of the internal view of the floating ball is determined, and according to the display content of the internal view of the floating ball, the display size of the floating ball is determined.
[0135] In a possible implementation manner, when the processor 701 executes an instruction to respond to a startup operation on the floating ball, set the screen brightness adjustment attribute of the floating ball to the always-on mode to keep the screen of the terminal device always on, and adjust the screen brightness of the terminal device to a preset low brightness, it is specifically used to:
[0136] In response to the start-up operation of the first switch on the internal view of the floating ball, the screen brightness adjustment property of the floating ball is set to the constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0137] In a possible implementation manner, when the processor 701 executes an instruction to set the screen brightness adjustment attribute of the floating ball to the constant light mode in response to the start-up operation of the first switch on the internal view of the floating ball, the processor 701 is specifically configured to:
[0138] In response to the start operation of the first switch on the internal view of the floating ball, the currently active window object is obtained, and the screen brightness adjustment attribute of the floating ball is obtained based on the window object, and a screen always-on display flag is added to the screen brightness adjustment attribute to modify the flag bit of the screen brightness adjustment attribute to obtain the modified screen brightness adjustment attribute;
[0139] Apply the modified screen brightness adjustment property to the window object to set the screen brightness adjustment property of the floating ball to the constant brightness mode.
[0140] In a possible implementation manner, the processor 701 is further configured to:
[0141] In response to the start-up operation of the second switch on the internal view of the floating ball, the screen brightness of the terminal device is adjusted to an initial screen brightness, and the initial screen brightness is greater than a preset low brightness.
[0142] In a possible implementation manner, when the processor 701 executes an instruction to adjust the screen brightness of the terminal device to the initial screen brightness in response to the start-up operation of the second switch on the internal view of the floating ball, it is specifically configured to:
[0143] In response to the startup operation of the second switch on the internal view of the floating ball, the automatic brightness adjustment function of the application system of the terminal device is disabled, and the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, and after the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, the automatic brightness adjustment function is re-enabled.
[0144] In a possible implementation manner, the processor 701 is further configured to:
[0145] In response to the running state of the front-end application reaching a preset state, the screen brightness of the terminal device is adjusted to the initial screen brightness.
[0146] In a possible implementation, when the processor 701 executes an instruction to adjust the screen brightness of the terminal device to the initial screen brightness in response to the running state of the front-end application reaching a preset state, the processor 701 is specifically configured to:
[0147] Monitor the running status of the front-end application in real time and determine whether the running status of the front-end application reaches the preset state;
[0148] If so, disable the automatic brightness adjustment function of the terminal device's application system, set the screen brightness of the terminal device to the brightness value corresponding to the initial screen brightness, and re-enable the automatic brightness adjustment function after setting the screen brightness of the terminal device to the brightness value corresponding to the initial screen brightness.
[0149] In a possible implementation manner, the processor 701 is further configured to:
[0150] In response to the stop operation of the second switch on the internal view of the floating ball, the screen brightness adjustment attribute of the floating ball is set to a default brightness mode. In the default brightness mode, the screen of the terminal device does not remain always on.
[0151] In a possible implementation manner, when the processor 701 executes an instruction to set the screen brightness adjustment attribute of the floating ball to the default brightness mode in response to the stop operation of the second switch on the internal view of the floating ball, it is specifically configured to:
[0152] In response to a stop operation on the second switch on the internal view of the floating ball, a currently active window object is obtained, and a screen brightness adjustment property of the floating ball is obtained based on the window object, and a screen always-on display flag in the screen brightness adjustment property is removed to modify the flag bit of the screen brightness adjustment property to obtain the modified screen brightness adjustment property;
[0153] Apply the modified screen brightness adjustment property to the window object to set the screen brightness adjustment property of the floating ball to the default brightness mode.
[0154] In a possible implementation manner, before executing an instruction to respond to a startup operation on the floating ball, set the screen brightness adjustment attribute of the floating ball to a constant light mode to keep the screen of the terminal device always on, and adjust the screen brightness of the terminal device to a preset low brightness, the processor 701 is further configured to:
[0155] The front-end application sends a permission request to the terminal device and receives a result of processing the permission request. The permission request is used to obtain processing permission to adjust the screen brightness adjustment attribute of the terminal device.
[0156] In a possible implementation manner, when the processor 701 executes an instruction to respond to a startup operation on the floating ball, set the screen brightness adjustment attribute of the floating ball to the always-on mode to keep the screen of the terminal device always on, and adjust the screen brightness of the terminal device to a preset low brightness, it is specifically used to:
[0157] If the result of processing the permission request is passed, in response to the startup operation of the floating ball, the screen brightness adjustment property of the floating ball is set to the always-on mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0158] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are performed:
[0159] In response to a floating ball display instruction triggered in a front-end application, a floating ball is displayed on a terminal device, wherein the front-end application is running on the terminal device;
[0160] In response to the startup operation for the floating ball, the screen brightness adjustment property of the floating ball is set to the constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0161] In a possible implementation manner, when the processor executes an instruction to display a floating ball on a terminal device in response to a floating ball display instruction triggered in a front-end application, the processor is specifically configured to:
[0162] In response to the floating ball display indication triggered in the front-end application, the window attribute information of the floating ball is obtained, and the window attribute information includes: window category, window position, window flag, and window size;
[0163] Create and display a floating ball based on the window attribute information.
[0164] In a possible implementation manner, when the processor executes the instruction to create and display the floating ball based on the window attribute information, it is specifically configured to:
[0165] Based on the window attribute information, determine the floating ball layout information;
[0166] The service class is registered in the application system of the terminal device, and a floating ball is created based on the service class and the floating ball layout information.
[0167] In a possible implementation manner, when the processor executes the instruction to determine the floating ball layout information based on the window attribute information, it is specifically configured to:
[0168] Based on the window type and window position, determine the display level and display position of the floating ball;
[0169] Based on the window flag, determining the response conditions of the floating ball and the view inside the floating ball, as well as the display area of the view inside the floating ball, wherein a plurality of functional components are displayed on the view inside the floating ball;
[0170] Based on the window size, the display size of the internal view of the floating ball is determined, and according to the display content of the internal view of the floating ball, the display size of the floating ball is determined.
[0171] In a possible implementation manner, when the processor executes an instruction to respond to a startup operation on the floating ball, set the screen brightness adjustment attribute of the floating ball to a constant light mode to keep the screen of the terminal device always on, and adjust the screen brightness of the terminal device to a preset low brightness, it is specifically used to:
[0172] In response to the start-up operation of the first switch on the internal view of the floating ball, the screen brightness adjustment property of the floating ball is set to the constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0173] In a possible implementation manner, when the processor executes an instruction to set the screen brightness adjustment attribute of the floating ball to the constant light mode in response to the start-up operation of the first switch on the internal view of the floating ball, the processor is specifically configured to:
[0174] In response to the start operation of the first switch on the internal view of the floating ball, the currently active window object is obtained, and the screen brightness adjustment attribute of the floating ball is obtained based on the window object, and a screen always-on display flag is added to the screen brightness adjustment attribute to modify the flag bit of the screen brightness adjustment attribute to obtain the modified screen brightness adjustment attribute;
[0175] Apply the modified screen brightness adjustment property to the window object to set the screen brightness adjustment property of the floating ball to the constant brightness mode.
[0176] In a possible implementation manner, the processor is further configured to:
[0177] In response to the start-up operation of the second switch on the internal view of the floating ball, the screen brightness of the terminal device is adjusted to an initial screen brightness, and the initial screen brightness is greater than a preset low brightness.
[0178] In a possible implementation manner, when the processor executes an instruction to adjust the screen brightness of the terminal device to the initial screen brightness in response to the start-up operation of the second switch on the internal view of the floating ball, the processor is specifically configured to:
[0179] In response to the startup operation of the second switch on the internal view of the floating ball, the automatic brightness adjustment function of the application system of the terminal device is disabled, and the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, and after the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, the automatic brightness adjustment function is re-enabled.
[0180] In a possible implementation manner, the processor is further configured to:
[0181] In response to the running state of the front-end application reaching a preset state, the screen brightness of the terminal device is adjusted to the initial screen brightness.
[0182] In a possible implementation, when the processor executes an instruction to adjust the screen brightness of the terminal device to the initial screen brightness in response to the running state of the front-end application reaching a preset state, the processor is specifically configured to:
[0183] Monitor the running status of the front-end application in real time and determine whether the running status of the front-end application reaches the preset state;
[0184] If so, disable the automatic brightness adjustment function of the terminal device's application system, set the screen brightness of the terminal device to the brightness value corresponding to the initial screen brightness, and re-enable the automatic brightness adjustment function after setting the screen brightness of the terminal device to the brightness value corresponding to the initial screen brightness.
[0185] In a possible implementation manner, the processor is further configured to:
[0186] In response to the stop operation of the second switch on the internal view of the floating ball, the screen brightness adjustment attribute of the floating ball is set to a default brightness mode. In the default brightness mode, the screen of the terminal device does not remain always on.
[0187] In a possible implementation manner, when the processor executes an instruction to set the screen brightness adjustment attribute of the floating ball to a default brightness mode in response to a stop operation of the second switch on the internal view of the floating ball, the processor is specifically configured to:
[0188] In response to a stop operation on the second switch on the internal view of the floating ball, a currently active window object is obtained, and a screen brightness adjustment property of the floating ball is obtained based on the window object, and a screen always-on display flag in the screen brightness adjustment property is removed to modify the flag bit of the screen brightness adjustment property to obtain the modified screen brightness adjustment property;
[0189] Apply the modified screen brightness adjustment property to the window object to set the screen brightness adjustment property of the floating ball to the default brightness mode.
[0190] In a possible implementation manner, before executing an instruction to respond to a startup operation on the floating ball, set the screen brightness adjustment attribute of the floating ball to a constant light mode to keep the screen of the terminal device always on, and adjust the screen brightness of the terminal device to a preset low brightness, the processor is further configured to:
[0191] The front-end application sends a permission request to the terminal device and receives a result of processing the permission request. The permission request is used to obtain processing permission to adjust the screen brightness adjustment attribute of the terminal device.
[0192] In a possible implementation manner, when the processor executes an instruction to respond to a startup operation on the floating ball, set the screen brightness adjustment attribute of the floating ball to a constant light mode to keep the screen of the terminal device always on, and adjust the screen brightness of the terminal device to a preset low brightness, it is specifically used to:
[0193] If the result of processing the permission request is passed, in response to the startup operation of the floating ball, the screen brightness adjustment property of the floating ball is set to the always-on mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
[0194] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0195] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Mem ory), disk or optical disk and other media that can store program code.
[0196] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A screen attribute control method, characterized in that: include: In response to a floating ball display instruction triggered in a front-end application, displaying a floating ball on a terminal device, wherein the front-end application runs on the terminal device; In response to a startup operation on the floating ball, the screen brightness adjustment property of the floating ball is set to a constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
2. The screen attribute control method according to claim 1, characterized in that: The step of displaying a floating ball on a terminal device in response to a floating ball display indication triggered in a front-end application includes: In response to a floating ball display indication triggered in a front-end application, obtain window attribute information of the floating ball, wherein the window attribute information includes: window category, window position, window flag, and window size; Based on the window attribute information, the floating ball is created and displayed.
3. The screen attribute control method according to claim 2, characterized in that: The creating and displaying the floating ball based on the window attribute information includes: Determining floating ball layout information based on the window attribute information; A service class is registered in the application system of the terminal device, and the floating ball is created based on the service class and the floating ball layout information.
4. The screen attribute control method according to claim 2, characterized in that: The determining the floating ball layout information based on the window attribute information includes: Based on the window category and the window position, determining a display level and a display position of the floating ball; Based on the window flag, determining response conditions of the floating ball and the internal view of the floating ball, and a display area of the internal view of the floating ball, wherein a plurality of functional components are displayed on the internal view of the floating ball; Based on the window size, the display size of the internal view of the floating ball is determined, and according to the display content of the internal view of the floating ball, the display size of the floating ball is determined.
5. The screen attribute control method according to claim 1, characterized in that: The step of responding to the startup operation of the suspension ball, setting the screen brightness adjustment attribute of the suspension ball to a constant light mode to keep the screen of the terminal device constant light, and adjusting the screen brightness of the terminal device to a preset low brightness, includes: In response to the start-up operation of the first switch on the internal view of the suspension ball, the screen brightness adjustment property of the suspension ball is set to the constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
6. The screen attribute control method according to claim 5, characterized in that: The step of setting the screen brightness adjustment property of the suspension ball to a constant light mode in response to the start-up operation of the first switch on the internal view of the suspension ball includes: In response to the start-up operation of the first switch on the internal view of the floating ball, the currently active window object is obtained, and the screen brightness adjustment attribute of the floating ball is obtained based on the window object, and a screen always-on display flag is added to the screen brightness adjustment attribute to modify the flag bit of the screen brightness adjustment attribute to obtain the modified screen brightness adjustment attribute; The modified screen brightness adjustment attribute is applied to the window object to set the screen brightness adjustment attribute of the floating ball to the always-on mode.
7. The screen attribute control method according to claim 1, characterized in that: The method further comprises: In response to the activation operation of the second switch on the internal view of the floating ball, the screen brightness of the terminal device is adjusted to an initial screen brightness, and the initial screen brightness is greater than the preset low brightness.
8. The screen attribute control method according to claim 7, characterized in that: The step of adjusting the screen brightness of the terminal device to the initial screen brightness in response to the start-up operation of the second switch on the internal view of the floating ball comprises: In response to the startup operation of the second switch on the internal view of the floating ball, the automatic brightness adjustment function of the application system of the terminal device is disabled, and the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, and after the screen brightness of the terminal device is set to the brightness value corresponding to the initial screen brightness, the automatic brightness adjustment function is re-enabled.
9. The screen attribute control method according to claim 1, characterized in that: The method further comprises: In response to the running state of the front-end application reaching a preset state, the screen brightness of the terminal device is adjusted to an initial screen brightness.
10. The screen attribute control method according to claim 9, characterized in that: In response to the running state of the front-end application reaching a preset state, adjusting the screen brightness of the terminal device to an initial screen brightness includes: Monitor the running state of the front-end application in real time, and determine whether the running state of the front-end application reaches the preset state; If so, disable the automatic brightness adjustment function of the application system of the terminal device, and set the screen brightness of the terminal device to the brightness value corresponding to the initial screen brightness, and after setting the screen brightness of the terminal device to the brightness value corresponding to the initial screen brightness, re-enable the automatic brightness adjustment function.
11. The screen attribute control method according to claim 1, characterized in that: The method further comprises: In response to the stop operation of the second switch on the internal view of the suspension ball, the screen brightness adjustment attribute of the suspension ball is set to a default brightness mode, in which the screen of the terminal device does not remain always on.
12. The screen attribute control method according to claim 11, characterized in that: The step of setting the screen brightness adjustment property of the suspension ball to a default brightness mode in response to the stop operation of the second switch on the internal view of the suspension ball comprises: In response to a stop operation on the second switch on the internal view of the floating ball, a currently active window object is obtained, and a screen brightness adjustment attribute of the floating ball is obtained based on the window object, and a screen always-on display flag in the screen brightness adjustment attribute is removed to modify the flag bit of the screen brightness adjustment attribute to obtain a modified screen brightness adjustment attribute; The modified screen brightness adjustment attribute is applied to the window object to set the screen brightness adjustment attribute of the floating ball to the default brightness mode.
13. The screen attribute control method according to claim 1, characterized in that: In response to the startup operation of the suspension ball, the screen brightness adjustment attribute of the suspension ball is set to a constant light mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness. The method also includes: The front-end application sends a permission acquisition request to the terminal device and receives a result of processing the permission request, wherein the permission acquisition request is used to obtain processing permission for adjusting the screen brightness adjustment attribute of the terminal device.
14. The screen attribute control method according to claim 13, characterized in that: The step of responding to the startup operation of the suspension ball, setting the screen brightness adjustment attribute of the suspension ball to a constant light mode to keep the screen of the terminal device constant light, and adjusting the screen brightness of the terminal device to a preset low brightness, includes: If the result of the processing permission request is passed, in response to the startup operation of the floating ball, the screen brightness adjustment attribute of the floating ball is set to the always-on mode to keep the screen of the terminal device always on, and the screen brightness of the terminal device is adjusted to a preset low brightness.
15. A screen attribute control device, characterized in that: include: A display module, configured to display a floating ball on a terminal device in response to a floating ball display indication triggered in a front-end application, wherein the front-end application runs on the terminal device; A setting module is used to respond to the startup operation of the floating ball, set the screen brightness adjustment property of the floating ball to the constant light mode to keep the screen of the terminal device always on, and adjust the screen brightness of the terminal device to a preset low brightness.
16. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor executes the machine-readable instructions to perform the steps of the screen attribute control method as described in any one of claims 1 to 12.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the screen attribute control method according to any one of claims 1 to 12 are executed.
