diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java index 5bdc9d821e7c4..b19ed167244ba 100644 --- a/services/core/java/com/android/server/pm/ComputerEngine.java +++ b/services/core/java/com/android/server/pm/ComputerEngine.java @@ -4453,13 +4453,11 @@ public class ComputerEngine implements Computer { if (p == null) { return false; } - final PackageStateInternal ps = getPackageStateInternal(p.getPackageName()); - if (ps == null) { - return false; - } final int callingUid = Binder.getCallingUid(); final int callingUserId = UserHandle.getUserId(callingUid); - if (shouldFilterApplication(ps, callingUid, callingUserId)) { + final PackageStateInternal ps = getPackageStateInternal(p.getPackageName()); + if (ps == null + || shouldFilterApplicationIncludingUninstalled(ps, callingUid, callingUserId)) { return false; } switch (type) {