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

Commit c1bac80a authored by Raj Yengisetty's avatar Raj Yengisetty
Browse files

Protected Apps: do not filter components from the same UID

Change-Id: Ia4f46b5295d97b2f297ba9a5d37e66728659ea0e
parent 28a7beae
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -7984,11 +7984,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();
                    }
                }