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

Commit 84e35b60 authored by Koushik Dutta's avatar Koushik Dutta
Browse files

FIx up analytics results by normalizing the version by stripping the device...

FIx up analytics results by normalizing the version by stripping the device info, which is redundant.

Change-Id: If4fc97c28fff6a82206a5491c256b05444da1a34
parent d47add2a
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -80,6 +80,19 @@ public class ReportingService extends Service {
        GoogleAnalytics ga = GoogleAnalytics.getInstance(this);
        Tracker tracker = ga.getTracker(getString(R.string.ga_trackingId));
        tracker.sendEvent(deviceName, deviceVersion, deviceCountry, null);
        // this really should be set at build time...
        // format of version should be:
        // version[-date-type]-device
        String[] parts = deviceVersion.split("-");
        String deviceVersionNoDevice = null;
        if (parts.length == 2) {
            deviceVersionNoDevice = parts[0];
        }
        else if (parts.length == 4) {
            deviceVersionNoDevice = parts[0] + "-" + parts[2];
        }
        if (deviceVersionNoDevice != null)
            tracker.sendEvent("checkin", deviceName, deviceVersionNoDevice, null);
        tracker.close();

        // report to the cmstats service