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-05-25 15:28:03 +0300
committerАлександр Зацепин <az@mapswithme.com>2017-05-25 15:41:24 +0300
commit4defc58effb6baa0f6a1a231539d9d734f2a4629 (patch)
treee6e434713aba10fb2a4ebdafdd7da595ed7e463f /android/src/com/mapswithme/maps/ads
parent7b0fcc90b10c5601beb0ccf7a25befe3b0870d6e (diff)
[android] Fixed Mopub ad's shows tracking
Diffstat (limited to 'android/src/com/mapswithme/maps/ads')
-rw-r--r--android/src/com/mapswithme/maps/ads/CompoundNativeAdLoader.java10
-rw-r--r--android/src/com/mapswithme/maps/ads/MopubNativeDownloader.java2
2 files changed, 10 insertions, 2 deletions
diff --git a/android/src/com/mapswithme/maps/ads/CompoundNativeAdLoader.java b/android/src/com/mapswithme/maps/ads/CompoundNativeAdLoader.java
index 8517f2fd76..7c89b6c0d9 100644
--- a/android/src/com/mapswithme/maps/ads/CompoundNativeAdLoader.java
+++ b/android/src/com/mapswithme/maps/ads/CompoundNativeAdLoader.java
@@ -73,7 +73,15 @@ public class CompoundNativeAdLoader extends BaseNativeAdLoader implements Native
mLoaders.add(loader);
attach();
loader.setAdListener(this);
- loader.loadAd(context, banner.getId());
+ // TODO: this workaround is need to avoid memory leak of activity context in MyTarget SDK.
+ // The fix of myTarged sdk will be done in this issue https://jira.mail.ru/browse/MOBADS-207.
+ // After the mentioned issued is fixed, this workaround should be removed. Also, we can't use
+ // the application context for all providers, because some of them (e.g. Mopub) requires an
+ // activity context and can't work with application context correctly.
+ if (loader instanceof MyTargetAdsLoader)
+ loader.loadAd(context.getApplicationContext(), banner.getId());
+ else
+ loader.loadAd(context, banner.getId());
}
}
diff --git a/android/src/com/mapswithme/maps/ads/MopubNativeDownloader.java b/android/src/com/mapswithme/maps/ads/MopubNativeDownloader.java
index b34aeefdb5..0d7105e2b9 100644
--- a/android/src/com/mapswithme/maps/ads/MopubNativeDownloader.java
+++ b/android/src/com/mapswithme/maps/ads/MopubNativeDownloader.java
@@ -95,7 +95,7 @@ class MopubNativeDownloader extends CachingNativeAdLoader
@Override
public void onAdImpressed()
{
- // No op.
+ LOGGER.d(TAG, "on MoPub Ad impressed");
}
@Override