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

Commit 60a46f95 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:...

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

Change-Id: I6912b65ae72bd55265b2732cc52ec6cdaf51017f
parents 3a7f16b1 fe500a5c
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1849,11 +1849,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);
    }
@@ -2885,7 +2890,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {

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