CN110647275A - Method for setting battery optimization white list, terminal and computer storage medium - Google Patents

Method for setting battery optimization white list, terminal and computer storage medium Download PDF

Info

Publication number
CN110647275A
CN110647275A CN201910798480.3A CN201910798480A CN110647275A CN 110647275 A CN110647275 A CN 110647275A CN 201910798480 A CN201910798480 A CN 201910798480A CN 110647275 A CN110647275 A CN 110647275A
Authority
CN
China
Prior art keywords
white list
application process
target application
battery
setting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910798480.3A
Other languages
Chinese (zh)
Inventor
何春江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201910798480.3A priority Critical patent/CN110647275A/en
Publication of CN110647275A publication Critical patent/CN110647275A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/329Power saving characterised by the action undertaken by task scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance

Abstract

The invention discloses a method, a terminal and a computer storage medium for setting a battery optimization white list, wherein the method detects whether a target application process is killed, blocks the action of killing the target application process when the target application process is killed, displays options and information for a user, and finally sets the battery optimization white list according to the selection of the user; the problem of the directory hierarchy of battery optimization white list in the setting is deep, and the user is difficult to know its effect, and the user is difficult to know the application process condition of being killed is solved. The invention also discloses a terminal and a computer storage medium, and by implementing the scheme, the effect of guiding the user to set the battery optimization white list is realized, the user can know the related information about the killed application process, and the user experience is improved.

Description

Method for setting battery optimization white list, terminal and computer storage medium
Technical Field
The present invention relates to the field of terminal control, and more particularly, to a method for setting a battery optimization white list, a terminal, and a computer storage medium.
Background
The intelligent terminal adopts a battery optimization scheme in order to improve the battery endurance, and under some battery optimization strategies, the system can correspondingly process the application process according to the current CPU service condition so as to achieve the purpose of improving the battery endurance of the intelligent terminal. When the CPU is occupied more, the system usually kills the application processes with lower priority according to the priority, which may cause some application processes that the user needs to run to be closed, and affect the user experience. Generally, the priority of the application process can be adjusted by setting a battery-optimized white list so that the required application can be kept alive as much as possible. The user can configure the white list through the setting, however, the configuration interface of the battery optimization white list is deep in the directory hierarchy in the setting, and the user is usually hard to find and not aware of the role of the configuration interface.
Disclosure of Invention
The technical problem to be solved by the present invention is how to help a user set a battery optimization white list, and for this technical problem, a method, a terminal, and a computer-readable storage medium for setting a battery optimization white list are provided.
In order to solve the above technical problem, the present invention provides a method for setting a battery optimization white list, where the method for setting the battery optimization white list includes:
detecting whether a target application process is to be killed;
blocking an action of killing the target application process when it is detected that the target application process is to be killed;
displaying a dialog box, the dialog box comprising: a first option, a second option and prompt information;
and detecting a selection instruction of a user, and setting the battery optimization white list according to the selection instruction.
Optionally, the prompt information includes:
the current state of the target application process and the reason why the target application process is killed.
Optionally, the target application process is:
an application process whose corresponding application does not currently exist in the battery optimized whitelist.
Optionally, the step of setting the battery optimization white list according to the selection instruction includes:
if the selection instruction is to select a first option;
adding the target application corresponding to the target application process into the battery optimization white list;
if the selection instruction is to select a second option;
unblocking the act of killing the target application process.
Optionally, after the user selects the second option for a certain target application process N-th time, the action of killing the target application process is no longer blocked, where N is greater than or equal to 1.
Optionally, the step of adding the target application corresponding to the target application process to the battery optimization white list includes:
skipping to a setting interface of the battery optimization white list;
receiving a control instruction of a user;
and adding the target application into the battery optimization white list according to the control instruction.
Optionally, the step of adding the target application corresponding to the target application process to the battery optimization white list includes:
the system directly adds the target application to the battery optimization whitelist.
Optionally, the method for adding the target application to the battery optimization white list includes:
and acquiring the package name of the target application, and adding the package name into the configuration file of the battery optimization white list.
Furthermore, the invention also provides a terminal, which comprises a processor, a memory and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the steps of the above-described method of setting a battery optimization white list.
Further, the present invention also provides a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement the steps of the above-described method of setting a battery optimization white list.
Advantageous effects
The invention provides a method, a terminal and a computer storage medium for setting a battery optimization white list, aiming at the defect that a user is difficult to obtain related information due to the fact that the existing battery optimization white list is deep in hierarchy in the setting, the action of killing a target application process is blocked when the target application process is killed by detecting whether the target application process is killed, a dialog box is displayed for the user, the battery optimization white list is set according to the selection of the user, the problem that the application process required by the user is closed under the unconscious condition is solved, and the effect that the user selects whether to add the application into the battery optimization white list before the application process is closed is achieved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a schematic diagram of a hardware structure of an optional mobile terminal for implementing various embodiments of the present invention.
FIG. 2 is a diagram of a wireless communication system for the mobile terminal shown in FIG. 1;
fig. 3 is a basic flowchart of a method for setting a battery optimization white list according to a first embodiment of the present invention;
fig. 4 is a detailed flowchart of a method for setting a battery optimization white list according to a second embodiment of the present invention;
FIG. 5 is a diagram of a dialog box according to a second embodiment of the present invention;
fig. 6 is a flowchart of a method for setting a battery optimization white list according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), 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 duplex-Long Term Evolution), and TDD-LTE (Time Division duplex-Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
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 Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may 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 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
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 that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the 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 having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and 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 an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and charging functions Entity) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, the present invention provides various embodiments of the method.
First embodiment
In order to solve the problems that the battery optimization white list is deeper in hierarchy in the setting process, a user is difficult to know the function of the battery optimization white list, and the user is difficult to know the relevant information that the application process is closed, the invention provides a method for setting the battery optimization white list, so that the user is made to know the condition that the application process is closed, and the user is guided to set the battery optimization white list according to the condition.
Fig. 3 is a basic flowchart of a method for setting a battery optimization white list according to this embodiment, where the method for setting the battery optimization white list includes:
s301, detecting whether the target application process is to be killed.
When an application process of the system is to be killed, the system must issue some message or perform some method before killing some application process. Thus, listening to these messages or methods at the bottom level of the system can detect whether any application process is going to be killed. Meanwhile, the resources occupied by the application processes in the system and the positions of the application processes in the stack are combined, so that more accurate judgment can be performed.
In a terminal, one application may generate a plurality of processes, and thus each process also has one application corresponding to it. Applications are stored in the battery optimization white list, and after an application is added to the battery optimization white list, all processes generated by the application can obtain the effect of not performing battery optimization on the application.
In this embodiment, the application process is detected to determine whether the application process is to be killed, and it is not necessary to detect all application processes in the system, and only the application process whose corresponding application does not exist in the battery optimization white list is monitored.
It is also a feasible implementation to detect all application processes in the system, and after detecting that an application process is about to be closed, determine whether an application corresponding to the application process to be closed exists in the battery-optimized white list.
Optionally, no matter whether the application is in the battery optimized white list, if the empty process generated by the application to set up the cache is to be killed by the system, the process may not be blocked and popped up with a dialog box.
S302, when detecting that the target application process is to be killed, blocking the action of killing the target application process.
It will be appreciated that blocking has two characteristics, one being thread-safe and one being latency that does not consume the CPU. Therefore, it is a feasible and effective method to prevent the target application process from being killed by blocking, in the application scenario of this embodiment, the system will execute the action of closing the application process because of insufficient CPU, and blocking this action will not generate extra CPU consumption, and will not pose a threat to the threads in the system.
And S303, displaying a dialog box on the screen.
In the dialog box, the contents of the first option, the second option, the prompt message and the like are included. The prompt information can include the current state of the target application process and the reason why the target application process is killed, and through the prompt information, the user can clearly know what happens currently, and the user can know which application process is to be killed due to what reason, so that the situation that in the related art, after the application process is killed, some functions cannot be used, and the user finds that the application process is killed when the user wants to use the functions is avoided. Furthermore, the related function of the battery optimization white list and/or the setting method of the battery optimization white list can be added in the prompt message, so that a user can directly and automatically set some common applications correspondingly after that; based on the above embodiment of displaying dialog boxes, a method for only prompting a user to set a battery optimization white list or an application process state is also disclosed herein: and after the applications which do not exist in the battery optimization white list are killed, displaying a prompt for a user, and displaying the method and the function for setting the battery optimization white list, wherein of course, the applications which exist in the battery optimization white list can also display related information to inform the user that the application process is closed.
In one embodiment, the prompt information can be improved more completely, for example, the function of the current target application process can be shown in the prompt information as much as possible, the user is informed of the possible influence of the application process after being killed, and corresponding suggestions are given, especially those application processes executed in the background, and the user does not usually know the action of the application process. The user is more likely to make an effective decision after knowing which functions the application process will affect execution.
In this embodiment, the first and second expressions in the first option and the second option do not indicate the sequential order of arrangement, the first and second expressions are only used for distinguishing, and the display positions of the first option and the second option in the dialog box are not limited, and the first option and the second option may be laid out horizontally or vertically. The presentation form of the options in the dialog box may be various, two buttons may be used to respectively represent different options, and the presentation form can also be realized by using a radio box or a drop-down selection box.
In other embodiments, options and prompt information may be displayed through other controls or manners, for example, in a notification manner, many current terminals may display messages and buttons in a notification bar, which is also an effective way for a user to display a prompt; and a special interface can be displayed to ensure that the user can notice the information in time.
It is understood that the applications in the battery optimized white list are not killed by the system, but have a higher priority, and when the applications are killed by the system, the application processes which are not added to the battery optimized white list are killed preferentially. However, the system will also optimize the applications in the white list to kill if needed. Therefore, the application process generated by the existing application in the battery optimization white list can also be detected, when the application process needs to be closed by the system, the closing of the application process is not blocked, but a dialog box is popped up for the user, or a notification or a prompt is pushed to inform the user that the application process is killed and the reason for killing the application.
S304, detecting a selection instruction of a user, and setting a battery optimization white list according to the selection instruction.
According to different expression forms of the options in the dialog box, different modes are adopted for obtaining the selection of the user, but the instructions formed by the selection of the user are similar, the options selected by the user finally form the selection instruction of the user, and after the user sends out the selection instruction, the battery optimization white list is set according to the selection instruction.
Optionally, when the user selects the first option, adding the target application corresponding to the target application process to be killed currently into the battery optimization white list; and when the user selects the second option, the target application is not added into the white list, and the blockage of the action of killing the target application currently is canceled, so that the target application can be killed normally. Of course, the role of the first option and the second option is not limited to correspond to the functions of adding white lists and removing blocking, and the first option and the second option are only used as differences.
If a certain application process is killed by the system for multiple times, and the user chooses not to add the corresponding application into the battery optimization white list for N times, the user can be considered that the application process does not need to be alive for a long time, so that the detection of the application process generated by the application can be cancelled later, and the killed action and the pop-up dialog box can not be blocked. The value of N should be greater than or equal to 1, and the specific value is set according to the needs of the user and the actual needs.
In another specific embodiment, a third option may be further displayed in the dialog box, and if the user selects the third option, no matter whether the condition that the application is not added to the battery optimization white list for N times is satisfied, the application process is no longer detected, and the killed action and the pop-up dialog box are no longer blocked.
Meanwhile, a default selection instruction can be set, and when the preset time is exceeded and the user does not send the selection instruction, the system automatically selects to send the default selection instruction. The method prevents the closing of the application process from being blocked for a long time, which can cause abnormal conditions of the system or the application.
For the first option selected by the user, the step of adding the target application corresponding to the target application process to be killed to the battery optimization white list may be:
and skipping to a setting interface of the battery optimization white list, controlling by a user, and adding the application selected by the user into the battery optimization white list according to the control of the user. It can be understood that, in the embodiment, the user only jumps to the interface set by the battery optimization white list, the interface may be a list of applications, the user is not limited to control the interface, other applications may also be selected to be deleted from the battery optimization white list when the user controls the interface, and the user completes the operation of adding or deleting the applications from the battery optimization white list by checking or canceling the checking.
In another embodiment, the battery-optimized whitelist is configured as a non-checkable application list, and the user may click on a special settings management interface for an application. In such an embodiment, the user may directly jump to the setting management interface of the target application according to the related information of the target application, and control or select the battery optimization level of the target application.
Optionally, the step of adding the target application corresponding to the target application process to be currently killed into the battery optimization white list may further be: the system acquires the relevant information of the target application and directly adds the target application into the battery optimization white list. In this way, the background silent processing can reduce the operation of the user.
It should be noted that, no matter which step is adopted to add the target application to the battery optimization white list, the method for finally adding the target application to the battery optimization white list is to add the package name of the target application to the configuration file of the battery optimization white list by obtaining the package name of the target application.
The embodiment provides a method for setting a battery optimization white list, which comprises the steps of detecting whether a target application is to be killed, blocking an action of killing the target application when the target application is to be killed, displaying a dialog box, wherein the dialog box comprises options, prompts and other messages, and carrying out corresponding setting on the battery optimization white list according to a selection instruction sent by a user. Based on the method, the terminal achieves the effects of displaying prompts to the user and guiding the user to set the battery optimization white list before the application process is closed, and the user experience is improved.
Second embodiment
The method of the present invention is described below with reference to a more specific application scenario.
Fig. 4 is a detailed flowchart of a method for setting a battery optimization white list according to a second embodiment of the present invention, where the method for setting the battery optimization white list includes the following steps:
s401 and S402 are specific implementation steps for detecting whether the target application process is to be killed. S405, S406, and S407 are specific implementation steps for adding an application to the battery optimization whitelist according to a selection instruction.
S401, whether an application process is to be killed or not is detected.
In the android system, the resident AMS service is responsible for managing the application process, and the application process is correspondingly processed according to the configuration condition of the battery optimization white list and the condition that the application uses the CPU, so that the cruising ability of the battery is improved.
The AMS behavior is detected in the framework layer, and whether the application process is to be closed or not can be known.
S402, detecting whether the application corresponding to the application process to be killed exists in a battery optimization white list.
In this embodiment, an application process that is detecting to be performing a download operation will be killed by the system.
At this time, it may be determined whether the application process to be shut down is an application process generated by an application that is not configured in the battery optimization whitelist, in conjunction with the configuration of the battery optimization whitelist. If the application corresponding to the application process to be closed is not the application configured in the battery optimization white list, indicating that the target application process is detected to be killed, the subsequent steps should be executed; if the application exists in the battery optimization white list, it indicates that the application process to be shut down at this time is not the target application process, and may not be processed correspondingly.
Because the application processes are divided into the displayed application process and the application process which is not displayed in the background, the system usually does not kill the displayed application process, and usually selects the application process in the background to execute the killed action, and the situation of the displayed application process can be easily obtained by the user. Thus, in another specific embodiment, only the application process in the background can be detected and processed.
S403, when the target application process is to be killed, blocking the action of killing the target application process.
When the AMS triggers a kill of an application process, the AMS is blocked from killing the application process.
And S404, displaying a dialog box on the screen.
A preset dialog box 51 is displayed at this time, fig. 5 is a schematic diagram of the dialog box of this embodiment, fig. 5 is a schematic diagram of only one dialog box implementation, and the style of the dialog box 51 may be designed into various styles and is not limited to the style shown in fig. 5. The user knows that an application process in charge of background downloading in an application is about to be closed through the prompt message 52 in the dialog box 51, and the reason for closing is that the CPU resource of the system is insufficient, and the battery optimization processing needs to be executed on the application process. In the dialog box there are also two options displayed, a first option 53 "close the application process", a second option 54 "do not optimize the application", which the user can click to select. It is understood that the words of the prompts and options presented herein are merely exemplary, and that in practice, various languages may be used to convey the relevant meaning.
In this embodiment, the downloaded application process is executed in the background, but the application process executed in the background is usually not noticed by the user, and the user often does not know the influence that may be generated after the application process is killed, so that it may be considered that, in the case that the function of the application process can be known, the user is prompted about the function for which the application process is responsible, and/or the influence that may be generated after the application process is closed, and a corresponding suggestion is given to help the user to make a decision. Therefore, in the prompt message of the pop-up dialog box, the application process is the downloading process of a certain application, and the closing may cause the failure of the executing downloading task.
S405, detecting a selection instruction of a user.
The user clicks on the application to be unoptimized, i.e., issues a selection instruction to add the application to the battery-optimized whitelist.
It should be noted that, if the user chooses not to optimize the application, the system may also automatically add the application corresponding to the application process into the battery optimization white list in the background, so as to reduce the user's operations.
And S406, acquiring the application corresponding to the application process.
And detecting that a user sends a selection instruction for adding the application to the battery optimization white list, acquiring the application corresponding to the background downloading application process, and obtaining the application corresponding to the background downloading application process through the information of the application process.
S407, jumping to a battery optimization white list setting interface of the application, and setting a battery optimization white list according to an instruction of a user.
After the specific application is obtained, the interface is skipped to the setting interface of the application according to the related information of the application, and in the android system, the accurate interface skip can be realized through the intent and the package name of the application. In a setting interface of an application, a user can set whether the application is added to a battery optimization white list or not. The user clicks "not optimized" and determines that the application was successfully added to the battery optimized whitelist.
And after the user determines to add the application to the battery optimization white list, adding the package name of the application to a corresponding system configuration file, and finishing the setting of the battery optimization white list.
After the application is added into the battery optimization white list, the system may reevaluate the occupation condition of the CPU and the configuration condition of the battery optimization white list, and may select a new application process to execute the killing operation, so that the downloading process of the application is successfully survived.
The embodiment determines that the target application process is killed by detecting whether the application process is killed or not and judging whether the application corresponding to the application process is in the battery optimization white list or not, and blocks the action of killing the target application process; and displaying a dialog box for a user, receiving a selection instruction of the user, and adding the application corresponding to the application process into the battery optimization white list according to the instruction of the user and the relevant information of the application process. Under the execution of the method, the user can know the condition that the application process is closed, and can be guided to set the battery optimization white list, so that the survival rate of the application process required by the user is improved, and the user experience is improved.
Third embodiment
Fig. 6 is a flowchart of a method for setting a battery optimization white list according to a third embodiment of the present invention, and the following description is focused on a scenario in which a user does not add an application to the battery optimization white list, where the method for setting the battery optimization white list includes the following steps:
s601, detecting that the target application process is to be killed.
And detecting the target application process which does not exist in the battery optimization white list, and discovering that the target application process is about to be killed, wherein the target application process is a background application process which is responsible for collecting messages.
And S602, blocking the action of killing the target application process.
The act of killing the background application process is blocked.
And S603, displaying a dialog box on the screen.
The dialog box shows that a process running in the background and responsible for collecting user messages is about to be closed, but prompts that closing does not have a substantial impact on existing functionality, and shows three options, a first option "allow closing", a second option "do not optimize", and a third option "no longer protect the application process alive".
S604, detecting a selection instruction of a user, and not changing the battery optimization white list according to the selection instruction
When the user selects the second option or the third option, the contents of the battery-optimized whitelist are not altered according to the instruction, and the current block to the action of killing the target application process is canceled.
At this time, whether the number of times that the user selects the second option reaches N times or whether the number of times that the user selects the second option is the third option is judged, and if the number of times that the user selects the second option reaches N times or the number of times that the user selects the third option is judged as an object which is not detected any more.
In this embodiment, when it is detected that the application process is to be killed, the action of killing the application process is blocked, a corresponding prompt and option are displayed to the user, the application process is allowed to be closed according to the selection of the user, and the battery optimization white list is not changed. The visibility for killing the application process and the convenience for setting the battery optimization white list are improved, and the user experience is improved.
Fourth embodiment
The present embodiment further provides a terminal, as shown in fig. 7, which includes a processor 71, a memory 72 and a communication bus 73, wherein:
the communication bus 73 is used for realizing connection communication between the processor 71 and the memory 72;
the processor 71 is configured to execute one or more programs stored in the memory 72 to implement the steps of the method for setting the battery optimization whitelist in the first, second, and third embodiments described above.
The present embodiment also provides a computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors, and the steps of the method for setting a battery optimization white list in the first, second, and third embodiments described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A method for setting a battery optimization white list is characterized in that the method for setting the battery optimization white list comprises the following steps:
detecting whether a target application process is to be killed;
blocking an action of killing the target application process when it is detected that the target application process is to be killed;
displaying a dialog box, the dialog box comprising: a first option, a second option and prompt information;
and detecting a selection instruction of a user, and setting the battery optimization white list according to the selection instruction.
2. The method of setting a battery optimization white list of claim 1, wherein the prompt message comprises:
the current state of the target application process and the reason why the target application process is killed.
3. The method of setting a battery optimized white list of claim 1, wherein the target application process is:
an application process whose corresponding application does not currently exist in the battery optimized whitelist.
4. The method of setting a battery optimized white list of claim 1, wherein the step of setting the battery optimized white list according to the selection instruction comprises:
if the selection instruction is to select a first option;
adding the target application corresponding to the target application process into the battery optimization white list;
if the selection instruction is to select a second option;
unblocking the act of killing the target application process.
5. The method of setting up a battery optimized white list of claim 4, wherein the act of killing a target application process is no longer blocked when the user selects the second option for the nth time for the target application process, wherein N is greater than or equal to 1.
6. The method of setting up a battery optimized whitelist of claim 4, wherein the step of adding the target application corresponding to the target application process to the battery optimized whitelist comprises:
skipping to a setting interface of the battery optimization white list;
receiving a control instruction of a user;
and adding the target application into the battery optimization white list according to the control instruction.
7. The method of setting up a battery optimized whitelist of claim 4, wherein the step of adding the target application corresponding to the target application process to the battery optimized whitelist comprises:
the system directly adds the target application to the battery optimization whitelist.
8. The method of setting up a battery optimized white list according to any of claims 6-7, characterized in that the method of adding a target application to the battery optimized white list is:
and acquiring the package name of the target application, and adding the package name into the configuration file of the battery optimization white list.
9. A terminal, characterized in that the terminal comprises a processor, a memory and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the steps of the method of setting a battery optimized whitelist of any of claims 1-8.
10. A computer readable storage medium, storing one or more programs, which are executable by one or more processors, to implement the steps of the method of setting a battery optimized whitelist as claimed in any one of claims 1 to 8.
CN201910798480.3A 2019-08-27 2019-08-27 Method for setting battery optimization white list, terminal and computer storage medium Pending CN110647275A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910798480.3A CN110647275A (en) 2019-08-27 2019-08-27 Method for setting battery optimization white list, terminal and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910798480.3A CN110647275A (en) 2019-08-27 2019-08-27 Method for setting battery optimization white list, terminal and computer storage medium

Publications (1)

Publication Number Publication Date
CN110647275A true CN110647275A (en) 2020-01-03

Family

ID=69009833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910798480.3A Pending CN110647275A (en) 2019-08-27 2019-08-27 Method for setting battery optimization white list, terminal and computer storage medium

Country Status (1)

Country Link
CN (1) CN110647275A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612589A (en) * 2020-12-26 2021-04-06 吉林亿联银行股份有限公司 Keep-alive method and device for application program

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020091991A1 (en) * 2000-05-11 2002-07-11 Castro Juan Carlos Unified real-time microprocessor computer
CN103677978A (en) * 2013-12-30 2014-03-26 Tcl集团股份有限公司 Method and electronic device for protecting processes
US20140090077A1 (en) * 2012-09-25 2014-03-27 Samsung Electronics Co., Ltd Method and apparatus for application management in user device
CN107506243A (en) * 2017-09-01 2017-12-22 惠州Tcl移动通信有限公司 Using processing method, mobile terminal and the storage medium for taking memory space
CN107748685A (en) * 2017-11-21 2018-03-02 广东欧珀移动通信有限公司 Application program launching control method, device, terminal device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020091991A1 (en) * 2000-05-11 2002-07-11 Castro Juan Carlos Unified real-time microprocessor computer
US20140090077A1 (en) * 2012-09-25 2014-03-27 Samsung Electronics Co., Ltd Method and apparatus for application management in user device
CN103677978A (en) * 2013-12-30 2014-03-26 Tcl集团股份有限公司 Method and electronic device for protecting processes
CN107506243A (en) * 2017-09-01 2017-12-22 惠州Tcl移动通信有限公司 Using processing method, mobile terminal and the storage medium for taking memory space
CN107748685A (en) * 2017-11-21 2018-03-02 广东欧珀移动通信有限公司 Application program launching control method, device, terminal device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612589A (en) * 2020-12-26 2021-04-06 吉林亿联银行股份有限公司 Keep-alive method and device for application program

Similar Documents

Publication Publication Date Title
CN109614176B (en) Application interface layout method, terminal and computer readable storage medium
CN107329682B (en) Edge interaction method and mobile terminal
CN108553896B (en) State information display control method, terminal and computer readable storage medium
CN109040441B (en) Application body-separating display method, mobile terminal and computer readable storage medium
CN107329865B (en) Method for opening adb function of debugging bridge, mobile terminal and computer readable medium
CN107861663B (en) Method and device for displaying dockbar under comprehensive screen
CN107635070B (en) Message reminding method, terminal and storage medium
CN109462696B (en) Information prompting method, mobile terminal and computer readable storage medium
CN110187808B (en) Dynamic wallpaper setting method and device and computer-readable storage medium
CN107172605B (en) Emergency call method, mobile terminal and computer readable storage medium
CN109766119B (en) Recovery partition upgrade method, terminal and computer readable storage medium
CN108052280B (en) Method for deleting cache data, terminal and computer readable storage medium
CN109889651B (en) Notification message processing method, terminal and computer readable storage medium
CN112346824B (en) Screen projection application control method and device and computer readable storage medium
CN110083294B (en) Screen capturing method, terminal and computer readable storage medium
CN112494932A (en) Game frame supplementing method and device, terminal and computer readable storage medium
CN108845821B (en) Application program updating method, terminal and computer readable storage medium
CN109308147B (en) Application icon display method and device and computer readable storage medium
CN110955397A (en) Method for setting frame rate of game terminal, game terminal and storage medium
CN110647275A (en) Method for setting battery optimization white list, terminal and computer storage medium
CN107404568B (en) Control switch management method and mobile terminal
CN115914719A (en) Screen projection display method, intelligent terminal and storage medium
CN114217685A (en) Application management method, intelligent terminal and storage medium
CN109995937B (en) Application icon display method, mobile terminal and computer-readable storage medium
CN109327604B (en) Status bar information display method and equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination