Patent Description:
Currently, when using an electronic device such as a mobile phone, a user usually needs to grant some permissions to an application to complete a corresponding task. For example, when sending a photo in a gallery by using a specific social application, the user needs to grant a gallery permission to the application, thereby completing a photo sending task.

However, the user cannot view whether the application abnormally uses a granted permission to obtain privacy information of the user, and cannot perform permission optimization. This may easily lead to a risk of user privacy disclosure and poor user experience.

<CIT> discloses a method for managing an application permission to grant a corresponding application permission to an application in different use scenarios. A prompt box is displayed to ask a user whether to allow an application permission in a use scenario.

Embodiments of this application provide a permission optimization method and a related device, to optimize permission of an application in which a privacy risk exists, reduce a risk of user privacy disclosure, and improve user experience.

Technical solutions in embodiments of this application are clearly and completely described below with reference to accompanying drawings in embodiments of this application. In descriptions of embodiments of this application, unless otherwise stated, "/" indicates or, for example, A/B may indicate A or B. "And/or" in the text is merely an association relationship that describes an associated object, and indicates that three relationships may exist. For example, A and/or B may indicate that there are three cases: only A exists, both A and B exist, and only B exists. In addition, in the descriptions of embodiments of this application, "a plurality of" means two or more.

It should be understood that the terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, and are not used to describe a specific sequence. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to a listed step or unit, but optionally further includes an unlisted step or unit, or optionally further includes another step or unit inherent to the process, method, product, or device.

In this application, referring to "an embodiment" means that specific features, structures or features described with reference to the embodiment may be included in at least one embodiment of this application. The phrase appearing at various locations in the specification does not necessarily refer to a same embodiment, nor is it a separate or alternative embodiment mutually exclusive with another embodiment. A person skilled in the art explicitly and implicitly understands that the described embodiments in this application may be combined with another embodiment. Currently, when using an electronic device such as a mobile phone, a user usually needs to grant some permissions to an application (or referred to as an application) to complete a corresponding task. For example, when sending a photo in a gallery by using a specific social application, the user needs to grant a gallery permission to the application, thereby completing a photo sending task.

An embodiment of this application provides a permission optimization method. The electronic device may determine, based on a permission access record of an application, whether a privacy risk exists. If the privacy risk exists, the electronic device may remind and guide a user to perform permission optimization, which reduces a risk of user privacy disclosure and improves user experience.

The electronic device in this embodiment of this application may be a mobile phone, a tablet computer, a wearable device, an on-board equipment, an augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR) device, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), or the like. A specific type of the electronic device is not limited in this embodiment of this application.

An example of a user interface (user interface, UI) provided by an electronic device <NUM> is described below.

The term "user interface" in the specification, claims, and accompanying drawings of this application is a media interface for an interaction and information exchange between an application or an operating system and a user. The media interface implements an information conversion between an internal form and a form acceptable to the user. A common form of expression of the user interface is a graphic user interface (graphic user interface, GUI), which is a user interface that is displayed in a graphical manner and that is related to a computer operation. The graphic user interface may be an interface element such as an icon, a window, or a control that is displayed on a display of an electronic device. The control may include visible interface elements such as an icon, a button, a menu, a tab, a text box, a dialog box, a status bar, a navigation bar, and a Widget. <FIG> shows an example of a user interface <NUM> on the electronic device <NUM> for displaying an application installed on the electronic device <NUM>.

The user interface <NUM> may include: a status bar <NUM>, a calendar indicator <NUM>, a weather indicator <NUM>, a tray <NUM> with an icon of a common application, a navigation bar <NUM>, a combination <NUM> of other application icons, and the like.

The status bar <NUM> may include one or more signal strength indicators 111A of a mobile communication signal (also referred to as a cellular signal), an operator name (such as "China Mobile") 111B, one or more signal strength indicators 111C of a wireless fidelity (wireless fidelity, Wi-Fi) signal, a battery status indicator 111D, and a time indicator 111E.

The calendar indicator <NUM> may be used to indicate current time, such as a date, a day of a week, and hour and minute information.

The weather indicator <NUM> may be used to indicate a weather type, for example, cloudy to sunny, or light rain, and may be further used to indicate information such as a temperature.

The tray <NUM> with an icon of a common application may display: a call icon 114A, a contact icon 114B, an SMS icon 114C, and a camera icon 114D.

The navigation bar <NUM> may include system navigation keys such as a return key 115A, a home screen key 115B, and a multi-task key 115C. When it is detected that the user taps the return key 115A, the electronic device <NUM> may display a previous page of a current page. When it is detected that the user taps the home screen key 115B, the electronic device <NUM> may display a home screen. When it is detected that the user taps the multi-task key 115C, the electronic device <NUM> may display tasks recently opened by the user. Each navigation key may have another name, which is not limited in this application. Each navigation key in the navigation bar <NUM> may alternatively be implemented as a physical key in addition to a virtual key.

The combination <NUM> of other application icons may include one or more other application icons, such as a life service icon 116A, a browser icon 116B, a setting icon 116C, and a music icon 116D. The user interface <NUM> may further include a page indicator <NUM>. Other application icons may be distributed on a plurality of pages. The page indicator <NUM> may be used to indicate an application that is currently browsed by the user and that is in a page. The user may slide an area of other application icons left or right to browse application icons in other pages.

In some embodiments, the user interface <NUM> shown in an example in <FIG> may be a home screen (Home screen).

In some other embodiments, the electronic device <NUM> may further include a physical home screen key. The home screen key may be used to receive an instruction of the user, and return a currently displayed UI to the home screen, so that the user can view the home screen at any time. The instruction may be specifically an operation instruction in which the user taps the home screen key for a single time, an operation instruction in which the user taps the home screen key twice in a short time, or an operation instruction in which the user taps the home screen key for a long time within a predetermined time. In some other embodiments of this application, the home screen key may further be integrated with a fingerprint sensor, so that when the home screen key is tapped, fingerprint collection and identification are subsequently performed.

It may be understood that <FIG> shows only an example of a user interface on the electronic device <NUM>, which should not constitute a limitation on this embodiment of this application.

As shown in <FIG>, the electronic device <NUM> may detect an operation used to open a "setting" application (such as a tap operation on the setting icon 116C); and in response to the operation, the electronic device <NUM> may display a user interface <NUM> of the setting application shown in an example in <FIG>.

As shown in <FIG>, a plurality of setting options may be displayed on the user interface <NUM>, such as a biometric identification and password setting option, an application setting option, a battery setting option, a storage setting option, a security setting option, and a privacy setting option <NUM>. The electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the privacy setting option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>.

As shown in <FIG>, a plurality of options for setting privacy may be displayed on the user interface <NUM>, such as a permission management option, a positioning service option, and an option of learning more privacy functions. However, these options on the user interface <NUM> cannot provide the user with functions of viewing a privacy access record of an application and optimizing a permission. Therefore, the user cannot view whether the application abnormally uses a granted permission to obtain privacy information of the user, and cannot perform permission optimization. This may easily lead to a risk of user privacy disclosure and poor user experience.

An embodiment of this application provides a permission optimization method. The electronic device <NUM> may determine, based on a permission access record of an application, whether a privacy risk exists. If the privacy risk exists, the electronic device <NUM> may remind and guide a user to perform permission optimization, which reduces user privacy disclosure and improves user experience.

A series of user interfaces in the permission optimization method provided in the embodiments of this application are described below in detail.

In a case of an application in which a privacy risk exists, the electronic device <NUM> may display a pop-up interface <NUM> shown in an example in <FIG>. Security prompt information is displayed on the pop-up interface <NUM>. The security prompt information is used to remind the user that a privacy risk exists in the application, and advise the user to view a privacy record in "setting-privacy" and perform optimization.

As shown in <FIG>, the electronic device <NUM> may detect an operation performed by the user on the privacy setting option <NUM> (such as a tap operation); and in response to the operation, the electronic device <NUM> may display a user interface <NUM> of the privacy setting option <NUM> shown in an example in <FIG>.

<FIG>-<FIG> show an example of a group of user interfaces on which the electronic device <NUM> guides the user to perform permission optimization.

<FIG> shows an example of a user interface <NUM> of the privacy setting option <NUM>.

As shown in <FIG>, an option <NUM>, indication information <NUM>, one or more permission setting options (such as a location permission setting option <NUM>, a camera permission setting option, a recording permission setting option, an address book permission setting option, and a storage permission setting option), one or more application options (such as a life service application option <NUM>, a browser application option, and a music application option), an all-privacy access record option <NUM>, a permission management option, a positioning service option, an option of learning more privacy functions, and the like may be displayed on the user interface <NUM>. A permission corresponding to the permission setting option may be a permission with a relatively large total quantity of times of use by all applications in the electronic device <NUM>, and the permission setting option may be arranged in descending order of the total quantity of use times of the permission. For example, five permission setting options are displayed on the user interface <NUM>, and are successively a location permission setting option <NUM>, a camera permission setting option, a recording permission setting option, an address book permission setting option, and a storage permission setting option. Therefore, a location permission is a permission with the largest total quantity of times of use by all applications in the electronic device <NUM>; a camera permission is a permission with the second largest total quantity of times of use by all applications in the electronic device <NUM>; and by analogy, a storage permission is a permission with the smallest total quantity of times of use by all applications in the electronic device <NUM>.

Still referring to <FIG>, it can be learned that the location permission setting option <NUM> is in a selected state. In this case, applications corresponding to a plurality of application options are applications that have used the location permission. The indication information <NUM> is used to indicate that a current access record is a record of an application accessing the location permission in recent XX days.

The application option may be arranged in descending order of a total quantity of times of using a specific permission by an application in recent XX days (for example, recent <NUM> days). For example, three application options are displayed on the user interface <NUM>, and are successively a life service application option <NUM>, a browser application option and a music application option. Therefore, the life service application is an application with the largest total quantity of times of using the location permission in recent XX days; a browser application is an application with the second largest total quantity of times of using the location permission in recent XX days; and a music application is an application with the smallest total quantity of times of using the location permission in recent XX days.

Still referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the life service application option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>.

<FIG> shows an example of a user interface <NUM> of a record of the life service application accessing the location permission in recent XX days.

As shown in <FIG>, it can be learned that the life service application accesses the location permission for XX times in total, that is, the life service application obtains location information in a background for XX times by using the location permission in recent XX days.

Still referring to <FIG>, a location permission access list may be displayed on the user interface <NUM>. The location permission access list may include one or more location permission access records, such as a location permission access record <NUM>, a location permission access record <NUM>, a location permission access record <NUM>, a location permission access record <NUM>, a location permission access record <NUM>, and a location permission access record <NUM>. The one or more location permission access records may display a time point when the life service application is allowed to use the location permission and a quantity of times that the life service application obtains location information in the background. For example, it can be learned from the location permission access record <NUM> that, at <NUM>:<NUM> this afternoon, the life service application is allowed to use the location permission to obtain the location information in the background for XX times. Still referring to <FIG>, the location permission access list may include a permission access record in which a privacy risk exists and/or a permission access record in which no privacy risk exists. A display manner of the permission access record in which a privacy risk exists may be different from a display manner of the permission access record in which no privacy risk exists, so that the user can distinguish these two types of permission access records.

For example, a font color of the permission access record in which a privacy risk exists may be different from a font color of the permission access record in which no privacy risk exists. For example, as shown in <FIG>, a permission access record with a dark font color may indicate the permission access record in which a privacy risk exists (such as the location permission access record <NUM> and the location permission access record <NUM>), and a permission access record with a light font color may indicate the permission access record in which no privacy risk exists (such as the location permission access record <NUM>, the location permission access record <NUM>, the location permission access record <NUM>, and the location permission access record <NUM>).

Optionally, for permission access records with privacy risks at different levels, font colors may alternatively be different. For example, a font color of a permission access record with a high privacy risk may be darker than a font color of a permission access record with a low privacy risk. Optionally, different styles of risk icons may further be used to distinguish between the permission access record in which a privacy risk exists and the permission access record in which no privacy risk exists. For example, a risk icon <NUM> may be used to indicate that a privacy risk exists in the permission access record, and a risk icon <NUM> may be used to indicate that no privacy risk exists in the permission access record.

It should be noted that a display manner used to distinguish the two types of permission access records is not limited to a font color and a style of a risk icon, and may further be a font size, a background color, and the like. This is not limited herein.

Still referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the location permission access record <NUM>; and in response to the operation, the electronic device <NUM> may display a pop-up interface <NUM> shown in an example in <FIG>.

As shown in <FIG>, prompt information <NUM>, an "immediate optimization" option <NUM>, and a "cancel" option <NUM> may be displayed on the pop-up interface <NUM>. The prompt information <NUM> may be used to remind the user that an application obtains location information in the background and a risk may exists, and advise the user to perform permission optimization. For example, an authorization manner of the location permission of the current life service application may be set to "always allowing", so that the electronic device <NUM> may advise the user to set an authorization manner of the location permission to "allowing during use only" by using the prompt information <NUM>.

Optionally, the "immediate optimization" option <NUM> may have a background color to indicate that the electronic device <NUM> recommends/advises the user to perform permission optimization.

Optionally, an icon <NUM> may further be displayed on the pop-up interface <NUM>, which is used to indicate that a privacy risk exists.

Still referring to <FIG>, for example, if the electronic device <NUM> detects an operation (such as a tap operation) performed by the user on the "cancel" option <NUM>, in response to the operation, the electronic device <NUM> may not perform permission optimization, and returns to display the user interface <NUM> shown in <FIG>. For example, if the electronic device <NUM> detects an operation (such as a tap operation) performed by the user on the "immediate optimization" option <NUM>, in response to the operation, the electronic device <NUM> may set the location permission of the life service application to "allowing during use only", that is, the life service application is allowed to use the location permission only when the user is using the life service application. In addition, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>.

As shown in <FIG>, it can be learned that, compared with display manners of all location permission access records in <FIG>, display manners of all location permission access records in <FIG> are the same, that is, the electronic device <NUM> adjusts the display manner of the permission access record in which a privacy risk exists and the display manner of the permission access record in which no privacy risk exists that are shown in <FIG> to a same display manner. For example, a font color of the location permission access record <NUM> is adjusted from dark to light, and a corresponding risk icon is adjusted from the risk icon <NUM> to the risk icon <NUM>. In this way, all location permission access records are displayed in a same manner, which may indicate that the electronic device <NUM> completes location permission optimization.

As shown in <FIG>, a "querying while using" option <NUM>, an "allowing during use only" option <NUM>, an "always allowing" option <NUM>, a "not allowing" option <NUM>, an "ok" option <NUM>, and a "cancel" option <NUM> may be displayed on the pop-up interface <NUM>. The user can set the location permission independently according to a requirement.

It can be learned from <FIG> that an authorization manner of the location permission of a current life service application is set to "allowing during use only". If the user needs to modify the location permission, the user may select a corresponding option for modification. For example, if the user needs to modify an authorization manner of the location permission to "querying while using", the user may select the "querying while using" option <NUM> and tap the "ok" option <NUM> to modify an authorization manner of the location permission from "allowing during use only" to "querying while using". Optionally, a "precise location" switch option <NUM> may further be displayed on the pop-up interface <NUM>. If the option is turned on, the application may use a specific location of the user; or if the option is turned off, the application may use only an approximate location of the user.

It should be noted that a process of permission optimization is described above in detail by only using an example in which the electronic device <NUM> performs optimization on the location permission of the life service application. It can be easily understood that a process in which the electronic device <NUM> performs optimization on another permission (such as a camera permission, a recording permission, an address book permission, or a storage permission) of another application (such as a browser application or a music application) is similar, and details are not described herein again.

<FIG>-<FIG> show an example of a group of user interfaces provided by the electronic device <NUM> for the user to view all privacy access records.

Referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the all-privacy access record option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>.

<FIG> shows an example of a user interface <NUM> of the all-privacy access record option <NUM>.

As shown in <FIG>, the user interface <NUM> may display a time option <NUM>, an application option <NUM>, a permission option <NUM>, and all privacy access records. The user interface <NUM> may include three pages (that is, a page corresponding to the time option <NUM>, a page corresponding to the application option <NUM>, and a page corresponding to the permission option <NUM>). These three pages are respectively used to display all privacy access records in a time dimension, an application dimension, and a permission dimension.

Still referring to <FIG>, it can be learned that the time option <NUM> is in a selected state, that is, a current page is a page corresponding to the time option <NUM>. In this case, all privacy access records may be displayed in a time dimension, that is, all the privacy access records may be arranged in chronological order, to distinctively display records in which all applications have used/attempted to use all permissions.

In this way, a requirement that a user needs to view all the privacy access records at a specific time point can be met.

Still referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the application option <NUM>; and in response to the operation, the electronic device <NUM> may place the application option <NUM> in a selected state shown in an example in <FIG>, that is, a current page is a page corresponding to the application option <NUM>. In this case, all privacy access records may be distinctively displayed based on an application name, and each application corresponds to an application permission option. For example, the life service application corresponds to a life service application permission option <NUM>. An icon (such as a location permission icon <NUM>, a storage permission icon, or an address book permission icon) of a permission that the life service application has used/attempted to use may be displayed on the option. The electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the life service application option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>. A record in which the life service application has used/attempted to use all permissions may be displayed on the user interface <NUM>.

In this way, a requirement that a user needs to view all privacy access records of a specific application can be met.

Optionally, the user interface <NUM> may further include a drop-down option <NUM>. The electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the drop-down option <NUM>; and in response to the operation, the electronic device <NUM> may display a window <NUM> shown in an example in <FIG>. The window <NUM> may include a plurality of permission options, such as an all-permission option, a camera permission option, a recording permission option, an address book permission option, and a storage permission option. The user may select a permission option to view whether the life service application has used/attempted to use the permission. For example, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the address book permission option; and in response to the operation, the electronic device <NUM> may display a record in which the life service application has used/attempted to use the address book permission as shown in an example in <FIG>.

In this way, the user can view, by using the drop-down option <NUM>, details about a record in which the application has used/attempted to use a specific permission.

Still referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the permission option <NUM>; and in response to the operation, the electronic device <NUM> may place the permission option <NUM> in a selected state shown in an example in <FIG>, that is, a current page is a page corresponding to the permission option <NUM>. In this case, all privacy access records may be distinctively displayed based on a permission name, and each permission corresponds to a permission record option (for example, the location permission corresponds to a permission record option <NUM>), by the user to view a record in which one or more applications access the permission. For example, if the user needs to view an access record of the location permission, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the permission record option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>. One or more location permission access records may be displayed on the user interface <NUM>. In this way, a requirement that a user needs to view all privacy access records of a specific permission can be met.

<FIG>-<FIG>, <FIG>-<FIG>, and <FIG>-<FIG> show another group of user interfaces on which the electronic device <NUM> guides the user to perform permission optimization.

Referring to <FIG>, the electronic device <NUM> may detect an operation performed by the user on the privacy setting option <NUM> (such as a tap operation); and in response to the operation, the electronic device <NUM> may display a user interface <NUM> of the privacy setting option <NUM> shown in an example in <FIG>.

As shown in <FIG>, prompt information <NUM>, an "optimization" option <NUM>, and a permission access record option <NUM> may be displayed on the user interface <NUM>. The prompt information <NUM> is used to remind the user that a privacy risk exists in XX applications, and advise the user to perform permission optimization.

Optionally, an icon <NUM>, a permission management option, a positioning service option, an option of learning more privacy functions, and the like may further be displayed on the user interface <NUM>. The electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the "optimization" option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>.

In a possible implementation, referring to <FIG>, the electronic device <NUM> may alternatively detect an operation (such as a tap operation) performed by the user on the option <NUM>; and in response to the operation, the electronic device <NUM> may alternatively display the user interface <NUM> shown in an example in <FIG>.

As shown in <FIG>, one or more permission information options (such as a location permission information option <NUM>), an over-authorization option <NUM>, a "one-tap optimization" option <NUM>, an intercepted access behavior option <NUM>, a permission removal record option <NUM>, and the like may be displayed on the user interface <NUM>. Prompt information may be displayed on each permission information option. For example, the prompt information displayed by the location permission information option <NUM> may be information that "XX applications continuously obtain your location in the background". The prompt information is used to remind the user that abnormal use of the permission occurs in an application, and a privacy risk may exist. Prompt information may alternatively be displayed on the over-authorization option <NUM>. For example, the prompt information is that "XX permissions of XX applications are over-authorized". The prompt information is used to remind the user that an application is over-authorized.

It should be noted that only the location permission information option <NUM> is used as an example of the one or more permission information options; and the one or more permission information options may further include a camera permission information option, a recording permission information option, an address book permission information option, a storage permission information option, and the like. This is not limited herein.

Possible implementations in which the electronic device <NUM> determines whether an application generates behavior of abnormal use of a permission are as follows:
Possible implementation <NUM>: The electronic device <NUM> may determine, based on a frequency of using a permission by the application, whether the application generates behavior of abnormal use of the permission.

Specifically, the electronic device <NUM> may determine whether a quantity of times that a specific application obtains privacy information of the user by using a specific permission within a first preset time period (for example, within three minutes) exceeds a first preset threshold (for example, seven times). If the quantity of times exceeds the first preset threshold, the electronic device <NUM> determines that the application continuously obtains the privacy information of the user by using the permission, and it may be further determined that the application generates behavior of abnormal use of the permission.

Possible implementation <NUM>: The electronic device <NUM> may determine, based on an application scenario, whether the application generates behavior of abnormal use of a permission.

Specifically, the electronic device <NUM> may determine whether a specific application uses a permission corresponding to a specific function when the specific function is disabled. If the specific application uses the permission, the electronic device <NUM> may determine that the application generates behavior of abnormal use of the permission.

For example, a specific application has a specific function of uploading a photo. A permission corresponding to the specific function may be a gallery permission. In a scenario in which the user needs to upload a photo by using the application, the electronic device <NUM> may use the gallery permission to obtain and upload a photo from the gallery. In this scenario, the electronic device <NUM> may determine that behavior of the application is normal use of the gallery permission, that is, no behavior of abnormal use of the permission is generated. In a scenario in which the user does not need to upload a photo by using the application, if the electronic device <NUM> still uses the gallery permission, the electronic device <NUM> may determine that behavior of the application is abnormal use of the gallery permission, that is, behavior of abnormal use of the permission is generated.

A possible implementation in which the electronic device <NUM> determines whether an application is over-authorized is as follows:
The electronic device <NUM> may detect that a specific application is granted a specific permission.

Further, the electronic device <NUM> may compare a permission allowed to be granted to the application in a preset rule with the granted permission. If the granted permission does not match the permission allowed to be granted to the application in the preset rule, the electronic device <NUM> may determine that the application is over-authorized.

For example, if a permission allowed to be granted to a specific application in a preset rule does not include the location permission, but the electronic device <NUM> detects that the application is granted the location permission, the electronic device <NUM> may determine that the application is over-authorized.

The preset rule may be a rule formulated based on a national standard, for example, a core permission specified by the Ministry of Industry and Information Technology, or a personal data minimization principle in the General Data Protection Regulations (General Data Protection Regulation, GDPR). Optionally, the preset rule may alternatively be a rule formulated based on a result of a big data statistical analysis.

Still referring to <FIG>, for example, the electronic device <NUM> may guide the user to perform permission optimization in the following three manners:.

Still referring to <FIG>, the electronic device <NUM> may detect an operation (for example, a tap operation) performed by the user on the "one-tap optimization" option <NUM>; and in response to the operation, the electronic device <NUM> may perform permission optimization at a time on all applications that use a permission abnormally and all applications that are over-authorized. Permission optimization performed by the electronic device <NUM> may specifically include one or more of the following operations performed by the electronic device <NUM>:
The electronic device <NUM> allows an application to use a permission corresponding to a specific function only when the application enables the specific function; and the electronic device <NUM> prohibits the application from using a permission that does not match the permission allowed to be granted to the application in the preset rule.

After the permission optimization is completed, as shown in an example in <FIG>, the icon <NUM> on the user interface <NUM> may be replaced with an icon <NUM>, which is used to remind the user that the permission optimization is completed and can freely use the application. The prompt information displayed in the location permission information option <NUM> may alternatively be replaced from information that "XX applications continuously obtain your location in the background" to information that "there is no abnormal behavior". The prompt information is used to remind the user that the application generates no behavior of abnormal use of the permission. The prompt information of the over-authorization option <NUM> may alternatively be replaced from information that "XX permissions of the XX applications are over-authorized" to information that "no permission of any application is over-authorized". The prompt information is used to remind the user that no application is over-authorized.

In this way, compared with the permission optimization method described in the <FIG>, a permission optimization method in which permission optimization is performed by using the "one-tap optimization" option <NUM> at a time can simplify an operation of the user and improve user experience.

Still referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on a "return" option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>.

As shown in <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on a "view" option <NUM>; and in response to the operation, the electronic device <NUM> may return to display the user interface shown in <FIG>.

Permission optimization is not limited to be performed at a time by using the "one-tap optimization" option <NUM>. The electronic device <NUM> may alternatively guide the user to separately perform permission optimization by using one or more permission information options (for example, the location permission information option <NUM>) and the over-authorization option <NUM>. The following provides a detailed description with reference to <FIG> and <FIG>.

(<NUM>) Permission optimization is separately performed by using one or more permission information options (such as the location permission information option <NUM>).

Still referring to <FIG>, using optimization of the location permission as an example, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the location permission information option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>.

As shown in <FIG>, the electronic device <NUM> may display one or more applications (such as the life service application) that obtain location information of the user in the background, and options (such as an option <NUM>) that are used to set location permissions of the one or more applications. The life service application is used as an example. The electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the option <NUM>; and in response to the operation, the electronic device <NUM> may display a pop-up interface <NUM> shown in an example in <FIG>. As shown in <FIG>, an option (such as an "allowing during use only" option) in which the electronic device <NUM> recommends the user to optimize location permission may be displayed on the pop-up interface <NUM>. The electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the "allowing during use only" option; and in response to the operation, as shown in <FIG>, the electronic device <NUM> may set an authorization manner of the location permission of the life service application from "always allowing" to "allowing during use only", thereby completing optimization on the location permission of the life service application. In a possible implementation, the user may alternatively perform, through one-tap optimization, optimization on location permissions of all applications in which a risk exists. As shown in <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by a user on a "one-tap optimization" option <NUM>; and in response to the operation, the electronic device <NUM> may set an authorization manner of the location permission to an authorization manner recommended by the electronic device <NUM> (such as a manner of "allowing during use only") and display a user interface shown in an example in <FIG>. The "one-tap optimization" option <NUM> may be grayed out, thereby completing optimization on location permissions of all applications in which a risk exists.

(<NUM>) Permission optimization is separately performed by using the over-authorization option <NUM>.

Still referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the over-authorization option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>.

As shown in <FIG>, the electronic device <NUM> may display one or more applications (such as a music application) in which a privacy risk exists due to over-authorization, and options (such as an option <NUM>, and an option <NUM>) that set permissions that are over-authorized to the one or more applications. The music application is used as an example. As shown in <FIG>, it is assumed that over-authorized permissions of the music application are a recording permission and a location permission.

Still referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the option <NUM>; and in response to the operation, the electronic device <NUM> may display a pop-up interface <NUM> shown in an example in <FIG>. As shown in <FIG>, an option (such as an "allowing during use only" option) recommended by the electronic device <NUM> to optimize the location permission of the user may be displayed on the pop-up interface <NUM>. The electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the "allowing during use only" option; and in response to the operation, as shown in <FIG>, the electronic device <NUM> may set an authorization manner of the recording permission of the music application from "always allowing" to "allowing during use only", thereby completing optimization on the recording permission of the music application.

Still referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the option <NUM>; and in response to the operation, the electronic device <NUM> may display a pop-up interface <NUM> shown in an example in <FIG>. As shown in <FIG>, an option (such as a "not allowing" option) recommended by the electronic device <NUM> to optimize the location permission of the user may be displayed on the pop-up interface <NUM>. The electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the "not allowing" option; and in response to the operation, as shown in <FIG>, the electronic device <NUM> may set an authorization manner of the recording permission of the music application from "always allowing" to "not allowing", thereby completing optimization on the recording permission of the music application.

In a possible implementation, the user may alternatively perform, through one-tap optimization, optimization on permissions that are over-authorized to all applications in which a risk exists. As shown in <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by a user on a "one-tap optimization" option <NUM>; and in response to the operation, the electronic device <NUM> may set authorization manners of permissions of all applications that are over-authorized and in which a risk exists to an authorization manner recommended by the electronic device <NUM>, and display a user interface shown in an example in <FIG>. The "one-tap optimization" option <NUM> may be grayed out, thereby completing optimization on the permissions that are over-authorized to all applications in which a risk exists.

<FIG>-<FIG> show a group of user interfaces provided by the electronic device <NUM> for the user to view permission access records, intercepted access behavior, and permission removal records.

Referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the permission access record option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>. For the user interface <NUM> shown in <FIG>, refer to a text description of the user interface shown in <FIG>.

As shown in <FIG>, the user may view a permission access record by performing an operation on an option displayed on the user interface, and further perform permission optimization. For a specific operation process of viewing a permission access record and performing permission optimization, refer to text descriptions of <FIG> and <FIG>.

Referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the intercepted access behavior option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>.

As shown in <FIG>, a total quantity of times that one or more applications attempt to use an unauthorized permission (for example, as shown in <FIG>, a quantity of times that the music application is refused to access is XX) in recent XX days (for example, <NUM> days) may be displayed on the user interface <NUM>. Using the music application as an example, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on an option <NUM>; and in response to the operation, the electronic device <NUM> may display detailed information such as an unauthorized permission attempted to be used by the music application shown in an example in <FIG> in recent XX days (for example, <NUM> days), a quantity of times that a corresponding permission refuses to be accessed, and a recent rejection time point (for example, a quantity of rejection times of the location permission: XX, and latest rejection: XX month/ XX day/ XX:XX). To protect data of the user and ensure privacy security of the user, the electronic device <NUM> may automatically remove access permissions of applications not used by the user in recent XX months, and may provide a permission removal record for the user to view.

For example, referring to <FIG>, the electronic device <NUM> may detect an operation (such as a tap operation) performed by the user on the permission removal record option <NUM>; and in response to the operation, the electronic device <NUM> may display a user interface <NUM> shown in an example in <FIG>. The user interface <NUM> is used by the user to view a record in which access permissions of unused applications in recent XX months are automatically removed. As shown in <FIG>, prompt information <NUM> and one or more applications (such as a game application and a sports and health application) that are not used in recent XX months may be displayed on the user interface <NUM>. Access permissions of these applications are automatically removed by the electronic device <NUM>.

As shown in <FIG>, if a quantity of applications not used by the electronic device <NUM> in recent XX months is zero, a quantity of applications displayed on the user interface <NUM> is zero, which indicates that a quantity of the applications not used by the electronic device <NUM> in recent XX months is zero, and the electronic device <NUM> does not automatically remove access permissions. A structure of an electronic device <NUM> according to an embodiment of this application is described below.

<FIG> shows an example of a structure of the electronic device <NUM> according to an embodiment of this application.

The electronic device <NUM> may include a processor <NUM>, a memory <NUM>, a wireless communication module <NUM>, a mobile communication module <NUM>, an antenna 103A, an antenna 104A, a power switch <NUM>, a sensor module <NUM>, an audio module <NUM>, a camera <NUM>, a display <NUM>, and the like. The sensor module <NUM> may include an optical proximity sensor 106A, an ambient light sensor 106B, a touch sensor 106C, a distance sensor 106D, and the like. The wireless communication module <NUM> may include a WLAN communication module, a Bluetooth communication module, and the like. The plurality of parts may transmit data by using a bus.

The electronic device <NUM> may implement a display function by using a GPU, the display <NUM>, an application processor, and the like. The GPU is an image processing microprocessor, which is connected to the display <NUM> and the application processor. The GPU is configured to perform mathematical and geometric calculations to render graphics. The processor <NUM> may include one or more GPUs that execute program instructions to generate or change display information.

The display <NUM> is configured to display an image, a video, and the like. The display <NUM> includes a display panel. The display panel may adopt a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (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), a flex light-emitting diode (flex light-emitting diode, FLED), a Miniled, a MicroLed, a Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device <NUM> may include one or N displays <NUM>, where N is a positive integer greater than <NUM>.

It can be understood that the structure illustrated in this embodiment of this application does not constitute a specific limitation on the electronic device <NUM>. In some other embodiments of this application, the electronic device <NUM> may include more or fewer components than those shown in the figure, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented by using hardware, software, or a combination of software and hardware.

A software architecture of the electronic device <NUM> according to an embodiment of this application is described below.

<FIG> shows an example of the software architecture of the electronic device <NUM> according to an embodiment of this application.

As shown in <FIG>, a software system of the electronic device <NUM> may use a hierarchical architecture, an event-driven architecture, a microkernel architecture, a micro-service architecture, or a cloud architecture. In this embodiment of this application, a software structure of the electronic device <NUM> is described by using an example of an Android system with a hierarchical architecture.

The hierarchical architecture divides software into layers, and each layer has a clear function and division of labor. The layers communicate with each other by using a software interface. In some embodiments, the Android system is divided into four layers: an application layer, an application framework layer, an Android runtime (Android runtime) and a system library layer, and a kernel layer from top down.

As shown in <FIG>, the application packages may include applications such as camera, gallery, setting, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications at the application layer.

The window manager is used to manage a window program. The window manager may obtain a size of a display, determine whether there is a status bar, lock a screen, take a screenshot, and the like.

The content provider is used to store and obtain data and enable the data to be accessible to an application. The data may include videos, images, audios, calls made and received, browsing histories and bookmarks, phone books, and the like.

The view system includes a visual control, such as a control for displaying a text, or a control for displaying a picture. The view system may be used to build an application. A display interface may include one or more views. For example, a display interface including an SMS message notification icon may include a view for displaying a text and a view for displaying a picture. The phone manager is used to provide a communication function of the electronic device <NUM>, for example, management of a call state (answering or declining).

The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, and video files.

The notification manager enables an application to display notification information in a status bar, and may be used to convey a message of a notification type, and the message may automatically disappear after a quick stop, without a user interaction. For example, the notification manager is used for notifying download completion or as a message reminder. The notification manager may alternatively be a notification that appears in the status bar at the top of the system in a form of a chart or a scroll bar text, for example, a notification for an application running in the background, or a notification that appears on a screen in a form of a dialog window. For example, text information is displayed in the status bar, a prompt tone is made, a terminal device is vibrating, and an indicator light is flashing.

The Android runtime includes a core library and a virtual machine.

The core library includes two parts: one part is function functions that the java language needs to invoke, and the other part is the core library of Android.

The application layer and the application framework layer run on the virtual machine. The virtual machine executes java files at the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as lifecycle management of an execution object, stack management, thread management, security and exception management, and garbage collection.

The system library may include a plurality of functional modules, such as a surface manager (surface manager), media libraries (Media Libraries), a 3D graphics processing library (for example, an OpenGL ES), and a 2D graphics engine (for example, an SGL).

The surface manager is used to manage a display subsystem, and provide fusion of 2D and 3D layers for a plurality of applications.

The media libraries support a plurality of common audio and video formats for playback and recording, still image files, and the like. The media libraries may support a plurality of audio and video encoding formats, such as MPEG4, H. <NUM>, MP3, AAC, AMR, JPG, and PNG.

The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.

The 2D graphics engine is a drawing engine for 2D graphics.

A working procedure of software and hardware of the electronic device <NUM> is described below as an example with reference to a capture photographing scenario.

When the touch sensor <NUM> receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, a timestamp of the touch operation, and other information). The original input event is stored at the kernel layer. The application framework layer obtains the original input event from the kernel layer, and identifies a control corresponding to the input event. For example, the touch operation is a touch tap operation, and a control corresponding to the tap operation is a control of a camera application icon. A camera application invokes an interface of the application framework layer to start the camera application, so that the kernel layer is invoked to start a camera driver, and the camera <NUM> captures a static image or video.

With reference to the series of user interfaces, a procedure of a permission optimization method according to an embodiment of this application is described below.

<FIG> shows an example of a procedure of a permission optimization method according to an embodiment of this application.

S1001: The electronic device <NUM> displays a permission access record of a first application.

For example, the first application may be the life service application, and the permission access record of the first application may be the location permission access record of the first application shown in <FIG>. In addition, the first application may also be another application, and the permission access record of the first application may also be an access record of another permission (for example, a camera permission or an address book permission).

The permission access record of the first application includes an access record in which a privacy risk exists. The access record in which a privacy risk exists includes a record in which the first application has used a permission (also referred to as a first permission) corresponding to a specific function when the specific function of the first application has been disabled and the record displays a time point of the use and a quantity of times of the use, and optionally a record in which the first application uses a permission (also referred to as a second permission) that does not match a permission allowed to be granted to the first application in a preset rule.

For a specific process of triggering the electronic device <NUM> to display the permission access record of the first application, refer to the text descriptions of <FIG>, <FIG>, and <FIG>.

S1002: The electronic device <NUM> detects a permission optimization operation performed by the user.

For example, the permission optimization operation performed by the user includes a first operation and a second operation. The first operation is an operation performed by the user on an access record in which a privacy risk exists (for example, as shown in <FIG>, an operation performed by the user on the location permission access record <NUM>). The second operation is an operation performed by the user on the "immediate optimization" option <NUM> (also referred to as a first option) displayed on the pop-up interface <NUM> (also referred to as a first window) shown in <FIG>.

For specific content, refer to the text descriptions of <FIG> and <FIG>.

The permission optimization operations mentioned above are not limited to interaction forms shown in <FIG> and <FIG>, and may further be another interaction form, such as a voice instruction or a gesture.

S1003: The electronic device <NUM> performs permission optimization on the first application.

For example, after detecting the permission optimization operation of the user, the electronic device <NUM> performs permission optimization on the first application. Specifically, the electronic device <NUM> allows the first application to use a permission corresponding to a specific function only when the specific function of the first application is enabled. The electronic device <NUM> prohibits the first application from using a permission that does not match a permission allowed to be granted to the first application in a preset rule.

It can be learned that the permission optimization method provided in <FIG> can enable the electronic device <NUM> to perform permission optimization, thereby reducing user privacy disclosure and improving user experience.

<FIG> shows an example of a procedure of another permission optimization method according to an embodiment of this application.

The method may include the following steps.

S1101: The electronic device <NUM> displays abnormal use records of a first permission and over-authorization records of one or more applications.

For example, the abnormal use record of the first permission may be an abnormal use record of the location permission (that is, the location permission information option <NUM>) shown in <FIG>, and the over-authorization record may be an over-authorization record (that is, the over-authorization option <NUM>) shown in <FIG>.

The abnormal use record of the first permission is merely used as an example of the abnormal use record of the location permission, which does not constitute a limitation. The abnormal use record of the first permission may further be an abnormal access record of another permission (for example, a camera permission or an address book permission).

The abnormal use record of the first permission includes a record in which the first permission has been used by the one or more applications when a specific function of the one or more applications has been disabled and the abnormal use record displays that privacy information has been continuously obtained by the use.

The first permission is a permission corresponding to the specific function. The over-authorization record includes a record in which the one or more applications are granted a second permission. The second permission is not a permission allowed to be granted to the one or more applications (that is, the second permission is a permission that does not match a permission allowed to be granted to an application in a preset rule).

S1102: The electronic device <NUM> detects a permission optimization operation performed by the user.

In a possible implementation, the permission optimization operation performed by the user may be an operation performed by the user on the "one-tap optimization" option <NUM> (also referred to as a fourth option) shown in <FIG>.

In another possible implementation, the permission optimization operation performed by the user may include a third operation and a fourth operation. The third operation may include an operation performed by the user on the abnormal use record of the first permission (for example, an operation performed by the user on the location permission information option <NUM> shown in <FIG>) and an operation performed by the user for modifying the first permission. For the operation performed by the user for modifying the first permission, refer to text descriptions of <FIG>. The fourth operation may include an operation performed by the user on the over-authorization record (for example, an operation performed by the user on the over-authorization option <NUM> shown in <FIG>) and an operation performed by the user for modifying the second permission. For the operation performed by the user for modifying the second permission, refer to text descriptions of <FIG>.

The permission optimization operations mentioned above are not limited to interaction forms shown in <FIG>, <FIG>, and <FIG>, and may further be another interaction form, such as a voice instruction or a gesture.

S1103: The electronic device <NUM> performs permission optimization on the one or more applications.

For example, after detecting the permission optimization operation of the user, the electronic device <NUM> may perform permission optimization on the one or more applications. Specifically, the electronic device <NUM> allows the one or more applications to use the first permission only when a specific function of the one or more applications is enabled. The electronic device <NUM> prohibits the one or more applications from using the second permission.

In this embodiment of this application, the first user interface may be the user interface shown in <FIG>; the second option may be the all-privacy access record option shown in <FIG>; the second user interface may be the user interface shown in <FIG>, <FIG>, or <FIG>; the third user interface may be the user interface shown in <FIG>; the third option may be the drop-down option <NUM>; the first prompt information may be the security prompt information displayed on the pop-up interface <NUM>; the fourth user interface may be the user interface shown in <FIG>; and the second prompt information may be the icon <NUM> shown in <FIG>.

The foregoing embodiments may be completely or partially implemented by using software, hardware, firmware, or any combination thereof. When software is used to implement the embodiments, the embodiments may be implemented completely or partially in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or some of the procedures or functions according to the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or another programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired (such as a coaxial cable, an optical fiber, or a digital subscriber line) manner or a wireless (such as infrared, wireless, or microwave) manner. The computer-readable storage medium may be any available medium accessible by a computer or a data storage device such as a server or a data center that integrates one or more available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), a semiconductor medium (such as a solid state disk (solid state disk, SSD)), or the like.

Persons of ordinary skill in the art may understand that all or some of the procedures in the methods in the foregoing embodiments are implemented, and the procedures may be implemented by a computer program instructing related hardware. The program may be stored in a computer-readable storage medium. When the program is executed, the procedures in the methods in the foregoing embodiments may be included. The foregoing storage medium includes various media that can store program code, such as a ROM or a random-access memory RAM, and a magnetic disk or a compact disc.

Claim 1:
A permission optimization method, applied to an electronic device, wherein the method comprises:
displaying (S1001), by the electronic device, a first permission access record interface (<NUM>), wherein the first permission access record interface comprises a first permission access record (<NUM>) of a first application, the first permission access record comprises an access record in which a privacy risk exists, and the access record in which a privacy risk exists comprises a record in which a first permission has been used by the first application when a specific function of the first application has been disabled and the access record displays a time point of the use and a quantity of times of the use;
detecting (S1002), by the electronic device, an operation performed by the user on the first permission access record of the first permission access record interface, and displaying a first pop-up interface (<NUM>), wherein the first pop-up interface comprises prompt information and a permission optimization option, and the prompt information is used to remind the user that a risk exists in the first permission of the first application and advise the user to perform permission optimization;
detecting (S1002), by the electronic device, a permission optimization operation performed by the user on the permission optimization option, wherein the electronic device performs the following operation:
allowing (S1003) the first application to use the first permission only when the specific function is enabled;
displaying, by the electronic device, a second permission access record interface (<NUM>), wherein the second permission access record interface comprises a first permission access record (<NUM>) obtained after the permission optimization operation is performed, the first permission access record comprises an access record in which no privacy risk exists, and the second permission access record interface is different from the first permission access record interface; and
detecting, by the electronic device, an operation performed by the user on the first permission access record of the second permission access record interface, and displaying a second pop-up interface (<NUM>), wherein the second pop-up interface is different from the first pop-up interface.