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

Commit d78eef86 authored by George Chan's avatar George Chan Committed by Android (Google) Code Review
Browse files

Merge "Added a GTS test flag for BICS." into main

parents 5e6386a3 08747156
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -390,10 +390,11 @@ public class BackgroundInstallControlService extends SystemService {
                .max(Comparator.comparingLong(PackageInstaller.SessionInfo::getCreatedMillis));
    }

    // ADB sets installerPackageName to null, this creates a loophole to bypass BIC which will be
    // addressed with b/265203007
    private boolean installedByAdb(String initiatingPackageName) {
        if(PackageManagerServiceUtils.isInstalledByAdb(initiatingPackageName)) {
        // GTS tests needs to adopt shell identity to install apps.
        if(!SystemProperties.get("gts.transparency.bg-install-apps").isEmpty()) {
            Slog.d(TAG, "handlePackageAdd: is GTS tests, skipping ADB check");
        } else if(PackageManagerServiceUtils.isInstalledByAdb(initiatingPackageName)) {
            Slog.d(TAG, "handlePackageAdd: is installed by ADB, skipping");
            return true;
        }