CN113792327B - Authority management method, user interface and electronic equipment - Google Patents
Authority management method, user interface and electronic equipment Download PDFInfo
- Publication number
- CN113792327B CN113792327B CN202110926389.2A CN202110926389A CN113792327B CN 113792327 B CN113792327 B CN 113792327B CN 202110926389 A CN202110926389 A CN 202110926389A CN 113792327 B CN113792327 B CN 113792327B
- Authority
- CN
- China
- Prior art keywords
- application
- permission
- electronic device
- user interface
- displayed
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/629—Protecting access to data via a platform, e.g. using keys or access control rules to features or functions of an application
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/604—Tools and structures for managing or administering access control systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2141—Access rights, e.g. capability lists, access control lists, access tables, access matrices
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bioethics (AREA)
- Automation & Control Theory (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本申请公开了一种权限管理方法、用户界面及电子设备,该方法能够根据不同应用对单次授权的适配程度,将应用分为白名单应用和黑名单应用,白名单应用对单次授权的适配程度较好,因此在对该类应用进行权限的配置时,存在单次授权的选项,这样用户可以根据自己的需求选择是否对应用进行单次授权,黑名单应用对单次授权的适配程度较差,因此在对该类应用进行权限的配置时,不存在单次授权的选项,避免了用户对应用进行单次授权后,出现运行异常的问题。
The present application discloses a rights management method, a user interface and an electronic device. The method can divide applications into whitelist applications and blacklist applications according to the degree of adaptation of different applications to a single authorization. The degree of adaptation is good, so when configuring permissions for this type of application, there is an option for single authorization, so that users can choose whether to authorize the application once according to their own needs. The degree of adaptation is poor, so when configuring permissions for this type of application, there is no single authorization option, which avoids the problem of abnormal operation after the user authorizes the application for a single time.
Description
技术领域technical field
本申请涉及终端及通信技术领域,尤其涉及权限管理方法、用户界面及电子设备。The present application relates to the technical field of terminals and communications, and in particular, to a rights management method, a user interface, and an electronic device.
背景技术Background technique
随着互联网的发展,电子设备上可安装的应用越来越多。应用在运行过程中,需要调用电子设备的硬件和软件资源,来支撑自身的运行。而电子设备的硬件和软件资源涉及到用户的隐私信息,因此,在首次打开应用或者应用的运行过程中,电子设备会显示权限窗口提示用户授予权限,并在得到用户的同意后,允许应用调用电子设备中,相应的硬件或软件资源。With the development of the Internet, more and more applications can be installed on electronic devices. During the running process of the application, it needs to call the hardware and software resources of the electronic device to support its own operation. The hardware and software resources of the electronic device involve the user's private information. Therefore, when the application is opened for the first time or the application is running, the electronic device will display a permission window to prompt the user to grant permission, and after obtaining the user's consent, allow the application to call In electronic equipment, the corresponding hardware or software resources.
其中,根据不同的授权时长,权限窗口中还提供了多种授权方式:始终允许、使用期间允许、本次运行允许、禁止等等,其中,本次运行允许是指允许应用仅在应用单次运行期间使用权限。但是由于不同应用对本次运行允许的授权方式的适配程度不同,当对应用配置本次运行允许的授权方式时,可能会出现应用再次回到前台运行时,无法访问权限,或者用户数据丢失的问题。Among them, according to different authorization durations, the permission window also provides a variety of authorization methods: always allow, allow during use, allow this run, prohibit, etc., among which, this run permission means that the application is allowed to be used only once in the application Use permissions during runtime. However, due to the different degrees of adaptation of different applications to the authorization methods allowed for this operation, when the application is configured with the authorization methods allowed for this operation, it may happen that when the application returns to the foreground to run again, access rights cannot be accessed, or user data is lost. The problem.
那么,如何管理不同应用对权限的访问,避免出现应用无法访问权限以及用户数据丢失的问题,是目前亟待解决的问题。Therefore, how to manage the access of different applications to permissions, and avoid the problems that applications cannot access permissions and user data are lost, is an urgent problem to be solved at present.
发明内容SUMMARY OF THE INVENTION
本申请一些实施例提供了权限管理方法、用户界面及电子设备。Some embodiments of the present application provide rights management methods, user interfaces, and electronic devices.
本申请一些实施例提供的方法能够针对不同的应用以及不同的权限,提供不同的授权方式,避免由于应用对单次授权不适配而出现运行异常的问题。The methods provided by some embodiments of the present application can provide different authorization modes for different applications and different permissions, so as to avoid the problem of abnormal operation due to the application not adapting to a single authorization.
第一方面,本申请实施例提供了一种权限管理方法,包括:In a first aspect, an embodiment of the present application provides a rights management method, including:
该电子设备显示第一应用的第一窗口,该第一窗口显示有第一权限的权限项;The electronic device displays a first window of a first application, and the first window displays a permission item with a first permission;
如果该第一应用为白名单应用,则该第一应用被允许在该第一应用的单次运行期间使用该第一权限,该第一权限的授权方式中包含第一授权方式,该第一授权方式为允许在该第一应用的单次运行期间使用该第一权限;否则,该第一权限的授权方式中不包含该第一授权方式;该白名单应用的用户界面在被关闭显示后,经过一段时间再次被显示时,存在以下一项异常:该白名单应用的用户数据丢失、该白名单应用的第一功能调用该第一权限失败,或者,不存在该异常。If the first application is a whitelisted application, the first application is allowed to use the first permission during a single running of the first application, and the authorization mode of the first permission includes a first authorization mode, and the first The authorization method is to allow the first authorization to be used during a single operation of the first application; otherwise, the authorization method of the first authorization does not include the first authorization method; after the user interface of the whitelist application is closed and displayed , when it is displayed again after a period of time, there is one of the following exceptions: the user data of the whitelist application is lost, the first function of the whitelist application fails to invoke the first permission, or the exception does not exist.
实施第一方面提供的方法,能够预先根据应用使用单次运行期间有效的权限的情况,分析该应用是否为白名单应用。白名单应用是指对单次授权的是否程度较好,运行过程中仅存在用户数据丢失或功能调用该权限失败的异常,或不存在上述异常的应用。应用为白名单应用,则说明该应用对单次授权的适配程度较好,则电子设备在该应用的授权窗口中可以提供该权限的单次授权的选项,这样用户可以根据自己的需求选择是否对应用进行单次授权。否则,应用为黑名单应用,即该应用对单次授权的适配程度较差,则电子设备在该应用的授权窗口中可以不提供该权限的单次授权的选项,避免了用户对应用进行单次授权后,出现运行异常的问题。By implementing the method provided by the first aspect, it is possible to analyze in advance whether the application is a whitelisted application according to the situation in which the application uses the permission valid during a single operation. A whitelisted application refers to whether the degree of authorization for a single time is good, and there are only exceptions in which user data is lost or the function fails to invoke the permission during operation, or there are no such exceptions. If the application is a whitelisted application, it means that the application is well adapted to a single authorization, and the electronic device can provide a single authorization option for the authorization in the authorization window of the application, so that the user can choose according to their own needs. Whether to authorize the application once. Otherwise, the application is a blacklisted application, that is, the degree of adaptation of the application to a single authorization is poor, and the electronic device may not provide the single authorization option of the authorization in the authorization window of the application, which prevents the user from performing a single authorization on the application. After a single authorization, the problem of abnormal operation occurs.
结合第一方面,在一种可能的实现方式中,该方法还包括:如果该第一应用的用户界面在被关闭显示后,经过一段时间再次被显示时,出现用户数据丢失,则该第一应用的用户界面在被关闭显示后的一段时间里,该电子设备仍然运行该第一应用,该一段时间的时长超过预设时长,在超过该预设时长后,该电子设备回收该第一应用的该第一权限。With reference to the first aspect, in a possible implementation manner, the method further includes: if user data is lost when the user interface of the first application is displayed after being closed for a period of time, then the first application is displayed again after a period of time. For a period of time after the user interface of the application is closed and displayed, the electronic device still runs the first application, and the duration of the period of time exceeds a preset period of time. After the preset period of time is exceeded, the electronic device recycles the first application. of this first authority.
当应用在运行过程中,存在用户数据丢失的情况时,可能是由于应用在后台运行超过一定时间后结束运行导致的,则电子设备可以在应用后台运行时,不结束运行该应用,仅回收对应用授予的单次运行期间有效的权限,避免出现用户数据丢失的情况,改善应用的运行情况,提升用户的体验感。When the application is running and user data is lost, it may be caused by the application running in the background for more than a certain period of time and ending the operation, then the electronic device can run the application in the background without ending the running of the application, only recycling the The permission granted by the application is valid during a single operation, to avoid the loss of user data, to improve the operation of the application, and to enhance the user's experience.
结合第一方面,在一种可能的实现方式中,该方法还包括:该第一应用的用户界面在被关闭显示后,经过该一段时间再次被显示时,该第一应用的用户界面没有呈现出用户数据丢失的异常。With reference to the first aspect, in a possible implementation manner, the method further includes: after the user interface of the first application is closed and displayed, when the user interface of the first application is displayed again after a period of time, the user interface of the first application is not displayed A user data loss exception occurs.
结合第一方面,在一种可能的实现方式中,该方法还包括:该第一应用的用户界面在被关闭显示后,经过该一段时间再次被显示时,该电子设备不显示该第一应用的启动界面。With reference to the first aspect, in a possible implementation manner, the method further includes: after the user interface of the first application is closed and displayed, when the user interface of the first application is displayed again after a period of time, the electronic device does not display the first application startup interface.
由于应用进入后台运行后,一直处于运行过程中,当应用再次回到前台运行时,应用无需重启,因此不会显示应用的启动界面。Since the application has been running after entering the background, when the application returns to the foreground to run again, the application does not need to be restarted, so the application startup interface will not be displayed.
结合第一方面,在一种可能的实现方式中,该启动界面包含等待该第一应用启动时,该第一应用提供的以下一项或多项页面:启动页面、广告页面。With reference to the first aspect, in a possible implementation manner, the startup interface includes one or more of the following pages provided by the first application while waiting for the first application to be started: a startup page and an advertisement page.
结合第一方面,在一种可能的实现方式中,该第一应用的用户界面为视频播放界面,该用户数据为视频播放进度。With reference to the first aspect, in a possible implementation manner, the user interface of the first application is a video playback interface, and the user data is the video playback progress.
也就是说,应用存在数据丢失的情况时,该应用可能是视频播放类应用,应用在切换到后台,并经过一段时间再次回到前台运行时,有可能会存在播放进度清零,视频重新回到起点开始播放的情况。这样的视频播放类应用即适用于在切换到后台运行后一直保持运行,从而避免了用户数据丢失的问题。That is to say, when there is data loss in the application, the application may be a video playback application. When the application switches to the background and returns to the foreground after a period of time, the playback progress may be cleared and the video will be restored. When playback starts at the beginning. Such a video playback application is suitable for keeping running after switching to the background, thereby avoiding the problem of user data loss.
结合第一方面,在一种可能的实现方式中,该方法还包括:如果该第一应用的用户界面在被关闭显示后,经过一段时间再次被显示时,出现该第一功能调用该第一权限异常,则在该第一应用的用户界面被关闭显示超过预设时长的情况下,该电子设备结束运行该第一应用,该电子设备回收该第一应用的该第一权限。With reference to the first aspect, in a possible implementation manner, the method further includes: if the user interface of the first application is displayed again after a period of time after being closed and displayed, the first function calls the first If the permission is abnormal, when the user interface of the first application is closed and displayed for more than a preset time period, the electronic device ends running the first application, and the electronic device reclaims the first permission of the first application.
当应用在运行过程中,存在功能调用权限失败的情况时,可能是由于应用切换到后台运行后一直在后台运行,而应用获取的单次运行期间有效的权限,在后台运行超过预设时长后被电子设备回收,造成应用启动功能时,无法获取该功能所需的权限,造成功能运行失败,则电子设备可以在应用后台运行时,超过预设时长后结束运行该应用,并回收对应用授予的单次运行期间有效的权限,避免出现功能调用权限失败的情况,改善应用的运行情况,提升用户的体验感。When the application is running and the function call permission fails, it may be because the application has been running in the background after switching to the background, and the permission obtained by the application is valid during a single operation. If it is recycled by an electronic device, the permission required for the function cannot be obtained when the application starts the function, and the function fails to run, then the electronic device can run the application in the background and end running the application after the preset time period has expired, and the application will be recycled and granted The effective permissions during a single operation can avoid the failure of function call permissions, improve the operation of the application, and enhance the user experience.
结合第一方面,在一种可能的实现方式中,该方法还包括:该第一应用的用户界面在被关闭显示后,经过一段时间再次被显示时,该第一功能成功调用该第一权限。With reference to the first aspect, in a possible implementation manner, the method further includes: after the user interface of the first application is displayed after being closed and displayed again after a period of time, the first function successfully invokes the first permission .
结合第一方面,在一种可能的实现方式中,该方法还包括:该第一应用的用户界面在被关闭显示后,经过一段时间再次被显示时,该电子设备显示该第一应用的该启动界面。With reference to the first aspect, in a possible implementation manner, the method further includes: after the user interface of the first application is turned off and displayed, when the user interface of the first application is displayed again after a period of time, the electronic device displays the user interface of the first application. Start interface.
由于应用在进入后台运行后超过预设时长时,电子设备会结束应用的运行,那么当应用再次回到前台运行时,电子设备需要重新拉起该应用的进程,则电子设备启动应用时会显示应用的启动界面。Since the electronic device will end the running of the application when the application runs in the background for more than the preset time period, when the application returns to the foreground to run again, the electronic device needs to restart the process of the application, and the electronic device will display the display when the application is started. The application's launch interface.
结合第一方面,在一种可能的实现方式中,该第一功能为语音聊天功能,该第一权限为麦克风。With reference to the first aspect, in a possible implementation manner, the first function is a voice chat function, and the first authority is a microphone.
也就是说,应用存在数据丢失的情况时,该功能可能为语音聊天功能,应用在切换到后台运行前可以正常使用语音聊天功能,当应用进入后台运行超过预设时长,电子设备回收应用的麦克风权限,当应用再次回到前台时,可能会存在语音聊天功能无法获取用户的语音信息。这样的应用即适用于在切换到后台后,超过预设时长时结束运行,从而避免了应用的功能调用权限失败的问题。That is to say, when there is data loss in the application, the function may be a voice chat function. The application can use the voice chat function normally before switching to the background operation. When the application enters the background and runs for more than a preset time, the electronic device will recycle the application's microphone. permission, when the app returns to the foreground again, there may be a possibility that the voice chat function cannot obtain the user's voice information. Such an application is suitable for ending the operation after switching to the background and exceeding the preset time period, thereby avoiding the problem of the failure of the application's function invocation permission.
结合第一方面,在一种可能的实现方式中,该方法还包括:该第一应用的用户界面在被关闭显示后,经过一段时间再次被显示之后,该电子设备响应于启动第一功能的操作,显示第二窗口,提示用户授予该第一应用使用该第一权限。With reference to the first aspect, in a possible implementation manner, the method further includes: after the user interface of the first application is closed and displayed and displayed again after a period of time, the electronic device responds to the activation of the first function in response to operation, a second window is displayed, prompting the user to grant the first application to use the first permission.
也就是说,在应用再次回到前台运行时,电子设备可以在应用的功能需要权限时,主动显示权限窗口,提示用户对应用授予权限,从而保证应用的正常运行。That is, when the application returns to the foreground to run again, the electronic device can actively display the permission window when the function of the application requires permission, and prompt the user to grant permission to the application, thereby ensuring the normal operation of the application.
结合第一方面,在一种可能的实现方式中,该方法还包括:对于一些敏感权限(如位置、拍摄、或录音等权限)可以推荐只单次授权,如推荐默认选中只一次允许这个选项。In combination with the first aspect, in a possible implementation manner, the method further includes: for some sensitive permissions (such as location, shooting, or recording permissions), it is recommended to authorize only once, for example, it is recommended to select the option to allow only once by default. .
第二方面,本申请实施例提供了另一种授权管理方法,该方法包括:电子设备允许该第一应用在该第一应用的单次运行期间使用第一权限;该电子设备关闭显示该第一应用的用户界面,经过一段时间再次显示该第一应用的用户界面;该电子设备响应于启动第一功能的操作,显示第二窗口,提示用户授予该第一应用使用该第一权限。In a second aspect, an embodiment of the present application provides another authorization management method. The method includes: the electronic device allows the first application to use the first authorization during a single execution of the first application; the electronic device closes the display of the first authorization The user interface of an application displays the user interface of the first application again after a period of time; the electronic device displays a second window in response to the operation of starting the first function, prompting the user to grant the first application the first permission.
实施第二方面提供的方法,当电子设备对应用授予单次运行期间有效的权限时,如果应用在切换到后台运行后,超过预设时长,电子设备会主动回收应用的该权限,这时,当应用再次回到前台运行时,电子设备可以在应用的功能需要权限时,主动显示权限窗口,提示用户对应用授予权限,从而保证应用的正常运行。Implementing the method provided in the second aspect, when the electronic device grants the application a permission valid for a single running period, if the application is switched to the background to run for more than a preset period of time, the electronic device will actively reclaim the permission of the application. At this time, When the application returns to the foreground to run again, the electronic device can actively display the permission window when the function of the application requires permission, prompting the user to grant permission to the application, so as to ensure the normal operation of the application.
结合第二方面,在一种可能的实现方式中,电子设备允许该第一应用在该第一应用的单次运行期间使用第一权限之前,该方法还包括:该电子设备显示该第一应用的第一窗口,该第一窗口显示有该第一权限的权限项,该第一权限的授权方式中包含第一授权方式,该第一授权方式为允许在该第一应用的单次运行期间使用该第一权限。With reference to the second aspect, in a possible implementation manner, before the electronic device allows the first application to use the first permission during a single running of the first application, the method further includes: the electronic device displays the first application The first window, the first window displays the permission item of the first permission, the authorization mode of the first permission includes the first authorization mode, and the first authorization mode is to allow the first application during a single running period Use this first permission.
也就是说,电子设备可以在接收到用户选择单次授权的选项时,对应用授予单次运行期间有效的权限,即允许应用在应用的单次运行期间使用该权限。That is to say, the electronic device may grant a permission valid during a single run to the application when receiving the option that the user selects a single authorization, that is, allow the application to use the permission during a single run of the application.
结合第二方面,在一种可能的实现方式中,该第一应用为白名单应用,该白名单应用的用户界面在被关闭显示后,经过一段时间,再次被显示时,存在以下一项异常:该白名单应用的用户数据丢失、该白名单的第一功能调用该第一权限失败,或者,不存在该异常。In combination with the second aspect, in a possible implementation manner, the first application is a whitelisted application, and after the user interface of the whitelisted application is closed and displayed, when it is displayed again after a period of time, there is one of the following exceptions : The user data of the whitelist application is lost, the first function of the whitelist fails to invoke the first permission, or the exception does not exist.
也就是说,电子设备允许应用在应用的单次运行期间使用权限,则说明该应用对单次授权的适配程度较好,即应用在运行过程中仅存在用户数据丢失或功能调用该权限失败的异常,或不存在上述异常。That is to say, if the electronic device allows the application to use the permission during a single operation of the application, it means that the application is well adapted to the single authorization, that is, only the user data is lost or the function fails to invoke the permission during the operation of the application. , or the above exception does not exist.
结合第二方面,在一种可能的实现方式中,如果该第一应用的用户界面在被关闭显示后,经过一段时间再次被显示时,出现用户数据丢失,则该第一应用的用户界面在被关闭显示后的一段时间里,该电子设备仍然运行该第一应用,该一段时间的时长超过预设时长,在超过该预设时长后,该电子设备回收该第一应用的该第一权限。In combination with the second aspect, in a possible implementation manner, if user data is lost when the user interface of the first application is displayed after being turned off and displayed again after a period of time, the user interface of the first application is displayed in For a period of time after the display is turned off, the electronic device still runs the first application, and the duration of the period of time exceeds the preset time period. After the preset time period is exceeded, the electronic device reclaims the first permission of the first application. .
当应用在运行过程中,存在用户数据丢失的情况时,可能是由于应用在后台运行超过一定时间后结束运行导致的,则电子设备可以在应用后台运行时,不结束运行该应用,仅回收对应用授予的单次运行期间有效的权限,避免出现用户数据丢失的情况,改善应用的运行情况,提升用户的体验感。When the application is running and user data is lost, it may be caused by the application running in the background for more than a certain period of time and ending the operation, then the electronic device can run the application in the background without ending the running of the application, only recycling the The permission granted by the application is valid during a single operation, to avoid the loss of user data, to improve the operation of the application, and to enhance the user's experience.
结合第二方面,在一种可能的实现方式中,该方法还包括:该第一应用的用户界面在被关闭显示后,经过该一段时间再次被显示时,该第一应用的用户界面没有呈现出用户数据丢失的异常。With reference to the second aspect, in a possible implementation manner, the method further includes: after the user interface of the first application is closed and displayed, when the user interface of the first application is displayed again after a period of time, the user interface of the first application is not displayed A user data loss exception occurs.
结合第二方面,在一种可能的实现方式中,该方法还包括:该第一应用的用户界面在被关闭显示后,经过该一段时间再次被显示时,该电子设备不显示该第一应用的启动界面。With reference to the second aspect, in a possible implementation manner, the method further includes: after the user interface of the first application is closed and displayed, when the user interface of the first application is displayed again after a period of time, the electronic device does not display the first application startup interface.
由于应用进入后台运行后,一直处于运行过程中,当应用再次回到前台运行时,应用无需重启,因此不会显示应用的启动界面。Since the application has been running after entering the background, when the application returns to the foreground to run again, the application does not need to be restarted, so the application startup interface will not be displayed.
结合第二方面,在一种可能的实现方式中,该启动界面包含等待该第一应用启动时,该第一应用提供的以下一项或多项页面:启动页面、广告页面。With reference to the second aspect, in a possible implementation manner, the startup interface includes one or more of the following pages provided by the first application while waiting for the first application to be started: a startup page and an advertisement page.
结合第二方面,在一种可能的实现方式中,该第一应用的用户界面为视频播放界面,该用户数据为视频播放进度。With reference to the second aspect, in a possible implementation manner, the user interface of the first application is a video playback interface, and the user data is the video playback progress.
也就是说,应用存在数据丢失的情况时,该应用可能是视频播放类应用,应用在切换到后台,并经过一段时间再次回到前台运行时,有可能会存在播放进度清零,视频重新回到起点开始播放的情况。这样的视频播放类应用即适用于在切换到后台运行后一直保持运行,从而避免了用户数据丢失的问题。That is to say, when there is data loss in the application, the application may be a video playback application. When the application switches to the background and returns to the foreground after a period of time, the playback progress may be cleared and the video will be restored. When playback starts at the beginning. Such a video playback application is suitable for keeping running after switching to the background, thereby avoiding the problem of user data loss.
结合第二方面,在一种可能的实现方式中,该方法还包括:如果该第一应用的用户界面在被关闭显示后,经过一段时间再次被显示时,出现该第一功能调用该第一权限异常,则在该第一应用的用户界面被关闭显示超过预设时长的情况下,该电子设备结束运行该第一应用,该电子设备回收该第一应用的该第一权限。With reference to the second aspect, in a possible implementation manner, the method further includes: if the user interface of the first application is displayed again after a period of time after being closed and displayed, the first function calls the first If the permission is abnormal, when the user interface of the first application is closed and displayed for more than a preset time period, the electronic device ends running the first application, and the electronic device reclaims the first permission of the first application.
当应用在运行过程中,存在功能调用权限失败的情况时,可能是由于应用切换到后台运行后一直在后台运行,而应用获取的单次运行期间有效的权限,在后台运行超过预设时长后被电子设备回收,造成应用启动功能时,无法获取该功能所需的权限,造成功能运行失败,则电子设备可以在应用后台运行时,超过预设时长后结束运行该应用,并回收对应用授予的单次运行期间有效的权限,避免出现功能调用权限失败的情况,改善应用的运行情况,提升用户的体验感。When the application is running and the function call permission fails, it may be because the application has been running in the background after switching to the background, and the permission obtained by the application is valid during a single operation. If it is recycled by an electronic device, the permission required for the function cannot be obtained when the application starts the function, and the function fails to run, then the electronic device can run the application in the background and end running the application after the preset time period has expired, and the application will be recycled and granted The effective permissions during a single operation can avoid the failure of function call permissions, improve the operation of the application, and enhance the user experience.
结合第二方面,在一种可能的实现方式中,该方法还包括:该第一应用的用户界面在被关闭显示后,经过一段时间再次被显示时,该第一功能成功调用该第一权限。In combination with the second aspect, in a possible implementation manner, the method further includes: after the user interface of the first application is displayed after being closed and displayed again after a period of time, the first function successfully invokes the first permission .
结合第二方面,在一种可能的实现方式中,该方法还包括:该第一应用的用户界面在被关闭显示后,经过一段时间再次被显示时,该电子设备显示该第一应用的该启动界面。With reference to the second aspect, in a possible implementation manner, the method further includes: after the user interface of the first application is closed and displayed, when the user interface of the first application is displayed again after a period of time, the electronic device displays the user interface of the first application. Start interface.
由于应用在进入后台运行后超过预设时长时,电子设备会结束应用的运行,那么当应用再次回到前台运行时,电子设备需要重新拉起该应用的进程,则电子设备启动应用时会显示应用的启动界面。Since the electronic device will end the running of the application when the application runs in the background for more than the preset time period, when the application returns to the foreground to run again, the electronic device needs to restart the process of the application, and the electronic device will display the display when the application is started. The application's launch interface.
结合第二方面,在一种可能的实现方式中,该第一功能为语音聊天功能,该第一权限为麦克风。With reference to the second aspect, in a possible implementation manner, the first function is a voice chatting function, and the first authority is a microphone.
也就是说,应用存在数据丢失的情况时,该功能可能为语音聊天功能,应用在切换到后台运行前可以正常使用语音聊天功能,当应用进入后台运行超过预设时长,电子设备回收应用的麦克风权限,当应用再次回到前台时,可能会存在语音聊天功能无法获取用户的语音信息。这样的应用即适用于在切换到后台后,超过预设时长时结束运行,从而避免了应用的功能调用权限失败的问题。That is to say, when there is data loss in the application, the function may be a voice chat function. The application can use the voice chat function normally before switching to the background operation. When the application enters the background and runs for more than a preset time, the electronic device will recycle the application's microphone. permission, when the app returns to the foreground again, there may be a possibility that the voice chat function cannot obtain the user's voice information. Such an application is suitable for ending the operation after switching to the background and exceeding the preset time period, thereby avoiding the problem of the failure of the application's function invocation permission.
第三方面,本申请实施例提供一种电子设备,包括:显示屏,存储器,一个或多个处理器,多个应用程序,以及一个或多个程序;其中该一个或多个程序被存储在该存储器中;其特征在于,该一个或多个处理器在执行该一个或多个程序时,使得该电子设备实现如第一方面或第一方面的任意一种实施方式所描述的方法。In a third aspect, embodiments of the present application provide an electronic device, including: a display screen, a memory, one or more processors, multiple application programs, and one or more programs; wherein the one or more programs are stored in The memory is characterized in that, when the one or more processors execute the one or more programs, the electronic device enables the electronic device to implement the method described in the first aspect or any one of the implementation manners of the first aspect.
第四方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质中包括指令,当该指令在电子设备上运行时,使得该电子设备执行如第一方面或第一方面的任意一种实施方式所描述的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium includes instructions, and when the instructions are executed on an electronic device, the electronic device is made to perform the first aspect or the first aspect The method described in any one of the embodiments.
第五方面,本申请实施例提供一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行如第一方面或第一方面的任意一种实施方式所描述的方法。In a fifth aspect, the embodiments of the present application provide a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the method described in the first aspect or any one of the implementation manners of the first aspect.
实施本申请实施例提供的技术方案,电子设备能够在对应用进行权限配置时,根据该应用为白名单应用还是黑名单应用,确定是否在应用的权限窗口中为权限提供单次授权的授权方式,避免用户选择会影响应用运行的授权方式。By implementing the technical solutions provided by the embodiments of the present application, the electronic device can determine whether to provide a single authorization authorization method for the permission in the permission window of the application according to whether the application is a whitelist application or a blacklist application when the permission is configured for the application. , to prevent the user from choosing an authorization method that affects the running of the application.
附图说明Description of drawings
图1为应用的不同授权方式与应用的运行状态之间的关系示意图;1 is a schematic diagram of the relationship between different authorization modes of an application and the running state of the application;
图2A-图2C为一种对应用进行单次授权的场景;Fig. 2A-Fig. 2C is a kind of scenario of single authorization to the application;
图3为本申请实施例提供的一种电子设备的硬件结构图;3 is a hardware structure diagram of an electronic device provided by an embodiment of the present application;
图4为本申请实施例提供的一种电子设备的软件结构图;4 is a software structure diagram of an electronic device provided by an embodiment of the present application;
图5A-图5H为本申请实施例提供的一些用户界面;5A-5H provide some user interfaces according to the embodiments of the present application;
图6为本申请实施例提供的权限管理方法的流程示意图。FIG. 6 is a schematic flowchart of a rights management method provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described clearly and in detail below with reference to the accompanying drawings. Wherein, in the description of the embodiments of the present application, unless otherwise specified, “/” means or, for example, A/B can mean A or B; “and/or” in the text is only a description of an associated object The association relationship indicates that there can be three kinds of relationships, for example, A and/or B can indicate that A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of this application , "plurality" means two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as implying or implying relative importance or implying the number of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, the "multiple" The meaning is two or more.
本申请以下实施例中的术语“用户界面(user interface,UI)”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。用户界面是通过java、可扩展标记语言(extensible markuplanguage,XML)等特定计算机语言编写的源代码,界面源代码在电子设备上经过解析,渲染,最终呈现为用户可以识别的内容。用户界面常用的表现形式是图形用户界面(graphicuser interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的文本、图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。The term "user interface (UI)" in the following embodiments of this application is a medium interface for interaction and information exchange between an application program or an operating system and a user, which realizes the internal form of information and the form acceptable to the user. conversion between. The user interface is a source code written in a specific computer language such as java and extensible markup language (XML). A commonly used form of user interface is a graphical user interface (graphic user interface, GUI), which refers to a user interface related to computer operations displayed in a graphical manner. It can be text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and other visual interface elements displayed on the display screen of the electronic device.
为了便于理解,首先对应用授权涉及到的授权方式进行简单的解释。For ease of understanding, a brief explanation of the authorization methods involved in application authorization is given first.
由于首次打开应用或者在应用运行的过程中,电子设备都会显示权限窗口提示用户授予权限,并且,权限窗口中还可以显示多种授权方式:始终允许,使用期间允许、本次运行允许、禁止等等,以供用户根据不同的需求,授予应用不同时长的权限。Since the application is opened for the first time or in the process of running the application, the electronic device will display a permission window to prompt the user to grant permission, and the permission window can also display various authorization methods: always allow, allow during use, allow this run, prohibit, etc. etc., so that users can grant permissions for different durations of applications according to different needs.
其中,始终允许是指对应用授予权限后,应用一直拥有该权限。使用期间允许是指对应用授予权限后,只有在用户使用该应用的过程中,应用才拥有该权限。本次运行允许是指对应用授予权限后,只有在用户最近一次使用该应用的过程中,应用才拥有该权限。禁止是指拒绝对应用授予权限。Among them, always allow means that after the permission is granted to the application, the application always has the permission. Allowed during use means that after a permission is granted to an app, the app only has the permission while the user is using the app. This running permission means that after the permission is granted to the application, the application only has the permission during the last time the user uses the application. Blocking means denying permission to an app.
图1示例性示出了上述授权方式与应用的运行状态之间的关系。FIG. 1 exemplarily shows the relationship between the above authorization mode and the running state of the application.
从图1可以看出,应用的运行状态包括三种:前台运行、后台运行、关闭。需要注意的时,这里提及的应用的运行状态是站在用户的角度上理解的。从用户的角度上出发,前台运行是指电子设备运行应用,且应用的运行过程对用户是可见的,应用能够与用户交互,例如,用户能够通过电子设备的显示,浏览应用提供的用户界面。后台运行是指电子设备运行应用,但是应用的运行过程对用户是不可见的,应用不能与用户交互。关闭是指电子设备未运行应用。其中,当电子设备为手机时,用户可以通过在显示屏中的滑动操作(例如,上滑操作)将应用从前台运行切换到后台运行,这里,用户的滑动操作可以实现将电子设备显示的用户界面从应用的用户界面切换到其他界面,例如,电子设备的主界面。用户可以通过多任务窗口,查看对应用的历史访问记录,其中,多任务窗口中可以显示有用户历史查看的一个或多个应用的用户界面,电子设备可以接收到用户作用于其中一个应用的用户界面的滑动操作(例如,上滑操作),将应用彻底关闭,即结束该应用的运行。As can be seen from Figure 1, the running state of the application includes three types: foreground running, background running, and closing. It should be noted that the running state of the application mentioned here is understood from the user's point of view. From the user's point of view, foreground operation means that the electronic device runs the application, and the running process of the application is visible to the user, and the application can interact with the user. For example, the user can browse the user interface provided by the application through the display of the electronic device. Background running means that the electronic device runs the application, but the running process of the application is invisible to the user, and the application cannot interact with the user. Off means the electronic device is not running the application. Wherein, when the electronic device is a mobile phone, the user can switch the application from the foreground running to the background running through a sliding operation (for example, an upward sliding operation) on the display screen. The interface switches from the user interface of the application to another interface, for example, the main interface of the electronic device. The user can view the historical access records to the application through the multitasking window, wherein the multitasking window can display the user interface of one or more applications that the user has viewed historically, and the electronic device can receive the user acting on one of the applications. The sliding operation of the interface (for example, the upward sliding operation) completely closes the application, that is, the operation of the application ends.
其中,0-t1、t8-t9阶段,应用处于关闭状态,t1-t3、t4-t5、t7-t8、t9之后,应用处于前台运行状态,t3-t4、t5-t7阶段,应用处于后台运行状态。授权方式为禁止时,无论应用是否运行,应用都没有权限,授权方式为始终允许时,应用在t2时刻获得权限后,会一直拥有该权限,授权方式为使用期间允许时,应用在t2时刻获得权限后,在每次前台运行,以及进入后台运行时间不超过阈值,该阈值即为t5-t6所在的时长),应用都拥有该权限,当授权方式为本次运行允许时,应用在t2时刻获得权限后,只有在单次运行过程中,且后台运行时间不超过阈值,即t2-t6阶段,应用才拥有该权限。Among them, in stages 0-t1, t8-t9, the application is closed, after t1-t3, t4-t5, t7-t8, and t9, the application is in the foreground running state, and in stages t3-t4, t5-t7, the application is running in the background state. When the authorization method is Prohibited, no matter whether the application is running or not, the application has no permission. When the authorization method is Always Allowed, the application will always have the permission after obtaining the permission at time t2. After permission, the application will have this permission every time it runs in the foreground, and the running time in the background does not exceed the threshold, which is the duration of t5-t6). After obtaining the permission, the application has the permission only during a single running process and the background running time does not exceed the threshold, that is, the t2-t6 stage.
可以看出,授权方式为本次运行允许时,当授予应用权限后,应用只有在单次运行的过程中,且应用进入后台运行的时间不超过阈值时,才拥有权限,当应用后台运行的时间超过阈值时,电子设备会回收该应用的权限。It can be seen that when the authorization method is allowed for this operation, when the application permission is granted, the application only has the permission during a single operation, and the time when the application enters the background operation does not exceed the threshold. When the application is running in the background When the time exceeds the threshold, the electronic device will reclaim the permission of the application.
可以理解的是,上述提及的权限授予情况是针对单个权限而言的,在本申请其他实施例中,本次运行允许还可以称为本次使用允许、单次允许、一次性授权、单次授权、单次权限、only this time等等,本申请实施例对该名称不作限制。It can be understood that the permission granting situation mentioned above is for a single permission, and in other embodiments of the present application, this operation permission may also be referred to as this use permission, single permission, one-time authorization, single permission. Sub-authorization, single-time authority, only this time, etc., the name is not limited in this embodiment of the present application.
在本申请以下实施例中,为了描述方便,将本次运行允许的授权方式称为单次授权。In the following embodiments of the present application, for the convenience of description, the authorization mode allowed in this operation is referred to as a single authorization.
图2A-图2C示出了一种对应用进行单次授权的场景。Figures 2A-2C illustrate a scenario in which an application is authorized for a single time.
图2A示出了首次开启浏览器时,电子设备提示对浏览器进行授权的权限窗口01,其中,用户对浏览器授予本次运行允许的权限后,浏览器即可获得在本次运行的过程中访问位置信息的权限。FIG. 2A shows a
图2B示出了完成浏览器授权后,电子设备显示的浏览器的用户界面,此时浏览器处于前台运行状态。其中,用户界面中的区域02用于展示浏览器启用附近新闻推送功能时,浏览器为用户推送的一些新闻,这些新闻为浏览器结合用户的地理位置,搜索出的新闻。这时,由于在开启浏览器时,电子设备对浏览器授予了位置信息的访问权限,因此此时浏览器的附近新闻推送功能能够正常运行。FIG. 2B shows the user interface of the browser displayed by the electronic device after the browser authorization is completed, and the browser is in the foreground running state at this time. The
图2C示出了浏览器从前台运行切换到后台运行,且经过一段时间后,再次在前台运行时,电子设备显示的用户界面。这时,当该一段时间的时长大于阈值时,电子设备会在浏览器从前台切换到后台运行后,经过阈值时间时,回收浏览器访问位置信息的权限。那么,在浏览器再次回到前台运行时,应用的附近新闻推送功能不能正常运行。此时,区域02中无法显示出附近推荐的新闻,区域02中显示有提示信息03,该提示信息03用于提示应用无法获取电子设备的位置信息,因此定位失败,无法搜索附近的新闻。FIG. 2C shows a user interface displayed by the electronic device when the browser is switched from running in the foreground to running in the background, and after a period of time, the browser runs in the foreground again. At this time, when the duration of the period of time is greater than the threshold, the electronic device will reclaim the browser's permission to access location information when the threshold time elapses after the browser switches from the foreground to the background. Then, when the browser returns to the foreground to run again, the app's nearby news feed function does not work properly. At this time, the nearby recommended news cannot be displayed in the
从图2A-图2C可以看出,当应用切换到后台运行后,经过的时间超过阈值时,电子设备会回收应用的单次运行期间有效的权限,导致应用的功能(附近新闻推送功能)调用权限(位置信息)失败。It can be seen from Fig. 2A-Fig. 2C that after the application is switched to running in the background, when the elapsed time exceeds the threshold, the electronic device will reclaim the valid permissions during a single operation of the application, resulting in the function of the application (nearby news push function) calling Permission (location information) failed.
一种解决方法是,对应用进行单次授权后,在应用切换到后台运行的时间超过阈值时,电子设备可以结束运行该应用,即杀死该应用的进程,从而结束应用的单次运行过程,在应用重新启动时,可以重新显示之前切换到后台前,应用显示的历史界面,并且,由于应用已经开始了一次新的运行阶段,可以再次请求用户授予权限,避免了出现应用的权限回收后,应用不再显示权限窗口,提示用户授权的问题。One solution is that after a single authorization of the application, when the time for the application to switch to the background running exceeds the threshold, the electronic device can end running the application, that is, kill the process of the application, thereby ending the single running process of the application. , when the application is restarted, the historical interface displayed by the application before switching to the background can be re-displayed, and since the application has started a new running phase, the user can be requested to grant permission again, avoiding the occurrence of the application's permission recovery. , the app no longer displays the permission window, prompting the user for authorization issues.
但是,杀死应用的进程也同样存在一定的问题,有些应用在关闭后再次启动时,可能无法完全还原到切换到后台前,应用显示的历史界面,例如,对于视频播放类应用,该历史界面可以是指视频播放界面,当视频播放类应用再次回到前台显示时,可能无法定位到上一次的视频播放进度,即存在用户数据丢失的问题,这仍然影响了用户对应用的体验感。However, the process of killing the application also has certain problems. When some applications are restarted after being closed, they may not be fully restored to the historical interface displayed by the application before switching to the background. For example, for video playback applications, the historical interface It can refer to the video playback interface. When the video playback application returns to the foreground to display again, it may not be able to locate the last video playback progress, that is, there is a problem of user data loss, which still affects the user's experience of the application.
以上出现的不管是功能调用权限失败,还是用户数据丢失,这都是由于应用对单次授权的适配不佳,所造成的应用运行异常的问题。因此,如何控制不同应用对权限的访问,避免出现应用运行异常的问题,是目前亟待解决的问题。Whether it is the failure of the function call permission or the loss of user data, the above problems are caused by the poor adaptation of the application to a single authorization, causing the application to run abnormally. Therefore, how to control the access of different applications to permissions and avoid the problem of abnormal operation of the application is an urgent problem to be solved at present.
本申请实施例提供了一种权限管理方法,该方法能够根据不同应用对单次授权的适配程度,将应用分为黑名单应用和白名单应用,白名单应用对单次授权的适配程度较好,因此在对该类应用进行权限的配置时,授权方式中包括单次授权,白名单应用对单次授权的适配程度较差,因此在对该类应用进行权限的配置时,授权方式中不包括单次授权。The embodiment of the present application provides a rights management method, which can divide applications into blacklist applications and whitelist applications according to the degree of adaptation of different applications to a single authorization, and the degree of adaptation of a whitelist application to a single authorization Therefore, when configuring permissions for this type of application, the authorization method includes a single authorization, and the whitelist application is poorly adapted to a single authorization. Therefore, when configuring permissions for this type of application, the authorization A single authorization is not included in the method.
这样,当应用对单次授权的适配程度较差时,可以通过移除单次授权的选项的方式,避免用户对应用进行单次授权,从而避免了应用在配置单次授权时,出现运行异常的问题,相反,当应用对单次授权的适配程度较好时,即应用即使配置单次授权,也不会出现运行异常的问题,或者应用运行异常的问题较小时,则可以在应用的权限配置中,增加该单次授权的选项,增加用户的选择。总体来说,该方法能够结合不同应用对单次授权的适配情况,个性化制定授权方式,实现了应用的合理授权,避免应用因为权限的配置出现较大的运行异常问题。In this way, when the adaptation of the application to the single authorization is poor, the option of the single authorization can be removed to prevent the user from authorizing the application once. On the contrary, when the application is well adapted to a single authorization, that is, even if the application is configured with a single authorization, there will be no problem of abnormal operation, or when the problem of abnormal operation of the application is small, it can be used in the application. In the permission configuration of , add the option of the single authorization, and increase the user's choice. In general, this method can combine the adaptation of different applications to a single authorization, and customize the authorization method, realize the reasonable authorization of the application, and avoid the problem of large abnormal operation of the application due to the configuration of permissions.
白名单应用在前台运行切换到后台运行,并经过一段时间后再次被显示时,存在以下一项异常,白名单应用的用户数据丢失、白名单应用的功能调用权限失败,或者,不存在上述异常;否则,黑名单应用存在上述两项异常。When a whitelisted application runs in the foreground and switches to the background, and is displayed again after a period of time, there is one of the following exceptions: the user data of the whitelisted application is lost, the function call permission of the whitelisted application fails, or the above exception does not exist ; otherwise, the above two exceptions exist in the blacklist application.
进一步地,白名单应用还可以进一步地细分成两个子类,第一个子类,主要针对于应用在进入后台运行一段时间后,返回前台运行时仅出现功能访问权限失败的情况,电子设备可以在这类应用进入后台运行预设时间后,回收这类应用的权限,杀死该类应用的进程,第二个子类,主要针对于应用在进入后台运行一段时间后,返回前台时仅出现用户数据丢失的情况,电子设备可以在这类应用进入后台运行预设时间后,仅回收这类应用的权限,不杀死该类应用的进程。其中,针对应用具体为白名单中的哪一个子类,可以在应用检测阶段,对应用进行单次授权,观察应用在切换到后台运行预设时间后,杀死应用的进程,或不杀死应用的进程时,是否会存在功能访问权限异常,或者用户数据丢失的问题,来确定应用具体适用于杀死进程或不杀死进程,从而完成白名单中子类的划分。Further, the whitelisted application can be further subdivided into two subclasses. The first subclass is mainly for the situation where the function access permission fails only when the application returns to the foreground after running in the background for a period of time. After this type of application enters the background to run for a preset time, the permissions of this type of application can be reclaimed, and the process of this type of application can be killed. The second subclass is mainly for applications that only appear when they return to the foreground after entering the background to run for a period of time. In the case of user data loss, the electronic device may only reclaim the permissions of such applications after such applications enter the background to run for a preset period of time, without killing the processes of such applications. Among them, according to which subclass in the whitelist the application is, you can authorize the application once during the application detection phase, and observe that after the application switches to the background to run for a preset time, kill the process of the application, or not kill the application. In the process of the application, whether there will be abnormal functional access rights or loss of user data, to determine whether the application is suitable for killing the process or not killing the process, so as to complete the division of subclasses in the whitelist.
也就是说,该方法可以进一步通过在应用后台运行时,杀死应用的进程或不杀死应用的进程,来尽可能地消除对应用进行单次授权后,存在的较小的运行异常的问题。这样,电子设备可以进一步根据应用对单次授权的适配程度,控制应用采用不同的运行方式,消除应用运行异常的问题,提升用户的体验感。That is to say, this method can further eliminate the problem of minor abnormal operation after the application is authorized for a single time by killing the process of the application or not killing the process of the application when the application is running in the background. . In this way, the electronic device can further control the application to adopt different operation modes according to the degree of adaptation of the application to a single authorization, so as to eliminate the problem of abnormal operation of the application, and improve the user's sense of experience.
本申请实施例还提供了一种权限管理方法,该方法能够对应用授予单次运行期间有效的第一权限,在应用从前台运行切换到后台运行,进过一段时间后,再次返回到前台运行时,电子设备可以响应于开启应用的功能的操作,显示一个权限窗口,该权限窗口用于提示用户对应用授予第一权限。The embodiment of the present application also provides a permission management method, which can grant a first permission valid during a single running period to an application, switch the application from foreground running to background running, and return to running in the foreground after a period of time At the time, the electronic device may display a permission window in response to the operation of enabling the function of the application, where the permission window is used to prompt the user to grant the first permission to the application.
这是由于,当应用存在单次运行期间有效的权限时,如果应用切换到后台运行的时间超过阈值,电子设备会将应用的权限回收,但是应用却不感知该权限回收,仍然以默认存在该权限的设定下继续运行,这也就出现了应用启动需要该权限的功能时,功能无法正常运行的情况。因此,该方法能够在应用再次回到前台运行时,在启用需要该权限的功能时,主动显示授权窗口,提示用户授予应用权限,避免应用出现功能访问权限失败的问题。This is because, when the application has a valid permission during a single run, if the time for the application to switch to the background running exceeds the threshold, the electronic device will reclaim the application's permission, but the application does not perceive the reclaimed permission and still exists by default. Continue to run under the permission setting, which means that when the application starts the function that requires the permission, the function cannot run normally. Therefore, the method can actively display the authorization window when the application returns to the foreground to run again and enable the function that requires the permission, and prompts the user to grant the application permission, so as to avoid the failure of the function access permission in the application.
其中,该方法中提及的应用为白名单应用,当应用为白名单应用时,电子设备显示的权限窗口中,存在单次授权的授权方式,这样,用户可以根据权限窗口中,该单次授权对应的选项,对应用授予单次运行期间有效的权限。具体关于白名单应用的描述可以参考前述内容,这不再赘述。The application mentioned in the method is a whitelisted application. When the application is a whitelisted application, there is a single authorization authorization method in the permission window displayed by the electronic device. Authorize the corresponding option to grant permissions valid for a single run to the application. For a specific description of the whitelist application, reference may be made to the foregoing content, which will not be repeated here.
另外,当应用从前台切换到后台运行时,电子设备还可以在预设时间后,结束运行该应用或不结束运行该应用,具体应用是否结束运行,可以预先根据应用结束运行和不结束运行时,是否存在功能调用权限失败,或者,用户数据丢失的情况来进行选择。具体关于应用是否结束运行的描述可以参见后续内容,这里先不赘述。In addition, when the application switches from the foreground to the background running, the electronic device can also end running the application or not after a preset time. Whether the application ends running can be determined in advance according to when the application ends running or does not end running. , whether there is a function call permission failure, or user data loss to select. For a specific description about whether the application has finished running, see the subsequent content, which will not be repeated here.
图3示出了本申请实施例提供的电子设备100的硬件结构示意图。FIG. 3 shows a schematic diagram of a hardware structure of an electronic device 100 provided by an embodiment of the present application.
电子设备100可以是手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmentedreality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificialintelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备等,本申请实施例对该电子设备的具体类型不作特殊限制。The electronic device 100 may be a cell phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular telephones, personal digital assistants (personal digital assistants) digital assistant (PDA), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices and/or smart cities equipment, etc., the specific types of the electronic equipment are not particularly limited in the embodiments of the present application.
电子设备100可以包括处理器101,存储器102,无线通信模块103,移动通信模块104,天线103A,天线104A,电源开关105,传感器模块106,音频模块107,摄像头108,显示屏109等。其中,传感器模块106可以包括陀螺仪传感器106A,气压传感器106B,触摸传感器106C等。其中,无线通信模块103可以包括WLAN通信模块,蓝牙通信模块等。上述多个部分可以通过总线传输数据。The electronic device 100 may include a processor 101, a memory 102, a wireless communication module 103, a mobile communication module 104, an antenna 103A, an antenna 104A, a power switch 105, a
在一些实施例中,处理器101可用于确定应用为白名单应用还是黑名单应用,或者,进一步地,确定应用为白名单中的哪一个子类应用。In some embodiments, the processor 101 may be configured to determine whether the application is a whitelisted application or a blacklisted application, or, further, determine which subclass of the whitelisted application the application is.
在一些实施例中,存储器102可用于存储黑白名单,该黑白名单中记录有不同应用所述的类别,即白名单应用还是黑名单应用,还是白名单应用中的某一个子类应用。In some embodiments, the memory 102 may be used to store a black and white list, in which the categories described by different applications are recorded, that is, a white list application or a black list application, or a certain sub-type application in the white list application.
在一些实施例中,移动通信模块104和无线通信模块103可用于接收其他设备,例如服务器发送的黑白名单。该黑白名单可以由服务器对各应用进行测试,获得的名单。具体关于服务器的测试过程可以参见后续内容,这里先不赘述。In some embodiments, the mobile communication module 104 and the wireless communication module 103 may be used to receive other devices, such as black and white lists sent by a server. The black and white list can be obtained by the server testing each application. For the specific test process of the server, please refer to the subsequent content, which will not be repeated here.
电子设备100可以通过GPU,显示屏109,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏109和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器101可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 may implement a display function through a GPU, a display screen 109, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 109 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 101 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏109用于显示图像,视频等。显示屏109包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏109,N为大于1的正整数。The display screen 109 is used to display images, videos, and the like. The display screen 109 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). , AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 100 may include one or N display screens 109 , where N is a positive integer greater than one.
在一些实施例中,显示屏109可用于显示应用提供的用户界面,并在对应用进行权限配置时,显示应用的权限窗口,具体关于显示屏109中显示的内容可以参见后续UI实施例,这里先不赘述。In some embodiments, the display screen 109 can be used to display the user interface provided by the application, and when the permissions are configured for the application, the permission window of the application is displayed. For details about the content displayed on the display screen 109, please refer to the subsequent UI embodiments, here I won't go into details first.
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
电子设备可以是搭载iOS、Android、Microsoft或者其它操作系统的便携式终端设备,例如手机、平板电脑、可穿戴设备等,还可以是具有触敏表面或触控面板的膝上型计算机(Laptop)、具有触敏表面或触控面板的台式计算机等非便携式终端设备。电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The electronic device may be a portable terminal device equipped with iOS, Android, Microsoft or other operating systems, such as a mobile phone, a tablet computer, a wearable device, etc., or a laptop computer (Laptop) with a touch-sensitive surface or a touch panel, Non-portable end devices such as desktop computers with touch-sensitive surfaces or touch panels. The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present invention takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 as an example.
图4是本申请实施例的电子设备100的软件结构框图。FIG. 4 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and system libraries, and a kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.
如图4所示,应用程序包可以包括相机,图库,日历,电话,通讯录,导航,WLAN,音乐,设置,短信等应用程序。As shown in Figure 4, the application package can include applications such as camera, gallery, calendar, phone, address book, navigation, WLAN, music, settings, SMS and so on.
在一些实施例中,在应用运行的过程中,应用可能需要访问其他应用程序,获取自身功能所需的资源,例如访问图库中的图片,这时,电子设备100可以显示授权窗口,提示用户请求授予应用访问其他应用程序的权限,该其他应用程序可以是指上述提及的相机、图库、日历等等应用程序。In some embodiments, during the running of the application, the application may need to access other application programs to obtain resources required for its own functions, such as accessing pictures in the gallery. At this time, the electronic device 100 may display an authorization window to prompt the user to request Grant the app permission to access other apps, which can refer to the aforementioned camera, gallery, calendar, and so on.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for the applications of the application layer. The application framework layer includes some predefined functions.
如图4所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 4, the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。其中,应用程序在访问这些数据之前,电子设备100可以先显示授权窗口,提示用户请求授予应用访问这些数据的权限。Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc. Wherein, before the application accesses the data, the electronic device 100 may first display an authorization window, prompting the user to request permission for the application to access the data.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device 100 . For example, the management of call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications that appear on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. 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 lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL) and so on.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如: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 still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
下面结合图5A-图5H介绍该权限管理方法涉及的一些用户界面。Some user interfaces involved in the rights management method are described below with reference to FIGS. 5A-5H .
在图5A-图5H所示的用户界面中,以电子设备100运行浏览器应用为例,浏览器应用是指一类用于检索、展示以及传递网络信息资源的应用程序,在本申请其他实施例中,电子设备可以运行其他应用,本申请实施例对电子设备运行的应用不作限制。In the user interface shown in FIGS. 5A-5H , taking the electronic device 100 running a browser application as an example, a browser application refers to a type of application program used to retrieve, display and transmit network information resources, and other implementations in this application In an example, the electronic device may run other applications, and the embodiments of the present application do not limit the applications run by the electronic device.
图5A示例性示出了电子设备100上用于应用程序菜单的示例性用户界面21,该用户界面21可以称为电子设备100的主界面。FIG. 5A illustrates an exemplary user interface 21 for an application menu on the electronic device 100 , which may be referred to as the main interface of the electronic device 100 .
如图5A所示,用户界面21可包括:状态栏211,日历指示符212、天气指示符213、设置图标214、浏览器图标215。其中:As shown in FIG. 5A , the user interface 21 may include: a status bar 211 , a
状态栏211可包括移动通信信号的一个或多个信号强度指示符、无线高保真(wirelessfidelity,WiFi)信号的一个或多个信号强度指示符、电池状态指示符以及时间指示符。日历指示符212可用于指示当前时间。天气指示符213可用于指示天气类型。The status bar 211 may include one or more signal strength indicators for mobile communication signals, one or more signal strength indicators for wireless fidelity (WiFi) signals, a battery status indicator, and a time indicator.
如图5A所示,电子设备100可以检测到首次打开浏览器的操作,即检测到作用于浏览器图标215的用户操作,并响应于该用户操作,显示图5B所示的用户界面31。这里,首次打开浏览器可以是指电子设备100安装或更新浏览器后,第一次开启该浏览器,或者,浏览器在电子设备100的存储空间中未占用数据时,开启该浏览器。As shown in FIG. 5A , the electronic device 100 can detect the operation of opening the browser for the first time, that is, detect the user operation acting on the
如图5B所示,用户界面31为浏览器提供的用户界面,该用户界面可以为浏览器提供的主页面,或者,首次开启浏览器时显示的启动页面等。在图5B中,该用户界面31为浏览器提供的主页面。As shown in FIG. 5B , the user interface 31 is a user interface provided by a browser, and the user interface may be a home page provided by the browser, or a startup page displayed when the browser is first opened, or the like. In FIG. 5B, the user interface 31 is the main page provided by the browser.
另外,用户界面31上还包含权限窗口311。该权限窗口311用于展示浏览器请求获取的一项或多项权限。其中,该权限窗口311包括权限项311A,该权限项311A指示了浏览器请求位置信息的访问权限,其中,该权限项311A还包含电子设备100提供的授权方式,其中,该授权方式可以包括本次运行允许,使用本应用时允许,禁止等等授权方式,不同的授权方式指示了电子设备100对应用授予权限的不同时长。在如图5B所示的权限项311A中,该权限项311A包含第一授权选项3111A,该第一授权选项3111A指示了电子设备100为浏览器提供的本次运行允许的授权方式。电子设备100在权限窗口311中提供该第一授权选项3111A,是根据浏览器对该授权方式的适配程度确定的,这里,电子设备100会浏览器提供了该第一授权选项3111A,则说明浏览器对单次授权的适配较好,不会因为电子设备100为浏览器配置单次授权而出现应用运行异常的问题,或者应用运行异常的问题较小。In addition, the user interface 31 also includes a
可以理解的是,当浏览器对单次授权的适配不好时,该权限项311A中将不会显示有该本次运行允许的授权方式,即参见图5C,权限窗口311中,关于位置信息的权限项311A中,相比于图5B中的权限项311A,电子设备100未提供单次授权的选项。It can be understood that when the browser does not adapt well to a single authorization, the
也就是说,在浏览器对单次授权的适配较差时,电子设备100可以不提供该单次授权对应的选项。That is, when the browser is poorly adapted to the single authorization, the electronic device 100 may not provide an option corresponding to the single authorization.
另外,在图5B所示的用户界面中,权限窗口311还包括取消选项311B和确定选项311C,其中,取消选项311B用于取消本次对浏览器的权限的配置,确定选项311C用于根据权限窗口311,对浏览器配置权限,其中,当权限项311A中的第一授权选项3111A处于选中状态,则说明用户为浏览器配置了允许在本次运行过程中,访问电子设备100的位置信息的权限。之后,当电子设备100接收到作用于确定控件311C的用户操作时,电子设备100完成对浏览器的权限配置,在前台运行浏览器,显示如图5D所示用户界面41,该用户界面41可以为浏览器提供的运行界面。In addition, in the user interface shown in FIG. 5B , the
如图5D所示,用户界面41用于显示浏览器的检索入口,检索关键字以及浏览器根据位置信息推荐的新闻。其中,用户界面41包括新闻展示区域411,该新闻展示区域411用于显示浏览器启动附近新闻推送功能时,根据电子设备100的位置信息搜索到的信息。这是因为在运行应用之前,用户在如图5B所示的权限窗口311中对应用授予了允许本次运行期间访问位置信息的权限,因此浏览器能够成功获取附近的新闻并展示在新闻展示区域411中。As shown in FIG. 5D , the user interface 41 is used to display the retrieval entry of the browser, retrieval keywords and news recommended by the browser according to the location information. The user interface 41 includes a
图5E示出了电子设备100在前台运行浏览器的过程中,检测到切换应用运行状态的操作(例如,上滑操作),电子设备100将浏览器由前台运行切换到后台运行。之后,电子设备100显示的用户界面由浏览器提供的运行界面(用户界面41)切换为,如图5F所示的电子设备100的主界面。FIG. 5E shows that when the electronic device 100 is running the browser in the foreground, the electronic device 100 detects an operation of switching the running state of the application (eg, a slide-up operation), and the electronic device 100 switches the browser from running in the foreground to running in the background. After that, the user interface displayed by the electronic device 100 is switched from the running interface (user interface 41 ) provided by the browser to the main interface of the electronic device 100 as shown in FIG. 5F .
可选地,电子设备100可以存在其他切换应用运行状态的方式,例如,当电子设备100运行浏览器的过程中,可以通过该浏览器触发开启另一个应用程序,这时,电子设备100可以显示另一个应用程序的用户界面,此时,浏览器即由前台运行切换到后台运行。本申请实施例对切换应用运行状态的方式不做限制。Optionally, the electronic device 100 may have other ways to switch the running state of the application. For example, when the electronic device 100 runs a browser, the browser can trigger the opening of another application. At this time, the electronic device 100 can display The user interface of another application. At this time, the browser switches from foreground to background. This embodiment of the present application does not limit the manner of switching the running state of the application.
如图5F所示,在浏览器切换到后台运行,且经过第一时间后,电子设备100在如图5F所示的用户界面21中,检测到作用于浏览器图标215的用户操作,响应于该操作,电子设备100再次在前台运行浏览器。As shown in FIG. 5F , after the browser is switched to run in the background and the first time elapses, the electronic device 100 detects the user operation acting on the
其中,在浏览器切换到后台运行之后,电子设备100可以存在两种可选的方式:一种是在到达阈值时间时,关闭浏览器的进程,一种是一直在后台运行浏览器。这样,在电子设备100使用第一种方式时,当电子设备100再次在前台运行浏览器,电子设备100会先启动浏览器,即创建浏览器的进程,再显示浏览器的运行界面。在电子设备100使用第二种方式时,当电子设备100再次在前台运行浏览器,电子设备100无需创建浏览器的进程,直接显示浏览器的运行界面。那么,在电子设备100创建浏览器的进程时,电子设备100会先显示浏览器的启动页面,或广告页面等等待浏览器启动的启动界面。Wherein, after the browser is switched to run in the background, the electronic device 100 may have two optional modes: one is to close the process of the browser when the threshold time is reached, and the other is to run the browser in the background all the time. In this way, when the electronic device 100 uses the first method, when the electronic device 100 runs the browser in the foreground again, the electronic device 100 will first start the browser, that is, the process of creating the browser, and then display the running interface of the browser. When the electronic device 100 uses the second method, when the electronic device 100 runs the browser in the foreground again, the electronic device 100 directly displays the running interface of the browser without creating a process of the browser. Then, when the electronic device 100 creates the process of the browser, the electronic device 100 will first display a start page of the browser, or a start interface waiting for the browser to start, such as an advertisement page.
也就是说,当电子设备100在浏览器切换到后台运行,且经过阈值时间(小于第一时间)时,电子设备100会杀死浏览器的进程,当时间到达第一时间,检测到作用于浏览器图标215的用户操作时,电子设备100会拉起浏览器的进程,显示如图5G所示的浏览器的启动界面51,等待浏览器启动完成。之后,电子设备100再显示图5H所示的浏览器的运行界面,该运行界面为浏览器前一次由前台运行切换到后台运行时,前台运行过程中显示的用户界面,即图5D所示的用户界面41。当电子设备100在浏览器切换到后台运行后,电子设备100一直在后台运行浏览器时,当时间到达第一时间,检测到作用于浏览器图标215的用户操作时,电子设备100直接显示如图5H所示的用户界面41。That is to say, when the electronic device 100 switches the browser to run in the background, and the threshold time (less than the first time) elapses, the electronic device 100 will kill the process of the browser. When the user operates the
在图5H所示的用户界面41中,由于浏览器在该界面中拥有新闻推送功能,需要调用电子设备100的位置信息来获取附近的信息,因此电子设备100可以显示如图5H中示出的权限窗口412,请求用户授予应用访问位置信息的权限,在用户同意授予权限后,浏览器即可继续为用户推荐附近的新闻,避免出现浏览器无法显示附近新闻的问题。In the user interface 41 shown in FIG. 5H , since the browser has a news push function in this interface, the location information of the electronic device 100 needs to be called to obtain nearby information, so the electronic device 100 can display the information shown in FIG. 5H . The
图6示例性示出了本申请实施例提供的权限管理方法的流程示意图。FIG. 6 exemplarily shows a schematic flowchart of a rights management method provided by an embodiment of the present application.
如图6所示,该方法包括:As shown in Figure 6, the method includes:
S101、电子设备100显示配置第一应用的第一权限的第一窗口。S101. The electronic device 100 displays a first window for configuring a first permission of a first application.
该第一窗口用于显示第一应用请求获得的一个或多个权限。其中,该第一窗口显示有第一权限的权限项。The first window is used to display one or more permissions requested by the first application. Wherein, the first window displays permission items with the first permission.
在电子设备100显示第一窗口之前,电子设备100可以检测到触发配置第一应用的权限的第一操作。电子设备100显示第一应用的第一窗口具体为电子设备100响应于第一操作,显示第一应用的第一窗口。Before the electronic device 100 displays the first window, the electronic device 100 may detect the first operation that triggers the configuration of the permission of the first application. For the electronic device 100 to display the first window of the first application, specifically, the electronic device 100 displays the first window of the first application in response to the first operation.
电子设备100可以在以下三种情况下触发第一应用权限的配置:The electronic device 100 can trigger the configuration of the first application permission in the following three situations:
1)电子设备100在设置应用程序中触发第一应用权限的配置1) The electronic device 100 triggers the configuration of the first application permission in the setting application
也就是说,电子设备100可以通过设置应用程序配置第一应用的权限。具体地,电子设备100可以通过设置应用程序中的权限管理,找到该第一应用的权限列表,从而进行第一应用的第一权限的配置。那么此时,该第一操作可以是指针对权限管理对应的选项的点击操作。That is, the electronic device 100 can configure the permissions of the first application through the setting application. Specifically, the electronic device 100 can find the permission list of the first application by setting the permission management in the application, so as to configure the first permission of the first application. Then, at this time, the first operation may be a click operation on an option corresponding to the authority management.
2)电子设备100在未运行第一应用的情况下,首次打开第一应用时触发第一应用权限的配置2) The electronic device 100 triggers the configuration of the permissions of the first application when the first application is opened for the first time without running the first application
电子设备100首次打开第一应用可以是指电子设备100在安装或更新第一应用后首次打开第一应用。The electronic device 100 opening the first application for the first time may mean that the electronic device 100 opens the first application for the first time after installing or updating the first application.
这时,电子设备100可以通过开启第一应用,触发显示第一应用的权限窗口,该权限窗口指示第一应用请求获取的权限。那么此时,该第一操作可以是指针对第一应用的图标的点击操作,该点击操作可用于触发开启第一应用进而触发显示第一应用的权限窗口,指示用户对第一应用的权限进行配置。At this time, the electronic device 100 may trigger the display of a permission window of the first application by opening the first application, where the permission window indicates the permission requested by the first application. Then, at this time, the first operation may be a click operation on the icon of the first application, and the click operation may be used to trigger the opening of the first application and then trigger the display of the permission window of the first application, instructing the user to perform the permission of the first application. configuration.
可以理解的是,该第一操作不限于针对第一应用的图标的点击操作,该第一操作可以是任意一个用于触发开启第一应用的操作,例如,语音输入,或者是作用于其他应用的操作,该操作用于触发其他应用在运行过程中开启该第一应用。It can be understood that the first operation is not limited to a click operation on the icon of the first application, and the first operation can be any operation for triggering the opening of the first application, for example, voice input, or acting on other applications. The operation is used to trigger other applications to open the first application during the running process.
参见图5A,该第一应用可以为浏览器,该第一操作可以是指作用于浏览器图标215的用户操作。Referring to FIG. 5A , the first application may be a browser, and the first operation may refer to a user operation acting on the
3)电子设备100在运行第一应用的过程中,启动第一应用的功能,触发第一应用权限的配置3) During the process of running the first application, the electronic device 100 starts the function of the first application and triggers the configuration of the first application permission
当第一应用的功能需要电子设备100授予第一应用相应的权限才能够正常启动时,则在电子设备100检测到触发开启第一应用功能的操作时,会显示第一应用的权限窗口,该权限窗口用于请求用户授予该第一应用的功能所需的第一权限。那么此时,该第一操作可以是指触发开启第一应用的功能的操作。When the function of the first application requires the electronic device 100 to grant the corresponding permission to the first application to be able to start normally, when the electronic device 100 detects an operation that triggers the opening of the function of the first application, the permission window of the first application will be displayed. The permission window is used to request the user to grant the first permission required by the function of the first application. Then, at this time, the first operation may refer to an operation that triggers the function of opening the first application.
可以理解的是,不限于上述三种触发第一应用权限配置的情况,本申请实施例对此不作限制。It can be understood that, it is not limited to the above three situations of triggering the first application permission configuration, which are not limited in this embodiment of the present application.
另外,电子设备100可以根据应用对单次授权的适配情况,确定是否在权限窗口中显示单次授权选项。In addition, the electronic device 100 may determine whether to display the single authorization option in the permission window according to the adaptation of the application to the single authorization.
当第一应用为白名单应用时,则第一应用被允许在第一应用的单次运行期间使用第一权限,第一权限的授权方式中包含第一授权方式,该第一授权方式为允许在第一应用的单次运行期间使用该第一权限。换句话说,当第一应用为白名单应用时,第一窗口中可以包含第一权限的单次授权选项;当第一应用为黑名单应用,则第一应用不被允许在第一应用的单次运行期间使用第一权限,那么第一权限的授权方式中不包含第一授权方式。换句话说,当第一应用为黑名单应用时,第一窗口中不包含第一权限的单次授权选项。When the first application is a whitelisted application, the first application is allowed to use the first permission during a single operation of the first application, and the authorization mode of the first permission includes the first authorization mode, and the first authorization mode is to allow The first permission is used during a single run of the first application. In other words, when the first application is a whitelisted application, the first window may include a one-time authorization option for the first permission; when the first application is a blacklisted application, the first application is not allowed in the first application If the first authorization is used during a single operation, the authorization mode of the first authorization does not include the first authorization mode. In other words, when the first application is a blacklisted application, the first window does not include a single authorization option for the first permission.
其中,白名单应用是指对单次授权的适配程度较好的应用,白名单应用的用户界面在被关闭显示后,经过一段时间再被显示时,存在以下一项异常:白名单应用的用户数据丢失、白名单应用的第一功能调用第一权限失败,或者不存在上述异常。这里,第一功能是指白名单应用中需要第一权限的功能。相反,黑名单应用是指对单次授权的适配程度较差的应用,黑名单应用的用户界面在被关闭显示后,经过一段时间再被显示时,存在上述两项异常。Among them, the whitelist application refers to the application with a good degree of adaptation to a single authorization. After the user interface of the whitelist application is closed and displayed, when it is displayed again after a period of time, there is one of the following exceptions: User data is lost, the first function of the whitelisted application fails to invoke the first permission, or the above exception does not exist. Here, the first function refers to a function in the whitelist application that requires the first permission. On the contrary, a blacklisted application refers to an application with a poor degree of adaptation to a single authorization. After the user interface of the blacklisted application is closed and displayed, the above two exceptions exist when it is displayed again after a period of time.
该单次授权选项用于触发电子设备100对第一应用授予,单次运行期间有效的第一权限。该单次运行期间是指应用从开始运行到结束运行,这一个连续阶段中,第一应用在后台运行的时间不能超过阈值的运行期间。当第一应用在后台运行的时间超过预设时长时,则该单次运行期间为第一应用授予第一权限,且开启运行到运行到该预设时长节点之前的一个连续阶段。也就是说,在第一应用后台运行的时间超过阈值时,电子设备100将回收授予第一应用的,单次运行期间有效的第一权限,第一应用进入下一个运行期间,或者,第一应用结束运行。The one-time authorization option is used to trigger the electronic device 100 to grant the first permission to the first application, which is valid during a single operation. The single running period refers to the running period during which the first application runs in the background and cannot exceed the threshold in this continuous stage from the start of the application to the end of the running. When the time that the first application runs in the background exceeds the preset duration, the first permission is granted to the first application during the single running period, and a continuous stage of running until running to the preset duration node is started. That is, when the time that the first application runs in the background exceeds the threshold, the electronic device 100 will reclaim the first permission granted to the first application that is valid during a single running period, and the first application will enter the next running period, or, the first The application finishes running.
在本申请实施例中,电子设备100可以存储有一个配置表,该配置表中指示有两类应用,一类应用为白名单应用,一类应用为即为黑名单应用。这样,在电子设备100显示第一应用配置第一权限的窗口(例如第一窗口)之前,电子设备100可以根据该配置表确定该第一应用为白名单应用还是黑名单应用,从而决定是否在该窗口中提供第一权限的单次授权选项。In this embodiment of the present application, the electronic device 100 may store a configuration table, and the configuration table indicates that there are two types of applications, one type of application is a whitelist application, and one type of application is a blacklist application. In this way, before the electronic device 100 displays a window (eg, the first window) in which the first application configures the first permission, the electronic device 100 can determine whether the first application is a whitelisted application or a blacklisted application according to the configuration table, so as to decide whether to A one-time authorization option for the first permission is available in this window.
其中,该配置表可以为提前为第一应用配置单次授权,即对第一应用授予单次运行期间有效的第一权限,测试该第一应用是否存在运行异常的情况。如果第一应用从前台运行切换到后台运行后,经过一段时间,再次回到前台运行时,出现上述白名单应用的一项异常或没有异常,则说明该第一应用为白名单应用,并将该结果记录到配置表中。如果测试过程中,第一应用存在上述白名单应用中提及的两项异常,则说明该第一应用为黑名单应用,则将该结果记录到配置表中。Wherein, the configuration table may configure a single authorization for the first application in advance, that is, grant the first authorization valid during a single operation to the first application, and test whether the first application has abnormal operation. If the first application is switched from the foreground to the background, and returns to the foreground after a period of time, one of the above whitelisted applications is abnormal or there is no abnormality, it means that the first application is a whitelisted application, and the The result is recorded in the configuration table. If during the test, the first application has the two exceptions mentioned in the above whitelist application, it means that the first application is a blacklist application, and the result is recorded in the configuration table.
这样,可以在用户为应用配置权限时,尽可能地避免用户选择会影响应用运行的授权方式,提升用户的体验感。In this way, when a user configures permissions for an application, the user can be prevented from selecting an authorization method that affects the operation of the application as much as possible, and the user's experience can be improved.
参见图5B-图5C,当第一应用为白名单应用时,该第一窗口可以是指图5B所示的权限窗口311,该第一权限为位置信息,该权限项为权限项311A,该第一授权方式即为第一授权选项3111A中指示的授权方式,当第一应用为黑名单应用时,该第一窗口可以为图5C所示的权限窗口311。5B-5C, when the first application is a whitelist application, the first window may refer to the
S102、电子设备100对第一应用授予单次运行期间有效的第一权限。S102. The electronic device 100 grants the first permission valid during a single operation to the first application.
具体地,电子设备100可以检测到作用于第一窗口的操作,响应于该操作,对第一应用授予单次运行期间有效的第一权限,即允许第一应用在第一应用的单次运行期间使用该第一权限。Specifically, the electronic device 100 may detect an operation acting on the first window, and in response to the operation, grant the first permission to the first application that is valid during a single operation, that is, allow the first application to operate in a single operation of the first application. Use this first permission during the period.
该操作可以是指用户配置权限的操作,例如,参见图5B,该操作可以是指作用于第一授权选项3111A的选择操作,以及作用于确定选项311C的用户操作,这样,电子设备100即可完成对应用授予单次运行过程中,拥有访问位置信息的权限。该第一权限即为位置信息。This operation may refer to an operation of configuring permissions by a user. For example, referring to FIG. 5B , the operation may refer to a selection operation acting on the
需要注意的时,电子设备100对第一应用授予单次运行期间有效的第一权限,则说明S102-S106中提及的第一应用为白名单应用。It should be noted that, when the electronic device 100 grants the first permission valid during a single operation to the first application, it means that the first application mentioned in S102-S106 is a whitelisted application.
S103、电子设备100关闭第一应用显示的用户界面。S103, the electronic device 100 closes the user interface displayed by the first application.
电子设备100关闭第一应用显示的用户界面包含两个含义:The user interface displayed by the electronic device 100 closing the first application includes two meanings:
1)电子设备100在关闭第一应用显示的用户界面之前,电子设备100显示第一应用的用户界面,即电子设备100在前台运行第一应用。1) Before the electronic device 100 closes the user interface displayed by the first application, the electronic device 100 displays the user interface of the first application, that is, the electronic device 100 runs the first application in the foreground.
2)电子设备100仅关闭第一应用显示的用户界面,即电子设备100在后台运行第一应用。2) The electronic device 100 only closes the user interface displayed by the first application, that is, the electronic device 100 runs the first application in the background.
换句话说,电子设备100关闭第一应用显示的用户界面可以是指电子设备100将第一应用从前台运行切换到后台运行。In other words, closing the user interface displayed by the first application by the electronic device 100 may mean that the electronic device 100 switches the first application from running in the foreground to running in the background.
参见图5D,用户界面41可以是指电子设备100在前台运行第一应用时,显示的第一应用的用户界面,从新闻展示区域411可以看出,应用可以获取电子设备100的位置信息,并根据该位置信息成功运行附近新闻推送功能,在新闻展示区域411中展示出根据位置信息获取的新闻。Referring to FIG. 5D , the user interface 41 may refer to the user interface of the first application displayed when the electronic device 100 runs the first application in the foreground. It can be seen from the
电子设备100从将第一应用从前台运行切换到后台运行可以具体为,电子设备100检测到用户的操作,响应于该操作,将前台运行的应用切换到后台运行。该操作可以为返回电子设备100主界面的操作,或者,开启其他应用的操作,本申请实施例对切换第一应用运行状态的操作不作限制。The electronic device 100 switches the first application from foreground running to background running may specifically be that the electronic device 100 detects the user's operation, and in response to the operation, switches the application running in the foreground to running in the background. The operation may be an operation of returning to the main interface of the electronic device 100, or an operation of opening other applications, and the embodiment of the present application does not limit the operation of switching the running state of the first application.
参见图5E,该操作可以是指作用于显示屏的上滑操作,该上滑操作可用于将电子设备100显示的浏览器的用户界面切换为电子设备100的主界面。Referring to FIG. 5E , the operation may refer to a slide-up operation acting on the display screen, and the slide-up operation may be used to switch the user interface of the browser displayed by the electronic device 100 to the main interface of the electronic device 100 .
S104、经过一段时间后,电子设备100再次显示第一应用的用户界面。S104. After a period of time, the electronic device 100 displays the user interface of the first application again.
电子设备100再次显示第一应用的用户界面可以是指,电子设备100再次在前台运行第一应用。该用户界面可以是指应用上一次前台运行时显示的用户界面。参见图5H,电子设备再次在前台运行第一应用时,显示的用户界面可以是指用户界面41。The electronic device 100 displaying the user interface of the first application again may mean that the electronic device 100 runs the first application in the foreground again. The user interface may refer to the user interface displayed when the application was last run in the foreground. Referring to FIG. 5H , when the electronic device runs the first application in the foreground again, the displayed user interface may refer to the user interface 41 .
由于第一权限为电子设备100为第一应用配置的单次运行期间有效的权限,当第一应用在切换到后台运行后,经过的时间大于预设时长(例如,5分钟)时,电子设备100会回收第一应用的第一权限。Since the first permission is a permission that is valid during a single running period configured by the electronic device 100 for the first application, when the time elapsed after the first application is switched to run in the background is greater than a preset time period (for example, 5 minutes), the electronic device 100 will reclaim the first permission of the first application.
另外,除了根据第一应用对单次授权的适配情况,确定是否在权限窗口中显示单次授权选项,还可以进一步确定在第一应用的用户界面被关闭显示后,经过预设时长是否结束运行第一应用。In addition, in addition to determining whether to display the single authorization option in the permission window according to the adaptation of the first application to the single authorization, it is also possible to further determine whether the preset time period ends after the user interface of the first application is closed and displayed. Run the first application.
这是由于不同的应用在用户界面被关闭显示后,经过一段时间再次被显示时,应用的运行情况可能会不同。This is because different applications may behave differently when the user interface is displayed again after a period of time after the user interface is closed.
如果第一应用的用户界面在被关闭显示后,经过一段时间再次被显示时,出现用户数据丢失,则第一应用的用户界面在被关闭显示的一段时间里,电子设备仍然运行第一应用,不结束第一应用的运行。这时由于一些应用在从前台运行切换到后台运行之后,如果应用在后台结束运行,应用在重新回到前台运行时,对于再次回到上次前台运行时的状态,一些应用可能无法恢复或者不能完全恢复到上次前台运行时显示的用户界面,存在用户数据丢失的情况。以视频播放类应用为例,再次显示的用户界面可以是指视频播放界面,用户数据可以是指视频播放进度,某些视频播放类应用可能在再次回到前台运行时,无法恢复到上次前台运行时,视频播放的节点,可能会从视频的起点开始重新播放视频。因此,可以通过不杀死应用的进程,避免出现再次回到前台时,用户数据丢失的问题。这样,在第一应用的用户界面被关闭显示后,经过一段时间再次被显示时,第一应用的用户界面没有呈现出用户数据丢失的异常。If user data is lost when the user interface of the first application is displayed again after being closed for a period of time, the electronic device still runs the first application during the period of time that the user interface of the first application is closed and displayed. The running of the first application is not terminated. At this time, since some applications are switched from foreground to background, if the application ends running in the background, when the application returns to the foreground, some applications may not be able to restore or fail to return to the state of the last foreground operation. Fully restored to the user interface displayed in the last foreground run, there is a loss of user data. Taking a video playback application as an example, the user interface displayed again may refer to the video playback interface, and the user data may refer to the video playback progress. Some video playback applications may not be restored to the previous foreground when they return to the foreground to run again. At runtime, the node where the video plays, may replay the video from the beginning of the video. Therefore, the problem of user data loss when returning to the foreground can be avoided by not killing the application process. In this way, after the user interface of the first application is turned off and displayed, when it is displayed again after a period of time, the user interface of the first application does not show an abnormality of user data loss.
而如果第一应用的用户界面在被关闭显示后,经过一段时间再次被显示时,出现第一功能调用第一权限异常,则在第一应用的用户界面被关闭显示超过预设时长的情况下,电子设备100可以结束运行第一应用。这是由于,第一应用的第一权限为单次运行期间有效的权限,在第一应用的用户界面被关闭显示后超过预设时长时,电子设备100会回收第一应用的第一权限,而一些应用可能无法感知到第一权限的缺失,导致第一应用无法获取到第一功能所需的第一权限,即应用的第一功能调用第一权限失败,造成应用运行异常。以聊天类应用为例,该第一功能可以是指语音聊天功能,第一权限可以是指麦克风,某些聊天类应用可能在再次回到前台运行时,由于访问麦克风的权限已回收,聊天类应用无法获取到用户的语音信息,但是也不会显示提示信息,提示用户开启麦克风权限,从而导致语音聊天功能失效。因此,可以通过杀死应用的进程,主动结束应用的单次运行阶段,避免出现再次回到前台时,功能调用权限失败的问题。这样,在第一应用的用户界面被关闭显示后,经过第一时间再次被显示时,第一应用的第一功能能够成功调用第一权限。However, if the user interface of the first application is displayed after being closed and displayed again after a period of time, an exception occurs when the first function invokes the first permission, and the user interface of the first application is closed and displayed for more than a preset period of time. , the electronic device 100 may end running the first application. This is because the first permission of the first application is a permission valid during a single operation, and when the user interface of the first application is closed and displayed for more than a preset period of time, the electronic device 100 will reclaim the first permission of the first application, However, some applications may not be able to perceive the lack of the first permission, so that the first application cannot obtain the first permission required by the first function, that is, the first function of the application fails to invoke the first permission, causing the application to run abnormally. Taking chat applications as an example, the first function may refer to the voice chat function, and the first permission may refer to the microphone. Some chat applications may return to the foreground to run again, because the permission to access the microphone has been revoked, and the chat category The application cannot obtain the user's voice information, but will not display a prompt message to prompt the user to enable the microphone permission, which will cause the voice chat function to fail. Therefore, you can actively end the single running phase of the application by killing the process of the application, so as to avoid the problem that the function call permission fails when returning to the foreground again. In this way, after the user interface of the first application is closed and displayed, when the user interface of the first application is displayed again after the first time, the first function of the first application can successfully invoke the first permission.
因此,配置表中可以在白名单应用中进一步细分两个子类应用,第一个子类中的应用可以在应用进入后台运行一段时间后,仅回收应用的权限,保持应用的运行,第二个子类的应用可以在应用进入后台运行时,回收应用的权限,结束应用的运行。Therefore, the configuration table can be further subdivided into two subclasses of applications in the whitelist. The applications in the first subclass can only reclaim the permissions of the application after the application enters the background to run for a period of time, keeping the application running, and the second This subclass of applications can reclaim the permissions of the application and end the running of the application when the application enters the background running.
这样,电子设备可以进一步根据应用对单次授权的适配程度,控制应用采用不同的授权细节,避免出现对应用进行单次授权时,出现应用运行异常的问题,提升用户的体验感。In this way, the electronic device can further control the application to adopt different authorization details according to the degree of adaptation of the application to a single authorization, so as to avoid the problem that the application runs abnormally when the application is authorized for a single time, and improve the user's sense of experience.
类似地,可以通过测试应用的用户界面在关闭显示后,经过一段时间再次被显示时,应用存在的异常来确定各应用具体适用于白名单应用中的哪一个子类应用。Similarly, it is possible to determine which sub-type application each application is specifically applicable to in the whitelisted applications by testing the abnormality of the application when the user interface of the application is displayed again after a period of time after being displayed.
其中,当第一应用为第一个子类的应用时,在第一应用的用户界面被关闭显示后,经过一段时间再次被显示时,第一应用直接从后台运行回到前台运行,则电子设备100不显示第一应用的启动界面,该启动界面包含等待第一应用启动时,第一应用提供的启动页面、广告页面等一个或多个页面。参见图5G,该启动界面可以是指用户界面51。Wherein, when the first application is an application of the first subclass, after the user interface of the first application is closed and displayed and displayed again after a period of time, the first application runs directly from the background to the foreground, and the electronic The device 100 does not display a startup interface of the first application, where the startup interface includes one or more pages such as a startup page and an advertisement page provided by the first application while waiting for the first application to start. Referring to FIG. 5G , the startup interface may refer to the user interface 51 .
当第一应用为第二个子类的应用时,在第一应用的用户界面被关闭显示后,进过一段时间再次被显示时,第一应用在从前台运行切换到后台运行后,会在经过预设时长后结束运行,之后在到达一段时间时重新启动并在前台运行。那么,在电子设备100重新启动第一应用的过程中,电子设备100会先拉起应用的进程,显示第一应用的启动界面,之后在第一应用启动完成后,再显示应用的运行界面。参见图5F-图5H,在电子设备100接收到用户作用于浏览器图标215的用户操作,再次在前台运行浏览器时,电子设备100显示如图5G所示的用户界面51,之后再显示如图5H所示的浏览器提供的用户界面41。When the first application is an application of the second subclass, after the user interface of the first application is closed and displayed and displayed again after a period of time, after the first application switches from the foreground to the background, it will It ends running after a preset duration, and then restarts and runs in the foreground when a certain period of time is reached. Then, during the process of restarting the first application by the electronic device 100, the electronic device 100 will first start the process of the application, display the startup interface of the first application, and then display the running interface of the application after the first application is started. 5F-5H, when the electronic device 100 receives a user operation on the
综上所述,当电子设备100确定第一应用为第一个子类应用时,在电子设备100再次显示第一应用的用户界面时,不会显示第一应用的启动界面,当电子设备100确定第一应用为第二个子类应用时,在电子设备100再次显示第一应用的用户界面时,会显示第一应用的启动界面。To sum up, when the electronic device 100 determines that the first application is the first sub-type application, when the electronic device 100 displays the user interface of the first application again, the startup interface of the first application will not be displayed. When it is determined that the first application is the second sub-type application, when the electronic device 100 displays the user interface of the first application again, the startup interface of the first application will be displayed.
S105、响应于启动第一功能的操作,电子设备100显示第二窗口,该第二窗口用于提示用户授予第一应用使用第一权限。S105. In response to the operation of starting the first function, the electronic device 100 displays a second window, where the second window is used to prompt the user to grant the first application the first permission to use.
在电子设备100回收第一应用的第一权限后,电子设备100可以再次显示权限窗口,即第二窗口,提示用户第一权限已回收,需要再次授予第一应用使用第一权限。这样,电子设备100可以主动提示用户对应用进行授权,可以避免应用因为权限的缺失而影响应用的运行。After the electronic device 100 reclaims the first permission of the first application, the electronic device 100 may display the permission window again, that is, the second window, prompting the user that the first permission has been reclaimed and the first application needs to be granted the first permission again. In this way, the electronic device 100 can actively prompt the user to authorize the application, which can prevent the application from affecting the running of the application due to lack of permission.
参见图5H,该第二窗口可以是指权限窗口412。Referring to FIG. 5H , the second window may be referred to as the
S106、电子设备100完成对第一应用的第一权限的配置。S106, the electronic device 100 completes the configuration of the first permission for the first application.
电子设备100完成对第一权限的配置可以是指接收到用户授予应用第一权限的操作,对应用授予第一权限,或者,接收到用户拒绝授予应用第一权限的操作,拒绝对应用授予第一权限。Completing the configuration of the first permission by the electronic device 100 may refer to receiving an operation that the user grants the first permission to the application, and granting the first permission to the application, or, receiving an operation that the user refuses to grant the first permission to the application, refusing to grant the first permission to the application. a permission.
这样,用户可以根据自己的需求,确定是否再次对第一应用授予第一权限,提高用户的可操作性。In this way, the user can determine whether to grant the first permission to the first application again according to his own needs, thereby improving the operability of the user.
可以理解的是,上述黑白名单仅针对应用的单个权限,例如,针对应用的第一权限,该应用可以包含单次授权的选项,针对应用的第二权限,该应用可以不包含单次授权的选项。这是由于针对不同的权限,应用对单次授权的适配程度不同。这样,电子设备可以根据应用的针对不同权限对单次授权的适配程度,来调整权限窗口中不同权限的授权方式,尽可能地避免应用因为单次授权而出现的运行异常,影响用户体验感的问题。It can be understood that the above black and white list is only for a single permission of an application. For example, for the first permission of an application, the application may include a single authorization option, and for the second permission of an application, the application may not include a single authorization. options. This is due to the different degrees of adaptation of applications to a single authorization for different permissions. In this way, the electronic device can adjust the authorization method of different permissions in the permission window according to the degree of adaptation of the application to a single authorization for different permissions, so as to avoid the abnormal operation of the application due to a single authorization as much as possible, which affects the user experience. The problem.
本申请的各实施方式可以任意进行组合,以实现不同的技术效果。The various embodiments of the present application can be arbitrarily combined to achieve different technical effects.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solidstate disk,SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer program instructions, when loaded and executed on a computer, result in whole or in part of the processes or functions described herein. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)), and the like.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented. The process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed , which may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other mediums that can store program codes.
总之,以上所述仅为本发明技术方案的实施例而已,并非用于限定本发明的保护范围。凡根据本发明的揭露,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。In a word, the above descriptions are merely examples of the technical solutions of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included within the protection scope of the present invention.
Claims (19)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110926389.2A CN113792327B (en) | 2021-08-12 | 2021-08-12 | Authority management method, user interface and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110926389.2A CN113792327B (en) | 2021-08-12 | 2021-08-12 | Authority management method, user interface and electronic equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113792327A CN113792327A (en) | 2021-12-14 |
| CN113792327B true CN113792327B (en) | 2022-09-02 |
Family
ID=78875976
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110926389.2A Active CN113792327B (en) | 2021-08-12 | 2021-08-12 | Authority management method, user interface and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113792327B (en) |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112352239A (en) * | 2019-01-23 | 2021-02-09 | 华为技术有限公司 | Application permission management method and electronic equipment |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10069832B2 (en) * | 2014-11-14 | 2018-09-04 | Google Llc | Ephemeral applications |
| US10244102B2 (en) * | 2015-08-20 | 2019-03-26 | Samsung Electronics Co., Ltd. | Method and apparatus for managing application data usage |
| CN106462697B (en) * | 2016-09-09 | 2019-11-26 | 北京小米移动软件有限公司 | Ancillary service management method and device |
| CN110489215A (en) * | 2019-06-29 | 2019-11-22 | 华为技术有限公司 | The treating method and apparatus of scene is waited in a kind of application program |
-
2021
- 2021-08-12 CN CN202110926389.2A patent/CN113792327B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112352239A (en) * | 2019-01-23 | 2021-02-09 | 华为技术有限公司 | Application permission management method and electronic equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113792327A (en) | 2021-12-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11803451B2 (en) | Application exception recovery | |
| EP2528310B1 (en) | Mobile terminal and mode controlling method therein | |
| EP2469817B1 (en) | Mobile terminal and method of sharing information therein | |
| EP2469442B1 (en) | Mobile terminal and method of controlling a mode screen display therein | |
| US8856950B2 (en) | Mobile terminal and method of managing information therein including first operating system acting in first mode and second operating system acting in second mode | |
| EP2469443B1 (en) | Mobile terminal and method of controlling a mode screen display therein | |
| EP2469404B1 (en) | Mobile terminal and method of displaying information in accordance with a plurality of modes of use | |
| US8868901B2 (en) | Mobile terminal supporting dual operating systems and a method for controlling thereof | |
| US20120102433A1 (en) | Browser Icon Management | |
| US20130007842A1 (en) | Mobile terminal and display controlling method therein | |
| US9047469B2 (en) | Modes for applications | |
| US9727705B2 (en) | Remotely defining security data for authorization of local application activity | |
| CN113792329B (en) | Permission optimization method and related equipment | |
| JP2014506363A (en) | Dynamic device configuration using predicates | |
| CN113792328B (en) | Authority management method, user interface and electronic equipment | |
| CN113792327B (en) | Authority management method, user interface and electronic equipment | |
| US8677476B2 (en) | Providing remotely defined security data to a local application extension | |
| CN114675897A (en) | Application startup method and related device | |
| US9384344B2 (en) | Authorizing local application activity using remotely defined security data | |
| KR20130065048A (en) | Mobile terminal and method for controlling a web browser according to mode conversion thereof | |
| CN116702115A (en) | Application program authority application method and device and computer equipment | |
| KR20190084808A (en) | Method for selectively providing network capability to each application | |
| CN111814135A (en) | Application control method, device and electronic device | |
| CN118708282A (en) | Application management method, electronic device, chip system and readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20230912 Address after: 201306 building C, No. 888, Huanhu West 2nd Road, Lingang New Area, Pudong New Area, Shanghai Patentee after: Shanghai Glory Smart Technology Development Co.,Ltd. Address before: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee before: Honor Device Co.,Ltd. |