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

Commit d575aa55 authored by Evan Severson's avatar Evan Severson
Browse files

Unset UserFixed flag for BG location

When the user changes permission in settings the userfixed flag should
be unset for background. Also the one-time flag should never be set for
background permission.

Fixes: 151370689
Test: atest CtsPermission3TestCases
Change-Id: I185e3d36cca55aa1f4d74620582256233597eb6a
parent 48cfaff0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -431,9 +431,10 @@ class AppPermissionViewModel(
        var newGroup = group
        val oldGroup = group

        if (shouldRevokeBackground && group.hasBackgroundGroup && wasBackgroundGranted) {
        if (shouldRevokeBackground && group.hasBackgroundGroup &&
                (wasBackgroundGranted || group.background.isUserFixed)) {
            newGroup = KotlinUtils
                    .revokeBackgroundRuntimePermissions(app, newGroup, false, setOneTime)
                    .revokeBackgroundRuntimePermissions(app, newGroup)

            // only log if we have actually denied permissions, not if we switch from
            // "ask every time" to denied