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

Commit c3167a1b 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

Change-Id: If8bf9511f64776066288aecde046fb23e5f99519
parents 2a3a5f3d cf463af8
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);
        }
    }