diff options
author | Roman Birg <roman@cyngn.com> | 2016-04-22 11:59:14 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-04-29 16:31:59 -0700 |
commit | 097b9503f45ae2a50c501fa95d13776d656621bb (patch) | |
tree | 1351993bbcd65d10ab0901649d766fffa9b1ef9d /src/com/android/launcher3/LauncherApplication.java | |
parent | 4ed36691e3a76bf36903be270a5165cf3069dcac (diff) | |
download | android_packages_apps_Trebuchet-097b9503f45ae2a50c501fa95d13776d656621bb.tar.gz android_packages_apps_Trebuchet-097b9503f45ae2a50c501fa95d13776d656621bb.tar.bz2 android_packages_apps_Trebuchet-097b9503f45ae2a50c501fa95d13776d656621bb.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.
Ticket: CYNGNOS-2545
Change-Id: I1af8106917e77b9ba70c57f18f5894087fc2f274
Signed-off-by: Roman Birg <roman@cyngn.com>
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); + } + } + } |