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

Commit e5505352 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: df4836a4

Change-Id: I37ae772aa43a1856f82e32e74fa5baafb3f9b66d
parents 3601d3f5 df4836a4
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);
        }
    }