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:
authorАлександр Зацепин <az@mapswithme.com>2017-07-16 15:58:09 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2017-07-17 10:54:35 +0300
commit66e3f3110fcb4955c64f6ab3a6a33b9499855b81 (patch)
tree8528d72dd965776cc668b7155cce93ea64e45f90
parenta0cc6ebad1baafd5324b88836678ed7adf38d626 (diff)
[android] Added logging of all entry points to the appbeta-910
-rw-r--r--android/src/com/mapswithme/maps/background/ConnectivityChangedReceiver.java11
-rw-r--r--android/src/com/mapswithme/maps/background/UpgradeReceiver.java12
-rw-r--r--android/src/com/mapswithme/maps/background/WorkerService.java11
-rw-r--r--android/src/com/mapswithme/maps/location/GPSCheck.java9
-rw-r--r--android/src/com/mapswithme/maps/location/TrackRecorderWakeReceiver.java13
-rw-r--r--android/src/com/mapswithme/maps/location/TrackRecorderWakeService.java7
-rw-r--r--android/src/com/mapswithme/util/MultipleTrackerReferrerReceiver.java13
7 files changed, 73 insertions, 3 deletions
diff --git a/android/src/com/mapswithme/maps/background/ConnectivityChangedReceiver.java b/android/src/com/mapswithme/maps/background/ConnectivityChangedReceiver.java
index 547516a353..b0d4a0664a 100644
--- a/android/src/com/mapswithme/maps/background/ConnectivityChangedReceiver.java
+++ b/android/src/com/mapswithme/maps/background/ConnectivityChangedReceiver.java
@@ -3,22 +3,33 @@ package com.mapswithme.maps.background;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
+import android.util.Log;
+import com.crashlytics.android.Crashlytics;
import com.mapswithme.maps.MwmApplication;
import com.mapswithme.maps.downloader.MapManager;
import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.PermissionsUtils;
+import com.mapswithme.util.log.Logger;
+import com.mapswithme.util.log.LoggerFactory;
+import static com.mapswithme.maps.MwmApplication.backgroundTracker;
import static com.mapswithme.maps.MwmApplication.prefs;
public class ConnectivityChangedReceiver extends BroadcastReceiver
{
+ private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
+ private static final String TAG = ConnectivityChangedReceiver.class.getSimpleName();
private static final String DOWNLOAD_UPDATE_TIMESTAMP = "DownloadOrUpdateTimestamp";
private static final long MIN_EVENT_DELTA_MILLIS = 3 * 60 * 60 * 1000; // 3 hours
@Override
public void onReceive(Context context, Intent intent)
{
+ String msg = "onReceive: " + intent + " app in background = "
+ + !backgroundTracker().isForeground();
+ LOGGER.i(TAG, msg);
+ Crashlytics.log(Log.INFO, TAG, msg);
if (!PermissionsUtils.isExternalStorageGranted())
return;
diff --git a/android/src/com/mapswithme/maps/background/UpgradeReceiver.java b/android/src/com/mapswithme/maps/background/UpgradeReceiver.java
index 3a72250e53..35e332cf53 100644
--- a/android/src/com/mapswithme/maps/background/UpgradeReceiver.java
+++ b/android/src/com/mapswithme/maps/background/UpgradeReceiver.java
@@ -3,14 +3,26 @@ package com.mapswithme.maps.background;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
+import android.util.Log;
+import com.crashlytics.android.Crashlytics;
import com.mapswithme.maps.MwmApplication;
+import com.mapswithme.util.log.Logger;
+import com.mapswithme.util.log.LoggerFactory;
+
+import static com.mapswithme.maps.MwmApplication.backgroundTracker;
public class UpgradeReceiver extends BroadcastReceiver
{
+ private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
+ private static final String TAG = UpgradeReceiver.class.getSimpleName();
@Override
public void onReceive(Context context, Intent intent)
{
+ String msg = "onReceive: " + intent + " app in background = "
+ + !backgroundTracker().isForeground();
+ LOGGER.i(TAG, msg);
+ Crashlytics.log(Log.INFO, TAG, msg);
MwmApplication.onUpgrade();
}
}
diff --git a/android/src/com/mapswithme/maps/background/WorkerService.java b/android/src/com/mapswithme/maps/background/WorkerService.java
index cdea7bf072..43d6ca4bb0 100644
--- a/android/src/com/mapswithme/maps/background/WorkerService.java
+++ b/android/src/com/mapswithme/maps/background/WorkerService.java
@@ -6,7 +6,9 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.location.Location;
import android.text.TextUtils;
+import android.util.Log;
+import com.crashlytics.android.Crashlytics;
import com.mapswithme.maps.MwmApplication;
import com.mapswithme.maps.R;
import com.mapswithme.maps.downloader.CountryItem;
@@ -15,11 +17,15 @@ import com.mapswithme.maps.editor.Editor;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.util.PermissionsUtils;
import com.mapswithme.util.concurrency.UiThread;
+import com.mapswithme.util.log.Logger;
+import com.mapswithme.util.log.LoggerFactory;
import java.util.concurrent.CountDownLatch;
public class WorkerService extends IntentService
{
+ private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
+ private static final String TAG = WorkerService.class.getSimpleName();
private static final String ACTION_CHECK_LOCATIION = "com.mapswithme.maps.action.check_location";
private static final String ACTION_UPLOAD_OSM_CHANGES = "com.mapswithme.maps.action.upload_osm_changes";
@@ -56,8 +62,11 @@ public class WorkerService extends IntentService
{
if (intent != null)
{
+ String msg = "onHandleIntent: " + intent + " app in background = "
+ + !MwmApplication.backgroundTracker().isForeground();
+ LOGGER.i(TAG, msg);
+ Crashlytics.log(Log.INFO, TAG, msg);
final String action = intent.getAction();
-
switch (action)
{
case ACTION_CHECK_LOCATIION:
diff --git a/android/src/com/mapswithme/maps/location/GPSCheck.java b/android/src/com/mapswithme/maps/location/GPSCheck.java
index f3a9c9e2b3..233fe9b9a8 100644
--- a/android/src/com/mapswithme/maps/location/GPSCheck.java
+++ b/android/src/com/mapswithme/maps/location/GPSCheck.java
@@ -5,11 +5,20 @@ import android.content.Context;
import android.content.Intent;
import com.mapswithme.maps.MwmApplication;
+import com.mapswithme.util.log.Logger;
+import com.mapswithme.util.log.LoggerFactory;
+
+import static com.mapswithme.maps.MwmApplication.backgroundTracker;
public class GPSCheck extends BroadcastReceiver
{
+ private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.LOCATION);
+ private static final String TAG = GPSCheck.class.getSimpleName();
@Override
public void onReceive(Context context, Intent intent) {
+ String msg = "onReceive: " + intent + " app in background = "
+ + !backgroundTracker().isForeground();
+ LOGGER.i(TAG, msg);
if (MwmApplication.get().arePlatformAndCoreInitialized() && MwmApplication.backgroundTracker().isForeground())
{
LocationHelper.INSTANCE.restart();
diff --git a/android/src/com/mapswithme/maps/location/TrackRecorderWakeReceiver.java b/android/src/com/mapswithme/maps/location/TrackRecorderWakeReceiver.java
index ced9ab0614..d14907925a 100644
--- a/android/src/com/mapswithme/maps/location/TrackRecorderWakeReceiver.java
+++ b/android/src/com/mapswithme/maps/location/TrackRecorderWakeReceiver.java
@@ -3,12 +3,25 @@ package com.mapswithme.maps.location;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
+import android.util.Log;
+
+import com.crashlytics.android.Crashlytics;
+import com.mapswithme.util.log.Logger;
+import com.mapswithme.util.log.LoggerFactory;
+
+import static com.mapswithme.maps.MwmApplication.backgroundTracker;
public class TrackRecorderWakeReceiver extends BroadcastReceiver
{
+ private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
+ private static final String TAG = TrackRecorderWakeReceiver.class.getSimpleName();
@Override
public void onReceive(Context context, Intent intent)
{
+ String msg = "onReceive: " + intent + " app in background = "
+ + !backgroundTracker().isForeground();
+ LOGGER.i(TAG, msg);
+ Crashlytics.log(Log.INFO, TAG, msg);
TrackRecorder.onWakeAlarm();
}
}
diff --git a/android/src/com/mapswithme/maps/location/TrackRecorderWakeService.java b/android/src/com/mapswithme/maps/location/TrackRecorderWakeService.java
index a9330d42d5..b2db3b56e1 100644
--- a/android/src/com/mapswithme/maps/location/TrackRecorderWakeService.java
+++ b/android/src/com/mapswithme/maps/location/TrackRecorderWakeService.java
@@ -3,10 +3,12 @@ package com.mapswithme.maps.location;
import android.app.IntentService;
import android.content.Intent;
import android.support.v4.content.WakefulBroadcastReceiver;
+import android.util.Log;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
+import com.crashlytics.android.Crashlytics;
import com.mapswithme.maps.MwmApplication;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
@@ -27,7 +29,10 @@ public class TrackRecorderWakeService extends IntentService
@Override
protected final void onHandleIntent(Intent intent)
{
- LOGGER.d(TAG, "SVC.onHandleIntent()");
+ String msg = "onHandleIntent: " + intent + " app in background = "
+ + !MwmApplication.backgroundTracker().isForeground();
+ LOGGER.i(TAG, msg);
+ Crashlytics.log(Log.INFO, TAG, msg);
synchronized (sLock)
{
diff --git a/android/src/com/mapswithme/util/MultipleTrackerReferrerReceiver.java b/android/src/com/mapswithme/util/MultipleTrackerReferrerReceiver.java
index 17c62ecf33..f72af4a876 100644
--- a/android/src/com/mapswithme/util/MultipleTrackerReferrerReceiver.java
+++ b/android/src/com/mapswithme/util/MultipleTrackerReferrerReceiver.java
@@ -3,19 +3,30 @@ package com.mapswithme.util;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
+import android.util.Log;
-import com.mapswithme.maps.MwmApplication;
+import com.crashlytics.android.Crashlytics;
+import com.mapswithme.util.log.Logger;
+import com.mapswithme.util.log.LoggerFactory;
import com.mapswithme.util.statistics.AlohaHelper;
import com.my.tracker.campaign.CampaignReceiver;
+import static com.mapswithme.maps.MwmApplication.backgroundTracker;
+
/**
* Custom broadcast receiver to send intent to MyTracker & Alohalytics at the same time
*/
public class MultipleTrackerReferrerReceiver extends BroadcastReceiver
{
+ private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
+ private static final String TAG = MultipleTrackerReferrerReceiver.class.getSimpleName();
@Override
public void onReceive(Context context, Intent intent)
{
+ String msg = "onReceive: " + intent + " app in background = "
+ + !backgroundTracker().isForeground();
+ LOGGER.i(TAG, msg);
+ Crashlytics.log(Log.INFO, TAG, msg);
Counters.initCounters(context);
// parse & send referrer to Aloha
try