CN115344860B - Method for managing application program and electronic equipment - Google Patents

Method for managing application program and electronic equipment Download PDF

Info

Publication number
CN115344860B
CN115344860B CN202210898750.XA CN202210898750A CN115344860B CN 115344860 B CN115344860 B CN 115344860B CN 202210898750 A CN202210898750 A CN 202210898750A CN 115344860 B CN115344860 B CN 115344860B
Authority
CN
China
Prior art keywords
application program
application
time
interface
data list
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.)
Active
Application number
CN202210898750.XA
Other languages
Chinese (zh)
Other versions
CN115344860A (en
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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210898750.XA priority Critical patent/CN115344860B/en
Publication of CN115344860A publication Critical patent/CN115344860A/en
Application granted granted Critical
Publication of CN115344860B publication Critical patent/CN115344860B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Abstract

A method and electronic equipment for managing application programs are applied to the technical field of terminals. The method comprises the following steps: detecting that a first application program initiates a restarting operation of the first application program; determining whether a first data list comprises information of the first application program, wherein the first data list comprises identification information of the application program which is forcedly stopped and time information of the application program which is forcedly stopped; when the first data list comprises the information of the first application program, the restarting operation of the first application program is forbidden, and the first application program can be effectively closed, so that the memory resources of the electronic equipment are saved, and the user experience is obviously improved.

Description

Method for managing application program and electronic equipment
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method and an electronic device for managing an application program.
Background
With the rapid development of intelligent terminals, users may actively or passively install some applications, such as third party applications or system applications, in the intelligent terminals. Some rogue applications may exist in the applications installed in the smart terminals at present. Besides occupying mobile phone resources, rogue applications have potential safety hazards such as stealing user information and the like, and seriously influence the terminal use experience of users. At present, when some rogue applications are used in user cleaning applications, the rogue applications can be kept alive in the background by means of automatic restarting, so that the rogue applications can always run in the background. This results in these rogue applications not being truly cleaned up, resulting in them being constantly in possession of background resources. Therefore, a solution to this problem is needed.
Disclosure of Invention
In view of the foregoing, the present application provides a method, an electronic device, a computer-readable storage medium, and a computer program product for managing an application program, which can effectively clean a rogue application, and greatly improve the use experience of a user.
In a first aspect, a method of managing an application is provided, comprising:
detecting that a first application program initiates a restarting operation of the first application program;
determining whether a first data list comprises information of the first application program, wherein the first data list comprises identification information of the application program which is forcedly stopped and time information of the application program which is forcedly stopped;
and prohibiting the restarting operation of the first application program when the information of the first application program is included in the first data list.
The above-described aspects may be performed by an electronic device or a chip in an electronic device. Based on the scheme, when the first application program is detected to initiate the restarting operation of the first application program, judging whether the first data list comprises information of the first application program or not, wherein the first data list comprises identification information of the application program which is forcedly stopped and time information of the application program which is forcedly stopped; and when the first data list comprises the information of the first application program, the restarting operation of the first application program is forbidden, and the first application program can be effectively closed, so that the memory resources of the electronic equipment are saved. In addition, after the first application program is closed, the first application program can be prevented from running in the background to consume the electric quantity of the electronic equipment, the electric quantity of the electronic equipment can be saved, and the user experience is obviously improved.
Optionally, the restarting operation of the first application program includes: and calling a restarting function in the AMS to restart the first application program. For example, the restart function is a startInstrumentation () method in AMS.
Optionally, the information of the first application program includes a first identifier and a first time, where the first identifier is used to identify the first application program, and the first time is used to determine a time when the first application program is prohibited from performing a restart operation;
wherein the prohibiting the restart operation of the first application program includes:
and prohibiting the restarting operation of the first application program before the first time.
Optionally, the first time is obtained by accumulating the first preset duration on the basis of the second time. That is, from the second time, the first application is not allowed to call the restart function for the first preset duration.
In some possible implementations, before detecting that a first application initiates a restart operation of the first application, the method further includes:
displaying a first interface, wherein the first interface is a management interface of the first application program, the first interface comprises a first control, and the state of the first control is an operable state;
Detecting a first operation of a user for the first control, wherein the first operation is used for forcedly stopping the first application program;
in response to the first operation, the first application program is forcibly stopped, and information of the first application program is stored in the first data list.
Therefore, when the forced stopping of the first application program is detected, the information of the first application program can be stored in the first data list so as to provide basis for the subsequent inquiry of the first data list.
Optionally, forcibly stopping the first application program includes: and calling a forced stopping function in the AMS to stop the process corresponding to the first application program. For example, the forced stop function is a forceStopPackageLocked () method in the AMS.
In some possible implementations, after prohibiting the restart operation of the first application, the method further includes:
displaying a second interface, wherein the second interface is a management interface of the first application program, the second interface comprises a second control, and the state of the second control is an inoperable state.
Thus, when the first application is forcibly stopped, the first control in the management interface of the first application can be changed into an inoperable state, and the side surface represents that the first application is successfully killed.
In some possible implementations, the method further includes:
detecting that a second application program initiates the operation of restarting the first application program;
determining whether the first data list comprises information of the first application program;
judging whether a first identifier is the same as a second identifier when the first data list comprises information of the first application program, wherein the first identifier is used for identifying the first application program, and the second identifier is used for identifying the second application program;
allowing the second application program to call a restart function to execute the restart operation of the first application program when the first identifier is different from the second identifier;
and when the first identifier is the same as the second identifier, prohibiting the second application program from calling a restart function to execute the restart operation of the first application program.
In this way, after the first application is forcibly stopped, other applications (such as the second application) can be prevented from failing when the first application is invoked for restarting. In other words, the embodiment of the application aims at preventing the keep-alive operation of the self-starting of the first application program, but does not affect the restart behavior of other application programs for calling the first application program.
In some possible implementations, the method further includes:
and when the data stored in the first data list is larger than a preset data threshold value, cleaning the expired data stored in the first data list, wherein the expired data comprises data with storage time earlier than preset time.
Therefore, by cleaning the expired data, the data list maintained in the first data list can be prevented from being too large, so that the memory is saved.
In a second aspect, there is provided an electronic device comprising means for performing any of the methods of the first aspect. The device may be a terminal (or a terminal device) or may be a chip in the terminal (or the terminal device). The device comprises an input unit, a display unit and a processing unit.
When the apparatus is a terminal, the processing unit may be a processor, the input unit may be a communication interface, and the display unit may be a graphic processing module and a screen; the terminal may further comprise a memory for storing computer program code which, when executed by the processor, causes the terminal to perform any of the methods of the first aspect.
When the device is a chip in the terminal, the processing unit may be a logic processing unit in the chip, the input unit may be an output interface, a pin, a circuit, or the like, and the display unit may be a graphics processing unit in the chip; the chip may also include memory, which may be memory within the chip (e.g., registers, caches, etc.), or memory external to the chip (e.g., read-only memory, random access memory, etc.); the memory is for storing computer program code which, when executed by the processor, causes the chip to perform any of the methods of the first aspect.
In a third aspect, there is provided a computer readable storage medium storing computer program code which, when executed by an electronic device, causes the electronic device to perform any one of the methods of the first aspect.
In a fourth aspect, there is provided a computer program product comprising: computer program code which, when run by an electronic device, causes the electronic device to perform any of the methods of the first aspect.
Drawings
FIG. 1 is an exemplary diagram of entering an application management interface;
FIG. 2 is a schematic diagram of an interface for managing applications;
FIG. 3 is a schematic diagram of a hardware system suitable for use with the electronic device of the present application;
FIG. 4 is a schematic diagram of a software system suitable for use with the electronic device of the present application;
FIG. 5 is a schematic flow chart diagram of a method of managing an application of an embodiment of the present application;
FIG. 6 is another schematic flow chart diagram of a method of managing an application of an embodiment of the present application;
FIG. 7 is an exemplary diagram of an interface of a management application in accordance with an embodiment of the present application;
fig. 8 is a schematic block diagram of an electronic device of an embodiment of the application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
The method for managing the application program provided by the embodiment of the application can be applied to the electronic equipment. The electronic device may be, for example, various terminal devices such as a mobile phone, a tablet computer, a multimedia playing device, an electronic book reader, a personal computer, a Personal Digital Assistant (PDA), a smart watch, etc. The present application is not limited to the specific form of the electronic device.
The following describes a schematic diagram of an application scenario according to an embodiment of the present application with reference to fig. 1 and fig. 2.
A schematic diagram of the relevant interfaces for entering application management is shown in fig. 1. For example, the main interface of the mobile phone 10 may display the interface shown in (1) in fig. 1. As shown in fig. 1 (1), each application icon (including a setting application, application 1, application 2, …, application 7) is displayed in the interface. When the user clicks on the icon 101 of the setup application, the mobile phone 10 may enter an interface of the setup application program, such as the interface shown in (2) of fig. 1.
As shown in fig. 1 (2), the setup interface includes relevant setup options of the mobile phone 10. Such as application settings options, battery settings options, storage settings options, privacy settings options, and the like. When the user clicks on control 102, an application setup interface, such as the interface shown in FIG. 1 (3), may be entered.
It should be understood that the interface of fig. 1 (2) only shows some of the setup options of the mobile phone 10, and embodiments of the present application are not limited thereto. In fact, the interface of (2) in fig. 1 may contain more function settings.
It should also be appreciated that the interface of FIG. 1 (2) also shows a search bar for search settings. The user can input a target function setting option in the search field so as to quickly search for the target function setting.
As shown in fig. 1 (3), the application setting interface includes therein setting options related to various functions of the application. Such as application management, application launch management, rights management, default applications, application assistants, application splitting, and application settings shown in fig. 1 (3). When the user clicks on control 103, an application management interface, such as the interface shown in FIG. 1 (4), may be entered.
As shown in fig. 1 (4), icons of part of the applications installed in the mobile phone 10 and operation controls for each application are shown in the application management interface. For example, the application program (memo, dial service, APP1, etc.) shown in (4) of fig. 1 is currently installed in the mobile phone 10. For another example, the operation control of APP1 shown in (4) in fig. 1 is control 104. Control 104 is used to enter the management interface of APP 1.
It should be appreciated that APP1 may be a third party application installed by a user or may be a system application, which is not particularly limited.
It should also be understood that the application program shown in (4) of fig. 1 is only an exemplary description, and embodiments of the present application are not limited thereto. For example, many more applications may be included in the handset 10. For another example, the application program shown in (4) in fig. 1 may be replaced with another application program.
Management operations for APP1 are described below in connection with the interface in fig. 2. The interface shown in (1) in fig. 2 is an application management interface, similar to the interface shown in (4) in fig. 1. Such as the interface shown in fig. 2 (1), after the user clicks on control 104, the user may enter an APP1 application information interface or management interface, such as the interface shown in fig. 2 (2).
As shown in fig. 2 (2), management function options for APP1 are shown in the interface. For example, (2) in fig. 2 shows an unload control 105, a forced stop control 106. When the user clicks the unload control 105, an unload operation may be performed on APP 1. When the user clicks the forced stop control 106, the associated operation of forced closing of APP1 may be performed.
In some embodiments, after the user clicks the forced stop control 106, the system may call a forced stop function in the AMS to force the APP1 to close. For example, the forced stop function may be a forcestopPackageLocked () method.
In some embodiments, the control 106 shown in fig. 2 (2) is in an operable state. An operable state refers to a user clicking on control 106 to perform a forced stop of APP1 operation. For example, in a particular implementation, the color change of the control 106 can be used to distinguish whether the control 106 is in an operable state. When the control 106 is darker (e.g., dark blue), the control 106 is in an operable state, i.e., the user can click on the control 106; when the control 106 is lighter in color (e.g., grayed out), the control 106 is in an inoperable state, i.e., the user cannot click on the control 106.
Optionally, the interface shown in fig. 2 (2) may also contain other management options. Such as notification management, permissions, traffic usage, storage, memory, power consumption details, switch options to default on, revoke permissions and release space (for unused applications), advanced, etc. functional options shown in fig. 2 (2).
Wherein the notification management is used to set the notification form of the notification message of APP 1. Rights management is used to manage APP1 rights to read or access other functions in the handset (such as location information, microphone, address book, etc.). Traffic usage is used to count traffic data used by APP 1. The internal memory used for statistics APP1 (e.g., 15 MB) is stored. Memory is used to count the average memory used by APP1 over the last 3 hours (e.g., 6 MB). The power consumption details are used for counting the power consumption of the APP1 (for example, no power is consumed since the last full charge). Default open is used to set APP1 default open option. For unused applications, after opening the switch options for canceling the rights and releasing the space, the applications can default to open some functional rights and occupy the memory space of the mobile phone; after the switch options of the revoked rights and the released space are closed, the rights of the application default to open some functions can be revoked, and the memory space of the mobile phone can be released.
In some embodiments, when the user clicks the forced stop control, the handset pops up a window to prompt the user if it is determined to perform the forced stop function.
For example, when the user clicks the forcible stop control 106 shown in fig. 2 (2), the interface of the mobile phone is displayed as the interface shown in fig. 2 (3). As shown in fig. 2 (3), window 107 prompts the user "potentially causing an anomaly. Is the application forcibly stopped? "cancel option and forced stop option are included in window 107. If the user clicks the cancel option, canceling the forced stop of the APP1 operation; if the user clicks the forced stop option, the forced stop APP1 operation is performed. In other words, the window 107 may be provided to alert the user whether to determine that a forced stop operation is to be performed, to avoid loss due to misclicking the forced stop 106.
When the user clicks on the forcible stop option in the window 107 shown in (3) of fig. 2, the interface is displayed as shown in (4) of fig. 2. It can be seen that the color of the control 106 shown in fig. 2 (4) is the same as the color of the control 106 shown in fig. 2 (2). If the color of control 106 remains the same as before the user clicks, it is stated that APP1 was not successfully killed, or APP1 has been live-enabled by means of self-priming. That is, APP1 is not actually killed after the user clicks the forced stop option in window 107.
Taking APP1 as an example, when a user forcibly stops APP1, APP1 may utilize a system vulnerability to perform an automatic restart operation in the background, so that APP1 cannot be truly stopped, and thus resources of a mobile phone are always occupied in the background, and power consumption is serious, so that user experience is affected.
In view of this, the method for managing an application program according to the embodiment of the present application introduces a first data list, and when detecting that a first application program initiates a restart operation, queries whether the first data list includes information of the first application program, and if the first data list includes information of the first application program, limits the restart operation of the first application program, thereby avoiding an automatic restart operation of the first application program.
Fig. 3 is a hardware system suitable for use in the electronic device of the present application.
The electronic device 100 may be a mobile phone, a smart screen, a tablet computer, a wearable electronic device, an in-vehicle electronic device, an augmented reality (augmented reality, AR) device, a Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), a projector, etc., and the specific type of the electronic device 100 is not limited in the embodiments of the present application.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
The configuration shown in fig. 3 does not constitute a specific limitation on the electronic apparatus 100. In other embodiments of the application, electronic device 100 may include more or fewer components than those shown in FIG. 3, or electronic device 100 may include a combination of some of the components shown in FIG. 3, or electronic device 100 may include sub-components of some of the components shown in FIG. 3. For example, the proximity light sensor 180G shown in fig. 3 may be optional. The components shown in fig. 3 may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units. For example, the processor 110 may include at least one of the following processing units: application processors (application processor, AP), modem processors, graphics processors (graphics processing unit, GPU), image signal processors (image signal processor, ISP), controllers, video codecs, digital signal processors (digital signal processor, DSP), baseband processors, neural-Network Processors (NPU). The different processing units may be separate devices or integrated devices.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
The connection relationship between the modules shown in fig. 3 is merely illustrative, and does not limit the connection relationship between the modules of the electronic device 100. Alternatively, the modules of the electronic device 100 may also use a combination of the various connection manners in the foregoing embodiments.
The electronic device 100 may implement display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 may be used to display images or video. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini light-emitting diode (Mini LED), a Micro light-emitting diode (Micro LED), a Micro OLED (Micro OLED), or a quantum dot LED (quantum dot light emitting diodes, QLED). In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1. In an embodiment of the present application, display 194 is a flexible display, or a retractable display, or a scroll screen. In some embodiments, the expanded state of the display 194 may be as 3 states shown in fig. 1.
The electronic device 100 may implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. The ISP can carry out algorithm optimization on noise, brightness and color of the image, and can optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into a standard Red Green Blue (RGB), YUV, etc. format image signal. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
The electronic device 100 may implement audio functions, such as music playing and recording, through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like.
The audio module 170 is used to convert digital audio information into an analog audio signal output, and may also be used to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a horn, is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music or hands-free conversation through the speaker 170A.
A receiver 170B, also referred to as an earpiece, converts the audio electrical signal into a sound signal. When a user uses the electronic device 100 to answer a phone call or voice message, the voice can be answered by placing the receiver 170B close to the ear.
Microphone 170C, also known as a microphone or microphone, is used to convert sound signals into electrical signals. When a user makes a call or transmits voice information, a sound signal may be input to the microphone 170C by sounding near the microphone 170C.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device 100 platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A may be of various types, such as a resistive pressure sensor, an inductive pressure sensor, or a capacitive pressure sensor. The capacitive pressure sensor may be a device comprising at least two parallel plates with conductive material, and when a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes, and the electronic device 100 determines the strength of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic apparatus 100 detects the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon; and executing the instruction of newly creating the short message when the touch operation with the touch operation intensity being larger than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x-axis, y-axis, and z-axis) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B can also be used for scenes such as navigation and motion sensing games.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. The electronic device 100 may set the characteristics of automatic unlocking of the flip cover according to the detected open-close state of the leather sheath or the open-close state of the flip cover.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically, x-axis, y-axis, and z-axis). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The acceleration sensor 180E may also be used to recognize the gesture of the electronic device 100 as an input parameter for applications such as landscape switching and pedometer.
The distance sensor 180F is used to measure a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, for example, in a shooting scene, the electronic device 100 may range using the distance sensor 180F to achieve fast focus.
The proximity light sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, for example, a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When the reflected light is detected, the electronic device 100 may determine that an object is present nearby. When no reflected light is detected, the electronic device 100 may determine that there is no object nearby. The electronic device 100 can use the proximity light sensor 180G to detect whether the user holds the electronic device 100 close to the ear for talking, so as to automatically extinguish the screen for power saving. The proximity light sensor 180G may also be used for automatic unlocking and automatic screen locking in holster mode or pocket mode. It should be appreciated that the proximity light sensor 180G described in fig. 3 may be an optional component. In some scenarios, an ultrasonic sensor may be utilized in place of proximity sensor 180G to detect proximity light.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches. In some embodiments, ambient light information of the terminal may be detected by ambient light sensor 180L.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to perform functions such as unlocking, accessing an application lock, taking a photograph, and receiving an incoming call.
The touch sensor 180K, also referred to as a touch device. The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a touch screen. The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor 180K may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 and at a different location than the display 194.
The keys 190 include a power-on key and an volume key. The keys 190 may be mechanical keys or touch keys. The electronic device 100 may receive a key input signal and implement a function related to the case input signal.
The motor 191 may generate vibration. The motor 191 may be used for incoming call alerting as well as for touch feedback. The motor 191 may generate different vibration feedback effects for touch operations acting on different applications. The motor 191 may also produce different vibration feedback effects for touch operations acting on different areas of the display screen 194. Different application scenarios (e.g., time alert, receipt message, alarm clock, and game) may correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
In some embodiments, the processor 110 is configured to detect that a first application initiates a restart operation of the first application; determining whether a first data list comprises information of the first application program, wherein the first data list comprises identification information of the application program which is forcedly stopped and time information of the application program which is forcedly stopped; and prohibiting the restarting operation of the first application program when the information of the first application program is included in the first data list.
The hardware system of the electronic device 100 is described in detail above, and the software system of the electronic device 100 is described below. The software system may employ a layered architecture, an event driven architecture, a microkernel architecture, a micro-service architecture, or a cloud architecture, and the embodiment of the present application exemplarily describes the software system of the electronic device 100.
As shown in fig. 4, the software system using the hierarchical architecture is divided into several layers, each of which has a clear role and division. The layers communicate with each other through a software interface. In some embodiments, the software system may be divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include applications for settings, cameras, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer may include some predefined functions.
For example, the application framework layer includes a window manager, an activity manager, a content provider, an input manager, a view system, a telephony manager, a resource manager, and a notification manager.
The window manager provides window management services (window manager service, WMS) that may be used for window management, window animation management, surface management, and as a transfer station to the input system. The window manager may obtain the display screen size, determine if there are status bars, lock screens, and intercept screens.
The activity manager may provide activity management services (activity manager service, AMS) that may be used for system component (e.g., activity, service, content provider, broadcast receiver) start-up, handoff, scheduling, and application process management and scheduling tasks.
The input manager may provide input management services (input manager service, IMS), which may be used to manage inputs to the system, such as touch screen inputs, key inputs, sensor inputs, and the like. The IMS retrieves events from the input device node and distributes the events to the appropriate windows through interactions with the WMS.
A Content Provider (Content Provider) is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, and phonebooks.
The view system includes visual controls, such as controls to display text and controls to display pictures. The view system may be used to build applications. The display interface may be composed of one or more views, for example, a display interface including a text notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide communication functions of the electronic device 100, such as management of call status (on or off).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, and video files.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as a notification manager, is used for download completion notification and message alerting. The notification manager may also manage notifications that appear in the system top status bar in the form of charts or scroll bar text, such as notifications for applications running in the background. The notification manager may also manage notifications that appear on the screen in the form of dialog windows, such as prompting text messages in status bars, sounding prompts, vibrating electronic devices, and flashing lights.
The method for managing the application program of the embodiment of the application can be executed in an application program framework layer. In some embodiments, when the system detects that a first application program invokes a restart function in an AMS to initiate a restart operation of the first application program, querying whether a first data list includes information of the first application program, where the first data list includes identification information of an application program that is forcibly stopped, and time information of the application program that is forcibly stopped; and when the first data list comprises the information of the first application program, prohibiting the first application program from calling a restarting function in the AMS to perform restarting operation. Optionally, the first data list is stored in an application framework layer.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing functions such as management of object life cycle, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules, such as: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., open graphics library (open graphics library for embedded systems, openGL ES) for embedded systems) and 2D graphics engines (e.g., skia graphics library (skia graphics library, SGL)).
The surface manager is used to manage the display subsystem and provides a fusion of the 2D and 3D layers for the plurality of applications.
The media library supports playback and recording of multiple audio formats, playback and recording of multiple video formats, and still image files. The media library may support a variety of audio video coding formats such as MPEG4, h.264, moving picture experts group audio layer 3 (moving picture experts group audio layer III, MP 3), advanced audio coding (advanced audio coding, AAC), adaptive multi-rate (AMR), joint picture experts group (joint photographic experts group, JPG), and portable network graphics (portable network graphics, PNG).
Three-dimensional graphics processing libraries may be used to implement three-dimensional graphics drawing, image rendering, compositing, and layer processing.
The two-dimensional graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The kernel layer may include a display driver, a camera driver, an audio driver, a sensor driver, and the like.
It should be understood that, the foregoing is an example of a structure diagram of an electronic device in fig. 3, and the software architecture of the electronic device is described by way of example in fig. 4, which is not a limitation of the embodiments of the present application.
The following describes a method of managing an application program according to an embodiment of the present application with reference to fig. 5 to 7.
Referring to fig. 5, fig. 5 shows a flow chart of a method of forcibly stopping an application. It is understood that the method 500 of fig. 5 is applicable to the scenarios illustrated in fig. 1 and 2. As shown in fig. 5, the method 500 includes:
step 501, displaying a first interface, where the first interface is a management interface of a first application program, the first interface includes a first control, and a state of the first control is an operable state.
The first application may be a third party application or a system application, which is not particularly limited.
In the embodiment of the application, the first application program can be regarded as an application program which can not be forcefully stopped or closed by a user, and can also be called a rogue application. When the user forcibly stops the first application, the first application may call a startInstrumentation () method in the AMS to perform self-starting to keep the first application alive.
The embodiment of the present application does not specifically limit how to enter the first interface. In some embodiments, the user may enter the management interface of the first application in the manner shown in FIG. 1. For example, the first application is APP1, the first interface may be a management interface of APP1 shown in (2) of fig. 2, and the first control may be control 106 shown in (2) of fig. 2. For another example, the first interface may be a management interface of APP1 shown in (2) of fig. 7, and the first control may be a control 803 shown in (2) of fig. 7.
Step 502, detecting a first operation of a user on the first control, where the first operation is used to forcibly stop the first application program.
The embodiment of the present application is not limited to the specific form of the first operation. Illustratively, the first operation may include: the user clicks on the operation of the control 106 in the interface shown in fig. 2 (2), and clicks on the forcible stop option in the window 107 in the interface shown in fig. 2 (3). For another example, the first operation may include: the user clicks the operation of the control 803 in the interface shown in (2) in fig. 7, and clicks the forcible stop option in the window 804 in the interface shown in (3) in fig. 7.
In response to the first operation, the first application is forcibly stopped and information of the first application is stored in the first data list in step 503.
The embodiment of the application does not limit the specific method for forcibly stopping the first application program. In some embodiments, in the android system, the stopping operation of the first application program may be implemented by the framework layer calling the interface of the related forced stopping function.
Optionally, forcibly stopping the first application includes: and calling a forced stop function in the AMS to close the first application program.
Illustratively, the forced stop function is a forceStopPackageLocked () method in the AMS. In general, an application may correspond to a plurality of processes, and when the first application is forcibly stopped, the plurality of processes of the first application need to be stopped. The forceStopPackageLocked () method traverses all processes of the first application, then cleans up the processes one by one, and finally cleans up the 4 large components involved in the application, thereby completing the theory of the first application.
Wherein, 4 big subassemblies specifically include: an activity (activity) component, a service component, a broadcast recipient (Broadcast Receive) component, and a Content Provider (Content Provider) component.
The active component is a visual interface operated by the user for rendering the function. The service component typically runs the service in the background, providing no interface presentation. The broadcast receiver is a type of component that filters the transmitted broadcast for reception and response, and is operable to receive the broadcast. Content providers support storing and reading data in multiple applications, which is equivalent to a database.
In the embodiment of the application, the information of the first application program is stored in the first data list while the forced stop function is called to close the first application program. The first data list may be understood as a list for recording or saving information of an application program forcibly stopped by the user.
In some embodiments, the first data list includes identification information of the application program that is forcibly stopped, and time information of the application program that is forcibly stopped.
Alternatively, the identification information of the application program that is forcibly stopped may include one or more of the following information: user Identifier (UID), application package name (packageName), and the like.
The UID is used to identify the application. The application is assigned a UID at installation time. The UID remains unchanged for the duration of the application on the device.
The package name can be used as a unique identification of the application program and is mainly used for system identification application. In general, a package name represents an application, and two applications are not allowed to use the same package name.
Alternatively, the time information of the forcibly stopped application may include: the time of the system when the application is forcibly stopped, or the time obtained by adding up the time of the system when the application is forcibly stopped to a preset length. The preset duration may be preset. The preset time period is longer than the time for restarting the application program. For example, the preset duration may be set to 6 seconds.
Illustratively, the first data list includes an identification information list and a time information list.
Taking the example that the identification information includes a UID, the following description is made in connection with an example in table 1.
TABLE 1
Identification information Time information
UID1 of APP1 8 th minute 25 seconds+6 seconds
UID2 of APP2 12 points 10 minutes 04 seconds +6 seconds
UID3 of APP3 16 points 19 minutes 21 seconds +6 seconds
As shown in table 1, APP1 is taken as an example, the identification information of APP1 is UID1 stored in table 1, and the time information of APP1 is 8 points 25 minutes 03 seconds+6 seconds. Specifically, the time of the system when APP1 is forcibly stopped by the user is 8 points 25 minutes 03 seconds, and the time is increased by 6 seconds on the basis of 8 points 25 minutes 03 seconds, so that 8 points 25 minutes 09 seconds can be obtained. Then the system does not allow APP1 to call the restart function for a restart before 8 th 25 min 09 seconds.
The identification information stored in table 1 is unique to the APP that is forced to stop running. After the APP is forced to stop running, if the forced to stop running APP is detected again later, the corresponding time information of the APP is updated in the table 1. For example, at time point 1, when the forced stop APP1 is detected for the first time, the identification information (for example, UID1 of APP 1) and the corresponding time information (for example, a time point obtained by adding a preset duration to time point 1) are stored in table 1; after a period of time, if the forced stop of the APP1 is detected again at the time point 2, the line where the UID1 of the APP1 is located is found in the table 1, the corresponding time information is updated, and the time information corresponding to the APP1 is stored as the time point obtained by adding the preset duration to the time 2.
It should be understood that, as described herein in a unified manner, the application may be identified by the UID, or by both the UID and the package name.
Taking the example that the identification information includes uid+packet name, the following description is made in connection with the example in table 2.
TABLE 2
Identification information Time information
UID1+ packet name 1 of APP1 8 th minute 25 seconds+6 seconds
UID2+ packet name 2 of APP2 12 points 10 minutes 04 seconds +6 seconds
UID3+ packet name 3 of APP3 16 points 19 minutes 21 seconds +6 seconds
As shown in table 2, taking APP1 as an example, the identification information of APP1 stored in table 2 is UID1+ packet name 1, and the time information of APP1 stored in table 2 is 8 th order 25 minutes 03 seconds +6 seconds. Specifically, the time of the system when APP1 is forcibly stopped by the user is 8 points 25 minutes 03 seconds, and the time is increased by 6 seconds on the basis of 8 points 25 minutes 03 seconds, so that 8 points 25 minutes 09 seconds can be obtained. Then the system does not allow APP1 to call the restart function for a restart before 8 th 25 min 09 seconds.
It should be understood that the examples in tables 1 and 2 are merely exemplary descriptions, and embodiments of the present application are not limited thereto. For example, table 1 or table 2 may include identification information of more applications and corresponding time information. For example, the time information in table 1 or table 2 may record the time when the application program is forcibly stopped, or may be replaced with another occurrence time.
The storage location of the first data list is not particularly limited in the embodiment of the present application. In some embodiments, the first data list may be stored in the AMS.
The data maintained in the first data list can be cleaned based on a preset principle, so that the memory occupied by the first data list is prevented from being too large.
Optionally, as an implementation manner, the method 500 further includes: when the data stored in the first data list is greater than a preset data threshold, the expired data stored in the first data list is cleaned, wherein the expired data comprises data (such as identification information and time information of an APP (application) with storage time earlier than preset time).
The preset data threshold is any preset value, and can be specifically determined according to the product implementation, and the value of the preset data threshold is not specifically limited in the embodiment of the application. The preset time can also be preset based on the requirement.
When the data stored in the first data list exceeds a preset threshold value, the expired data in the first data list can be cleaned.
For example, assuming that the preset data threshold is 30, the preset time is the first 10 days of the current time of the system, when the data stored in the first data list exceeds 30, the data stored in the first data list can be traversed, the time information corresponding to the data stored in the first data list is compared with the current time of the system, and then the data stored 10 days before the current time of the system is cleaned, so that the excessive occupation of the memory caused by the overlarge data list maintained in the first data list is avoided.
The construction and maintenance procedure of the first data list is described above. In the embodiment of the present application, after the first data list is generated, whether the first data list includes information of the application program may be used as a basis for whether to allow the restart operation to be invoked. The following will describe the flow of the method in fig. 6.
Fig. 6 shows a schematic flow chart of a method 600 of managing an application program according to an embodiment of the application. It is understood that the method 600 of fig. 6 is applicable to the scenarios illustrated in fig. 1 and 2. It should also be appreciated that the method 500 shown in fig. 5 may be used in combination with the method 600 of fig. 6, e.g., the method 500 of fig. 5 may also be performed prior to performing the method 600 of fig. 6.
As shown in fig. 6, the method 600 includes:
in step 601, it is detected that the first application initiates a restart operation of the first application.
The description of the first application may refer to the description of fig. 5, and for brevity, will not be repeated here.
Optionally, the initiating the restart operation of the first application program includes: a restart function is invoked. The restart function is used for restarting the first application program to keep the first application program alive.
Illustratively, the restart function is a startInstrumentation () method in the framework layer. The first application calls the startInstrumentation () method in AMS. The startInstrumentation () method in AMS kills the first application and then restarts the first application.
The embodiment of the application does not limit the specific time when the first application program initiates the restarting operation of the first application program.
Illustratively, when the user forces to stop the first application, multiple processes traversing the first application are killed one by one. The first application program starts a plurality of processes, and the processes monitor each other. When a process (such as a main process) is killed, other processes call a startInstrumentation () method in the AMS to restart.
Step 602, determining (or judging or querying) whether the first data list includes information of the first application program, where the first data list includes identification information of the application program that is forcedly stopped and time information of the application program that is forcedly stopped.
The construction and maintenance procedure of the first data list has been described in the foregoing, to which reference should be made in particular. For brevity, no further description is provided herein.
Optionally, the information of the first application program includes a first identifier and a first time. The first identification is used for identifying the first application program. The first time is used to determine a time to prohibit the first application from performing a restart operation.
Illustratively, the first identification may include a UID of the first application and/or a package name of the first application. The definition of UID and package name may refer to the foregoing description, and for brevity, will not be repeated here.
In some embodiments, the first time for determining a time to prohibit the first application from performing a restart operation includes: the first time is a time when the first application program is prohibited from restarting. That is, the first application is not allowed to perform a restart operation until the first time.
Optionally, the first time is determined based on the second time and the first preset duration. The first time is illustratively derived by accumulating a first predetermined length of time based on the second time. That is, from the second time, the first application is not allowed to call the restart function for the first preset duration.
The second time is the system time of forcibly stopping the first application program, or the second time is the system time recorded when the system calls the forcible stopping function.
The first preset time period may be preset. The value of the first preset duration is larger than the time for restarting the first application program. Or, the first preset time period is longer than the time required by the first application program to call the restart function for keep-alive.
It is understood that the first time and the second time may be meanings of time points.
It should also be understood that, in the embodiment of the present application, the specific value of the first preset duration is not limited, and may be set based on actual requirements. For example, the first preset time period may be set to 6 seconds.
For example, assuming that the system time (i.e., the second time) when the system calls the forced stop function is 8 points 10 minutes 3 seconds, the first preset duration is 6 seconds, the time obtained by adding 6 seconds to the first time is 8 points 10 minutes 3 seconds, that is, 8 points 10 minutes 9 seconds, then the first application is not allowed to call the restart function until 8 points 10 minutes 9 seconds.
The embodiment of the present application does not specifically limit the form of the time stored in the first data list. The above description is given by taking the first time as an example, but the embodiment of the present application is not limited thereto. In fact, the system time recorded when the first application program is forcibly stopped, for example, the second time may also be stored in the first data list. At this time, after the second time is acquired, the system may automatically accumulate the first preset duration, that is, from the second time, and the first application program is not allowed to call the restart function in the first preset duration.
Step 603, when the first data list includes information of the first application program, prohibiting a restart operation of the first application program.
Optionally, disabling the restarting operation of the first application program includes: before a first time, prohibiting a restart operation of the first application; or, starting from the second time, the first application program is not allowed to call the restart function for the first preset duration.
Illustratively, if the first data list includes information of the first application program, the information of the first application program includes a first identifier and a first time, the first application program is prohibited from calling the restart function to restart before the first time. Of course, if the information of the first application program is not included in the first data list, a restart operation of the first application program is allowed.
For example, if the system time when the forced stop function is called is 8 points 10 minutes 3 seconds, then the first application is not allowed to call the restart function for restart within 6 seconds from 10 minutes 3 seconds for 8 points. Or, when the information of the first application program is stored in the first data list, if the current system time is earlier than 8 points by 10 minutes and 9 seconds, the first application program is not allowed to call the restart function, so that the first application program is prevented from being kept alive.
For another example, if the first data list stores that the time for prohibiting the invoking of the restart function is 8 points 10 minutes 9 seconds, the first application is not allowed to invoke the restart function for restarting until the time is 8 points 10 minutes 9 seconds.
In the embodiment of the application, when the first application program is detected to initiate the restarting operation of the first application program, whether the first data list comprises information of the first application program or not is judged, wherein the first data list comprises identification information of the application program which is forcedly stopped and time information of the application program which is forcedly stopped; and when the first data list comprises the information of the first application program, the restarting operation of the first application program is forbidden, and the first application program can be effectively closed, so that the memory resources of the electronic equipment are saved. In addition, after the first application program is closed, the first application program can be prevented from running in the background to consume the electric quantity of the electronic equipment, the electric quantity of the electronic equipment can be saved, and the user experience is obviously improved.
Optionally, as a possible embodiment, after the first application is forcibly stopped, the method 600 further includes:
displaying a second interface, wherein the second interface is a management interface of the first application program, the second interface comprises a second control, and the state of the second control is an inoperable state.
And when the state of the second control is the inoperable state, the first application program is forcedly stopped, and the first application program is not restarted successfully, namely the first application program is really cleaned.
That is, when the first application is forcibly stopped, the second control in the management interface of the first application may be changed to the inoperable state. Described below in connection with the interface example in fig. 7.
It should be understood that the embodiment of the present application does not specifically limit how to enter the management interface of the first application program. For example, the management interface of the first application may be entered with reference to the interface in fig. 1.
An exemplary diagram of an interface for an embodiment of the present application is shown in fig. 7. The interfaces shown in (1) to (3) in fig. 7 are similar to those shown in (1) to (3) in fig. 2. As shown in fig. 7 (1), after the user clicks on control 801, an application information interface or management interface of APP1, such as the interface shown in fig. 7 (2), may be entered. The interface shown in fig. 7 (2) is similar to the management function options included in the interface shown in fig. 2 (2), and specific meanings of the respective function options are not repeated here.
For example, (2) in fig. 7 shows an unload control 802 and a forced stop control 803. If the user clicks the unload control 802, an unload operation can be performed on APP 1. If the user clicks the forced stop control 803, the relevant operation of forced closing of APP1 is performed. After the user clicks the forcible stop control 803 shown in (2) of fig. 7, the interface of the mobile phone is displayed as the interface shown in (3) of fig. 7. As shown in fig. 7 (3), window 804 prompts the user for "potentially causing an anomaly. Is the application forcibly stopped? ". Window 804 is similar to window 107 shown in fig. 2 (3).
In the embodiment of the present application, the interface is displayed as shown in fig. 7 (4) (corresponding to the second interface described above) illustratively after the user clicks the forcible stop option in the window 804 shown in fig. 7 (3). It can be seen that the color of the control 803 shown in fig. 7 (4) is significantly lighter than the color of the control 803 shown in fig. 7 (2). Alternatively, control 803 shown in fig. 7 (4) (corresponding to the second control) is grayed out and in an inoperable state (corresponding to the inoperable state described above), which indicates that APP1 has been successfully killed. That is, after adopting the method of managing an application program of the embodiment of the present application, APP1 is actually killed after the user clicks the forcible stop option in window 804.
It should be appreciated that in the interface shown in fig. 7 (4), the graying of control 803 is only one representation of APP1 being successfully killed, and embodiments of the application are not limited thereto. Indeed, it is also possible to see if APP1 is actually killed by other means.
It is also possible to check in the background whether the process run by the handset comprises a process of APP1, for example. When APP1 is killed, the running process of the mobile phone does not include the process of APP1, namely all processes of APP1 are cleaned up.
Illustratively, when viewing APP1 in a setting, it can be seen that APP1 has been turned off.
Illustratively, after APP1 is killed, if APP1 is re-opened, the handset will display the first entry interface (or initial entry interface) of APP1, or the page opened before APP1 is killed has been closed.
The above describes the related embodiments of the first application program initiating the restart operation of the first application program by itself, and the embodiments of the present application also provide the related embodiments of the restart operation of the first application program initiated by other application programs after the first application program is forcibly stopped.
Optionally, as a possible implementation manner, the method 600 further includes:
detecting that a second application program initiates the operation of restarting the first application program, wherein the second application program is identified by a second identifier;
determining whether information of the first application program is included in a first data list;
judging whether a first identifier is the same as the second identifier when the first data list comprises information of the first application program, wherein the first identifier is used for identifying the first application program, and the second identifier is used for identifying the second application program;
Allowing the second application program to call a restart function to execute the restart operation of the first application program when the first identifier is different from the second identifier;
and when the first identifier is the same as the second identifier, prohibiting the second application program from calling a restart function to execute the restart operation of the first application program.
For brevity, the first data list and the related description of the information of the first application program may refer to the foregoing description, which is not repeated herein.
Optionally, the first identification may include a UID and a package name of the first application.
Optionally, the second identification may include a UID and a package name of the second application.
In an exemplary embodiment, after the first application program is forcibly stopped, if it is detected that other application programs (such as a second application program) call the restart function to restart the first application program, after the information of the first application program is included in the first data list, it is further required to determine whether the UID and the package name of the second application program calling the restart function are consistent with the UID and the package name of the first application program stored in the first data list. Assuming that the UID and the package name of the first application program are stored in the first data list, calling the UID and the package name of the second application program of the restart function, and if the UID and the package name of the first application program are the same as the UID and the package name of the second application program, namely, the second application program calling the restart function and the first application program stored in the first data list are the same application program, then prohibiting calling the restart function; if the UID and package name of the first application are different from the UID and package name of the second application, i.e. the second application calling the restart function is a different application from the first application stored in the first data list, then the restart function is allowed to be called. In this way, after the first application program is forcibly stopped, other application programs can be prevented from failing when the first application program is called for restarting. In other words, the embodiment of the application aims at preventing the keep-alive operation of the self-starting of the first application program, but does not affect the restart behavior of other application programs for calling the first application program.
In another specific example description, taking the first application program as an application a and the second application program as an application B as an example description, assuming that the application B calls the startInstrumentation () method in the AMS to restart the application a, after querying that the first application list contains information of the application a, it is further required to determine whether the UID and the package name (i.e., the UID and the package name of the application B) that call the startInstrumentation () method in the AMS are consistent with the UID and the package name (i.e., the UID and the package name of the application a) that need to be pulled up by the startInstrumentation () method in the AMS. If so, not allowing the B application to call a startInstrumentation () method in the AMS to restart the application A; if not, the B application is allowed to invoke the startInstrumentation () method in the AMS to restart application A. In this way, after the a application is forcibly stopped, the B application can be prevented from failing to call the a application through startInstrumentation () in the AMS, i.e., the call to the B application is prevented from being miskilled.
It should be understood that the above examples are illustrative only and that embodiments of the present application are not limited thereto.
It should also be appreciated that the above description is given by way of example of the identification of the application including the UID and the packet name, and embodiments of the present application are not limited thereto. For example, the first identifier includes a UID, and the second identifier includes a UID, that is, whether the application program calling the restart function and the application program stored in the first data list are the same application program may also be determined by the UID.
The above description is provided with reference to fig. 1 to fig. 7, which illustrate a method for managing an application according to an embodiment of the present application. An embodiment of the device of the present application is described below in connection with fig. 8. It should be understood that the device for managing an application program according to the embodiment of the present application may perform the embodiments of the methods for managing an application program according to the foregoing embodiments of the present application, that is, the following specific working processes of various products may refer to the corresponding processes in the foregoing method embodiments.
Fig. 8 is a schematic block diagram of an electronic device 800 in accordance with an embodiment of the present application. As shown in fig. 8, the electronic device 800 includes: an input unit 810, a processing unit 820, and a display unit 830. It should be appreciated that the electronic device 800 may perform the method of managing applications in the method embodiments described above.
In one possible example, the processing unit 820 is configured to detect that a first application initiates a restart operation of the first application;
determining whether a first data list comprises information of the first application program, wherein the first data list comprises identification information of the application program which is forcedly stopped and time information of the application program which is forcedly stopped;
and prohibiting the restarting operation of the first application program when the information of the first application program is included in the first data list.
Optionally, as a possible implementation manner, the information of the first application program includes a first identifier and a first time, where the first identifier is used to identify the first application program, and the first time is used to determine a time when the first application program is prohibited from performing a restart operation;
the processing unit 820 is configured to prohibit a restart operation of the first application program, and specifically includes: and prohibiting the restarting operation of the first application program before the first time.
Optionally, as a possible implementation manner, the processing unit 820 is further configured to, before detecting that a first application initiates a restart operation of the first application, invoke the display unit 830 to display a first interface, where the first interface is a management interface of the first application, and the first interface includes a first control, and a state of the first control is an operational state;
the input unit 810 is configured to detect a first operation of the user on the first control, where the first operation is used to forcibly stop the first application program;
the processing unit 820 is further configured to forcibly stop the first application program in response to the first operation, and store information of the first application program in the first data list.
Optionally, as a possible implementation manner, the processing unit 820 is further configured to invoke, after prohibiting the restart operation of the first application program, the display unit 830 to display a second interface, where the second interface is a management interface of the first application program, and the second interface includes a second control, and a state of the second control is an inoperable state.
Optionally, as a possible implementation manner, the processing unit 820 is further configured to detect that a second application initiates an operation of restarting the first application; determining whether the first data list comprises information of the first application program;
judging whether a first identifier is the same as a second identifier when the first data list comprises information of the first application program, wherein the first identifier is used for identifying the first application program, and the second identifier is used for identifying the second application program;
allowing the second application program to call a restart function to execute the restart operation of the first application program when the first identifier is different from the second identifier;
and when the first identifier is the same as the second identifier, prohibiting the second application program from calling a restart function to execute the restart operation of the first application program.
Optionally, as a possible implementation manner, the processing unit 820 is further configured to:
and when the data stored in the first data list is larger than a preset data threshold value, cleaning the expired data stored in the first data list, wherein the expired data comprises data with storage time earlier than preset time.
Optionally, as a possible implementation manner, the processing unit 820 is configured to forcibly stop the first application program, including:
and calling a forced stopping function in the AMS to stop the process corresponding to the first application program.
Optionally, as a possible implementation manner, the restarting operation of the first application program includes: and calling a restarting function in the AMS to restart the first application program.
It should be appreciated that the electronic device 800 described above is embodied in the form of functional units. The term "unit" herein may be implemented in the form of software and/or hardware, to which embodiments of the application are not limited in particular.
For example, a "unit" may be a software program, a hardware circuit or a combination of both that implements the functions described above. The hardware circuitry may include (ASIC) application specific integrated circuits, electronic circuits, processors (e.g., shared, dedicated, or group processors, etc.) and memory that execute one or more software or firmware programs, integrated logic circuits, and/or other suitable devices that provide the above described functionality. In a simple embodiment, one skilled in the art will appreciate that the electronic device may take the form shown in FIG. 3.
As can be seen from the foregoing, in the method for managing an application program according to the embodiment of the present application, when detecting that a first application program initiates a restart operation of the first application program, whether the first data list includes information of the first application program is first determined, if the first data list includes information of the first application program, the restart operation of the first application program is prohibited within a preset duration, so that the first application program can be effectively closed, thereby saving memory resources of an electronic device and significantly improving user experience.
The application also provides a computer program product which, when executed by a processor, implements the method of any of the method embodiments of the application.
The computer program product may be stored in a memory and eventually converted to an executable object file that can be executed by a processor through preprocessing, compiling, assembling, and linking.
The application also provides a computer readable storage medium having stored thereon a computer program which when executed by a computer implements the method according to any of the method embodiments of the application. The computer program may be a high-level language program or an executable object program.
The computer readable storage medium may be volatile memory or nonvolatile memory, or may include both volatile memory and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct memory bus RAM (DR RAM).
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working processes and technical effects of the apparatus and device described above may refer to corresponding processes and technical effects in the foregoing method embodiments, which are not described in detail herein.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It should be understood that, in various embodiments of the present application, the size of the sequence number of each process does not mean that the execution sequence of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
The terms "first," second, "…" and the like as used in the embodiments of the present application are used for descriptive purposes only and are not to be construed as indicating or implying any particular importance or number of features in order to distinguish between different objects such as different "applications" or the like. Thus, features defining "first", "second", …, etc., may include one or more features, either explicitly or implicitly. In the description of embodiments of the application, "at least one (an item)" means one or more. The meaning of "plurality" is two or more. "at least one of (an) or the like" below means any combination of these items, including any combination of a single (an) or a plurality (an) of items.
In addition, the terms "system" and "network" are often used interchangeably herein. The term "and/or" herein is merely one association relationship describing the associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
For example, items appearing similar to "in embodiments of the application include at least one of: the meaning of the expressions a, B, and C "generally means that the item may be any one of the following unless otherwise specified: a, A is as follows; b, a step of preparing a composite material; c, performing operation; a and B; a and C; b and C; a, B and C; a and A; a, A and A; a, A and B; a, a and C, a, B and B; a, C and C; b and B, B and C, C and C; c, C and C, and other combinations of a, B and C. The above is an optional entry for the item exemplified by 3 elements a, B and C, when expressed as "the item includes at least one of the following: a, B, … …, and X ", i.e. when there are more elements in the expression, then the entry to which the item is applicable can also be obtained according to the rules described above.
In summary, the foregoing description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (9)

1. A method of managing an application, comprising:
detecting that a first application program initiates a restarting operation of the first application program;
Determining whether a first data list comprises information of the first application program, wherein the first data list comprises identification information of the application program which is forcedly stopped and time information of the application program which is forcedly stopped;
when the information of the first application program is included in the first data list, prohibiting the restarting operation of the first application program;
the information of the first application program comprises a first identifier and a first time, wherein the first identifier is used for identifying the first application program, and the first time is used for determining the time for prohibiting the first application program from executing a restarting operation;
wherein the prohibiting the restart operation of the first application program includes:
and before the first time, prohibiting the restarting operation of the first application program, wherein the first time is obtained by accumulating a first preset duration on the basis of a second time, and the second time is the system time for forcibly stopping the first application program.
2. The method of claim 1, wherein prior to detecting that a first application initiates a restart operation of the first application, the method further comprises:
displaying a first interface, wherein the first interface is a management interface of the first application program, the first interface comprises a first control, and the state of the first control is an operable state;
Detecting a first operation of a user for the first control, wherein the first operation is used for forcedly stopping the first application program;
in response to the first operation, the first application program is forcibly stopped, and information of the first application program is stored in the first data list.
3. The method according to claim 1 or 2, wherein after prohibiting the restart operation of the first application program, the method further comprises:
displaying a second interface, wherein the second interface is a management interface of the first application program, the second interface comprises a second control, and the state of the second control is an inoperable state.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
detecting that a second application program initiates the operation of restarting the first application program, wherein the second application program is identified by a second identifier;
determining whether the first data list comprises information of the first application program;
judging whether a first identifier is the same as a second identifier when the first data list comprises information of the first application program, wherein the first identifier is used for identifying the first application program, and the second identifier is used for identifying the second application program;
Allowing the second application program to call a restart function to execute the restart operation of the first application program when the first identifier is different from the second identifier;
and when the first identifier is the same as the second identifier, prohibiting the second application program from calling a restart function to execute the restart operation of the first application program.
5. The method according to claim 1 or 2, characterized in that the method further comprises:
and when the data stored in the first data list is larger than a preset data threshold value, cleaning the expired data stored in the first data list, wherein the expired data comprises data with storage time earlier than preset time.
6. The method according to claim 1 or 2, wherein the restarting operation of the first application program comprises: and calling a restarting function in the AMS to restart the first application program.
7. An electronic device comprising a processor and a memory, the processor and the memory being coupled, the memory being for storing a computer program that, when executed by the processor, causes the electronic device to perform the method of any one of claims 1 to 6.
8. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program, which when executed by a processor causes the processor to perform the method of any of claims 1 to 6.
9. A chip comprising a processor which, when executing instructions, performs the method of any one of claims 1 to 6.
CN202210898750.XA 2022-07-28 2022-07-28 Method for managing application program and electronic equipment Active CN115344860B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210898750.XA CN115344860B (en) 2022-07-28 2022-07-28 Method for managing application program and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210898750.XA CN115344860B (en) 2022-07-28 2022-07-28 Method for managing application program and electronic equipment

Publications (2)

Publication Number Publication Date
CN115344860A CN115344860A (en) 2022-11-15
CN115344860B true CN115344860B (en) 2023-10-10

Family

ID=83949652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210898750.XA Active CN115344860B (en) 2022-07-28 2022-07-28 Method for managing application program and electronic equipment

Country Status (1)

Country Link
CN (1) CN115344860B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331357A (en) * 2014-10-10 2015-02-04 北京金山安全软件有限公司 Application program abnormity detection method and device and mobile terminal
CN104462980A (en) * 2014-12-30 2015-03-25 北京奇虎科技有限公司 Authority management method, device and system of application programs and mobile terminal
CN107862203A (en) * 2017-11-21 2018-03-30 广东欧珀移动通信有限公司 Control method, device, storage medium and the terminal of application program
CN107943270A (en) * 2017-11-21 2018-04-20 广东欧珀移动通信有限公司 Control method, device and the storage medium and mobile terminal of application service
CN107957905A (en) * 2017-11-21 2018-04-24 广东欧珀移动通信有限公司 Method, apparatus, storage medium and the intelligent terminal of self-starting are applied in limitation
CN110659082A (en) * 2019-09-11 2020-01-07 Oppo(重庆)智能科技有限公司 Application program interface display method and device, terminal and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331357A (en) * 2014-10-10 2015-02-04 北京金山安全软件有限公司 Application program abnormity detection method and device and mobile terminal
CN104462980A (en) * 2014-12-30 2015-03-25 北京奇虎科技有限公司 Authority management method, device and system of application programs and mobile terminal
CN107862203A (en) * 2017-11-21 2018-03-30 广东欧珀移动通信有限公司 Control method, device, storage medium and the terminal of application program
CN107943270A (en) * 2017-11-21 2018-04-20 广东欧珀移动通信有限公司 Control method, device and the storage medium and mobile terminal of application service
CN107957905A (en) * 2017-11-21 2018-04-24 广东欧珀移动通信有限公司 Method, apparatus, storage medium and the intelligent terminal of self-starting are applied in limitation
CN110659082A (en) * 2019-09-11 2020-01-07 Oppo(重庆)智能科技有限公司 Application program interface display method and device, terminal and storage medium

Also Published As

Publication number Publication date
CN115344860A (en) 2022-11-15

Similar Documents

Publication Publication Date Title
US11947974B2 (en) Application start method and electronic device
CN111543042B (en) Notification message processing method and electronic equipment
KR102503341B1 (en) Security service deletion method and electronic device
CN113806105B (en) Message processing method, device, electronic equipment and readable storage medium
WO2021253975A1 (en) Permission management method and apparatus for application, and electronic device
CN114553814B (en) Method and device for processing push message
CN111913750B (en) Application program management method, device and equipment
CN110569080B (en) Application control method and electronic equipment
EP4152782A1 (en) Message pushing method and apparatus
CN113805797B (en) Processing method of network resource, electronic equipment and computer readable storage medium
CN111523136A (en) Authority management method, device and equipment of application program and storage medium
CN115438354A (en) User privacy protection method and device
CN115344860B (en) Method for managing application program and electronic equipment
CN111787157A (en) Mobile terminal and operation response method thereof
CN116048545B (en) Processing method of popup advertisement, electronic equipment and readable storage medium
CN116048829B (en) Interface calling method, device and storage medium
CN116027933B (en) Method and device for processing service information
CN115828227B (en) Method for identifying advertisement popup, electronic equipment and storage medium
CN116668581A (en) Method and device for preventing false touch
CN114816169B (en) Desktop icon display method and device and storage medium
CN116672707B (en) Method and electronic device for generating game prediction frame
CN115017473B (en) Authorization method and electronic equipment
CN115981576B (en) Method for sharing data, electronic device and storage medium
CN117812534A (en) Enhanced positioning method based on target area, electronic equipment and readable storage medium
CN116048325A (en) Processing method for abnormal behavior of application, electronic equipment and 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
GR01 Patent grant
GR01 Patent grant