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

Commit 95d6c3a4 authored by Raj Yengisetty's avatar Raj Yengisetty Committed by Matt Garnes
Browse files

Protected Apps: do not filter components from the same UID

Change-Id: Ia4f46b5295d97b2f297ba9a5d37e66728659ea0e
(cherry picked from commit c1bac80a)
(cherry picked from commit 87317407)
parent 89b2d4f4
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -7289,11 +7289,14 @@ public class PackageManagerService extends IPackageManager.Stub {
                    (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId);
            // Remove protected Application components
            int callingUid = Binder.getCallingUid();
            List<String> packages = Arrays.asList(getPackagesForUid(callingUid));
            if (callingUid != Process.SYSTEM_UID &&
                    (getFlagsForUid(callingUid) & ApplicationInfo.FLAG_SYSTEM) == 0) {
               Iterator<ResolveInfo> itr = list.iterator();
                while (itr.hasNext()) {
                    if (itr.next().activityInfo.applicationInfo.protect) {
                    ActivityInfo activityInfo = itr.next().activityInfo;
                    if (activityInfo.applicationInfo.protect && (packages == null
                            || !packages.contains(activityInfo.packageName))) {
                        itr.remove();
                    }
                }