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

Commit 1a5203ea authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Filter non-exported components from activity start

This change filters non-exported components from resolveForStart queries
to avoid permission checks done as part of activity starts. Since these
components are not intended to be used by other apps, we'll hide them
at query time instead of adding complex enforcement at permission check
time.

Bug: 197945962
Test: atest AppEnumerationTests
Change-Id: Ib066a04ac30efa542e4efa62201d0937435e923c
parent 11d4dacf
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -540,8 +540,13 @@ public class ComputerEngine implements Computer {
                                && ((!matchInstantApp && !isCallerInstantApp && isTargetInstantApp)
                                || (matchVisibleToInstantAppOnly && isCallerInstantApp
                                && isTargetHiddenFromInstantApp));
                final boolean resolveForStartNonExported = resolveForStart
                                && !ai.exported
                                && !isCallerSameApp(pkgName, filterCallingUid);
                final boolean blockNormalResolution =
                        !resolveForStart && !isTargetInstantApp && !isCallerInstantApp
                        (!resolveForStart || resolveForStartNonExported)
                                && !isTargetInstantApp
                                && !isCallerInstantApp
                                && shouldFilterApplication(
                                getPackageStateInternal(ai.applicationInfo.packageName,
                                        Process.SYSTEM_UID), filterCallingUid, userId);