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

Commit 08747156 authored by George Chan's avatar George Chan
Browse files

Added a GTS test flag for BICS.

Normally, we do not want to include apps installed by ADB, but because GTS host tests needs to assume shell identity to install packages, we need to create a check for GTS conditions to include ADB installed apps.

Change-Id: Iaad0ed4ef5f8640bbed21d48e23503d22cfd953a
Test: atest
Bug: 394380792, 395178773
Flag: EXEMPT test fix
parent b86c4a61
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;
        }