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:
Diffstat (limited to 'android/jni/com')
-rw-r--r--android/jni/com/mapswithme/maps/Framework.cpp6
-rw-r--r--android/jni/com/mapswithme/maps/MapManager.cpp3
-rw-r--r--android/jni/com/mapswithme/maps/Sponsored.cpp3
-rw-r--r--android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp6
4 files changed, 18 insertions, 0 deletions
diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp
index d31dbd04fe..ec44257a21 100644
--- a/android/jni/com/mapswithme/maps/Framework.cpp
+++ b/android/jni/com/mapswithme/maps/Framework.cpp
@@ -2211,4 +2211,10 @@ Java_com_mapswithme_maps_Framework_nativeSetSearchViewport(JNIEnv *, jclass, jdo
auto const rect = df::GetRectForDrawScale(static_cast<int>(zoom), center);
frm()->GetSearchAPI().OnViewportChanged(rect);
}
+
+JNIEXPORT jboolean JNICALL
+Java_com_mapswithme_maps_Framework_nativeHasPlacePageInfo(JNIEnv *, jclass)
+{
+ return static_cast<jboolean>(frm()->HasPlacePageInfo());
+}
} // extern "C"
diff --git a/android/jni/com/mapswithme/maps/MapManager.cpp b/android/jni/com/mapswithme/maps/MapManager.cpp
index 5bb351f88e..330cbbb04a 100644
--- a/android/jni/com/mapswithme/maps/MapManager.cpp
+++ b/android/jni/com/mapswithme/maps/MapManager.cpp
@@ -569,6 +569,9 @@ Java_com_mapswithme_maps_downloader_MapManager_nativeEnableDownloadOn3g(JNIEnv *
JNIEXPORT jstring JNICALL
Java_com_mapswithme_maps_downloader_MapManager_nativeGetSelectedCountry(JNIEnv * env, jclass clazz)
{
+ if (!g_framework->NativeFramework()->HasPlacePageInfo())
+ return nullptr;
+
storage::CountryId const & res = g_framework->GetPlacePageInfo().GetCountryId();
return (res == storage::kInvalidCountryId ? nullptr : jni::ToJavaString(env, res));
}
diff --git a/android/jni/com/mapswithme/maps/Sponsored.cpp b/android/jni/com/mapswithme/maps/Sponsored.cpp
index 0e9eb09b09..fd67333481 100644
--- a/android/jni/com/mapswithme/maps/Sponsored.cpp
+++ b/android/jni/com/mapswithme/maps/Sponsored.cpp
@@ -126,6 +126,9 @@ JNIEXPORT jobject JNICALL Java_com_mapswithme_maps_widget_placepage_Sponsored_na
{
PrepareClassRefs(env, clazz);
+ if (!g_framework->NativeFramework()->HasPlacePageInfo())
+ return nullptr;
+
place_page::Info const & ppInfo = g_framework->GetPlacePageInfo();
if (!ppInfo.IsSponsored())
return nullptr;
diff --git a/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp b/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp
index 45bb90e74a..cec418c841 100644
--- a/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp
+++ b/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp
@@ -622,6 +622,9 @@ JNIEXPORT jobject JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAddBookmarkToLastEditedCategory(
JNIEnv * env, jobject thiz, double lat, double lon)
{
+ if (!frm()->HasPlacePageInfo())
+ return nullptr;
+
BookmarkManager & bmMng = frm()->GetBookmarkManager();
place_page::Info const & info = g_framework->GetPlacePageInfo();
@@ -775,6 +778,9 @@ JNIEXPORT jobject JNICALL
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeUpdateBookmarkPlacePage(
JNIEnv * env, jobject thiz, jlong bmkId)
{
+ if (!frm()->HasPlacePageInfo())
+ return nullptr;
+
auto & info = g_framework->GetPlacePageInfo();
auto buildInfo = info.GetBuildInfo();
buildInfo.m_userMarkId = static_cast<kml::MarkId>(bmkId);