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

Commit 00e8d59a authored by Patrick's avatar Patrick
Browse files

Honors MATCH_ALL flag

This makes the behavior of MATCH_ALL match the documentation by ignoring
all other match flags.

Change-Id: I8060cedd2144d0cdbc89d974f4d9f87b601d24e3
Fixes: 35176630
Test: disabled some components and ensured they are visible when querying with MATCH_ALL
parent 304fcaf7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
import static android.content.pm.PackageManager.MATCH_ALL;
import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_AWARE;
import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS;
@@ -125,6 +126,9 @@ public class PackageUserState {
     * </p>
     */
    public boolean isMatch(ComponentInfo componentInfo, int flags) {
        if ((flags & MATCH_ALL) != 0) {
            return true;
        }
        final boolean isSystemApp = componentInfo.applicationInfo.isSystemApp();
        final boolean matchUninstalled = (flags & PackageManager.MATCH_KNOWN_PACKAGES) != 0;
        if (!isAvailable(flags)