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

Commit df4836a4 authored by Songchun Fan's avatar Songchun Fan Committed by Automerger Merge Worker
Browse files

[pm/metrics] do not log package name for adb installations am: cf463af8 am: 9f67ba19

Change-Id: I6ac34c9802472c8a6013d1ed914e0721b2b4b879
parents 6ff3e3b2 9f67ba19
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1847,11 +1847,16 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
        }
    }

    private void logDataLoaderInstallationSession(int returnCode, String extraMessage) {
    private void logDataLoaderInstallationSession(int returnCode) {
        // Skip logging the side-loaded app installations, as those are private and aren't reported
        // anywhere; app stores already have a record of the installation and that's why reporting
        // it here is fine
        final String packageNameToLog =
                (params.installFlags & PackageManager.INSTALL_FROM_ADB) == 0 ? mPackageName : "";
        final long currentTimestamp = System.currentTimeMillis();
        FrameworkStatsLog.write(FrameworkStatsLog.PACKAGE_INSTALLER_V2_REPORTED,
                isIncrementalInstallation(),
                mPackageName,
                packageNameToLog,
                currentTimestamp - createdMillis,
                returnCode);
    }
@@ -2879,7 +2884,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {

        mCallback.onSessionFinished(this, success);
        if (isDataLoaderInstallation()) {
            logDataLoaderInstallationSession(returnCode, msg);
            logDataLoaderInstallationSession(returnCode);
        }
    }