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

Commit d2c348e3 authored by Svet Ganov's avatar Svet Ganov Committed by Svetoslav Ganov
Browse files

Requested unused permissions reported as granted for app using none.

If the app uses no permissions and requested a runtime permission,
the latter is reported granted while it is correctly not granted.
Now we initialize everything as denied in case we exit eraly as
the app does not use any permissions.

bug:30747277

Change-Id: I08dbf086e7c3d5f66b6831c54910fbb4f0943388
parent 8fdd3b31
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import com.android.packageinstaller.permission.ui.handheld.GrantPermissionsViewH
import com.android.packageinstaller.permission.utils.SafetyNetLogger;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;

@@ -92,6 +93,7 @@ public class GrantPermissionsActivity extends OverlayTouchActivity

        final int requestedPermCount = mRequestedPermissions.length;
        mGrantResults = new int[requestedPermCount];
        Arrays.fill(mGrantResults, PackageManager.PERMISSION_DENIED);

        if (requestedPermCount == 0) {
            setResultAndFinish();