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

Commit fa93339c authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Fix missing case to update permission group subtitle" into oc-dev

parents 74652cba dedcca44
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -316,20 +316,25 @@ public final class AllAppPermissionsFragment extends SettingsWithHeader {
                    // because another permission in the group is granted. This applies
                    // only to apps that support runtime permissions.
                    if (appPermissionGroup.doesSupportRuntimePermissions()) {
                        int grantedCount = 0;
                        String[] revokedPermissionsToFix = null;
                        final int permissionCount = appPermissionGroup.getPermissions().size();
                        for (int i = 0; i < permissionCount; i++) {
                            Permission current = appPermissionGroup.getPermissions().get(i);
                            if (!current.isGranted() && !current.isUserFixed()) {
                            if (!current.isGranted()) {
                                if (!current.isUserFixed()) {
                                    revokedPermissionsToFix = ArrayUtils.appendString(
                                            revokedPermissionsToFix, current.getName());
                                }
                            } else {
                                grantedCount++;
                            }
                        }
                        if (revokedPermissionsToFix != null) {
                            // If some permissions were not granted then they should be fixed.
                            appPermissionGroup.revokeRuntimePermissions(true,
                                    revokedPermissionsToFix);
                        } else {
                        } else if (appPermissionGroup.getPermissions().size() == grantedCount) {
                            // If all permissions are granted then they should not be fixed.
                            appPermissionGroup.grantRuntimePermissions(false);
                        }
+3 −2
Original line number Diff line number Diff line
@@ -321,11 +321,12 @@ public final class AppPermissionsFragment extends SettingsWithHeader
                        .setPositiveButton(R.string.grant_dialog_button_deny_anyway,
                                (DialogInterface dialog, int which) -> {
                            ((SwitchPreference) preference).setChecked(false);
                            if (preference instanceof MultiTargetSwitchPreference) {
                            group.revokeRuntimePermissions(false);
                            if (Utils.areGroupPermissionsIndividuallyControlled(getContext(),
                                    group.getName())) {
                                updateSummaryForIndividuallyControlledPermissionGroup(
                                        group, preference);
                            }
                            group.revokeRuntimePermissions(false);
                            if (!grantedByDefault) {
                                mHasConfirmedRevoke = true;
                            }