[android] Try to fix android stats for FB ads

This commit is contained in:
Alex Zolotarev 2014-08-03 14:57:05 +03:00 committed by Alex Zolotarev
parent 569c1463a9
commit 49b3fc5a1d
3 changed files with 4 additions and 26 deletions

View file

@ -343,7 +343,7 @@ public class DownloadResourcesActivity extends MapsWithMeBaseActivity
}
else
{
if (!MWMApplication.get().isYota() &&
if (!mApplication.isYota() &&
(getPackageIntent("com.mapswithme.maps") != null ||
getPackageIntent("com.mapswithme.maps.samsung") != null))
{
@ -368,7 +368,6 @@ public class DownloadResourcesActivity extends MapsWithMeBaseActivity
super.onCreate(savedInstanceState);
mApplication = (MWMApplication)getApplication();
mApplication.onMwmStart(this);
final boolean isPro = mApplication.isProVersion();
if (checkLiteProPackages(isPro))

View file

@ -649,6 +649,9 @@ public class MWMActivity extends NvEventQueueActivity
super.onCreate(savedInstanceState);
mApplication = (MWMApplication) getApplication();
// Log app start events - successful installation means that user has passed DownloadResourcesActivity
mApplication.onMwmStart(this);
// Do not turn off the screen while benchmarking
if (mApplication.nativeIsBenchmarking())
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

View file

@ -14,35 +14,11 @@ public class FbUtil
public static Logger mLogger = SimpleLogger.get("MWM_FB");
public final static String[] SUPPORTED_PACKAGES = {
"com.mapswithme.maps",
"com.mapswithme.maps.pro",
};
public static void activate(Context context)
{
if (!Statistics.INSTANCE.isStatisticsEnabled(context))
return;
final String thisPackageName = context.getPackageName();
boolean supported = false;
for (final String pkg : SUPPORTED_PACKAGES)
{
if (pkg.equals(thisPackageName))
{
supported = true;
break;
}
}
// do not try to activate if package is not registered in FB
if (!supported)
{
mLogger.d("SKIPPING ACTIVATION");
return;
}
mLogger.d("ACTIVATING");
AppEventsLogger.activateApp(context, context.getString(R.string.fb_app_id));
}