|
@@ -30,6 +30,7 @@ import android.location.Location;
|
30
|
30
|
import android.os.Handler;
|
31
|
31
|
import android.os.IBinder;
|
32
|
32
|
import android.util.Log;
|
|
33
|
+import com.flurry.android.FlurryAgent;
|
33
|
34
|
|
34
|
35
|
import java.io.IOException;
|
35
|
36
|
import java.util.Collection;
|
|
@@ -115,6 +116,8 @@ public class ContextAnalyserService extends Service {
|
115
|
116
|
names.putAll(dataHelper.getUnnamedLocations());
|
116
|
117
|
|
117
|
118
|
handler.postDelayed(scheduleRunnable, POLLING_DELAY);
|
|
119
|
+
|
|
120
|
+ FlurryAgent.onStartSession(this, "MKB8YES3C6CFB86PXYXK");
|
118
|
121
|
}
|
119
|
122
|
|
120
|
123
|
public void poll() {
|
|
@@ -219,6 +222,7 @@ public class ContextAnalyserService extends Service {
|
219
|
222
|
intent.putExtra("old", lastLocation == null ? -1 : lastLocation.getId());
|
220
|
223
|
intent.putExtra("new", location.getId());
|
221
|
224
|
sendBroadcast(intent, Manifest.permission.RECEIVE_UPDATES);
|
|
225
|
+ FlurryAgent.onEvent("broadcast_context_location");
|
222
|
226
|
}
|
223
|
227
|
|
224
|
228
|
activityLog.clear();
|
|
@@ -245,6 +249,7 @@ public class ContextAnalyserService extends Service {
|
245
|
249
|
intent.putExtra("old", lastActivity);
|
246
|
250
|
intent.putExtra("new", newActivity);
|
247
|
251
|
sendBroadcast(intent, Manifest.permission.RECEIVE_UPDATES);
|
|
252
|
+ FlurryAgent.onEvent("broadcast_activity");
|
248
|
253
|
|
249
|
254
|
lastActivity = newActivity;
|
250
|
255
|
}
|
|
@@ -299,6 +304,7 @@ public class ContextAnalyserService extends Service {
|
299
|
304
|
intent.putExtra("best_target", bestTarget);
|
300
|
305
|
intent.putExtra("best_probability", (float) best / total);
|
301
|
306
|
sendBroadcast(intent, Manifest.permission.RECEIVE_UPDATES);
|
|
307
|
+ FlurryAgent.onEvent("broadcast_prediction");
|
302
|
308
|
}
|
303
|
309
|
|
304
|
310
|
@Override
|
|
@@ -306,6 +312,7 @@ public class ContextAnalyserService extends Service {
|
306
|
312
|
super.onDestroy();
|
307
|
313
|
|
308
|
314
|
handler.removeCallbacks(scheduleRunnable);
|
|
315
|
+ FlurryAgent.onEndSession(this);
|
309
|
316
|
}
|
310
|
317
|
|
311
|
318
|
@Override
|