[go: up one dir, main page]

CN116737258B - Method and related device for unloading application - Google Patents

Method and related device for unloading application Download PDF

Info

Publication number
CN116737258B
CN116737258B CN202211215431.0A CN202211215431A CN116737258B CN 116737258 B CN116737258 B CN 116737258B CN 202211215431 A CN202211215431 A CN 202211215431A CN 116737258 B CN116737258 B CN 116737258B
Authority
CN
China
Prior art keywords
sim card
application
card application
terminal device
target process
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
CN202211215431.0A
Other languages
Chinese (zh)
Other versions
CN116737258A (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 CN202211215431.0A priority Critical patent/CN116737258B/en
Publication of CN116737258A publication Critical patent/CN116737258A/en
Application granted granted Critical
Publication of CN116737258B publication Critical patent/CN116737258B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a method and a related device for unloading an application, and relates to the technical field of terminals. The method comprises the following steps: the terminal equipment receives an operation of uninstalling the SIM card application; at a first moment, stopping a component running in a target process by the SIM card application by the terminal equipment, and registering a registered component or a registered callback of the SIM card application in the target process, wherein the target process is a process in which the SIM card application and other applications co-process; and unloading the SIM card application by the terminal equipment at a second moment, wherein the second moment is later than the first moment. Therefore, when the SIM card application is unloaded, the operation of other services in the process of co-processing with the SIM card application is not influenced, and the user experience is improved.

Description

卸载应用的方法及相关装置Method and related device for uninstalling application

技术领域Technical Field

本申请涉及终端技术领域,尤其涉及卸载应用的方法及相关装置。The present application relates to the field of terminal technology, and in particular to a method for uninstalling an application and a related device.

背景技术Background technique

随着终端技术的发展,终端设备中可以安装各种类型的应用程序,例如,系统应用程序、三方应用程序等,用户可以管理终端设备中的这些应用程序。With the development of terminal technology, various types of applications can be installed in terminal devices, such as system applications, third-party applications, etc., and users can manage these applications in the terminal devices.

然而,当用户清理终端设备的内存,或者管理终端设备的桌面,而想要卸载一些不经常使用的系统应用程序时,可能出现其他业务闪退的场景,给用户带来不好的使用体验。However, when the user cleans up the memory of the terminal device or manages the desktop of the terminal device and wants to uninstall some infrequently used system applications, other services may crash, giving the user a bad experience.

发明内容Summary of the invention

本申请实施例提供卸载应用的方法及相关装置,终端设备在卸载SIM卡应用时,终端设备可以先停止因在Phone进程中运行而无法被删除的SIM卡应用的部分组件的运行,或者去注册因在Phone进程中注册而无法被删除的SIM卡应用的部分组件或回调等,然后再执行卸载流程。从而可以在SIM卡应用被卸载时,不影响与SIM卡应用共进程的Phone进程中其他业务的运行,提升用户体验。The embodiment of the present application provides a method and a related device for uninstalling an application. When a terminal device uninstalls a SIM card application, the terminal device can first stop the operation of some components of the SIM card application that cannot be deleted because they are running in the Phone process, or deregister some components or callbacks of the SIM card application that cannot be deleted because they are registered in the Phone process, and then execute the uninstallation process. Therefore, when the SIM card application is uninstalled, the operation of other services in the Phone process that shares the same process with the SIM card application is not affected, thereby improving the user experience.

或者,终端设备在卸载SIM卡应用时,终端设备在执行SIM卡应用卸载流程后,可以重启Phone进程。因为在Phone进程重启时,SIM卡应用已完成卸载,SIM卡应用不会在Phone进程中运行,因此在Phone进程中不会运行SIM卡应用的组件或不会注册SIM卡应用的组件或回调等,使得SIM卡应用不会对Phone进程造成影响。从而可以在SIM卡应用被卸载时,不影响与SIM卡应用共进程的Phone进程中其他业务的运行,提升用户体验。Alternatively, when the terminal device uninstalls the SIM card application, the terminal device can restart the Phone process after executing the SIM card application uninstallation process. Because the SIM card application has been uninstalled when the Phone process is restarted, the SIM card application will not run in the Phone process, so the components of the SIM card application will not run or the components or callbacks of the SIM card application will not be registered in the Phone process, so that the SIM card application will not affect the Phone process. Therefore, when the SIM card application is uninstalled, it will not affect the operation of other services in the Phone process that share the SIM card application process, thereby improving the user experience.

第一方面,本申请实施例提供一种卸载应用的方法,方法包括:In a first aspect, an embodiment of the present application provides a method for uninstalling an application, the method comprising:

终端设备接收到卸载SIM卡应用的操作;在第一时刻,终端设备停止SIM卡应用在目标进程中运行的组件,以及去注册SIM卡应用在目标进程中已注册的组件或已注册的回调,目标进程为SIM卡应用与其他应用共进程的进程;在第二时刻,终端设备卸载SIM卡应用,第二时刻晚于第一时刻。这样,可以在SIM卡应用被卸载时,不影响与SIM卡应用共进程的进程中其他业务的运行,提升用户体验。The terminal device receives an operation to uninstall the SIM card application; at the first moment, the terminal device stops the components of the SIM card application running in the target process, and deregisters the components or registered callbacks of the SIM card application in the target process, and the target process is a process in which the SIM card application and other applications share the same process; at the second moment, the terminal device uninstalls the SIM card application, and the second moment is later than the first moment. In this way, when the SIM card application is uninstalled, the operation of other services in the process in which the SIM card application shares the same process with the SIM card application is not affected, thereby improving the user experience.

一种可能的实现方式中,SIM卡应用在目标进程中运行的组件可以包括服务Service组件;SIM卡应用在目标进程中已注册的组件可以包括接收Receiver组件;SIM卡应用在目标进程中已注册的回调可以包括定时服务回调AlarmManger.OnAlarmListener,和/或,回调callback。这样,终端设备在卸载SIM卡应用时无法删除SIM卡应用在目标进程中运行的组件,或注册的组件或回调,因此需要对这些组件或者回调单独处理,这样可以确保目标进程的正常运行。In a possible implementation, the components of the SIM card application running in the target process may include a service component; the components registered by the SIM card application in the target process may include a receiver component; the callbacks registered by the SIM card application in the target process may include a timer service callback AlarmManger.OnAlarmListener, and/or a callback callback. In this way, when uninstalling the SIM card application, the terminal device cannot delete the components of the SIM card application running in the target process, or the registered components or callbacks, so these components or callbacks need to be processed separately, so as to ensure the normal operation of the target process.

一种可能的实现方式中,终端设备停止SIM卡应用在目标进程中运行的组件,可以包括:终端设备调用关闭服务Service组件的函数。这样,终端设备在卸载SIM卡应用前,通过关闭正在运行的服务Service组件,可以使目标进程正常运行,从而不影响目标进程中的其他业务。In a possible implementation, the terminal device stops the component of the SIM card application running in the target process, which may include: the terminal device calls a function to close the service component. In this way, before uninstalling the SIM card application, the terminal device can close the running service component to enable the target process to run normally, thereby not affecting other services in the target process.

一种可能的实现方式中,终端设备去注册SIM卡应用在目标进程中已注册的组件,可以包括:终端设备调用去注册广播接收器Receiver组件的函数。这样,终端设备在卸载SIM卡应用前,通过去注册广播接收器Receiver组件,可以使目标进程正常运行,从而不影响目标进程中的其他业务。In a possible implementation, the terminal device deregistering the component registered by the SIM card application in the target process may include: the terminal device calling a function to deregister the broadcast receiver Receiver component. In this way, before uninstalling the SIM card application, the terminal device can enable the target process to run normally by deregistering the broadcast receiver Receiver component, thereby not affecting other services in the target process.

一种可能的实现方式中,终端设备去注册SIM卡应用在目标进程中已注册的回调,可以包括:终端设备调用去注册定时任务回调AlarmManger.OnAlarmListener的函数;和/或,终端设备调用注册回调callback的函数。这样,终端设备在卸载SIM卡应用前,通过去注册定时任务回调AlarmManger.OnAlarmListener或者去注册回调callback,可以使目标进程正常运行,从而不影响目标进程中的其他业务。In a possible implementation, the terminal device deregistering the callback registered by the SIM card application in the target process may include: the terminal device calling the function of deregistering the timed task callback AlarmManger.OnAlarmListener; and/or the terminal device calling the function of registering the callback callback. In this way, before uninstalling the SIM card application, the terminal device can make the target process run normally by deregistering the timed task callback AlarmManger.OnAlarmListener or deregistering the callback callback, so as not to affect other services in the target process.

一种可能的实现方式中,终端设备接收到卸载SIM卡应用的操作之前,还可以包括:终端设备为SIM卡应用注册卸载广播。In a possible implementation manner, before the terminal device receives the operation of uninstalling the SIM card application, the method may further include: the terminal device registers uninstall broadcast for the SIM card application.

根据终端设备接收的卸载SIM卡应用的操作,第一时刻,终端设备停止SIM卡应用在目标进程中运行的组件,以及去注册SIM卡应用在目标进程中已注册的组件或回调,可以包括:根据该操作,终端设备发送卸载广播,卸载广播可以包括SIM卡应用的标识;当终端设备通过SIM卡应用确定卸载广播包括SIM卡应用的标识时,在第一时刻,终端设备停止SIM卡应用在目标进程中运行的组件,以及去注册SIM卡应用在目标进程中已注册的组件或回调。According to the operation of uninstalling the SIM card application received by the terminal device, at the first moment, the terminal device stops the components of the SIM card application running in the target process, and de-registers the components or callbacks of the SIM card application registered in the target process, which may include: according to the operation, the terminal device sends an uninstall broadcast, and the uninstall broadcast may include the identifier of the SIM card application; when the terminal device determines through the SIM card application that the uninstall broadcast includes the identifier of the SIM card application, at the first moment, the terminal device stops the components of the SIM card application running in the target process, and de-registers the components or callbacks of the SIM card application registered in the target process.

这样,在用户触发卸载应用的操作时,终端设备发送卸载广播可以使注册了卸载广播的应用或者模块接收到该卸载广播,从而使相关的应用或者模块可以在接收到卸载广播后,执行卸载应用的操作。In this way, when the user triggers the operation of uninstalling the application, the terminal device sends the uninstall broadcast so that the application or module registered for the uninstall broadcast can receive the uninstall broadcast, so that the related application or module can perform the operation of uninstalling the application after receiving the uninstall broadcast.

一种可能的实现方式中,终端设备为SIM卡应用注册卸载广播,可以包括:终端设备向意图过滤器IntentFilter添加卸载广播所对应的字段Intent.ACTION_PACKAGE_REMOVED,以及添加SIM卡应用的标识。这样,终端设备通过为SIM卡应用注册卸载广播,可以方便接收卸载SIM卡应用的卸载广播,并进一步执行相关的卸载流程。In a possible implementation, the terminal device registers an uninstall broadcast for the SIM card application, which may include: the terminal device adds a field Intent.ACTION_PACKAGE_REMOVED corresponding to the uninstall broadcast to the intent filter IntentFilter, and adds the identifier of the SIM card application. In this way, by registering the uninstall broadcast for the SIM card application, the terminal device can conveniently receive the uninstall broadcast of uninstalling the SIM card application and further execute the relevant uninstall process.

一种可能的实现方式中,目标进程可以包括Phone进程。这样,SIM卡应用与Phone进程共进程,可以使SIM相关的业务正常运行,可以很好的为用户提供SIM相关服务。In a possible implementation, the target process may include a Phone process. In this way, the SIM card application and the Phone process are co-processed, so that SIM-related services can run normally and provide users with SIM-related services well.

第二方面,本申请实施例提供另一种卸载应用的方法,方法包括:In a second aspect, an embodiment of the present application provides another method for uninstalling an application, the method comprising:

终端设备接收到卸载SIM卡应用的操作;在第三时刻,终端设备卸载SIM卡应用;在第四时刻,终端设备重启目标进程,目标进程为SIM卡应用与其他应用共进程的进程,第四时刻晚于第三时刻。这样,可以在SIM卡应用被卸载时,不影响与SIM卡应用共进程的Phone进程中其他业务的运行,提升用户体验。The terminal device receives an operation to uninstall the SIM card application; at the third moment, the terminal device uninstalls the SIM card application; at the fourth moment, the terminal device restarts the target process, the target process is a process that the SIM card application shares with other applications, and the fourth moment is later than the third moment. In this way, when the SIM card application is uninstalled, the operation of other services in the Phone process that shares with the SIM card application is not affected, thereby improving the user experience.

一种可能的实现方式中,终端设备卸载SIM卡应用之前,还可以包括:终端设备显示弹窗,弹窗中包括确定按钮、取消按钮以及用于提示卸载SIM卡应用存在的风险的提示信息。In a possible implementation, before the terminal device uninstalls the SIM card application, the process may further include: the terminal device displays a pop-up window, wherein the pop-up window includes an OK button, a Cancel button, and prompt information for prompting the risk of uninstalling the SIM card application.

终端设备卸载SIM卡应用可以包括:响应于对确定按钮的操作,终端设备卸载SIM卡应用。这样,在卸载过程中,终端设备通过给用户弹窗提示卸载SIM卡应用存在的风险,可以让用户及时了解未知的风险,提升用户体验。The terminal device uninstalling the SIM card application may include: in response to the operation of the confirmation button, the terminal device uninstalls the SIM card application. In this way, during the uninstallation process, the terminal device prompts the user with a pop-up window to prompt the user of the risks of uninstalling the SIM card application, so that the user can understand the unknown risks in time and improve the user experience.

一种可能的实现方式中,终端设备显示弹窗之前,还可以包括:终端设备通过SIM卡应用的配置文件判断SIM卡应用为共进程应用。这样,终端设备在确定卸载应用所对应的进程与其他进程共进程时,可以通过重启进程使该进程中不再加载卸载应用的相关数据,从而使该进程中的其他业务可以正常运行。In a possible implementation, before the terminal device displays the pop-up window, the terminal device may also include: the terminal device determines that the SIM card application is a co-process application through the configuration file of the SIM card application. In this way, when the terminal device determines that the process corresponding to the uninstalled application is a co-process with other processes, it can restart the process so that the process no longer loads the relevant data of the uninstalled application, so that other services in the process can run normally.

一种可能的实现方式中,目标进程包括Phone进程。这样,SIM卡应用与Phone进程共进程,可以使SIM相关的业务正常运行,可以很好的为用户提供SIM相关服务。In a possible implementation, the target process includes a Phone process. In this way, the SIM card application and the Phone process share the same process, which can enable SIM-related services to run normally and provide users with SIM-related services.

第三方面,本申请实施例提供一种卸载应用的装置,该卸载应用的装置可以是终端设备,也可以是终端设备内的芯片或者芯片系统。该卸载应用的装置可以包括显示单元、处理单元。显示单元用于实现第一方面或第一方面的任意一种可能的实现方式中,或者第二方面或第二方面的任意一种可能的实现方式中,终端设备执行的与显示相关的任意方法。处理单元用于实现第一方面或第一方面的任意一种可能的实现方式中,或者第二方面或第二方面的任意一种可能的实现方式中,终端设备执行的与处理相关的任意方法。当该卸载应用的装置是终端设备时,该处理单元可以是处理器。该卸载应用的装置还可以包括存储单元,该存储单元可以是存储器。该存储单元用于存储指令,该处理单元执行该存储单元所存储的指令,以使该终端设备实现第一方面或第一方面的任意一种可能的实现方式中,或者第二方面或第二方面的任意一种可能的实现方式中描述的一种方法。当该卸载应用的装置是终端设备内的芯片或者芯片系统时,该处理单元可以是处理器。该处理单元执行存储单元所存储的指令,以使该终端设备实现第一方面或第一方面的任意一种可能的实现方式中,或者第二方面或第二方面的任意一种可能的实现方式中描述的一种方法。该存储单元可以是该芯片内的存储单元(例如,寄存器、缓存等),也可以是该终端设备内的位于该芯片外部的存储单元(例如,只读存储器、随机存取存储器等)。In a third aspect, an embodiment of the present application provides a device for uninstalling an application, which may be a terminal device, or a chip or chip system in a terminal device. The device for uninstalling an application may include a display unit and a processing unit. The display unit is used to implement any method related to display executed by the terminal device in the first aspect or any possible implementation of the first aspect, or in the second aspect or any possible implementation of the second aspect. The processing unit is used to implement any method related to processing executed by the terminal device in the first aspect or any possible implementation of the first aspect, or in the second aspect or any possible implementation of the second aspect. When the device for uninstalling an application is a terminal device, the processing unit may be a processor. The device for uninstalling an application may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit to enable the terminal device to implement a method described in the first aspect or any possible implementation of the first aspect, or in the second aspect or any possible implementation of the second aspect. When the device for uninstalling an application is a chip or chip system in a terminal device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit to enable the terminal device to implement a method described in the first aspect or any possible implementation of the first aspect, or in the second aspect or any possible implementation of the second aspect. The storage unit may be a storage unit in the chip (e.g., a register, a cache, etc.), or a storage unit in the terminal device that is located outside the chip (e.g., a read-only memory, a random access memory, etc.).

示例性的,在实现第一方面或第一方面的任意一种可能的实现方式中,处理单元,用于接收到卸载SIM卡应用的操作;还用于停止SIM卡应用在目标进程中运行的组件,以及去注册SIM卡应用在目标进程中已注册的组件或已注册的回调;还用于卸载SIM卡应用。Exemplarily, in implementing the first aspect or any possible implementation method of the first aspect, the processing unit is used to receive an operation to uninstall a SIM card application; is also used to stop components of the SIM card application running in a target process, and to deregister components or registered callbacks of the SIM card application in the target process; and is also used to uninstall the SIM card application.

一种可能的实现方式中,SIM卡应用在目标进程中运行的组件包括服务Service组件;SIM卡应用在目标进程中已注册的组件包括接收Receiver组件;SIM卡应用在目标进程中已注册的回调包括定时服务回调AlarmManger.OnAlarmListener,和/或,回调callback。In a possible implementation, the components of the SIM card application running in the target process include the service component; the components registered by the SIM card application in the target process include the receiver component; the callbacks registered by the SIM card application in the target process include the timer service callback AlarmManger.OnAlarmListener, and/or callback.

一种可能的实现方式中,处理单元,用于调用关闭服务Service组件的函数。In a possible implementation, the processing unit is used to call a function for closing a service component.

一种可能的实现方式中,处理单元,用于调用去注册广播接收器Receiver组件的函数。In a possible implementation, the processing unit is used to call a function to register a broadcast receiver Receiver component.

一种可能的实现方式中,处理单元,用于调用去注册定时任务回调AlarmManger.OnAlarmListener的函数;和/或,调用去注册回调callback的函数。In a possible implementation, the processing unit is configured to call a function for deregistering a scheduled task callback AlarmManger.OnAlarmListener; and/or call a function for deregistering a callback callback.

一种可能的实现方式中,处理单元,用于为SIM卡应用注册卸载广播;还用于发送卸载广播,卸载广播包括SIM卡应用的标识;具体还用于通过SIM卡应用确定卸载广播包括SIM卡应用的标识时,在第一时刻,停止SIM卡应用在目标进程中运行的组件,以及去注册SIM卡应用在目标进程中已注册的组件或回调。In one possible implementation, the processing unit is used to register an uninstall broadcast for a SIM card application; and is also used to send an uninstall broadcast, where the uninstall broadcast includes an identifier of the SIM card application; and is specifically used to, when determining through the SIM card application that the uninstall broadcast includes the identifier of the SIM card application, at the first moment, stop the component of the SIM card application running in the target process, and deregister the component or callback that has been registered by the SIM card application in the target process.

一种可能的实现方式中,处理单元,用于向意图过滤器IntentFilter添加卸载广播所对应的字段Intent.ACTION_PACKAGE_REMOVED,以及添加SIM卡应用的标识。In a possible implementation manner, the processing unit is configured to add a field Intent.ACTION_PACKAGE_REMOVED corresponding to the uninstall broadcast to the intent filter IntentFilter, and add an identifier of the SIM card application.

一种可能的实现方式中,目标进程包括Phone进程。In a possible implementation, the target process includes a Phone process.

示例性的,在实现第二方面或第二方面的任意一种可能的实现方式中,处理单元,用于接收到卸载SIM卡应用的操作;还用于卸载SIM卡应用;还用于重启目标进程。Exemplarily, in implementing the second aspect or any possible implementation manner of the second aspect, the processing unit is used to receive an operation of uninstalling a SIM card application; is also used to uninstall the SIM card application; and is also used to restart a target process.

一种可能的实现方式中,显示单元,用于显示弹窗,弹窗中包括确定按钮、取消按钮以及用于提示卸载SIM卡应用存在的风险的提示信息。In a possible implementation, the display unit is used to display a pop-up window, which includes a confirmation button, a cancel button, and prompt information for prompting the risks of uninstalling the SIM card application.

处理单元,用于响应于对确定按钮的操作,终端设备卸载SIM卡应用。The processing unit is used for uninstalling the SIM card application by the terminal device in response to the operation of the confirmation button.

一种可能的实现方式中,处理单元,用于通过SIM卡应用的配置文件判断SIM卡应用为共进程应用。In a possible implementation manner, the processing unit is configured to determine, through a configuration file of the SIM card application, whether the SIM card application is a co-process application.

一种可能的实现方式中,目标进程包括Phone进程。In a possible implementation, the target process includes a Phone process.

第四方面,本申请实施例提供一种电子设备,包括处理器和存储器,存储器用于存储代码指令,处理器用于运行代码指令,以执行第一方面或第一方面的任意一种可能的实现方式中描述的卸载应用方法,或者以执行第二方面或第二方面的任意一种可能的实现方式中描述的卸载应用方法。In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, the memory being used to store code instructions, and the processor being used to run the code instructions to execute the uninstallation application method described in the first aspect or any possible implementation of the first aspect, or to execute the uninstallation application method described in the second aspect or any possible implementation of the second aspect.

第五方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序或指令,当计算机程序或指令在计算机上运行时,使得计算机执行第一方面或第一方面的任意一种可能的实现方式中描述的卸载应用方法,或者执行第二方面或第二方面的任意一种可能的实现方式中描述的卸载应用方法。In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is run on a computer, the computer executes the uninstallation application method described in the first aspect or any possible implementation of the first aspect, or executes the uninstallation application method described in the second aspect or any possible implementation of the second aspect.

第六方面,本申请实施例提供一种包括计算机程序的计算机程序产品,当计算机程序在计算机上运行时,使得计算机执行第一方面或第一方面的任意一种可能的实现方式中描述的卸载应用方法,或者执行第二方面或第二方面的任意一种可能的实现方式中描述的卸载应用方法。In a sixth aspect, an embodiment of the present application provides a computer program product comprising a computer program. When the computer program runs on a computer, the computer executes the application uninstallation method described in the first aspect or any possible implementation of the first aspect, or executes the application uninstallation method described in the second aspect or any possible implementation of the second aspect.

第七方面,本申请提供一种芯片或者芯片系统,该芯片或者芯片系统包括至少一个处理器和通信接口,通信接口和至少一个处理器通过线路互联,至少一个处理器用于运行计算机程序或指令,以执行第一方面或第一方面的任意一种可能的实现方式中描述的卸载应用方法,或者执行第二方面或第二方面的任意一种可能的实现方式中描述的卸载应用方法。其中,芯片中的通信接口可以为输入/输出接口、管脚或电路等。In a seventh aspect, the present application provides a chip or a chip system, the chip or chip system comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is used to run a computer program or instruction to execute the unloading application method described in the first aspect or any possible implementation of the first aspect, or to execute the unloading application method described in the second aspect or any possible implementation of the second aspect. Among them, the communication interface in the chip can be an input/output interface, a pin or a circuit, etc.

在一种可能的实现中,本申请中上述描述的芯片或者芯片系统还包括至少一个存储器,该至少一个存储器中存储有指令。该存储器可以为芯片内部的存储单元,例如,寄存器、缓存等,也可以是该芯片的存储单元(例如,只读存储器、随机存取存储器等)。In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).

应当理解的是,本申请的第三方面至第七方面与本申请的第一方面或者第二方面的技术方案相对应,各方面及对应的可行实施方式所取得的有益效果相似,不再赘述。It should be understood that the third to seventh aspects of the present application correspond to the technical solutions of the first or second aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请实施例提供的一种终端设备的结构示意图;FIG1 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

图2为本申请实施例提供的一种终端设备的软件结构示意图;FIG2 is a schematic diagram of a software structure of a terminal device provided in an embodiment of the present application;

图3为本申请实施例提供的一种清理应用的方法示意图;FIG3 is a schematic diagram of a method for cleaning an application provided in an embodiment of the present application;

图4为本申请实施例提供的一种终端设备卸载应用时的弹窗提示的示意图;FIG4 is a schematic diagram of a pop-up window prompt when a terminal device uninstalls an application provided in an embodiment of the present application;

图5为本申请实施例提供的一种卸载应用方法的流程示意图;FIG5 is a schematic diagram of a flow chart of a method for uninstalling an application provided in an embodiment of the present application;

图6为本申请实施例提供的一种卸载应用方法的示意图;FIG6 is a schematic diagram of a method for uninstalling an application provided in an embodiment of the present application;

图7为本申请实施例提供的另一种卸载应用方法的示意图;FIG7 is a schematic diagram of another method for uninstalling an application provided in an embodiment of the present application;

图8为本申请实施例提供的一种芯片的结构示意图。FIG8 is a schematic diagram of the structure of a chip provided in an embodiment of the present application.

具体实施方式Detailed ways

为了便于清楚描述本申请实施例的技术方案,以下,对本申请实施例中所涉及的部分术语和技术进行简单介绍:In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:

1、3GPP协议:是第三代合作伙伴计划(3rd generation partnership project,3GPP)为第三代移动系统制定的全球适用技术规范和技术报告,实现由2G网络到3G网络的平滑过渡,保证未来技术的后向兼容性。1. 3GPP protocol: It is the globally applicable technical specifications and technical reports developed by the 3rd Generation Partnership Project (3GPP) for the third generation mobile system, which realizes the smooth transition from 2G network to 3G network and ensures the backward compatibility of future technologies.

2、Ril:无线接口适配层(radio interface layer,Ril)可以负责终端设备与移动网络间的数据通信,数据通信例如包括数据的传输、命令的发送以及响应消息的解析等。Ril还可以为应用程序层中的应用程序提供通用的应用编程接口(applicationprogramming interface,API),示例性的,Ril可以提供电话、短信、网络状态,以及用户标识模块(subscriber identity module,SIM)卡状态等相关API。2. Ril: The radio interface layer (Ril) is responsible for data communication between the terminal device and the mobile network, including data transmission, command sending, and response message parsing. Ril can also provide a general application programming interface (application programming interface, API) for applications in the application layer. For example, Ril can provide APIs related to phone calls, text messages, network status, and subscriber identity module (SIM) card status.

3、CatService模块:可以接收并解析Ril发来的SIM卡应用工具包(simapplication tool kit,STK)相关的数据,还可以将解析后的数据发送给STK。3. CatService module: can receive and parse the data related to the SIM card application tool kit (STK) sent by Ril, and can also send the parsed data to STK.

4、STK:SIM卡应用工具包(sim application tool kit,STK)是3GPP协议定义的SIM卡基本业务应用工具,STK应用(application,APP)也可以称为SIM卡应用。4. STK: SIM card application tool kit (STK) is a basic SIM card service application tool defined by the 3GPP protocol. STK application (APP) can also be called SIM card application.

STK APP中可以包含用于进行SIM卡交互的一系列协议指令,基于协议指令,STKAPP可以与SIM卡内的程序进行交互,以实现SIM卡内程序的运行,进而终端设备可以实现运营商提供的SIM卡相关业务。其中,用于进行SIM卡交互的一系列协议指令也可以称为SIM卡指令。The STK APP may contain a series of protocol instructions for SIM card interaction. Based on the protocol instructions, the STK APP may interact with the program in the SIM card to implement the operation of the program in the SIM card, and then the terminal device may implement the SIM card related services provided by the operator. Among them, the series of protocol instructions for SIM card interaction may also be called SIM card instructions.

示例性的,在终端设备接收到用户点击桌面上的STK APP的操作时,终端设备响应于该操作,可以打开STK APP。STK APP的界面中可以显示SIM卡上报的菜单。当STK APP监控到用户点击相关菜单后,STK APP可以将接收到的STK相关的指令传递给CatService模块。CatService模块在接收到指令后,将指令处理为Ril要求的格式后传递给Ril。Ril可以通过调制解调器Modem将指令处理后,传递给SIM卡,进而SIM卡可以基于运营商提供的服务处理该指令。Exemplarily, when the terminal device receives an operation of the user clicking on the STK APP on the desktop, the terminal device can open the STK APP in response to the operation. The menu reported by the SIM card can be displayed in the interface of the STK APP. When the STK APP monitors that the user clicks on the relevant menu, the STK APP can pass the received STK-related instructions to the CatService module. After receiving the instruction, the CatService module processes the instruction into the format required by Ril and passes it to Ril. Ril can process the instruction through the modem and pass it to the SIM card, and then the SIM card can process the instruction based on the service provided by the operator.

5、Phone进程:是Android系统中的系统进程,Phone进程中可以执行电话、短信、上网等相关业务。Phone进程是终端设备的开机启动进程,在终端设备开机启动后,Phone进程持续运行,如果Phone进程在运行中出现异常退出的情况,则终端设备可以自动重启Phone进程。5. Phone process: It is a system process in the Android system. Phone process can execute phone calls, text messages, Internet access and other related services. Phone process is the startup process of the terminal device. After the terminal device is started, the Phone process continues to run. If the Phone process exits abnormally during operation, the terminal device can automatically restart the Phone process.

6、术语6. Terminology

在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。例如,第一芯片和第二芯片仅仅是为了区分不同的芯片,并不对其先后顺序进行限定。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

需要说明的是,本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a--c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And/or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, a-b, a--c, b-c, or a-b-c, where a, b, c can be single or multiple.

7、终端设备7. Terminal equipment

本申请实施例的终端设备也可以为任意形式的电子设备,例如,电子设备可以包括具有移动通信功能的手持式设备、车载设备等。例如,一些电子设备为:手机(mobilePhone)、平板电脑、掌上电脑、笔记本电脑、移动互联网设备(mobile internet device,MID)、可穿戴设备,虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端、蜂窝电话、无绳电话、会话启动协议(session initiation protocol,SIP)电话、无线本地环路(wireless local loop,WLL)站、个人数字助理(personal digital assistant,PDA)、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备,5G网络中的终端设备或者未来演进的公用陆地移动通信网络(public land mobile network,PLMN)中的终端设备等,本申请实施例对此并不限定。The terminal device of the embodiment of the present application may also be any form of electronic device. For example, the electronic device may include a handheld device with mobile communication function, a vehicle-mounted device, etc. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication functions, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks (public land mobile The embodiments of the present application do not limit this.

作为示例而非限定,在本申请实施例中,该电子设备还可以是可穿戴设备。可穿戴设备也可以称为穿戴式智能设备,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功能,例如:智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环、智能首饰等。As an example but not limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.

此外,在本申请实施例中,电子设备还可以是物联网(internet of things,IoT)系统中的终端设备,IoT是未来信息技术发展的重要组成部分,其主要技术特点是将物品通过通信技术与网络连接,从而实现人机互连,物物互连的智能化网络。In addition, in the embodiments of the present application, the electronic device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.

本申请实施例中的电子设备也可以称为:终端设备、用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置等。The electronic devices in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.

在本申请实施例中,电子设备或各个网络设备包括硬件层、运行在硬件层之上的操作系统层,以及运行在操作系统层上的应用层。该硬件层包括中央处理器(centralprocessing unit,CPU)、内存管理单元(memory management unit,MMU)和内存(也称为主存)等硬件。该操作系统可以是任意一种或多种通过进程(process)实现业务处理的计算机操作系统,例如,Linux操作系统、Unix操作系统、Android操作系统、iOS操作系统或windows操作系统等。该应用层包含浏览器、通讯录、文字处理软件、即时通信软件等应用。In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.

示例性的,图1示出了电子设备的结构示意图。Exemplarily, FIG1 shows a schematic structural diagram of an electronic device.

电子设备可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及SIM卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a SIM card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

可以理解的是,本发明实施例示意的结构并不构成对电子设备的具体限定。在本申请另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从上述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,SIM卡接口,和/或USB接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a SIM card interface, and/or a USB interface, etc.

可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备的结构限定。在本申请另一些实施例中,电子设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

电子设备通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

电子设备可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.

内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备的各种功能应用以及数据处理。例如,可以执行本申请实施例的卸载应用的方法。The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (universal flash storage, UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the internal memory 121, and/or instructions stored in a memory provided in the processor. For example, the method for uninstalling an application in an embodiment of the present application may be executed.

图2是本申请实施例的终端设备的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。FIG2 is a software structure diagram of a terminal device in an embodiment of the present application. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, namely, from top to bottom, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer.

应用程序层可以包括一系列应用程序包。如图2所示,应用程序包可以包括SIM卡、电话、短信、备忘录、相机等应用程序。这些应用程序包对应的应用程序可以是系统应用程序,也可以是三方应用程序。The application layer can include a series of application packages. As shown in Figure 2, the application package can include SIM card, phone, SMS, memo, camera and other applications. The applications corresponding to these application packages can be system applications or third-party applications.

应用程序框架层也称为Framework层,可以为应用程序层的应用程序提供API和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer is also called the Framework layer, which can provide API and programming framework for the applications in the application layer. The application framework layer includes some pre-defined functions.

如图2所示,应用程序框架层可以包括窗口管理器、资源管理器、通知管理器、内容提供器、视图系统等。As shown in FIG. 2 , the application framework layer may include a window manager, a resource manager, a notification manager, a content provider, a view system, and the like.

窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏、锁定屏幕、触摸屏幕、拖拽屏幕、截取屏幕等。The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, capture the screen, etc.

资源管理器为应用程序提供各种资源,例如本地化字符串、图标、图片、布局文件、视频文件等等。The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息、发出提示音、终端设备振动、指示灯闪烁等。The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the terminal device vibrates, the indicator light flashes, etc.

内容提供器用于在不同的应用程序之间实现数据共享的功能,允许一个程序访问另一个程序中的数据,同时还能保证被访问的数据的安全性。Content providers are used to implement data sharing between different applications, allowing one program to access data in another program while ensuring the security of the accessed data.

视图系统可以负责应用程序的界面绘制和事件处理。The view system can be responsible for the application interface drawing and event processing.

Android runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。例如本申请实施例中,虚拟机可以用于执行卸载应用等功能。The application layer and the application framework layer run in a virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection. For example, in the embodiment of the present application, the virtual machine can be used to perform functions such as uninstalling applications.

系统库可以包括多个功能模块。例如:媒体库(Media Libraries)、函数库(Function Libraries)、图形处理库(例如:OpenGL ES)等。The system library may include multiple functional modules, such as media libraries, function libraries, graphics processing libraries (such as OpenGL ES), etc.

媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

函数库为开发者提供多种服务的API接口,方便开发者快速集成并实现各种功能。The function library provides developers with API interfaces for multiple services, making it easy for developers to quickly integrate and implement various functions.

图形处理库用于实现三维图形绘图、图像渲染、合成和图层处理等。The graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing.

内核层是硬件和软件之间的层。内核层可以包括显示驱动、摄像头驱动、音频驱动、中央处理器驱动、USB驱动、电池驱动等。The kernel layer is the layer between hardware and software. The kernel layer may include display driver, camera driver, audio driver, CPU driver, USB driver, battery driver, etc.

终端设备中的应用程序可以支持卸载,一些实现中,当用户卸载应用程序时,在终端系统的Framework层中可以关闭该应用程序的进程并删除该应用程序的应用数据,以释放终端设备系统中的内存资源。然而,若被卸载的应用程序与其他进程共进程,则在卸载应用程序时,在Framework层中不会关闭与该应用程序共进程的进程,导致该应用程序的应用数据在被删除后,该进程中仍可能使用已被删除的应用程序的应用数据,使进程出错,从而可能出现该进程所对应的业务闪退的场景。Applications in terminal devices can support uninstallation. In some implementations, when a user uninstalls an application, the application process can be closed and the application data of the application can be deleted in the Framework layer of the terminal system to release memory resources in the terminal device system. However, if the uninstalled application is shared with other processes, the process shared with the application will not be closed in the Framework layer when the application is uninstalled, resulting in that after the application data of the application is deleted, the process may still use the application data of the deleted application, causing the process to fail, and the service corresponding to the process may crash.

示例性的,以STK APP被卸载为例,由于STK APP是在Phone进程中执行的,或理解为STK APP与Phone是共进程的,并且STK APP是终端设备的开机启动应用,在终端设备开机启动后,STK APP可以启动并持续运行。当STK APP被卸载时,STK APP的应用数据可以被删除,但是Phone进程不会被关闭,因此,运行在Phone进程中的STK APP的部分组件不会被删除,在Phone进程中已注册的STK APP的部分组件或回调等也不会被删除,这些组件或者回调仍可能在Phone进程中运行。For example, taking the uninstallation of STK APP as an example, since STK APP is executed in the Phone process, or it can be understood that STK APP and Phone are co-processes, and STK APP is the startup application of the terminal device, after the terminal device is started, STK APP can be started and run continuously. When STK APP is uninstalled, the application data of STK APP can be deleted, but the Phone process will not be closed. Therefore, some components of STK APP running in the Phone process will not be deleted, and some components or callbacks of STK APP registered in the Phone process will not be deleted, and these components or callbacks may still run in the Phone process.

这些组件或者回调在运行过程中,可能会调用已被删除的STK APP的应用数据,从而导致Phone进程的运行出错而出现闪退的场景,使Phone进程所对应的电话、短信、上网等业务短暂时间内无法使用,给用户带来不好的使用体验。During the operation of these components or callbacks, the application data of the deleted STK APP may be called, which may cause the Phone process to run incorrectly and crash. The corresponding phone calls, text messages, Internet access and other services of the Phone process may be temporarily unavailable, giving users a bad experience.

例如,一种可能的实现中,在终端设备修改系统语言的场景中,可以涉及到Phone进程中运行STK APP相应业务的情况。例如,SIM卡可以支持几种不同的语言,当终端设备接收到用户修改终端设备的系统语言的操作时,终端设备响应于该操作,可以发送系统广播,该系统广播用于通知系统语言被修改。在Phone进程中,STK APP可以接收该系统广播以及进行STK相应的业务处理流程等。For example, in a possible implementation, in the scenario where the terminal device modifies the system language, it may involve the situation where the corresponding services of the STK APP are run in the Phone process. For example, the SIM card can support several different languages. When the terminal device receives the user's operation to modify the system language of the terminal device, the terminal device can send a system broadcast in response to the operation. The system broadcast is used to notify that the system language has been modified. In the Phone process, the STK APP can receive the system broadcast and perform the corresponding business processing flow of the STK.

然而,在STK APP被卸载的情况下,STK APP已注册的用于接收系统语言被修改的广播的广播接收器不会被删除,该广播接收器仍会在Phone进程中接收系统语言被修改的广播。该广播接收器在接收到该广播后会进行STK相应的业务处理流程。但是,由于STK APP的应用数据已被删除,该广播接收器无法在Phone进程中调用已被删除的STK APP的应用数据,从而导致Phone进程执行流程出错,Phone进程出现闪退等,进而影响在Phone进程中运行的其他业务。However, when the STK APP is uninstalled, the broadcast receiver registered by the STK APP for receiving the broadcast of the modified system language will not be deleted, and the broadcast receiver will still receive the broadcast of the modified system language in the Phone process. After receiving the broadcast, the broadcast receiver will perform the corresponding business processing flow of STK. However, since the application data of the STK APP has been deleted, the broadcast receiver cannot call the application data of the deleted STK APP in the Phone process, which will cause the execution process of the Phone process to fail, the Phone process will crash, etc., and then affect other businesses running in the Phone process.

另一种可能的实现中,在终端设备中插入或拔出SIM卡的场景中,可以涉及到Phone进程中运行STK APP相应业务的情况。例如,当终端设备接收到用户插入SIM卡或拔出SIM卡的操作时,终端设备响应于该操作,可以发送广播,该广播用于通知插入SIM卡或拔出SIM卡。在Phone进程中,STK APP可以接收该广播以及处理插入SIM卡或拔出SIM卡的相关业务流程。In another possible implementation, in the scenario of inserting or removing a SIM card from a terminal device, the situation of running the corresponding service of the STK APP in the Phone process may be involved. For example, when the terminal device receives an operation of inserting or removing a SIM card from a user, the terminal device may send a broadcast in response to the operation, and the broadcast is used to notify the insertion or removal of the SIM card. In the Phone process, the STK APP may receive the broadcast and process the relevant service processes of inserting or removing a SIM card.

然而,在STK APP被卸载的情况下,STK APP已注册的用于接收插入SIM卡或拔出SIM卡的广播的广播接收器不会被删除,该广播接收器仍会在Phone进程中接收插入SIM卡或拔出SIM卡的广播。该广播接收器在接收到该广播后会进行STK相应的业务处理流程。但是由于STK APP的应用数据已被删除,该广播接收器无法在Phone进程中调用已被删除的STK APP的应用数据,从而导致Phone进程的执行流程出错,Phone进程出现闪退等,进而影响在Phone进程中运行的其他业务。However, when the STK APP is uninstalled, the broadcast receiver registered by the STK APP for receiving broadcasts of inserting or removing the SIM card will not be deleted, and the broadcast receiver will still receive broadcasts of inserting or removing the SIM card in the Phone process. After receiving the broadcast, the broadcast receiver will perform the corresponding business processing flow of STK. However, since the application data of the STK APP has been deleted, the broadcast receiver cannot call the application data of the deleted STK APP in the Phone process, resulting in errors in the execution process of the Phone process, the Phone process crashes, etc., which in turn affects other services running in the Phone process.

有鉴于此,本申请实施例提供的一种卸载应用方法中,终端设备在卸载STK APP时,终端设备可以先停止因在Phone进程中运行而无法被删除的STK APP的部分组件的运行,或者去注册因在Phone进程中注册而无法被删除的STK APP的部分组件或回调等,然后再执行卸载流程。从而可以在STK APP被卸载时,不影响与STK APP共进程的Phone进程中其他业务的运行,提升用户体验。In view of this, in an application uninstallation method provided in an embodiment of the present application, when a terminal device uninstalls an STK APP, the terminal device may first stop the operation of some components of the STK APP that cannot be deleted because they are running in the Phone process, or deregister some components or callbacks of the STK APP that cannot be deleted because they are registered in the Phone process, and then execute the uninstallation process. Therefore, when the STK APP is uninstalled, the operation of other services in the Phone process that shares the same process with the STK APP will not be affected, thereby improving the user experience.

或者,终端设备在卸载STK APP时,终端设备在执行STK APP卸载流程后,可以重启Phone进程。因为在Phone进程重启时,STK APP已完成卸载,STK APP不会在Phone进程中运行,因此在Phone进程中不会运行STK APP的组件或不会注册STK APP的组件或回调等,使得STK APP不会对Phone进程造成影响。从而可以在STK APP被卸载时,不影响与STK APP共进程的Phone进程中其他业务的运行,提升用户体验。Alternatively, when the terminal device uninstalls the STK APP, the terminal device can restart the Phone process after executing the STK APP uninstallation process. Because the STK APP has been uninstalled when the Phone process is restarted, the STK APP will not run in the Phone process. Therefore, the components of the STK APP will not run or the components or callbacks of the STK APP will not be registered in the Phone process, so that the STK APP will not affect the Phone process. Therefore, when the STK APP is uninstalled, it will not affect the operation of other services in the Phone process that share the STK APP process, thereby improving the user experience.

下面通过具体的实施例对本申请实施例的卸载应用方法进行详细说明。下面的实施例可以相互结合或独立实施,对于相同或相似的概念或过程可能在某些实施例中不再赘述。The following describes in detail the method for uninstalling applications in the embodiments of the present application through specific embodiments. The following embodiments can be combined with each other or implemented independently, and the same or similar concepts or processes may not be described in detail in some embodiments.

本申请实施例的一种卸载应用方法中,在STK APP被卸载前,终端设备可以先停止因在Phone进程中运行而无法被删除的STK APP的部分组件的运行,或者去注册因在Phone进程中注册而无法被删除的STK APP的部分组件或回调等。示例性的,需要停止在Phone进程中运行的组件或需要去注册在Phone进程中注册的部分组件或回调等可以包括:服务Service组件、接收器Receiver组件、定时服务回调AlarmManger.OnAlarmListener,以及回调callback等。其中,接收器Receiver组件可以包括广播接收器BroastcastReceiver组件。In an application uninstallation method of an embodiment of the present application, before the STK APP is uninstalled, the terminal device may first stop the operation of some components of the STK APP that cannot be deleted because they are running in the Phone process, or deregister some components or callbacks of the STK APP that cannot be deleted because they are registered in the Phone process. Exemplarily, the components that need to be stopped from running in the Phone process or the components or callbacks registered in the Phone process that need to be deregistered may include: a service Service component, a receiver Receiver component, a timer service callback AlarmManger.OnAlarmListener, and a callback callback, etc. Among them, the receiver Receiver component may include a broadcast receiver BrooastcastReceiver component.

可以理解的是,STK APP中还可以有其他需要停止在Phone进程中运行的组件或需要去注册在Phone进程中注册的部分组件或回调等,本申请实施例不作限定。It is understandable that there may be other components in the STK APP that need to stop running in the Phone process or need to deregister some components or callbacks registered in the Phone process, etc., which is not limited in the embodiments of the present application.

一种可能的实现中,图3以卸载STK APP为例示出了本申请实施例的卸载应用方法的示意图,具体步骤可以为:In a possible implementation, FIG3 shows a schematic diagram of the method for uninstalling an application according to an embodiment of the present application, taking uninstalling the STK APP as an example. The specific steps may be:

S301、注册卸载广播。S301: Register and uninstall broadcast.

终端设备可以为STK APP注册卸载广播。可以理解的是,终端设备可以基于STKAPP注册卸载广播,也可以基于终端设备中的其他应用或模块为STK APP注册卸载广播,本申请实施例不作限定。其中,终端设备可以在STK APP启动时注册卸载广播,也可以在其他应用或模块中注册卸载广播,具体的注册卸载广播的流程,本申请实施例不作限定。The terminal device can register an uninstall broadcast for the STK APP. It is understandable that the terminal device can register an uninstall broadcast based on the STK APP, or it can register an uninstall broadcast for the STK APP based on other applications or modules in the terminal device, which is not limited in the embodiments of the present application. Among them, the terminal device can register an uninstall broadcast when the STK APP is started, or it can register an uninstall broadcast in other applications or modules. The specific process of registering and uninstalling broadcast is not limited in the embodiments of the present application.

示例性的,以在STK APP应用启动时,STK APP注册卸载广播为例,注册卸载广播的过程可以包括:For example, when the STK APP application is started, the STK APP registers the uninstall broadcast as an example. The process of registering the uninstall broadcast may include:

STK APP可以向意图过滤器IntentFilter添加卸载广播所对应的字段Intent.ACTION_PACKAGE_REMOVED,以及添加STK APP的包名。STK APP can add the field Intent.ACTION_PACKAGE_REMOVED corresponding to the uninstall broadcast to the intent filter IntentFilter, and add the package name of the STK APP.

进一步的,STK APP可以调用注册广播接收器Receiver的函数完成卸载广播注册。其中,注册广播接收器Receiver的函数例如包括registerReceiver()等。Furthermore, the STK APP can call a function for registering a broadcast receiver to complete the uninstall broadcast registration. The function for registering a broadcast receiver includes, for example, registerReceiver().

S302、判断是否卸载STK APP。S302: Determine whether to uninstall the STK APP.

当终端设备接收到用户触发卸载STK APP的操作时,终端设备响应于该操作,可以发送的卸载广播,其中,该卸载广播中可以包括STK APP的包名。When the terminal device receives an operation triggered by the user to uninstall the STK APP, the terminal device may send an uninstall broadcast in response to the operation, wherein the uninstall broadcast may include the package name of the STK APP.

当STK APP在收到终端设备发送的卸载广播后,可以判断该卸载广播中所携带的包名是否为STK APP所对应的包名。When the STK APP receives the uninstall broadcast sent by the terminal device, it can determine whether the package name carried in the uninstall broadcast is the package name corresponding to the STK APP.

若STK APP判断卸载广播中没有STK APP所对应的包名,则确定不卸载STK APP。If the STK APP determines that there is no package name corresponding to the STK APP in the uninstall broadcast, it is determined not to uninstall the STK APP.

若STK APP判断卸载广播中有STK APP所对应的包名,则确定卸载STK APP,STKAPP可以停止在Phone进程中运行的组件,或者去注册在Phone进程中注册的部分组件或回调等。也可以理解为STK APP对在Phone进程中运行的组件或在Phone进程中注册的部分组件或回调等的清理。If STK APP determines that the package name corresponding to STK APP is in the uninstall broadcast, STK APP is determined to be uninstalled, and STK APP can stop the components running in the Phone process, or deregister some components or callbacks registered in the Phone process, etc. It can also be understood as STK APP cleaning up the components running in the Phone process or some components or callbacks registered in the Phone process, etc.

具体的清理方式可以参照下述S303的描述。The specific cleaning method may refer to the description of S303 below.

S303、组件或回调的清理。S303: Clean up components or callbacks.

示例性的,对于服务Service组件,当STK APP判断应用自身被卸载时,STK APP可以判断服务Service是否正在运行,若服务Service正在运行,则STK APP可以调用关闭服务Service组件的函数,例如stopService()函数,来停止Service组件的运行,完成Service组件的内存释放。For example, for the service component, when the STK APP determines that the application itself is uninstalled, the STK APP can determine whether the service is running. If the service is running, the STK APP can call a function to close the service component, such as the stopService() function, to stop the operation of the Service component and complete the memory release of the Service component.

对于广播接收器Receiver组件,当STK APP判断应用自身被卸载时,STK APP可以判断是否有已注册的广播接收器Receiver,若有已注册的广播接收器Receiver,则STK APP可以调用去注册广播接收器Receiver组件的函数,例如unRegisterReceiver()函数,来停止Receiver组件的运行,完成Receiver组件的内存释放。For the broadcast receiver Receiver component, when the STK APP determines that the application itself is uninstalled, the STK APP can determine whether there is a registered broadcast receiver Receiver. If there is a registered broadcast receiver Receiver, the STK APP can call the function to register the broadcast receiver Receiver component, such as the unRegisterReceiver() function, to stop the operation of the Receiver component and complete the memory release of the Receiver component.

对于定时服务回调AlarmManger.OnAlarmListener,当STK APP判断应用自身被卸载时,STK APP可以判断是否有已注册的定时任务回调AlarmManger.OnAlarmListener,若STK APP中有已注册的定时任务回调AlarmManger.OnAlarmListener,则STK APP可以执行去注册定时任务回调AlarmManger.OnAlarmListener的函数,例如cancel()函数,完成定时任务回调AlarmManger.OnAlarmListener的内存释放。For the timed service callback AlarmManger.OnAlarmListener, when STK APP determines that the application itself is uninstalled, STK APP can determine whether there is a registered timed task callback AlarmManger.OnAlarmListener. If there is a registered timed task callback AlarmManger.OnAlarmListener in STK APP, STK APP can execute the function of deregistering the timed task callback AlarmManger.OnAlarmListener, such as the cancel() function, to complete the memory release of the timed task callback AlarmManger.OnAlarmListener.

对于回调callback,当STK APP判断应用自身被卸载时,STK APP可以判断在Phone进程中是否存在已注册的回调callback,若在Phone进程中存在已注册的回调callback,STK APP可以调用去注册回调callback的函数,来停止回调callback的运行,完成回调callback的内存释放。For callbacks, when STK APP determines that the application itself is uninstalled, STK APP can determine whether there is a registered callback in the Phone process. If there is a registered callback in the Phone process, STK APP can call the function to register the callback to stop the callback from running and complete the memory release of the callback.

示例性的,表1汇总示出了对上述几种组件或回调的清理方案。Exemplarily, Table 1 summarizes the cleaning solutions for the above-mentioned components or callbacks.

表1Table 1

本申请实施例中,STK APP在被卸载前,终端设备可以先停止因在Phone进程中运行而无法被删除的STK APP的部分组件的运行,或者去注册因在Phone进程中注册而无法被删除的STK APP的部分组件或回调等,然后再执行卸载流程。这样可以在用户不感知的情况下,完成STK APP内存的清理以及应用的卸载,提升用户体验。In the embodiment of the present application, before the STK APP is uninstalled, the terminal device may first stop the operation of some components of the STK APP that cannot be deleted because they are running in the Phone process, or deregister some components or callbacks of the STK APP that cannot be deleted because they are registered in the Phone process, and then execute the uninstallation process. In this way, the STK APP memory can be cleaned up and the application uninstalled without the user's awareness, thereby improving the user experience.

可以理解的是,在STK APP被卸载时,由于运行在Phone进程中的STK APP的部分组件不会被删除,或者在Phone进程中已注册的STK APP的部分组件或回调等也不会被删除,这些组件或者回调在Phone进程中运行的过程中,可能会调用已被删除的STK APP的应用数据,从而导致Phone进程的运行出错而出现闪退的场景,可以通过重启Phone进程来恢复。因为在Phone进程重启时,STK APP已完成卸载,STK APP不会在Phone进程中运行,因此在Phone进程中不会运行STK APP的组件或不会注册STK APP的组件或回调等,从而不会导致Phone进程的运行出错而出现闪退的场景。It is understandable that when the STK APP is uninstalled, some components of the STK APP running in the Phone process will not be deleted, or some components or callbacks of the STK APP registered in the Phone process will not be deleted. These components or callbacks may call the application data of the deleted STK APP during the running of the Phone process, which may cause the Phone process to run incorrectly and crash. This can be recovered by restarting the Phone process. Because the STK APP has been uninstalled when the Phone process is restarted, the STK APP will not run in the Phone process, so the components of the STK APP will not run or the components or callbacks of the STK APP will not be registered in the Phone process, which will not cause the Phone process to run incorrectly and crash.

因此,STK APP可以在被卸载时指示终端设备重启Phone进程,从而使Phone进程不会出现因为STK APP的部分组件或者部分回调调用已被删除的STK APP的应用数据而闪退的场景,还可以使Phone进程中的其他相关业务(如电话、短信、上网等业务)正常运行。Therefore, when the STK APP is uninstalled, it can instruct the terminal device to restart the Phone process, so that the Phone process will not crash due to some components of the STK APP or some callbacks calling the application data of the deleted STK APP, and other related services in the Phone process (such as phone calls, text messages, Internet access, etc.) can run normally.

此外,由于重启Phone进程可能导致Phone进程中运行的其他相关业务(如电话、短信、上网等业务)出现短暂时间内无法使用的场景,是用户可以感知的。因此,在STK APP指示终端设备重启Phone进程时,终端设备可以给用户显示弹窗,提示卸载STK APP时可能出现的影响,由用户决定是否继续卸载STK APP。In addition, since restarting the Phone process may cause other related services (such as phone calls, text messages, Internet access, etc.) running in the Phone process to be unavailable for a short period of time, the user can perceive it. Therefore, when the STK APP instructs the terminal device to restart the Phone process, the terminal device can display a pop-up window to the user to prompt the possible impact of uninstalling the STK APP, and the user can decide whether to continue uninstalling the STK APP.

示例性的,图4提供了一种STK APP被卸载时,终端设备显示卸载应用弹窗的界面示意图。如图4所示,终端设备的界面上可以显示弹窗401,弹窗401中可以显示STK APP的图标402、卸载提示标题403、卸载提示信息404、确定按钮405以及取消按钮406。For example, Figure 4 provides a schematic diagram of an interface in which a terminal device displays a pop-up window for uninstalling an application when an STK APP is uninstalled. As shown in Figure 4, a pop-up window 401 may be displayed on the interface of the terminal device, and the pop-up window 401 may display an icon 402 of the STK APP, an uninstallation prompt title 403, uninstallation prompt information 404, an OK button 405, and a Cancel button 406.

其中,卸载提示标题403可以包括“是否卸载SIM卡应用?”,卸载提示信息404可以包括“此应用属于系统应用,卸载后可能会导致通话、短信、上网等业务暂时无法使用。”具体的卸载提示标题403和卸载提示信息404的内容信息,本申请实施例不作限定。当终端设备接收到用户触发确定按钮405的操作时,终端设备可以基于STK APP执行卸载应用的流程。当终端设备接收到用户触发取消按钮406的操作时,终端设备可以取消弹窗401的显示,且不执行卸载应用的流程。Among them, the uninstall prompt title 403 may include "Do you want to uninstall the SIM card application?", and the uninstall prompt information 404 may include "This application is a system application. After uninstallation, it may cause calls, text messages, Internet access and other services to be temporarily unavailable." The specific content information of the uninstall prompt title 403 and the uninstall prompt information 404 is not limited in the embodiment of the present application. When the terminal device receives the operation of the user triggering the confirmation button 405, the terminal device can execute the process of uninstalling the application based on the STK APP. When the terminal device receives the operation of the user triggering the cancel button 406, the terminal device can cancel the display of the pop-up window 401 and does not execute the process of uninstalling the application.

对应于图4所示的卸载应用后重启进程的场景,示例性的,图5示出本申请实施例所提供的一种卸载应用的流程示意图。具体步骤可以为:Corresponding to the scenario of restarting the process after uninstalling the application shown in FIG4 , FIG5 is an exemplary flowchart of uninstalling the application provided by an embodiment of the present application. The specific steps may be:

S501、接收到用于触发卸载应用的操作。S501: Receive an operation for triggering uninstallation of an application.

示例性的,用于触发卸载应用的操作可以包括:用户在终端设备的桌面上长按应用的应用图标,触发卸载按钮的操作,也可以包括:用户在终端设备的设置界面的应用管理中,找到应用并触发卸载按钮的操作,具体的卸载应用的操作,本申请实施例不作限定。Exemplarily, the operation for triggering the uninstallation of an application may include: a user long pressing the application icon of the application on the desktop of the terminal device to trigger the operation of the uninstall button; it may also include: a user finding the application in the application management in the setting interface of the terminal device and triggering the operation of the uninstall button. The specific operation for uninstalling the application is not limited in the embodiments of the present application.

S504、终端设备在界面中显示弹窗,弹窗中可以包括:取消按钮、确定按钮、以及用于提示用户卸载应用后可能的影响的信息。具体的,卸载应用的弹窗以及提示信息可以参照图4所对应的界面显示,不再赘述。S504, the terminal device displays a pop-up window in the interface, which may include: a cancel button, an OK button, and information for prompting the user of possible impacts after uninstalling the application. Specifically, the pop-up window for uninstalling the application and the prompt information can be displayed with reference to the interface corresponding to FIG. 4, which will not be repeated here.

S505、当终端设备接收到用户触发取消按钮的操作时,终端设备可以取消弹窗的显示。同时,终端设备可以不需要执行卸载应用的流程。S505: When the terminal device receives the user's operation of triggering the cancel button, the terminal device may cancel the display of the pop-up window. Meanwhile, the terminal device may not need to execute the process of uninstalling the application.

S506、当终端设备接收到用户触发确定按钮的操作时,终端设备可以执行卸载流程。S506: When the terminal device receives an operation of the user triggering a confirmation button, the terminal device may execute an uninstallation process.

示例性的,卸载流程可以包括通过调用应用程序管理服务(package managerservice,PMS)中删除应用程序的函数来删除应用对应的安装文件和应用数据,以及清理终端设备的系统内存信息。Exemplarily, the uninstallation process may include deleting the installation files and application data corresponding to the application by calling a function for deleting the application in the package manager service (PMS), and clearing the system memory information of the terminal device.

S507、在终端设备执行卸载流程后,终端设备可以重启共进程的进程。S507: After the terminal device executes the uninstallation process, the terminal device may restart the process of the common process.

一种可能的重启进程的实现中,终端设备可以基于活动管理器ActivityManager中关闭进程的函数来关闭进程,以及启动进程的函数来启动进程。In a possible implementation of restarting a process, the terminal device may close the process based on a process closing function in the activity manager ActivityManager, and may start the process based on a process starting function.

S508、完成应用的卸载。S508: Complete uninstallation of the application.

本申请实施例提供的卸载应用的方法,应用在被卸载前,应用可以在终端设备界面中给用户显示弹窗,提示卸载应用的影响,同时重启与应用共进程的进程,从而可以在应用被卸载时,不影响与应用共进程的进程中其他业务的运行,提升用户体验。The method for uninstalling an application provided in an embodiment of the present application can display a pop-up window to the user in the terminal device interface before the application is uninstalled, prompting the user of the impact of uninstalling the application and restarting the process that shares the same process with the application. This allows the operation of other services in the process that shares the same process with the application to be not affected when the application is uninstalled, thereby improving the user experience.

可选的,在S501和S504之间还可以包括S502。Optionally, S502 may be included between S501 and S504.

S502、判断应用是否共进程。S502: Determine whether the application is a common process.

在应用被卸载前,终端设备可以判断该应用是否是共进程应用。一种可能的实现中,若在应用的配置文件中查询到application字段所对应的内容中的“android:process”属性配置了其他进程的标识,则说明应用与其他进程是共进程的。示例性的,以应用为STKAPP为例,若在STK APP的配置文件中查询到application字段所对应的内容中的“android:process”属性配置为“android:process="com.android.Phone"”,则说明STK APP与Phone进程共进程。Before the application is uninstalled, the terminal device can determine whether the application is a co-process application. In one possible implementation, if the "android:process" attribute in the content corresponding to the application field in the application configuration file is configured with the identifier of other processes, it means that the application and other processes are co-processes. Exemplarily, taking the application as STKAPP as an example, if the "android:process" attribute in the content corresponding to the application field in the STK APP configuration file is configured as "android:process="com.android.Phone", it means that the STK APP and the Phone process are co-processes.

如果在应用的配置文件中可以查询到其他进程的标识,说明该应用是共进程应用,则可以执行S504的步骤,如果在应用的配置文件中未查询到其他进程的标识,说明该应用不是共进程应用,则可以执行S503的步骤。If the identifiers of other processes can be found in the configuration file of the application, it means that the application is a co-process application, and step S504 can be executed. If the identifiers of other processes are not found in the configuration file of the application, it means that the application is not a co-process application, and step S503 can be executed.

S503、若应用不是共进程应用,终端设备可以执行应用的卸载流程。卸载流程可以参考上述S506的描述,不再赘述。S503: If the application is not a co-process application, the terminal device may execute an uninstallation process of the application. The uninstallation process may refer to the description of S506 above, which will not be described in detail.

这样,在终端设备卸载应用时,终端设备可以基于本申请实施例的卸载流程实现应用的卸载,例如,该应用可以是共进程应用,也可以是不共进程的应用。In this way, when the terminal device uninstalls the application, the terminal device can uninstall the application based on the uninstallation process of the embodiment of the present application. For example, the application can be a co-process application or a non-co-process application.

具体的,图6为本申请实施例所提供的一种SIM卡业务处理的示意图。方法包括:Specifically, FIG6 is a schematic diagram of a SIM card service processing method provided by an embodiment of the present application. The method includes:

S601、终端设备接收到卸载SIM卡应用的操作。S601: The terminal device receives an operation to uninstall a SIM card application.

本申请实施例中,卸载SIM卡应用的操作可以包括:用户在终端设备的桌面上长按SIM卡应用的应用图标,触发卸载按钮的操作;也可以包括:用户在终端设备的设置界面的应用管理中,找到SIM卡应用并触发卸载按钮的操作。具体的卸载SIM卡应用的操作,本申请实施例不作限定。In the embodiment of the present application, the operation of uninstalling the SIM card application may include: the user long presses the application icon of the SIM card application on the desktop of the terminal device to trigger the operation of the uninstall button; it may also include: the user finds the SIM card application in the application management of the setting interface of the terminal device and triggers the operation of the uninstall button. The specific operation of uninstalling the SIM card application is not limited in the embodiment of the present application.

S602、根据终端设备接收的卸载SIM卡应用的操作,在第一时刻,终端设备停止SIM卡应用在目标进程中运行的组件,以及去注册SIM卡应用在目标进程中已注册的组件或已注册的回调,目标进程为SIM卡应用与其他应用共进程的进程。S602. According to the operation of uninstalling the SIM card application received by the terminal device, at the first moment, the terminal device stops the components of the SIM card application running in the target process, and deregisters the components or registered callbacks of the SIM card application in the target process, where the target process is a process shared by the SIM card application and other applications.

本申请实施例中,第一时刻可以为终端设备清理SIM卡应用的组件或回调的时刻。In the embodiment of the present application, the first moment may be the moment when the terminal device cleans up components or callbacks of the SIM card application.

终端设备停止SIM卡应用在目标进程中运行的组件,以及去注册SIM卡应用在目标进程中已注册的组件或已注册的回调的具体执行过程,可以参照上述图3对应的实施例中S303中组件或回调的清理的相关描述,在此不再赘述。The specific execution process of the terminal device stopping the components of the SIM card application running in the target process, and deregistering the registered components or registered callbacks of the SIM card application in the target process can refer to the relevant description of the cleanup of components or callbacks in S303 in the embodiment corresponding to Figure 3 above, which will not be repeated here.

目标进程可以为SIM卡应用运行时所对应的进程,例如,SIM卡应用可以与Phone进程共进程,则目标进程可以为Phone进程。The target process may be a process corresponding to the execution of the SIM card application. For example, the SIM card application may be a common process with the Phone process, and the target process may be the Phone process.

S603、在第二时刻,终端设备卸载SIM卡应用,第二时刻晚于第一时刻。S603: At a second moment, the terminal device uninstalls the SIM card application, and the second moment is later than the first moment.

本申请实施例中,第二时刻可以为终端设备卸载SIM卡应用的时刻,可以理解的是,终端设备可以在执行完S602中清理SIM卡应用的组件或回调的流程后,才执行卸载SIM卡应用的流程。In the embodiment of the present application, the second moment may be the moment when the terminal device uninstalls the SIM card application. It is understandable that the terminal device may execute the process of uninstalling the SIM card application only after executing the process of cleaning up the components or callbacks of the SIM card application in S602.

本申请实施例中,SIM卡应用在被卸载前,终端设备可以先清理SIM卡应用的组件或回调,然后再执行卸载流程。这样可以在用户不感知的情况下,完成SIM卡应用内存的清理以及应用的卸载,提升用户体验。In the embodiment of the present application, before the SIM card application is uninstalled, the terminal device can first clean up the components or callbacks of the SIM card application, and then execute the uninstallation process. In this way, the SIM card application memory can be cleaned up and the application can be uninstalled without the user's awareness, thereby improving the user experience.

可选的,在图6对应的实施例的基础上,SIM卡应用在目标进程中运行的组件可以包括服务Service组件;SIM卡应用在目标进程中已注册的组件可以包括接收Receiver组件;SIM卡应用在目标进程中已注册的回调可以包括定时服务回调AlarmManger.OnAlarmListener,和/或,回调callback。Optionally, based on the embodiment corresponding to Figure 6, the component of the SIM card application running in the target process may include a service component; the component registered by the SIM card application in the target process may include a Receiver component; the callback registered by the SIM card application in the target process may include a timer service callback AlarmManger.OnAlarmListener, and/or callback.

本申请实施例中,终端设备在卸载SIM卡应用时无法删除SIM卡应用在目标进程中运行的组件,或注册的组件或回调,因此需要对这些组件或者回调单独处理,这样可以确保目标进程的正常运行。In the embodiment of the present application, when uninstalling the SIM card application, the terminal device cannot delete the components running in the target process, or the registered components or callbacks of the SIM card application, so these components or callbacks need to be processed separately to ensure the normal operation of the target process.

可选的,在图6对应的实施例的基础上,终端设备停止SIM卡应用在目标进程中运行的组件,可以包括:终端设备调用关闭服务Service组件的函数。Optionally, based on the embodiment corresponding to FIG. 6 , the terminal device stops the component of the SIM card application running in the target process, which may include: the terminal device calls a function of closing the service component.

本申请实施例中,终端设备可以判断服务Service是否正在运行,若服务Service正在运行,则终端设备可以调用关闭服务Service组件的函数。该函数可以参照图3对应的实施例中S303的相关描述,具体关闭服务Service组件的方法,本申请实施例不作限定。In the embodiment of the present application, the terminal device can determine whether the service Service is running. If the service Service is running, the terminal device can call a function to close the service Service component. The function can refer to the relevant description of S303 in the embodiment corresponding to Figure 3. The specific method of closing the service Service component is not limited in the embodiment of the present application.

终端设备在卸载SIM卡应用前,通过关闭正在运行的服务Service组件,可以使目标进程正常运行,从而不影响目标进程中的其他业务。Before uninstalling the SIM card application, the terminal device can shut down the running service component to enable the target process to run normally, thereby not affecting other services in the target process.

可选的,在图6对应的实施例的基础上,终端设备去注册SIM卡应用在目标进程中已注册的组件,可以包括:终端设备调用去注册广播接收器Receiver组件的函数。Optionally, based on the embodiment corresponding to FIG. 6 , the terminal device deregistering the component of the SIM card application that has been registered in the target process may include: the terminal device calling a function to deregister the broadcast receiver Receiver component.

本申请实施例中,终端设备可以判断是否有已注册的广播接收器Receiver,若有已注册的广播接收器Receiver,则终端设备可以调用去注册广播接收器Receiver组件的函数。该函数可以参照图3对应的实施例中S303的相关描述,具体去注册广播接收器Receiver组件的方法,本申请实施例不作限定。In the embodiment of the present application, the terminal device can determine whether there is a registered broadcast receiver Receiver. If there is a registered broadcast receiver Receiver, the terminal device can call a function to deregister the broadcast receiver Receiver component. The function can refer to the relevant description of S303 in the embodiment corresponding to Figure 3. The specific method of deregistering the broadcast receiver Receiver component is not limited in the embodiment of the present application.

终端设备在卸载SIM卡应用前,通过去注册广播接收器Receiver组件,可以使目标进程正常运行,从而不影响目标进程中的其他业务。Before uninstalling the SIM card application, the terminal device can register the broadcast receiver Receiver component to enable the target process to run normally without affecting other services in the target process.

可选的,在图6对应的实施例的基础上,终端设备去注册SIM卡应用在目标进程中已注册的回调,可以包括:终端设备调用去注册定时任务回调AlarmManger.OnAlarmListener的函数;和/或,终端设备调用注册回调callback的函数。Optionally, based on the embodiment corresponding to Figure 6, the terminal device deregisters the callback registered by the SIM card application in the target process, which may include: the terminal device calls the function to register the scheduled task callback AlarmManger.OnAlarmListener; and/or the terminal device calls the function to register the callback callback.

本申请实施例中,终端设备可以判断是否有已注册的定时任务回调AlarmManger.OnAlarmListener,若终端设备中有已注册的定时任务回调AlarmManger.OnAlarmListener,则终端设备可以执行去注册定时任务回调AlarmManger.OnAlarmListener的函数。或者,终端设备可以判断是否有已注册的回调callback,若终端设备中有已注册的回调callback,则终端设备可以执行去注册回调callback的函数。In the embodiment of the present application, the terminal device can determine whether there is a registered timed task callback AlarmManger.OnAlarmListener. If there is a registered timed task callback AlarmManger.OnAlarmListener in the terminal device, the terminal device can execute a function to deregister the timed task callback AlarmManger.OnAlarmListener. Alternatively, the terminal device can determine whether there is a registered callback callback. If there is a registered callback callback in the terminal device, the terminal device can execute a function to deregister the callback callback.

其中,去注册定时任务回调AlarmManger.OnAlarmListener的函数或者去注册回调callback的函数可以参照图3对应的实施例中S303的相关描述,具体去注册定时任务回调AlarmManger.OnAlarmListener的方法或者去注册回调callback的函数的方法,本申请实施例不作限定。Among them, the function of deregistering the scheduled task callback AlarmManger.OnAlarmListener or the function of deregistering the callback callback can refer to the relevant description of S303 in the embodiment corresponding to Figure 3. The specific method of deregistering the scheduled task callback AlarmManger.OnAlarmListener or the method of deregistering the callback callback function is not limited in the embodiments of this application.

终端设备在卸载SIM卡应用前,通过去注册定时任务回调AlarmManger.OnAlarmListener或者去注册回调callback,可以使目标进程正常运行,从而不影响目标进程中的其他业务。Before uninstalling the SIM card application, the terminal device can enable the target process to run normally by registering the scheduled task callback AlarmManger.OnAlarmListener or registering the callback callback, so as not to affect other services in the target process.

可选的,在图6对应的实施例的基础上,终端设备接收到卸载SIM卡应用的操作之前,还可以包括:终端设备为SIM卡应用注册卸载广播。Optionally, based on the embodiment corresponding to FIG. 6 , before the terminal device receives the operation of uninstalling the SIM card application, the method may further include: the terminal device registers an uninstall broadcast for the SIM card application.

根据终端设备接收的卸载SIM卡应用的操作,第一时刻,终端设备停止SIM卡应用在目标进程中运行的组件,以及去注册SIM卡应用在目标进程中已注册的组件或回调,可以包括:根据该操作,终端设备发送卸载广播,卸载广播可以包括SIM卡应用的标识;当终端设备通过SIM卡应用确定卸载广播包括SIM卡应用的标识时,在第一时刻,终端设备停止SIM卡应用在目标进程中运行的组件,以及去注册SIM卡应用在目标进程中已注册的组件或回调。According to the operation of uninstalling the SIM card application received by the terminal device, at the first moment, the terminal device stops the components of the SIM card application running in the target process, and de-registers the components or callbacks of the SIM card application registered in the target process, which may include: according to the operation, the terminal device sends an uninstall broadcast, and the uninstall broadcast may include the identifier of the SIM card application; when the terminal device determines through the SIM card application that the uninstall broadcast includes the identifier of the SIM card application, at the first moment, the terminal device stops the components of the SIM card application running in the target process, and de-registers the components or callbacks of the SIM card application registered in the target process.

本申请实施例中,当用户触发卸载应用的操作时,终端设备可以发送卸载广播。可以理解的是,用户触发卸载的应用可以是SIM卡应用,也可以是其他三方应用或者系统应用,本申请实施例不作限定。当用户触发卸载SIM卡应用的操作时,终端设备发送的卸载广播中可以包括SIM卡应用的标识,例如,卸载广播中可以包括SIM卡应用的包名。In an embodiment of the present application, when a user triggers an operation to uninstall an application, the terminal device may send an uninstall broadcast. It is understandable that the application that the user triggers to uninstall may be a SIM card application, or may be another third-party application or a system application, which is not limited in the embodiment of the present application. When a user triggers an operation to uninstall a SIM card application, the uninstall broadcast sent by the terminal device may include an identifier of the SIM card application, for example, the uninstall broadcast may include the package name of the SIM card application.

确定卸载广播包括SIM卡应用的标识的流程可以参照图3对应的实施例中S302的相关描述,不再赘述。在用户触发卸载应用的操作时,终端设备发送卸载广播可以使注册了卸载广播的应用或者模块接收到该卸载广播,从而使相关的应用或者模块可以在接收到卸载广播后,执行卸载应用的操作。The process of determining that the uninstall broadcast includes the identification of the SIM card application can refer to the relevant description of S302 in the embodiment corresponding to Figure 3, which will not be repeated here. When the user triggers the operation of uninstalling the application, the terminal device sends the uninstall broadcast so that the application or module registered for the uninstall broadcast can receive the uninstall broadcast, so that the related application or module can perform the operation of uninstalling the application after receiving the uninstall broadcast.

可选的,在图6对应的实施例的基础上,终端设备为SIM卡应用注册卸载广播,可以包括:终端设备向意图过滤器IntentFilter添加卸载广播所对应的字段Intent.ACTION_PACKAGE_REMOVED,以及添加SIM卡应用的标识。Optionally, based on the embodiment corresponding to FIG. 6 , the terminal device registers an uninstall broadcast for the SIM card application, which may include: the terminal device adds a field Intent.ACTION_PACKAGE_REMOVED corresponding to the uninstall broadcast to the intent filter IntentFilter, and adds an identifier of the SIM card application.

本申请实施例中,注册卸载广播的流程可以参照图3对应的实施例中S301的相关描述,不再赘述。终端设备通过为SIM卡应用注册卸载广播,可以方便接收卸载SIM卡应用的卸载广播,并进一步执行相关的卸载流程。In the embodiment of the present application, the process of registering uninstall broadcast can refer to the relevant description of S301 in the embodiment corresponding to Figure 3, which will not be repeated. By registering uninstall broadcast for SIM card application, the terminal device can conveniently receive the uninstall broadcast of uninstalling SIM card application and further execute the relevant uninstall process.

可选的,在图6对应的实施例的基础上,目标进程可以包括Phone进程。Optionally, based on the embodiment corresponding to FIG. 6 , the target process may include a Phone process.

本申请实施例中,Phone进程是终端设备中的系统进程,Phone进程可以在终端设备开机启动后持续运行,SIM卡应用与Phone进程共进程,可以使SIM相关的业务正常运行,可以很好的为用户提供SIM相关服务。In the embodiment of the present application, the Phone process is a system process in the terminal device. The Phone process can continue to run after the terminal device is turned on. The SIM card application and the Phone process share the same process, which can enable SIM-related services to operate normally and provide users with SIM-related services.

具体的,图7为本申请实施例所提供的另一种SIM卡业务处理的示意图。方法可以包括:Specifically, FIG7 is a schematic diagram of another SIM card service processing provided by an embodiment of the present application. The method may include:

S701、终端设备接收到卸载SIM卡应用的操作。S701: The terminal device receives an operation to uninstall a SIM card application.

本申请实施例中,接收卸载SIM卡应用的操作可以参照上述图6对应的实施例中S601的相关描述,不再赘述。In the embodiment of the present application, the operation of receiving the uninstallation of the SIM card application can refer to the relevant description of S601 in the embodiment corresponding to FIG. 6 above, and will not be repeated here.

S702、在第三时刻,终端设备卸载SIM卡应用。S702: At the third moment, the terminal device uninstalls the SIM card application.

本申请实施例中,第三时刻可以为终端设备卸载SIM卡应用的时刻,可以理解的是,终端设备在接收到卸载SIM卡应用的操作后,可以执行卸载SIM卡应用的流程。使终端设备响应于用户卸载应用的操作后,可以及时完成终端设备内存的清理。In the embodiment of the present application, the third moment may be the moment when the terminal device uninstalls the SIM card application. It is understandable that after receiving the operation of uninstalling the SIM card application, the terminal device may execute the process of uninstalling the SIM card application, so that after the terminal device responds to the user's operation of uninstalling the application, the terminal device memory can be cleaned up in time.

S703、在第四时刻,终端设备重启目标进程,目标进程为SIM卡应用与其他应用共进程的进程,第四时刻晚于第三时刻。S703. At a fourth moment, the terminal device restarts the target process, where the target process is a process shared by the SIM card application and other applications. The fourth moment is later than the third moment.

本申请实施例中,第四时刻可以为终端设备重启目标进程的时刻,也就是说,第四时刻可以为终端设备执行卸载SIM卡应用的流程后,重启与SIM卡应用共进程的进程。重启与SIM卡应用共进程的进程可以使该进程不再加载SIM卡应用的相关数据,从而使该进程中的其他业务可以正常运行。In the embodiment of the present application, the fourth moment may be the moment when the terminal device restarts the target process, that is, the fourth moment may be the moment when the terminal device executes the process of uninstalling the SIM card application and restarts the process that is a common process with the SIM card application. Restarting the process that is a common process with the SIM card application can make the process no longer load the relevant data of the SIM card application, so that other services in the process can run normally.

可选的,在图7对应的实施例的基础上,终端设备卸载SIM卡应用之前,还可以包括:终端设备显示弹窗,弹窗中包括确定按钮、取消按钮以及用于提示卸载SIM卡应用存在的风险的提示信息。Optionally, based on the embodiment corresponding to FIG. 7 , before the terminal device uninstalls the SIM card application, the process may further include: the terminal device displays a pop-up window including a confirmation button, a cancel button, and prompt information for prompting the risks of uninstalling the SIM card application.

终端设备卸载SIM卡应用可以包括:响应于对确定按钮的操作,终端设备卸载SIM卡应用。The terminal device uninstalling the SIM card application may include: in response to an operation on a confirmation button, the terminal device uninstalling the SIM card application.

本申请实施例中,终端设备显示弹窗可以参照图4所示的界面弹窗,不再赘述。当用户触发确定按钮后,说明用户选择卸载SIM卡应用,则终端设备可以执行卸载SIM卡应用的流程。在卸载过程中,终端设备通过给用户弹窗提示卸载SIM卡应用存在的风险,可以让用户及时了解未知的风险,提升用户体验。In the embodiment of the present application, the pop-up window displayed by the terminal device can refer to the pop-up window shown in FIG. 4, which will not be described in detail. When the user triggers the OK button, it means that the user chooses to uninstall the SIM card application, and the terminal device can execute the process of uninstalling the SIM card application. During the uninstallation process, the terminal device prompts the user with a pop-up window to remind the user of the risks of uninstalling the SIM card application, so that the user can understand the unknown risks in time and improve the user experience.

可选的,在图7对应的实施例的基础上,终端设备显示弹窗之前,还可以包括:终端设备通过SIM卡应用的配置文件判断SIM卡应用为共进程应用。Optionally, based on the embodiment corresponding to FIG. 7 , before the terminal device displays the pop-up window, the method may further include: the terminal device determines that the SIM card application is a co-process application through a configuration file of the SIM card application.

本申请实施例中,终端设备通过SIM卡应用的配置文件判断SIM卡应用为共进程应用可以参照上述图5对应的实施例中S502的相关描述,不再赘述。具体的,终端设备判断应用是否为共进程应用的方法,本申请实施例不作限定。In the embodiment of the present application, the terminal device can determine whether the SIM card application is a co-process application through the configuration file of the SIM card application by referring to the relevant description of S502 in the embodiment corresponding to FIG. 5 above, and will not be repeated here. Specifically, the method for the terminal device to determine whether the application is a co-process application is not limited in the embodiment of the present application.

终端设备在确定卸载应用所对应的进程与其他进程共进程时,可以通过重启进程使该进程中不再加载卸载应用的相关数据,从而使该进程中的其他业务可以正常运行。When the terminal device determines that the process corresponding to the uninstalled application is shared with other processes, it can restart the process so that the process no longer loads the relevant data of the uninstalled application, so that other services in the process can run normally.

可选的,在图7对应的实施例的基础上,目标进程包括Phone进程。Optionally, based on the embodiment corresponding to FIG. 7 , the target process includes a Phone process.

本申请实施例中,Phone进程是终端设备中的系统进程,Phone进程可以在终端设备开机启动后持续运行,SIM卡应用与Phone进程共进程,可以使SIM相关的业务正常运行,可以很好的为用户提供SIM相关服务。In the embodiment of the present application, the Phone process is a system process in the terminal device. The Phone process can continue to run after the terminal device is turned on. The SIM card application and the Phone process share the same process, which can enable SIM-related services to operate normally and provide users with SIM-related services.

上述主要从方法的角度对本申请实施例提供的方案进行了介绍。为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的方法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and/or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the method steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

本申请实施例可以根据上述方法示例对实现卸载应用的方法的装置进行功能模块的划分,例如可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application can divide the functional modules of the device for implementing the method of uninstalling the application according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

如图8示为本申请实施例提供的一种芯片的结构示意图。芯片800包括一个或两个以上(包括两个)处理器801、通信线路802、通信接口803和存储器804。FIG8 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. The chip 800 includes one or more (including two) processors 801 , a communication line 802 , a communication interface 803 and a memory 804 .

在一些实施方式中,存储器804存储了如下的元素:可执行模块或者数据结构,或者他们的子集,或者他们的扩展集。In some implementations, the memory 804 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.

上述本申请实施例描述的方法可以应用于处理器801中,或者由处理器801实现。处理器801可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器801中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器801可以是通用处理器(例如,微处理器或常规处理器)、数字信号处理器(digitalsignal processing,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门、晶体管逻辑器件或分立硬件组件,处理器801可以实现或者执行本申请实施例中的公开的各处理相关的方法、步骤及逻辑框图。The method described in the above embodiment of the present application can be applied to the processor 801, or implemented by the processor 801. The processor 801 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware or software instructions in the processor 801. The above processor 801 can be a general processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 801 can implement or execute the methods, steps and logic block diagrams related to each processing disclosed in the embodiment of the present application.

结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。其中,软件模块可以位于随机存储器、只读存储器、可编程只读存储器或带电可擦写可编程存储器(electricallyerasable programmable read only memory,EEPROM)等本领域成熟的存储介质中。该存储介质位于存储器804,处理器801读取存储器804中的信息,结合其硬件完成上述方法的步骤。The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 804, and the processor 801 reads the information in the memory 804 and completes the steps of the above method in combination with its hardware.

处理器801、存储器804以及通信接口803之间可以通过通信线路802进行通信。The processor 801 , the memory 804 , and the communication interface 803 may communicate with each other via the communication line 802 .

在上述实施例中,存储器存储的供处理器执行的指令可以以计算机程序产品的形式实现。其中,计算机程序产品可以是事先写入在存储器中,也可以是以软件形式下载并安装在存储器中。In the above embodiments, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory, or may be downloaded and installed in the memory in the form of software.

本申请实施例还提供一种计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包括一个或多个可用介质集成的服务器、数据中心等数据存储设备。例如,可用介质可以包括磁性介质(例如,软盘、硬盘或磁带)、光介质(例如,数字通用光盘(digital versatile disc,DVD))、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。The present application embodiment also provides a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium may include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

本申请实施例还提供一种计算机可读存储介质。上述实施例中描述的方法可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。计算机可读介质可以包括计算机存储介质和通信介质,还可以包括任何可以将计算机程序从一个地方传送到另一个地方的介质。存储介质可以是可由计算机访问的任何目标介质。The embodiments of the present application also provide a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.

作为一种可能的设计,计算机可读介质可以包括紧凑型光盘只读储存器(compactdisc read-only memory,CD-ROM)、RAM、ROM、EEPROM或其它光盘存储器;计算机可读介质可以包括磁盘存储器或其它磁盘存储设备。而且,任何连接线也可以被适当地称为计算机可读介质。例如,如果使用同轴电缆,光纤电缆,双绞线,DSL或无线技术(如红外,无线电和微波)从网站,服务器或其它远程源传输软件,则同轴电缆,光纤电缆,双绞线,DSL或诸如红外,无线电和微波之类的无线技术包括在介质的定义中。如本文所使用的磁盘和光盘包括光盘(CD),激光盘,光盘,数字通用光盘(digital versatile disc,DVD),软盘和蓝光盘,其中磁盘通常以磁性方式再现数据,而光盘利用激光光学地再现数据。As a possible design, the computer readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while optical discs reproduce data optically using lasers.

本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理单元以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理单元执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application embodiment is described with reference to the flowchart and/or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and/or box in the flowchart and/or block diagram, and the combination of the process and/or box in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.

Claims (14)

1. A method of offloading an application, the method comprising:
the terminal equipment receives an operation of uninstalling the SIM card application;
According to the operation, at a first moment, stopping a component operated by the SIM card application in a target process by the terminal equipment, and registering a registered component or a registered callback of the SIM card application in the target process, wherein the target process is a process of the SIM card application and other applications in a co-process manner;
And unloading the SIM card application by the terminal equipment at a second moment, wherein the second moment is later than the first moment.
2. The method of claim 1, wherein the components of the SIM card application running in the target process comprise a Service component; the registered components of the SIM card application in the target process comprise a Receiver component; the registered callbacks of the SIM card application in the target process comprise a timing service callback AlarmManger.OnAlarmListener and/or a callback.
3. The method according to claim 2, wherein the terminal device stops components of the SIM card application running in the target process, comprising:
The terminal device invokes a function that closes the Service component.
4. A method according to claim 2 or 3, wherein the terminal device de-registering components of the SIM card application registered in the target process, comprising:
the terminal device invokes a function to register a Receiver component of the broadcast Receiver.
5. A method according to claim 2 or 3, wherein the terminal device de-registering a callback registered by the SIM card application in the target process, comprising:
The terminal equipment calls a function of a deregistering timing task callback AlarmManger. OnAlarmListener;
And/or the terminal equipment calls a function for registering callback.
6. A method according to any of claims 1-3, characterized in that the terminal device, before receiving the operation of uninstalling the SIM card application, further comprises: the terminal equipment registers and uninstalls broadcasting for the SIM card application;
According to the operation, at a first moment, the terminal device stops a component of the SIM card application running in a target process, and registers a registered component or callback of the SIM card application in the target process, including:
According to the operation, the terminal equipment sends an unloading broadcast, wherein the unloading broadcast comprises an identifier of the SIM card application;
When the terminal device determines that the uninstallation broadcast comprises the identification of the SIM card application through the SIM card application, the terminal device stops a component of the SIM card application running in the target process and registers a registered component or callback of the SIM card application in the target process at the first moment.
7. The method of claim 6, wherein the terminal device registering for offloading broadcasts for the SIM card application, comprising:
the terminal device adds a field Intent. Action_ PACKAGE _REMOVED corresponding to the uninstalled broadcast to the intention filter INTENTFILTER, and adds an identifier of the SIM card application.
8. A method according to any of claims 1-3, wherein the target process comprises a Phone process.
9. A method according to any one of claims 1-3, wherein the method further comprises:
And restarting the target process by the terminal equipment at a fourth time, wherein the fourth time is later than the second time.
10. The method of claim 9, wherein before the terminal device uninstalls the SIM card application, further comprising:
the terminal equipment displays a popup window, wherein the popup window comprises a determination button, a cancel button and prompt information for prompting the risk existing in the process of unloading the SIM card application;
The terminal device uninstalling the SIM card application comprises: and responding to the operation of the determination button, and unloading the SIM card application by the terminal equipment.
11. The method of claim 10, wherein before the terminal device displays the popup window, further comprising:
and the terminal equipment judges that the SIM card application is a co-process application through the configuration file of the SIM card application.
12. A terminal device, comprising: memory for storing a computer program, and a processor for executing the computer program to perform the method of uninstalling an application as claimed in any of claims 1-11.
13. A computer readable storage medium storing instructions that, when executed, cause a computer to perform the method of offloading an application of any one of claims 1-11.
14. A computer program product comprising a computer program which, when run, causes an electronic device to perform the method of uninstalling an application as claimed in any one of claims 1-11.
CN202211215431.0A 2022-09-30 2022-09-30 Method and related device for unloading application Active CN116737258B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211215431.0A CN116737258B (en) 2022-09-30 2022-09-30 Method and related device for unloading application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211215431.0A CN116737258B (en) 2022-09-30 2022-09-30 Method and related device for unloading application

Publications (2)

Publication Number Publication Date
CN116737258A CN116737258A (en) 2023-09-12
CN116737258B true CN116737258B (en) 2024-07-09

Family

ID=87917425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211215431.0A Active CN116737258B (en) 2022-09-30 2022-09-30 Method and related device for unloading application

Country Status (1)

Country Link
CN (1) CN116737258B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104376257A (en) * 2014-12-12 2015-02-25 北京奇虎科技有限公司 Application self-protection and active defense method and application self-protection and active defense device
CN105955789A (en) * 2016-05-18 2016-09-21 广东欧珀移动通信有限公司 Application uninstallation method, device and equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631617A (en) * 2013-11-01 2014-03-12 北京奇虎科技有限公司 Method and device for unloading system application on terminal equipment
CN105302589B (en) * 2014-07-10 2019-12-03 腾讯科技(深圳)有限公司 A kind of method and device obtaining unloading information
CN106775887A (en) * 2016-12-27 2017-05-31 努比亚技术有限公司 The discharging method and device of a kind of application program
CN114546511A (en) * 2020-11-11 2022-05-27 华为技术有限公司 Plug-in management method, system and device
CN113918060B (en) * 2021-09-06 2023-10-24 荣耀终端有限公司 Application management method and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104376257A (en) * 2014-12-12 2015-02-25 北京奇虎科技有限公司 Application self-protection and active defense method and application self-protection and active defense device
CN105955789A (en) * 2016-05-18 2016-09-21 广东欧珀移动通信有限公司 Application uninstallation method, device and equipment

Also Published As

Publication number Publication date
CN116737258A (en) 2023-09-12

Similar Documents

Publication Publication Date Title
US11803451B2 (en) Application exception recovery
CN114461239B (en) Software upgrading system and software upgrading method
CN112988213B (en) Program data updating method, electronic equipment and computer storage medium
CN114461240A (en) Software upgrading method, software upgrading system and electronic equipment
CN117707626A (en) System starting method and electronic equipment
WO2025060715A1 (en) Method for managing system services, and related apparatus
WO2022143126A1 (en) Method, apparatus, and device for analyzing safety of application, and storage medium
WO2024131486A1 (en) Performance analysis method, readable storage medium, program product and electronic device
CN116737258B (en) Method and related device for unloading application
CN116700768B (en) An applied processing method and related device
CN117149476B (en) Fault reporting method and related device
CN117156088B (en) Image processing method and related device
CN117130824B (en) A method for handling abnormality, electronic equipment and storage medium
CN116737104B (en) Volume adjustment method and related device
CN117707439A (en) Log printing method and related device
CN118363598A (en) Compiling method and device of application program
CN117714271B (en) Message processing method and related device
CN116719556B (en) System upgrading method and electronic device
CN116088970B (en) Method for controlling application call and related device
CN116737037B (en) Stack management method in interface display and related device
CN114625428B (en) Application exception processing method and electronic equipment
CN117858279A (en) SIM card service processing method and related device
CN116708615B (en) Device registration method, device registration apparatus and storage medium
CN117707453B (en) Method, equipment and storage medium for reading node information
CN116701320B (en) A log generation method and related device

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China