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

Commit 775b5ac6 authored by Xin Li's avatar Xin Li
Browse files

DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5713463) into stage-aosp-master

Bug: 134405016
Change-Id: I9ecb0b4c54759a6303711461aebb9d1fe2744e79
parents 7b5fb80a ddbe0492
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -231,8 +231,13 @@ public final class ReviewPermissionsFragment extends PreferenceFragmentCompat
        UserHandle user = UserHandle.getUserHandleForUid(pkg.applicationInfo.uid);

        for (String perm : pkg.requestedPermissions) {
            try {
                pm.updatePermissionFlags(perm, pkg.packageName, FLAG_PERMISSION_REVIEW_REQUIRED,
                        0, user);
            } catch (IllegalArgumentException e) {
                Log.e(LOG_TAG, "Cannot unmark " + perm + " requested by " + pkg.packageName
                        + " as review required", e);
            }
        }
    }

+8 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.packageinstaller.role.service;
import android.content.Context;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.os.Binder;
import android.provider.SearchIndexablesContract;
import android.util.ArrayMap;

@@ -50,9 +51,14 @@ public class RoleSearchIndexablesProvider extends BaseSearchIndexablesProvider {
        for (int i = 0; i < rolesSize; i++) {
            Role role = roles.valueAt(i);

            long token = Binder.clearCallingIdentity();
            try {
                if (!role.isAvailable(context) || !role.isVisible(context)) {
                    continue;
                }
            } finally {
                Binder.restoreCallingIdentity(token);
            }

            String label = context.getString(role.getLabelResource());
            boolean isExclusive = role.isExclusive();