diff options
author | Roman Birg <roman@cyngn.com> | 2016-05-02 11:03:08 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-05-03 15:27:22 -0700 |
commit | 90106d85b75a60a8bdc9c4ad891e4a2e7ce548dd (patch) | |
tree | 9de7cbcf763ac13e28b24a413ea3b882e8864515 /src/com/android/launcher3/LauncherApplication.java | |
parent | 1daec9c7f02dad48039ea6999f3b50983f3b4617 (diff) | |
download | android_packages_apps_Trebuchet-90106d85b75a60a8bdc9c4ad891e4a2e7ce548dd.tar.gz android_packages_apps_Trebuchet-90106d85b75a60a8bdc9c4ad891e4a2e7ce548dd.tar.bz2 android_packages_apps_Trebuchet-90106d85b75a60a8bdc9c4ad891e4a2e7ce548dd.zip |
Trebuchet: send metrics directly when possible
Use the SDK directly instead of relying on an external package.
Still relies on C-Apps Core to send.
Reverts the revert and fixes the issue (missing aapt flag overlay)
This reverts commit d20f7796e45dcae0e619d3bb76a3a89674705702.
Ticket: CYNGNOS-2545
Change-Id: I9445cadc429c3158cabb6a7d07e016f6fe3dac19
Diffstat (limited to 'src/com/android/launcher3/LauncherApplication.java')
-rw-r--r-- | src/com/android/launcher3/LauncherApplication.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherApplication.java b/src/com/android/launcher3/LauncherApplication.java index 4bbcec073..896963e6d 100644 --- a/src/com/android/launcher3/LauncherApplication.java +++ b/src/com/android/launcher3/LauncherApplication.java @@ -20,10 +20,14 @@ import android.app.Application; import com.android.launcher3.stats.LauncherStats; import com.android.launcher3.stats.internal.service.AggregationIntentService; +import com.cyanogen.ambient.analytics.AnalyticsServices; +import com.cyanogen.ambient.analytics.Event; +import com.cyanogen.ambient.common.api.AmbientApiClient; public class LauncherApplication extends Application { private static LauncherStats sLauncherStats = null; + private AmbientApiClient mClient; /** * Get the reference handle for LauncherStats commands @@ -37,8 +41,18 @@ public class LauncherApplication extends Application { @Override public void onCreate() { super.onCreate(); + mClient = new AmbientApiClient.Builder(this) + .addApi(AnalyticsServices.API) + .build(); + mClient.connect(); sLauncherStats = LauncherStats.getInstance(this); AggregationIntentService.scheduleService(this); } + public void sendEvent(Event event) { + if (mClient.isConnected()) { + AnalyticsServices.AnalyticsApi.sendEvent(mClient, event); + } + } + } |