Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <alex@maps.me>2015-07-27 21:12:33 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:57:52 +0300
commitf51f0749915a8dc6f95a421da295ea643ffc0026 (patch)
tree10d7c9e5ebbaf2fb4903559eadab29a18918a69d /map/framework.cpp
parent17c5cb89cde15a3940656cddc2967025abe343f6 (diff)
Log zoom level and map coordinate when user finishes it’s usage.
Diffstat (limited to 'map/framework.cpp')
-rw-r--r--map/framework.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/map/framework.cpp b/map/framework.cpp
index a02b4e3fd0..8f4b336348 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -1016,8 +1016,14 @@ void Framework::MemoryWarning()
void Framework::EnterBackground()
{
+ const ms::LatLon ll = MercatorBounds::ToLatLon(GetViewportCenter());
+ alohalytics::Stats::Instance().LogEvent("Framework::EnterBackground", {{"zoom", strings::to_string(GetDrawScale())},
+ {"foregroundSeconds", strings::to_string(
+ static_cast<int>(my::Timer::LocalTime() - m_startForegroundTime))}},
+ alohalytics::Location::FromLatLon(ll.lat, ll.lon));
// Do not clear caches for Android. This function is called when main activity is paused,
// but at the same time search activity (for example) is enabled.
+ // TODO(AlexZ): Use onStart/onStop on Android to correctly detect app background and remove #ifndef.
#ifndef OMIM_OS_ANDROID
ClearAllCaches();
#endif
@@ -1025,7 +1031,7 @@ void Framework::EnterBackground()
void Framework::EnterForeground()
{
- m_StartForegroundTime = my::Timer::LocalTime();
+ m_startForegroundTime = my::Timer::LocalTime();
}
void Framework::ShowAll()