diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 0baf430945..33f6e98d79 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -1043,6 +1043,12 @@ Java_com_mapswithme_maps_Framework_nativeDisableFollowing(JNIEnv * env, jclass) frm()->GetRoutingManager().DisableFollowMode(); } +JNIEXPORT void JNICALL +Java_com_mapswithme_maps_Framework_nativeGetUserAgent(JNIEnv * env, jclass) +{ + return static_cast(GetPlatform().GetAppUserAgent()); +} + JNIEXPORT jobjectArray JNICALL Java_com_mapswithme_maps_Framework_nativeGenerateNotifications(JNIEnv * env, jclass) { diff --git a/android/src/com/mapswithme/maps/Framework.java b/android/src/com/mapswithme/maps/Framework.java index 2ab35938e9..fcb6c4f143 100644 --- a/android/src/com/mapswithme/maps/Framework.java +++ b/android/src/com/mapswithme/maps/Framework.java @@ -293,6 +293,8 @@ public class Framework public static native void nativeDisableFollowing(); + public static native String nativeGetUserAgent(); + @Nullable public static native RoutingInfo nativeGetRouteFollowingInfo(); diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarksDownloadManager.java b/android/src/com/mapswithme/maps/bookmarks/BookmarksDownloadManager.java index 92530e4804..0f3cc3d8b3 100644 --- a/android/src/com/mapswithme/maps/bookmarks/BookmarksDownloadManager.java +++ b/android/src/com/mapswithme/maps/bookmarks/BookmarksDownloadManager.java @@ -6,10 +6,11 @@ import android.net.Uri; import android.support.annotation.NonNull; import android.text.TextUtils; import android.util.Pair; - +import com.mapswithme.maps.Framework; import com.mapswithme.maps.bookmarks.data.BookmarkManager; import com.mapswithme.util.log.Logger; import com.mapswithme.util.log.LoggerFactory; +import com.mopub.common.util.ResponseHeader; import java.net.URLEncoder; @@ -50,6 +51,7 @@ public class BookmarksDownloadManager .Request(dstUri) .setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE) .setTitle(title) + .addRequestHeader(ResponseHeader.USER_AGENT.getKey(), Framework.nativeGetUserAgent()) .setDestinationInExternalFilesDir(mContext, null, dstUri.getLastPathSegment()); return downloadManager.enqueue(request); }