A method, device and computer readable storage medium for applying anti-color dynamic configuration

By listening to the system service settings database, the application package name of the color inversion switch on the Android device is obtained and the color inversion rendering process is dynamically adjusted, which solves the problem of inaccurate color inversion mode on Android devices and achieves a more stable and complete user experience.

CN113157378BActive Publication Date: 2026-01-23NUBIA TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110571487.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-25
Publication Date
2026-01-23
Estimated Expiration
2041-05-25

AI Technical Summary

Technical Problem

In existing technologies, the color inversion mode of Android devices cannot control color inversion with 100% accuracy, resulting in a poor user experience.

Method used

By listening to the database through system services, the application package name that has the forced color inversion switch enabled is obtained and added to a custom list. The system then determines whether the application is included in the list and dynamically adjusts the color inversion rendering process based on the application's foreground and background status.

Benefits of technology

It achieves user-friendly dynamic configuration of color inversion, avoids the failure of color inversion processing in the native color inversion scheme, improves the integrity and stability of the function, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113157378B_ABST
    Figure CN113157378B_ABST
Patent Text Reader

Abstract

The application discloses an application reverse color dynamic configuration method and device and a computer readable storage medium, wherein the method comprises the following steps: when any application is started, the self-defined list is read by loading interactive configuration attributes, and it is judged whether the application is contained in the self-defined list; if the application is contained in the self-defined list, it is judged whether the application is in the background through the system service; if the application is not in the background, the reverse color rendering process is executed for the application through the native interactive control; and if the application is in the background, the reverse color rendering process of the application is refreshed through a preset update configuration, so that the reverse color configuration of the application is completed when the application is switched to the foreground. The application discloses a humanized application reverse color dynamic configuration scheme, avoids the problem of reverse color processing failure that may occur in the native reverse color scheme, improves the completeness and stability of the function, and enhances the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of mobile communication, and in particular to an application reverse color dynamic configuration method, device and computer readable storage medium. BACKGROUND

[0002] In the prior art, with the continuous development of intelligent terminal devices, the use frequency and use time of the devices by users are gradually increasing. In order to alleviate the impact of the device screen on the eye health of the user, the existing device system provides a dark night mode based on reverse color. In order to realize the above display mode, Android, the original system, provides a scheme of forcibly reversing the color of interactive controls, which can automatically force reverse color for applications that do not adapt to the dark mode. However, the above scheme cannot accurately control the reverse color 100%, and occasionally there are scenes of reverse color failure, and the user experience needs to be improved. SUMMARY

[0003] In order to solve the above technical defects in the prior art, the present application provides an application reverse color dynamic configuration method, which comprises:

[0004] The system service listens to the setting database to obtain the application package name of the opened forced reverse color switch, and adds the application package name to the preset custom list.

[0005] When any application is started, the custom list is read by loading the interactive configuration attribute, and it is judged whether the application is included in the custom list.

[0006] If the application is not included in the custom list, the normal rendering process is performed for the application, and if the application is included in the custom list, it is judged by the system service whether the application is in the background.

[0007] If the application is not in the background, the reverse color rendering process is performed for the application through the original interactive control, and if the application is in the background, the reverse color rendering process of the application is refreshed through the preset update configuration, so that the reverse color configuration of the application is completed when the application is switched to the foreground.

[0008] Optionally, the system service listens to the setting database to obtain the application package name of the opened forced reverse color switch, and adds the application package name to the preset custom list, comprising:

[0009] A data table for saving the application package name of the currently opened forced reverse color switch is created in the setting database, and a reverse color helper class is added in the system service, and the custom list is created in the helper class.

[0010] The system service monitors the settings database to ensure that the content of the custom list is consistent with the content of the data table.

[0011] Optionally, the step of obtaining the application package name for enabling the forced color inversion switch by listening to the database through system service and adding the application package name to a preset custom list further includes:

[0012] Create a first communication interface for communication between the color-inverting helper class and the activity management service.

[0013] When the content of the custom list changes, the changed content is notified to the activity management service through the first communication interface.

[0014] Optionally, the step of obtaining the application package name for enabling the forced color inversion switch by listening to the database through system service and adding the application package name to a preset custom list further includes:

[0015] Create a second communication interface for communication between the application and the color inversion helper class.

[0016] The application obtains status information about whether it needs to perform forced color inversion through the second communication interface.

[0017] Optionally, the step of reading the custom list by loading interaction configuration attributes when any application starts, and determining whether the application is included in the custom list, includes:

[0018] When any of the applications is launched, determine whether it is a cold start.

[0019] If it is a cold start, the application's status information is obtained through the second communication interface during the loading of the interactive configuration attributes.

[0020] Optionally, if the application is not included in the custom list, the application will undergo normal rendering; if the application is included in the custom list, the system service will determine whether the application is in the background, including:

[0021] If the status information indicates that forced color inversion is not required, then the application will execute the normal rendering process.

[0022] If the status information indicates that forced color inversion needs to be performed, then the color inversion rendering process will be executed for the application.

[0023] Optionally, if the application is not in the background, the inverse color rendering process is executed for the application through native interactive controls; if the application is in the background, the inverse color rendering process of the application is refreshed through a preset update configuration so that the inverse color configuration is completed when the application is switched to the foreground, including:

[0024] If the state of the forced color inversion switch changes, the custom list is updated synchronously through the color inversion helper class.

[0025] The updated content is notified to the activity management service through the first communication interface, and the activity management service then iterates through the list of currently active processes.

[0026] Optionally, the step of performing a color inversion rendering process for the application through native interactive controls if the application is not in the background, and refreshing the color inversion rendering process of the application through a preset update configuration if the application is in the background, so that the color inversion configuration is completed when the application is switched to the foreground, further includes:

[0027] If the application is not in the list of active processes, it is determined that the application is not in the background, and the inverse color rendering process is executed for the application through the native interactive control.

[0028] If the application is in the list of active processes, it is determined that the application is in the background. The activity management service notifies the application's process of attribute changes for each activity, so that each activity refreshes the application's inverse color rendering process according to the updated configuration.

[0029] The present invention also proposes an application inverse color dynamic configuration device, the device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the application inverse color dynamic configuration method as described in any of the preceding claims.

[0030] The present invention also proposes a computer-readable storage medium storing an application inverse color dynamic configuration program, which, when executed by a processor, implements the steps of the application inverse color dynamic configuration method as described in any of the preceding claims.

[0031] The present invention implements an application inversion dynamic configuration method, device, and computer-readable storage medium. It obtains the application package name for which a forced inversion switch is enabled by monitoring a database through a system service, and adds the application package name to a preset custom list. When any application starts, it reads the custom list by loading interactive configuration attributes and determines whether the application is included in the custom list. If the application is not included in the custom list, it executes the normal rendering process for the application. If the application is included in the custom list, it determines whether the application is in the background through the system service. If the application is not in the background, it executes the inversion rendering process for the application through native interactive controls. If the application is in the background, it refreshes the inversion rendering process of the application through a preset update configuration so that the inversion configuration is completed when the application is switched to the foreground. This provides a user-friendly application inversion dynamic configuration scheme, avoiding the inversion processing failure problem that may occur in native inversion schemes, improving the integrity and stability of the function, and enhancing the user experience. Attached Figure Description

[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:

[0033] Figure 1 This is a schematic diagram of the hardware structure of a mobile terminal according to the present invention;

[0034] Figure 2 This is a communication network system architecture diagram provided in an embodiment of the present invention;

[0035] Figure 3 This is a flowchart of the first embodiment of the inverse color dynamic configuration method of the present invention;

[0036] Figure 4 This is a flowchart of the second embodiment of the inverse color dynamic configuration method of the present invention;

[0037] Figure 5 This is a flowchart of the third embodiment of the inverse color dynamic configuration method of the present invention;

[0038] Figure 6 This is a flowchart of the fourth embodiment of the inverse color dynamic configuration method of the present invention;

[0039] Figure 7 This is a flowchart of the fifth embodiment of the inverse color dynamic configuration method of the present invention;

[0040] Figure 8 This is a flowchart of the sixth embodiment of the inverse color dynamic configuration method of the present invention;

[0041] Figure 9 This is a flowchart of the seventh embodiment of the inverse color dynamic configuration method of the present invention;

[0042] Figure 10 This is a flowchart of the eighth embodiment of the inverse color dynamic configuration method of the present invention. Detailed Implementation

[0043] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0044] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.

[0045] Terminals can be implemented in various forms. For example, the terminals described in this invention may include mobile terminals such as mobile phones, tablets, laptops, handheld computers, personal digital assistants (PDAs), portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, etc., as well as fixed terminals such as digital TVs and desktop computers.

[0046] The following description will use a mobile terminal as an example. Those skilled in the art will understand that, apart from elements specifically designed for mobile purposes, the construction according to embodiments of the present invention can also be applied to fixed-type terminals.

[0047] Please see Figure 1 This is a schematic diagram of the hardware structure of a mobile terminal implementing various embodiments of the present invention. The mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an A / V (Audio / Video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111, etc. Those skilled in the art will understand that... Figure 1 The mobile terminal structure shown does not constitute a limitation on the mobile terminal. The mobile terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0048] The following is combined Figure 1 A detailed introduction to each component of the mobile terminal:

[0049] The radio frequency unit 101 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with the processor 110; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, and a duplexer. Furthermore, the radio frequency unit 101 can also communicate wirelessly with networks and other devices. The aforementioned wireless communications may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution), and TDD-LTE (Time Division Duplexing-Long Term Evolution).

[0050] WiFi is a short-range wireless transmission technology. Mobile terminals, through the WiFi module 102, can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 1 WiFi module 102 is shown, but it is understood that it is not a necessary component of a mobile terminal and can be omitted as needed without changing the nature of the invention.

[0051] The audio output unit 103 can convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into audio signals and output them as sound when the mobile terminal 100 is in call signal receiving mode, call mode, recording mode, voice recognition mode, broadcast receiving mode, etc. Furthermore, the audio output unit 103 can also provide audio output related to specific functions performed by the mobile terminal 100 (e.g., call signal receiving sound, message receiving sound, etc.). The audio output unit 103 may include a speaker, a buzzer, etc.

[0052] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on the display unit 106. The image frames processed by the GPU 1041 can be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) in operating modes such as telephone call mode, recording mode, and voice recognition mode, and can process such sound into audio data. The processed audio (voice) data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 101 in telephone call mode. The microphone 1042 can implement various types of noise cancellation (or suppression) algorithms to eliminate (or suppress) noise or interference generated during the reception and transmission of audio signals.

[0053] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1061 according to the ambient light level, and the proximity sensor can turn off the display panel 1061 and / or backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that may be configured in the phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0054] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0055] User input unit 107 can be used to receive input numerical or character information, and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, user input unit 107 may include touch panel 1071 and other input devices 1072. Touch panel 1071, also known as touch screen, can collect touch operations on or near the user (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 1071), and drive corresponding connection devices according to a pre-set program. Touch panel 1071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to processor 110, and can receive and execute commands from processor 110. In addition, touch panel 1071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc., without being limited here.

[0056] Furthermore, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of touch event. Subsequently, the processor 110 provides corresponding visual output on the display panel 1061 based on the type of touch event. Although in Figure 1 In this embodiment, the touch panel 1071 and the display panel 1061 are two independent components to realize the input and output functions of the mobile terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to realize the input and output functions of the mobile terminal. The specific implementation is not limited here.

[0057] Interface unit 108 serves as an interface through which at least one external device can connect to mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 108 may be used to receive input (e.g., data, power, etc.) from the external device and transmit the received input to one or more elements within mobile terminal 100, or it may be used to transmit data between mobile terminal 100 and the external device.

[0058] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0059] The processor 110 is the control center of the mobile terminal. It connects various parts of the mobile terminal via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 109, and by calling data stored in the memory 109, it performs various functions and processes data of the mobile terminal, thereby providing overall monitoring of the mobile terminal. The processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 110.

[0060] The mobile terminal 100 may also include a power supply 111 (such as a battery) that supplies power to various components. Preferably, the power supply 111 can be logically connected to the processor 110 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0061] although Figure 1 As not shown, the mobile terminal 100 may also include a Bluetooth module, etc., which will not be described in detail here.

[0062] To facilitate understanding of the embodiments of the present invention, the communication network system on which the mobile terminal of the present invention is based is described below.

[0063] Please see Figure 2 , Figure 2 This invention provides a communication network system architecture diagram. The communication network system is an LTE system based on the universal mobile communication technology. The LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and the operator's IP services 204, which are connected in sequence.

[0064] Specifically, UE201 can be the aforementioned terminal 100, which will not be elaborated here.

[0065] E-UTRAN202 includes eNodeB2021 and other eNodeB2022s. Among them, eNodeB2021 can connect to other eNodeB2022s via backhaul (e.g., X2 interface), and eNodeB2021 connects to EPC203. eNodeB2021 can provide UE201 with access to EPC203.

[0066] EPC203 may include MME (Mobility Management Entity) 2031, HSS (Home Subscriber Server) 2032, other MMEs 2033, SGW (Serving Gateway) 2034, PGW (Packet Data Network Gateway) 2035, and PCRF (Policy and Charging Rules Function) 2036, etc. Among them, MME2031 is the control node that handles signaling between UE201 and EPC203, providing bearer and connection management. HSS2032 provides registers to manage functions such as the Home Location Register (not shown in the diagram) and stores user-specific information such as service characteristics and data rates. All user data can be sent through SGW2034. PGW2035 can provide UE 201 IP address allocation and other functions. PCRF2036 is the policy and charging control decision point for service data flow and IP bearer resources. It selects and provides available policy and charging control decisions for the policy and charging enforcement function unit (not shown in the figure).

[0067] IP services 204 may include the Internet, intranet, IMS (IP Multimedia Subsystem), or other IP services.

[0068] Although the above description uses the LTE system as an example, those skilled in the art should understand that the present invention is not only applicable to the LTE system, but also to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems, etc., which are not limited here.

[0069] Based on the aforementioned mobile terminal hardware structure and communication network system, various embodiments of the method of the present invention are proposed.

[0070] Example 1

[0071] Figure 3 This is a flowchart of the first embodiment of the inverse color dynamic configuration method of the present invention. An inverse color dynamic configuration method includes:

[0072] S1. Obtain the application package name that enables the forced color inversion switch by listening to the database through the system service, and add the application package name to the preset custom list.

[0073] S2. When any application starts, the custom list is read by loading the interaction configuration properties, and it is determined whether the application is included in the custom list.

[0074] S3. If the application is not included in the custom list, the normal rendering process is executed for the application. If the application is included in the custom list, the system service determines whether the application is in the background.

[0075] S4. If the application is not in the background, the inverse color rendering process is executed for the application through the native interactive control. If the application is in the background, the inverse color rendering process of the application is refreshed through the preset update configuration so that the inverse color configuration is completed when the application is switched to the foreground.

[0076] Optionally, in this embodiment, the system service listens to the settings database to obtain the application package names with the forced color inversion switch enabled, and adds the application package names to a preset custom list. Specifically, taking the Android system as an example, the system service (system_server) listens to the settings database to obtain the names of all application packages with the forced color inversion switch enabled, and puts them into a custom list (ForceDarkAppList).

[0077] Optionally, in this embodiment, when any application starts, the custom list is read by loading the interaction configuration attributes to determine whether the application is included in the custom list. Specifically, when an application starts, the method for loading the interaction (UI) configuration attributes reads the custom list (ForceDarkAppList) set above to determine whether the currently belonging application needs color inversion processing.

[0078] Optionally, in this embodiment, if the application is not included in the custom list, the application undergoes a normal rendering process; if the application is included in the custom list, the system service determines whether the application is in the background. Specifically, if color inversion is required, the native Android UI controls are executed to force color inversion using native methods; otherwise, the normal rendering process is executed.

[0079] Optionally, in this embodiment, if the application is not in the background, the inversion rendering process is executed for the application through native interactive controls. If the application is in the background, the inversion rendering process of the application is refreshed through a preset update configuration so that the inversion configuration is completed when the application is switched to the foreground. Specifically, to dynamically reflect changes in the custom list, when the ForceDarkAppList list sends a change, the changed package name also needs to be notified to the system_server process. In subsequent processing, system_server first determines whether the application with the changed package name is in the background. If the application is in the background, it also needs to refresh the application through the updateConfiguration method so that it can dynamically reflect the effect of turning inversion on (or off).

[0080] The beneficial effect of this embodiment is that it obtains the application package name for which the forced color inversion switch is enabled by listening to the database through a system service, and adds the application package name to a preset custom list. When any application starts, the custom list is read by loading interactive configuration attributes to determine whether the application is included in the custom list. If the application is not included in the custom list, the normal rendering process is executed for the application. If the application is included in the custom list, the system service determines whether the application is in the background. If the application is not in the background, the color inversion rendering process is executed for the application through native interactive controls. If the application is in the background, the color inversion rendering process of the application is refreshed through a preset update configuration so that the color inversion configuration is completed when the application is switched to the foreground. This implements a user-friendly dynamic configuration scheme for application color inversion, avoids the problem of color inversion processing failure that may occur in the native color inversion scheme, improves the integrity and stability of the function, and enhances the user experience.

[0081] Example 2

[0082] Figure 4 This is a flowchart of the second embodiment of the dynamic color inversion configuration method of the present invention. Based on the above embodiment, the step of obtaining the application package name for enabling the forced color inversion switch by listening to the database through system service, and adding the application package name to a preset custom list, includes:

[0083] S11. Create a data table in the settings database to store the application package names that are currently enabled by the forced color inversion switch, and add a color inversion helper class to the system service, and create the custom list in the helper class.

[0084] S12. Monitor the settings database through the system service to ensure that the content of the custom list is consistent with the content of the data table.

[0085] Optionally, in this embodiment, a data table is created in the settings database to store the names of application packages that currently have the forced color inversion switch enabled. Additionally, a color inversion helper class is added to the system service, and the custom list is created within this helper class. Specifically, as described in the example above, a data table named ForceDarkAppTable is added to the Settings database to store the names of application packages that currently have the forced color inversion switch enabled.

[0086] Optionally, in this embodiment, an application inversion helper class (ForceDarkAppHelper.java) is added to system_server. At the same time, a custom list of application package names that currently have the forced inversion switch turned on, ForceDarkAppList, is stored in the inversion helper class. The content is kept consistent with the data table in Settings by monitoring the Settings database.

[0087] The beneficial effects of this embodiment are as follows: By creating a data table in the settings database to store the application package names currently enabled by the forced color inversion switch, and by adding a color inversion helper class to the system service and creating the custom list within that helper class; then, by having the system service monitor the settings database to ensure that the content of the custom list is consistent with the content of the data table, a data synchronization foundation is provided for implementing a user-friendly dynamic configuration scheme for application color inversion. This avoids the color inversion processing failure problem that may occur in the native color inversion scheme, improves the integrity and stability of the function, and enhances the user experience.

[0088] Example 3

[0089] Figure 5 This is a flowchart of the third embodiment of the dynamic configuration method for color inversion of the present invention. Based on the above embodiment, the step of obtaining the application package name for enabling the forced color inversion switch by listening to the database through system service, and adding the application package name to a preset custom list, further includes:

[0090] S13. Create a first communication interface for communication between the color-inverting helper class and the activity management service.

[0091] S14. When the content of the custom list changes, the changed content is notified to the activity management service through the first communication interface.

[0092] Optionally, in this embodiment, a first communication interface is created for communication between the color-inverting helper class and the activity management service. Specifically, as described in the example above, an AIDL interface (Android Interface Definition Language) is added to facilitate communication between the application color-inverting helper class (ForceDarkAppHelper.java) and the activity management service AMS (ActivityManagerService), serving as the first communication interface in this embodiment.

[0093] Optionally, in this embodiment, when the content of the custom list changes, the changed content is notified to the activity management service through the first communication interface. That is, when the custom list (ForceDarkAppList) changes, the changed application package name can be promptly notified to the activity management service (AMS).

[0094] The beneficial effect of this embodiment is that by creating a first communication interface for communication between the color-inverting helper class and the activity management service, when the content of the custom list changes, the changed content is notified to the activity management service through the first communication interface. This provides a relevant communication interface setting scheme for implementing a user-friendly application color-inverting dynamic configuration scheme, avoiding the color-inverting processing failure problem that may occur in the native color-inverting scheme, improving the integrity and stability of the function, and enhancing the user experience.

[0095] Example 4

[0096] Figure 6 This is a flowchart of the fourth embodiment of the dynamic configuration method for applying inverted colors in this invention. Based on the above embodiment, the step of obtaining the application package name for enabling the forced inverted color switch by listening to the database through system service, and adding the application package name to a preset custom list, further includes:

[0097] S15. Create a second communication interface for communication between the application and the color inversion helper class.

[0098] S16. The application obtains status information about whether it needs to perform forced color inversion through the second communication interface.

[0099] Optionally, in this embodiment, a second communication interface is created for communication between the application and the color-inverting helper class. Specifically, as described in the example above, an AIDL interface is added for communication between the application side and the application color-inverting helper class in system_server, serving as the second communication interface in this embodiment.

[0100] Optionally, in this embodiment, the application obtains its own status information regarding whether it needs to perform forced color inversion through the second communication interface. That is, through the AIDL interface through which the application side communicates with the application color inversion helper class in system_server, the application side can read the status information regarding whether the application package name needs to be forcibly inverted based on the application package name.

[0101] The beneficial effect of this embodiment is that by creating a second communication interface for communication between the application and the color inversion helper class, the application obtains status information about whether it needs to perform forced color inversion through the second communication interface. This provides another related communication interface setting scheme for realizing a user-friendly application color inversion dynamic configuration scheme, avoiding the color inversion processing failure problem that may occur in the native color inversion scheme, improving the integrity and stability of the function, and enhancing the user experience.

[0102] Example 5

[0103] Figure 7 This is a flowchart of the fifth embodiment of the inverse color dynamic configuration method of the present invention. Based on the above embodiment, when any application starts, the step of reading the custom list by loading interactive configuration attributes and determining whether the application is included in the custom list includes:

[0104] S21. When any of the applications is started, determine whether it is a cold start.

[0105] S22. If it is a cold start, the application's status information is obtained through the second communication interface during the loading of the interactive configuration attributes.

[0106] Optionally, in this embodiment, when any of the applications is launched, it is determined whether it is a cold start. That is, it is determined whether the application is not launched in the background.

[0107] Optionally, in this embodiment, if it is a cold start, the application's state information is obtained through the second communication interface during the loading of the interaction configuration attributes. As described in the example above, during an application cold start, when loading the interaction (UI) configuration attributes, the application first obtains whether it needs forced color inversion through the second communication interface. If color inversion is required, the native Android process for forced UI color inversion is executed; otherwise, the normal rendering process is executed.

[0108] The beneficial effect of this embodiment is that, when any of the applications is launched, it is determined whether it is a cold start; if it is a cold start, the application's status information is obtained through the second communication interface during the loading of the interactive configuration attributes. This provides a user-friendly application color-inverting dynamic configuration scheme for cold starts, avoiding the color-inverting processing failure that may occur in the native color-inverting scheme, improving the completeness and stability of the function, and enhancing the user experience.

[0109] Example 6

[0110] Figure 8 This is a flowchart of the sixth embodiment of the inverse color dynamic configuration method of the present invention. Based on the above embodiment, if the application is not included in the custom list, the application performs a normal rendering process; if the application is included in the custom list, the system service determines whether the application is in the background, including:

[0111] S31. If the status information indicates that forced color inversion is not required, then the application will execute the normal rendering process.

[0112] S32. If the status information indicates that forced color inversion needs to be performed, then the color inversion rendering process is executed for the application.

[0113] Optionally, in this embodiment, when determining whether the application is not started in the background, if the status information indicates that forced color inversion is not required, then the normal rendering process is executed for the application.

[0114] Optionally, in this embodiment, when determining whether the application is not started in the background, if the status information indicates that forced color inversion needs to be performed, then the color inversion rendering process is executed for the application.

[0115] The beneficial effect of this embodiment is that, by recognizing that if the status information indicates that forced color inversion is not required, the application executes the normal rendering process; and if the status information indicates that forced color inversion is required, the application executes the color inversion rendering process. This provides a user-friendly dynamic color inversion configuration scheme for application cold starts, avoiding the color inversion processing failure that may occur in the native color inversion scheme, improving the completeness and stability of the function, and enhancing the user experience.

[0116] Example 7

[0117] Figure 9 This is a flowchart of the seventh embodiment of the inverse color dynamic configuration method of the present invention. Based on the above embodiment, if the application is not in the background, the inverse color rendering process is executed for the application through native interactive controls; if the application is in the background, the inverse color rendering process of the application is refreshed through a preset update configuration so that the inverse color configuration is completed when the application is switched to the foreground, including:

[0118] S41. If the state of the forced color inversion switch changes, the custom list is updated synchronously through the color inversion helper class.

[0119] S42. The updated content is notified to the activity management service through the first communication interface, and the activity management service traverses the list of currently active processes.

[0120] Optionally, in this embodiment, if the state of the forced color inversion switch changes, the custom list is updated synchronously through the color inversion helper class. As described in the example above, when the application switch category is changed according to user manual or system automatic settings, the application color inversion helper class (ForceDarkAppHelper) first synchronizes the color inversion list (ForceDarkAppList), and then notifies AMS that the switch of a certain application has changed through the first communication interface mentioned above. AMS then iterates through the list of currently active processes.

[0121] Optionally, in this embodiment, when the activity management service traverses the list of currently active processes, two results are obtained: one is that the application exists in the list of currently active processes, in which case it is determined that the application is in the background; the other is that the application does not exist in the list of currently active processes, in which case it is determined that the application is not processing in the background.

[0122] The beneficial effect of this embodiment is that, by recognizing that the state of the forced color inversion switch has changed, the custom list is synchronously updated through the color inversion helper class; the updated content is notified to the activity management service through the first communication interface, and the activity management service traverses the currently active process list. This provides a differentiated color inversion configuration scheme based on the traversal state of the active process list to achieve a user-friendly application color inversion dynamic configuration scheme, avoiding the color inversion processing failure problem that may occur in the native color inversion scheme, improving the integrity and stability of the function, and enhancing the user experience.

[0123] Example 8

[0124] Figure 10 This is a flowchart of the eighth embodiment of the inverse color dynamic configuration method of the present invention. Based on the above embodiment, if the application is not in the background, the inverse color rendering process is executed for the application through native interactive controls; if the application is in the background, the inverse color rendering process of the application is refreshed through a preset update configuration so that the inverse color configuration is completed when the application is switched to the foreground. The method also includes:

[0125] S43. If the application is not in the list of active processes, it is determined that the application is not in the background, and the inverse color rendering process is executed for the application through the native interactive control.

[0126] S44. If the application is in the list of active processes, then the application is determined to be in the background. The application's process is notified of the attribute changes of each activity through the activity management service, so that each activity refreshes the application's inverse color rendering process according to the updated configuration.

[0127] Optionally, in this embodiment, if the application is in the active process list, it is determined that the application is in the background. The activity management service notifies each activity of the application's process of attribute changes, so that each activity refreshes the application's inverse color rendering process according to the updated configuration. As described in the example above, if the application process being changed does not exist at this time, AMS does not perform any operation in this scenario. Subsequently, when the application is opened, the logic control for whether to invert colors is executed according to the method described in Embodiment Six above.

[0128] Optionally, in this embodiment, if the application process being modified exists, then in this scenario, firstly, considering that the logic related to loading UI configuration attributes is not executed during application hot restart, this embodiment first needs to perform a dynamic refresh. That is, in the above scenario, AMS notifies each Activity of the application process of the attribute change, so that these Activities go through the UI refresh process again. In this process, the control method of Embodiment Six above will also be executed to reload the UI configuration attributes and determine and select whether to perform color inversion. Therefore, when the application is opened again, the effect of the user turning the forced color inversion setting on (or off) in the switch list can be reflected in real time, without the problem of native color inversion control failing.

[0129] The beneficial effect of this embodiment is that, by recognizing that the application is not in the active process list, it is determined that the application is not in the background, and the inversion rendering process is executed for the application through the native interactive control; if the application is in the active process list, it is determined that the application is in the background, and the activity management service notifies the application's process of attribute changes for each activity, so that each activity refreshes the application's inversion rendering process according to the updated configuration. This provides more stable logical control conditions for implementing a user-friendly application inversion dynamic configuration scheme, avoids the inversion processing failure problem that may occur in the native inversion scheme, improves the integrity and stability of the function, and enhances the user experience.

[0130] Example 9

[0131] Based on the above embodiments, the present invention also proposes an application inverse color dynamic configuration device, the device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the application inverse color dynamic configuration method as described in any of the above embodiments.

[0132] It should be noted that the above-described device embodiments and method embodiments belong to the same concept. The specific implementation process can be found in the method embodiments, and the technical features in the method embodiments are also applicable to the device embodiments, which will not be repeated here.

[0133] Example 10

[0134] Based on the above embodiments, the present invention also proposes a computer-readable storage medium storing an application inverse color dynamic configuration program, which, when executed by a processor, implements the steps of the application inverse color dynamic configuration method as described in any of the above claims.

[0135] It should be noted that the above-described medium embodiments and method embodiments belong to the same concept. The specific implementation process can be found in the method embodiments, and the technical features in the method embodiments are also applicable to the medium embodiments, which will not be repeated here.

[0136] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0137] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0139] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A method for dynamic color configuration using inverse colors, characterized in that, The method includes: The system service monitors the settings database to obtain the application package names for which the forced color inversion switch is enabled, and adds these application package names to a preset custom list. Specifically, a data table is created in the settings database to store the application package names for which the forced color inversion switch is currently enabled. A color inversion helper class is added to the system service, and the custom list is created within this helper class. The system service monitors the settings database to ensure that the content of the custom list matches the content of the data table. A first communication interface is created for communication between the color inversion helper class and the activity management service. When the content of the custom list changes, the activity management service is notified of the change through the first communication interface. A second communication interface is created for communication between the application and the color inversion helper class. The application obtains its status information (whether it needs to perform forced color inversion) through the second communication interface. When any application starts, the custom list is read by loading the interaction configuration attributes to determine whether the application is included in the custom list; wherein, when any application starts, it is determined whether it is a cold start; if it is a cold start, the status information of the application is obtained through the second communication interface during the loading of the interaction configuration attributes. If the application is not included in the custom list, the application will be executed in the normal rendering process. If the application is included in the custom list, the system service will determine whether the application is in the background. If the status information indicates that forced color inversion is not required, the application will be executed in the normal rendering process. If the status information indicates that forced color inversion is required, the application will be executed in the color inversion rendering process. If the application is not in the background, the inverse color rendering process is executed for the application through native interactive controls. If the application is in the background, the inverse color rendering process of the application is refreshed through a preset update configuration so that the inverse color configuration is completed when the application is switched to the foreground. If the state of the forced inverse color switch changes, the custom list is updated synchronously through the inverse color helper class. The updated content is notified to the activity management service through the first communication interface, and the activity management service iterates through the current active process list. If the application is not in the active process list, it is determined that the application is not in the background, and the inverse color rendering process is executed for the application through the native interactive controls. If the application is in the active process list, it is determined that the application is in the background, and the activity management service notifies each activity of the application's process of attribute changes so that each activity refreshes the application's inverse color rendering process according to the update configuration.

2. A device for applying inverse color dynamic configuration, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the dynamic configuration method for applying inverse colors as described in claim 1.

3. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an application inversion dynamic configuration program, which, when executed by a processor, implements the steps of the application inversion dynamic configuration method as described in claim 1.

Citation Information

Patent Citations

  • Display mode setting method and device and computer readable storage medium

    CN112578985A