[AND] Don't invoke trackers if has no GP.

This commit is contained in:
Dmitry Kunin 2013-11-15 17:00:20 +03:00 committed by Alex Zolotarev
parent e1f3b5289a
commit a3a1086fb7

View file

@ -318,20 +318,31 @@ public class MWMApplication extends android.app.Application implements MapStorag
{
FbUtil.activate(context);
trackInstallUpdate();
}
private void trackInstallUpdate()
{
//{@ TRACKERS
final boolean DEBUG = false;
final Logger logger = DEBUG ? SimpleLogger.get("MAT") : StubLogger.get();
if (!Utils.hasAnyGoogleStoreInstalled(this))
{
logger.d("SKIPPING TRACKERS, DOES NOT HAVE GP");
return;
}
final long DELTA = 60*1000;
final File mwmDir = new File(getDataStoragePath());
final boolean isNewUser = mwmDir.exists()
? (System.currentTimeMillis() - mwmDir.lastModified()) < DELTA
? (System.currentTimeMillis() - mwmDir.lastModified()) < DELTA
: true;
final String advId = getString(R.string.advertiser_id);
final String convKey = getString(R.string.conversion_key);
final boolean doTrack = !"FALSE".equalsIgnoreCase(advId);
if (doTrack)
{
@ -355,6 +366,5 @@ public class MWMApplication extends android.app.Application implements MapStorag
}
}
//{@ trackers
}
}