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:
authorDmitry Donskoy <donskdmitry@mail.ru>2018-09-26 13:23:27 +0300
committerAleksandr Zatsepin <alexzatsepin@users.noreply.github.com>2018-09-27 14:07:37 +0300
commit080cfc3771937db9e399cfcd798c548ff12e6893 (patch)
tree9b5ba0def4f56e73a3f26bca645e58aabe26754b
parent2d47039c1e2d3f390a0c03b0a6245ed0cd15a18b (diff)
[android] Added more information about exception, renamed old utils methods, removed unused classes, moved simple logger initialization
-rw-r--r--android/src/com/mapswithme/maps/ExternalLibrariesMediator.java5
-rw-r--r--android/src/com/mapswithme/maps/MwmApplication.java12
-rw-r--r--android/src/com/mapswithme/maps/analytics/EventLoggerProvider.java16
-rw-r--r--android/src/com/mapswithme/maps/analytics/FlurryEventLogger.java2
-rw-r--r--android/src/com/mapswithme/maps/analytics/LibnotifyEventLogger.java2
-rw-r--r--android/src/com/mapswithme/maps/analytics/MyTrackerEventLogger.java5
-rw-r--r--android/src/com/mapswithme/maps/analytics/PushWooshEventLogger.java2
-rw-r--r--android/src/com/mapswithme/maps/discovery/Locals.java4
-rw-r--r--android/src/com/mapswithme/maps/taxi/TaxiManager.java4
-rw-r--r--android/src/com/mapswithme/util/concurrency/UiThread.java4
10 files changed, 14 insertions, 42 deletions
diff --git a/android/src/com/mapswithme/maps/ExternalLibrariesMediator.java b/android/src/com/mapswithme/maps/ExternalLibrariesMediator.java
index 081a7e33bd..9d6c688d66 100644
--- a/android/src/com/mapswithme/maps/ExternalLibrariesMediator.java
+++ b/android/src/com/mapswithme/maps/ExternalLibrariesMediator.java
@@ -35,7 +35,6 @@ public class ExternalLibrariesMediator
@NonNull
private final Application mApplication;
-
@NonNull
private volatile EventLogger mEventLogger;
@@ -60,7 +59,7 @@ public class ExternalLibrariesMediator
private void initSensitiveEventLogger()
{
- if (com.mapswithme.util.concurrency.UiThread.isUiThreadNow())
+ if (com.mapswithme.util.concurrency.UiThread.isUiThread())
{
mEventLogger = new EventLoggerAggregator(mApplication);
mEventLogger.initialize();
@@ -164,7 +163,7 @@ public class ExternalLibrariesMediator
}
catch (GooglePlayServicesNotAvailableException | IOException | GooglePlayServicesRepairableException e)
{
- LOGGER.e(TAG, e.getMessage());
+ LOGGER.e(TAG, "Failed to obtain advertising id: ", e);
CrashlyticsUtils.logException(e);
return false;
}
diff --git a/android/src/com/mapswithme/maps/MwmApplication.java b/android/src/com/mapswithme/maps/MwmApplication.java
index d943ec06c0..1e4430f222 100644
--- a/android/src/com/mapswithme/maps/MwmApplication.java
+++ b/android/src/com/mapswithme/maps/MwmApplication.java
@@ -15,7 +15,6 @@ import com.mapswithme.maps.background.NotificationChannelFactory;
import com.mapswithme.maps.background.NotificationChannelProvider;
import com.mapswithme.maps.background.Notifier;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
-import com.mapswithme.maps.analytics.EventLoggerProvider;
import com.mapswithme.maps.downloader.CountryItem;
import com.mapswithme.maps.downloader.MapManager;
import com.mapswithme.maps.editor.Editor;
@@ -72,9 +71,6 @@ public class MwmApplication extends Application
@SuppressWarnings("NullableProblems")
@NonNull
private ExternalLibrariesMediator mMediator;
- @SuppressWarnings("NullableProblems")
- @NonNull
- private Statistics mStatistics;
@NonNull
public SubwayManager getSubwayManager()
@@ -274,7 +270,7 @@ public class MwmApplication extends Application
@SuppressWarnings("unused")
void sendPushWooshTags(String tag, String[] values)
{
- EventLoggerProvider.obtainLogger(this).sendTags(tag, values);
+ getMediator().getEventLogger().sendTags(tag, values);
}
@NonNull
@@ -309,12 +305,6 @@ public class MwmApplication extends Application
return mConnectivityListener;
}
- @NonNull
- public Statistics getStatistics()
- {
- return mStatistics;
- }
-
private native void nativeInitPlatform(String apkPath, String storagePath, String privatePath,
String tmpPath, String obbGooglePath, String flavorName,
String buildType, boolean isTablet);
diff --git a/android/src/com/mapswithme/maps/analytics/EventLoggerProvider.java b/android/src/com/mapswithme/maps/analytics/EventLoggerProvider.java
deleted file mode 100644
index 14af5392ae..0000000000
--- a/android/src/com/mapswithme/maps/analytics/EventLoggerProvider.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.mapswithme.maps.analytics;
-
-import android.app.Application;
-import android.support.annotation.NonNull;
-
-import com.mapswithme.maps.MwmApplication;
-
-public class EventLoggerProvider
-{
- @NonNull
- public static EventLogger obtainLogger(@NonNull Application application)
- {
- MwmApplication app = (MwmApplication) application;
- return app.getMediator().getEventLogger();
- }
-}
diff --git a/android/src/com/mapswithme/maps/analytics/FlurryEventLogger.java b/android/src/com/mapswithme/maps/analytics/FlurryEventLogger.java
index 6038326459..8a3f536d91 100644
--- a/android/src/com/mapswithme/maps/analytics/FlurryEventLogger.java
+++ b/android/src/com/mapswithme/maps/analytics/FlurryEventLogger.java
@@ -11,7 +11,7 @@ import com.mapswithme.maps.PrivateVariables;
import java.util.Map;
-public class FlurryEventLogger extends DefaultEventLogger
+class FlurryEventLogger extends DefaultEventLogger
{
FlurryEventLogger(@NonNull Application application)
{
diff --git a/android/src/com/mapswithme/maps/analytics/LibnotifyEventLogger.java b/android/src/com/mapswithme/maps/analytics/LibnotifyEventLogger.java
index ccb9db526c..ef83f8cb9d 100644
--- a/android/src/com/mapswithme/maps/analytics/LibnotifyEventLogger.java
+++ b/android/src/com/mapswithme/maps/analytics/LibnotifyEventLogger.java
@@ -15,7 +15,7 @@ import ru.mail.notify.core.api.NetworkSyncMode;
import java.util.Collections;
import java.util.Map;
-public class LibnotifyEventLogger extends DefaultEventLogger
+class LibnotifyEventLogger extends DefaultEventLogger
{
@SuppressWarnings("NullableProblems")
@NonNull
diff --git a/android/src/com/mapswithme/maps/analytics/MyTrackerEventLogger.java b/android/src/com/mapswithme/maps/analytics/MyTrackerEventLogger.java
index 3655847adf..162b07dd47 100644
--- a/android/src/com/mapswithme/maps/analytics/MyTrackerEventLogger.java
+++ b/android/src/com/mapswithme/maps/analytics/MyTrackerEventLogger.java
@@ -13,18 +13,17 @@ import com.my.tracker.MyTrackerParams;
import java.util.Map;
-public class MyTrackerEventLogger extends ContextDependentEventLogger
+class MyTrackerEventLogger extends ContextDependentEventLogger
{
MyTrackerEventLogger(@NonNull Application application)
{
super(application);
- initTracker();
}
@Override
public void initialize()
{
-
+ initTracker();
}
@Override
diff --git a/android/src/com/mapswithme/maps/analytics/PushWooshEventLogger.java b/android/src/com/mapswithme/maps/analytics/PushWooshEventLogger.java
index 5fbec2c60b..4ebb28c798 100644
--- a/android/src/com/mapswithme/maps/analytics/PushWooshEventLogger.java
+++ b/android/src/com/mapswithme/maps/analytics/PushWooshEventLogger.java
@@ -10,7 +10,7 @@ import com.mapswithme.util.log.LoggerFactory;
import com.mapswithme.util.statistics.PushwooshHelper;
import com.pushwoosh.Pushwoosh;
-public class PushWooshEventLogger extends DefaultEventLogger
+class PushWooshEventLogger extends DefaultEventLogger
{
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
private static final String PW_EMPTY_APP_ID = "XXXXX";
diff --git a/android/src/com/mapswithme/maps/discovery/Locals.java b/android/src/com/mapswithme/maps/discovery/Locals.java
index 0bccf95c9c..c7271cd2c5 100644
--- a/android/src/com/mapswithme/maps/discovery/Locals.java
+++ b/android/src/com/mapswithme/maps/discovery/Locals.java
@@ -28,7 +28,7 @@ final class Locals
@MainThread
void onLocalsReceived(@NonNull LocalExpert[] experts)
{
- if (!UiThread.isUiThreadNow())
+ if (!UiThread.isUiThread())
throw new AssertionError("Must be called from UI thread!");
if (mListener != null)
@@ -39,7 +39,7 @@ final class Locals
@MainThread
void onLocalsErrorReceived(@NonNull LocalsError error)
{
- if (!UiThread.isUiThreadNow())
+ if (!UiThread.isUiThread())
throw new AssertionError("Must be called from UI thread!");
if (mListener != null)
diff --git a/android/src/com/mapswithme/maps/taxi/TaxiManager.java b/android/src/com/mapswithme/maps/taxi/TaxiManager.java
index e4cd150091..84630fc085 100644
--- a/android/src/com/mapswithme/maps/taxi/TaxiManager.java
+++ b/android/src/com/mapswithme/maps/taxi/TaxiManager.java
@@ -39,7 +39,7 @@ public class TaxiManager
@MainThread
void onTaxiProvidersReceived(@NonNull TaxiInfo[] providers)
{
- if (!UiThread.isUiThreadNow())
+ if (!UiThread.isUiThread())
throw new AssertionError("Must be called from UI thread!");
if (providers.length == 0)
@@ -63,7 +63,7 @@ public class TaxiManager
@MainThread
void onTaxiErrorsReceived(@NonNull TaxiInfoError[] errors)
{
- if (!UiThread.isUiThreadNow())
+ if (!UiThread.isUiThread())
throw new AssertionError("Must be called from UI thread!");
if (errors.length == 0)
diff --git a/android/src/com/mapswithme/util/concurrency/UiThread.java b/android/src/com/mapswithme/util/concurrency/UiThread.java
index 564361c871..478b171fde 100644
--- a/android/src/com/mapswithme/util/concurrency/UiThread.java
+++ b/android/src/com/mapswithme/util/concurrency/UiThread.java
@@ -7,7 +7,7 @@ public class UiThread
{
private static final Handler sUiHandler = new Handler(Looper.getMainLooper());
- public static boolean isUiThreadNow()
+ public static boolean isUiThread()
{
return Looper.getMainLooper().getThread() == Thread.currentThread();
}
@@ -19,7 +19,7 @@ public class UiThread
*/
public static void run(Runnable task)
{
- if (isUiThreadNow())
+ if (isUiThread())
task.run();
else
sUiHandler.post(task);