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

Commit 6e783ad2 authored by Raj Yengisetty's avatar Raj Yengisetty
Browse files

Updating ActivityIntentResolver so that queryIntents doesn't return protected applications.

Any calls from System UID(1000) are not filtered

Change-Id: I037cddaf91b6943b8cc837c5b046cf320c4caa5f
parent 4d807141
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -6419,8 +6419,20 @@ public class PackageManagerService extends IPackageManager.Stub {
                int userId) {
            if (!sUserManager.exists(userId)) return null;
            mFlags = flags;
            return super.queryIntent(intent, resolvedType,
            List<ResolveInfo> list = super.queryIntent(intent, resolvedType,
                    (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId);
            // Remove protected Application components
            if (Binder.getCallingUid() != Process.SYSTEM_UID) {
                Iterator<ResolveInfo> itr = list.iterator();
                while (itr.hasNext()) {
                    if (itr.next().activityInfo.applicationInfo.protect) {
                        itr.remove();
                    }
                }
            }
            return list;
        }
        public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType,