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

Commit f7b09eb5 authored by Brint E. Kriebel's avatar Brint E. Kriebel
Browse files

Revert "Add support for allow-permission extension."

This is not currently in use and can be replaced by a better solution.

This reverts commit 33110a0b.

Change-Id: I672381398c8d09275226a0ef4ead408e2ccbd040
parent 49cd14cc
Loading
Loading
Loading
Loading
+1 −25
Original line number Diff line number Diff line
@@ -450,8 +450,6 @@ public class PackageManagerService extends IPackageManager.Stub {
    final ActivityIntentResolver mReceivers =
            new ActivityIntentResolver();
    final HashSet<String> mAllowances = new HashSet<String>();
    // All available services, for your resolving pleasure.
    final ServiceIntentResolver mServices = new ServiceIntentResolver();
@@ -1834,26 +1832,6 @@ public class PackageManagerService extends IPackageManager.Stub {
                    perms.add(perm);
                    XmlUtils.skipCurrentTag(parser);
                } else if ("allow-permission".equals(name)) {
                    String perm = parser.getAttributeValue(null, "name");
                    if (perm == null) {
                        Slog.w(TAG,
                                "<allow-permission> without name at "
                                        + parser.getPositionDescription());
                        XmlUtils.skipCurrentTag(parser);
                        continue;
                    }
                    String sharedUserId = parser.getAttributeValue(null, "sharedUserId");
                    if (sharedUserId == null) {
                        Slog.w(TAG,
                                "<allow-permission> without uid at "
                                        + parser.getPositionDescription());
                        XmlUtils.skipCurrentTag(parser);
                        continue;
                    }
                    mAllowances.add(sharedUserId + ":" + perm);
                    XmlUtils.skipCurrentTag(parser);
                } else if ("library".equals(name)) {
                    String lname = parser.getAttributeValue(null, "name");
                    String lfile = parser.getAttributeValue(null, "file");
@@ -6384,9 +6362,7 @@ public class PackageManagerService extends IPackageManager.Stub {
                bp.packageSetting.signatures.mSignatures, pkg.mSignatures)
                        == PackageManager.SIGNATURE_MATCH)
                || (compareSignatures(mPlatformPackage.mSignatures, pkg.mSignatures)
                        == PackageManager.SIGNATURE_MATCH)
                || (pkg.mSharedUserId != null
                        && mAllowances.contains(pkg.mSharedUserId + ":" + perm));
                        == PackageManager.SIGNATURE_MATCH);
        if (!allowed && (bp.protectionLevel
                & PermissionInfo.PROTECTION_FLAG_SYSTEM) != 0) {
            if (isSystemApp(pkg)) {