Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a8c1351 authored by Nick Kralevich's avatar Nick Kralevich
Browse files

AppSecurityPermissions: Add isGranted to isDisplayablePermission

Modify isDisplayablePermission to display a permission if the
app update will grant a new optional permission to the app.

Change-Id: Ic647826b0c48f9f7ec8e4f69b90197211f83278d
parent a5043ed7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -515,10 +515,12 @@ public class AppSecurityPermissions {
                ((pInfo.protectionLevel&PermissionInfo.PROTECTION_FLAG_DEVELOPMENT) != 0);
        final boolean wasGranted =
                ((existingReqFlags&PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0);
        final boolean isGranted =
                ((newReqFlags&PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0);

        // Dangerous and normal permissions are always shown to the user if the permission
        // is required, or it was previously granted
        if ((isNormal || isDangerous) && (isRequired || wasGranted)) {
        if ((isNormal || isDangerous) && (isRequired || wasGranted || isGranted)) {
            return true;
        }