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

Commit 170208c1 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Android (Google) Code Review
Browse files

Merge "Update QAS to further restrict visibility." into main

parents 66b43763 ea10dcc5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -323,7 +323,7 @@ public abstract class Context {
            // Make sure no flag uses the sign bit (most significant bit) of the long integer,
            // to avoid future confusion.
            BIND_BYPASS_USER_NETWORK_RESTRICTIONS,
            BIND_FILTER_OUT_QUARANTINED_COMPONENTS,
            BIND_MATCH_QUARANTINED_COMPONENTS,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface BindServiceFlagsLongBits {}
@@ -703,7 +703,7 @@ public abstract class Context {
     *
     * @hide
     */
    public static final long BIND_FILTER_OUT_QUARANTINED_COMPONENTS = 0x2_0000_0000L;
    public static final long BIND_MATCH_QUARANTINED_COMPONENTS = 0x2_0000_0000L;


    /**
+3 −3
Original line number Diff line number Diff line
@@ -838,7 +838,7 @@ public abstract class PackageManager {
            GET_DISABLED_COMPONENTS,
            GET_DISABLED_UNTIL_USED_COMPONENTS,
            GET_UNINSTALLED_PACKAGES,
            FILTER_OUT_QUARANTINED_COMPONENTS,
            MATCH_QUARANTINED_COMPONENTS,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ComponentInfoFlagsBits {}
@@ -863,7 +863,7 @@ public abstract class PackageManager {
            GET_DISABLED_UNTIL_USED_COMPONENTS,
            GET_UNINSTALLED_PACKAGES,
            MATCH_CLONE_PROFILE,
            FILTER_OUT_QUARANTINED_COMPONENTS,
            MATCH_QUARANTINED_COMPONENTS,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ResolveInfoFlagsBits {}
@@ -1257,7 +1257,7 @@ public abstract class PackageManager {
    /**
     * @hide
     */
    public static final long FILTER_OUT_QUARANTINED_COMPONENTS = 0x100000000L;
    public static final long MATCH_QUARANTINED_COMPONENTS = 0x100000000L;

    /**
     * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when
+1 −1
Original line number Diff line number Diff line
@@ -5309,7 +5309,7 @@ public class AccountManagerService
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, "performing bindService to " + authenticatorInfo.componentName);
            }
            long flags = Context.BIND_FILTER_OUT_QUARANTINED_COMPONENTS | Context.BIND_AUTO_CREATE;
            long flags = Context.BIND_AUTO_CREATE;
            if (mAuthenticatorCache.getBindInstantServiceAllowed(mAccounts.userId)) {
                flags |= Context.BIND_ALLOW_INSTANT;
            }
+7 −7
Original line number Diff line number Diff line
@@ -3678,8 +3678,8 @@ public final class ActiveServices {
                || (flags & Context.BIND_EXTERNAL_SERVICE_LONG) != 0;
        final boolean allowInstant = (flags & Context.BIND_ALLOW_INSTANT) != 0;
        final boolean inSharedIsolatedProcess = (flags & Context.BIND_SHARED_ISOLATED_PROCESS) != 0;
        final boolean filterOutQuarantined =
                (flags & Context.BIND_FILTER_OUT_QUARANTINED_COMPONENTS) != 0;
        final boolean matchQuarantined =
                (flags & Context.BIND_MATCH_QUARANTINED_COMPONENTS) != 0;

        ProcessRecord attributedApp = null;
        if (sdkSandboxClientAppUid > 0) {
@@ -3689,7 +3689,7 @@ public final class ActiveServices {
                isSdkSandboxService, sdkSandboxClientAppUid, sdkSandboxClientAppPackage,
                resolvedType, callingPackage, callingPid, callingUid, userId, true, callerFg,
                isBindExternal, allowInstant, null /* fgsDelegateOptions */,
                inSharedIsolatedProcess, filterOutQuarantined);
                inSharedIsolatedProcess, matchQuarantined);
        if (res == null) {
            return 0;
        }
@@ -4202,7 +4202,7 @@ public final class ActiveServices {
                sdkSandboxClientAppUid, sdkSandboxClientAppPackage, resolvedType, callingPackage,
                callingPid, callingUid, userId, createIfNeeded, callingFromFg, isBindExternal,
                allowInstant, fgsDelegateOptions, inSharedIsolatedProcess,
                false /* filterOutQuarantined */);
                false /* matchQuarantined */);
    }

    private ServiceLookupResult retrieveServiceLocked(Intent service,
@@ -4211,7 +4211,7 @@ public final class ActiveServices {
            String callingPackage, int callingPid, int callingUid, int userId,
            boolean createIfNeeded, boolean callingFromFg, boolean isBindExternal,
            boolean allowInstant, ForegroundServiceDelegationOptions fgsDelegateOptions,
            boolean inSharedIsolatedProcess, boolean filterOutQuarantined) {
            boolean inSharedIsolatedProcess, boolean matchQuarantined) {
        if (isSdkSandboxService && instanceName == null) {
            throw new IllegalArgumentException("No instanceName provided for sdk sandbox process");
        }
@@ -4333,8 +4333,8 @@ public final class ActiveServices {
                if (allowInstant) {
                    flags |= PackageManager.MATCH_INSTANT;
                }
                if (filterOutQuarantined) {
                    flags |= PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
                if (matchQuarantined) {
                    flags |= PackageManager.MATCH_QUARANTINED_COMPONENTS;
                }
                // TODO: come back and remove this assumption to triage all services
                ResolveInfo rInfo = mAm.getPackageManagerInternal().resolveService(service,
+1 −3
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ import static android.app.ProcessMemoryState.HOSTING_COMPONENT_TYPE_INSTRUMENTAT
import static android.app.ProcessMemoryState.HOSTING_COMPONENT_TYPE_PERSISTENT;
import static android.app.ProcessMemoryState.HOSTING_COMPONENT_TYPE_SYSTEM;
import static android.content.pm.ApplicationInfo.HIDDEN_API_ENFORCEMENT_DEFAULT;
import static android.content.pm.PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
import static android.content.pm.PackageManager.GET_SHARED_LIBRARY_FILES;
import static android.content.pm.PackageManager.MATCH_ALL;
import static android.content.pm.PackageManager.MATCH_ANY_USER;
@@ -14295,8 +14294,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    private List<ResolveInfo> collectReceiverComponents(Intent intent, String resolvedType,
            int callingUid, int[] users, int[] broadcastAllowList) {
        // TODO: come back and remove this assumption to triage all broadcasts
        long pmFlags = STOCK_PM_FLAGS | MATCH_DEBUG_TRIAGED_MISSING
                | FILTER_OUT_QUARANTINED_COMPONENTS;
        long pmFlags = STOCK_PM_FLAGS | MATCH_DEBUG_TRIAGED_MISSING;
        List<ResolveInfo> receivers = null;
        HashSet<ComponentName> singleUserReceivers = null;
Loading