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

Commit 602f11dd authored by George Chan's avatar George Chan
Browse files

Adding debugging log messages to help verify and track issues in test suite flakiness.

Change-Id: I883e9b22a035061b03b0b76ff09135a259ca0753
Test: atest
Bug: 373453341
Flag: EXEMPT log only update
parent 2e939dd6
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -265,6 +265,7 @@ public class BackgroundInstallControlService extends SystemService {

        @Override
        public void handleMessage(Message msg) {
            Slog.d(TAG, "Package event received: " + msg.what);
            switch (msg.what) {
                case MSG_USAGE_EVENT_RECEIVED:
                    mService.handleUsageEvent(
@@ -326,6 +327,8 @@ public class BackgroundInstallControlService extends SystemService {
            return;
        }

        Slog.d(TAG, "handlePackageAdd: adding " + packageName + " from "
            + userId + " and notifying callbacks");
        initBackgroundInstalledPackages();
        mBackgroundInstalledPackages.add(userId, packageName);
        mCallbackHelper.notifyAllCallbacks(userId, packageName, INSTALL_EVENT_TYPE_INSTALL);
@@ -364,7 +367,11 @@ public class BackgroundInstallControlService extends SystemService {
    // ADB sets installerPackageName to null, this creates a loophole to bypass BIC which will be
    // addressed with b/265203007
    private boolean installedByAdb(String initiatingPackageName) {
        return PackageManagerServiceUtils.isInstalledByAdb(initiatingPackageName);
        if(PackageManagerServiceUtils.isInstalledByAdb(initiatingPackageName)) {
            Slog.d(TAG, "handlePackageAdd: is installed by ADB, skipping");
            return true;
        }
        return false;
    }

    private boolean wasForegroundInstallation(
@@ -407,6 +414,7 @@ public class BackgroundInstallControlService extends SystemService {
        if (mBackgroundInstalledPackages.contains(userId, packageName)) {
            mCallbackHelper.notifyAllCallbacks(userId, packageName, INSTALL_EVENT_TYPE_UNINSTALL);
        }
        Slog.d(TAG, "handlePackageRemove: removing " + packageName + " from " + userId);
        mBackgroundInstalledPackages.remove(userId, packageName);
        writeBackgroundInstalledPackagesToDisk();
    }