forked from organicmaps/organicmaps
[android] Feature status JNI.
This commit is contained in:
parent
8ab0aa74c4
commit
b92ecc9e08
2 changed files with 32 additions and 0 deletions
|
@ -509,4 +509,18 @@ Java_com_mapswithme_maps_editor_Editor_nativeGetCategory(JNIEnv * env, jclass cl
|
|||
{
|
||||
return jni::ToJavaString(env, g_editableMapObject.GetLocalizedType());
|
||||
}
|
||||
|
||||
// @FeatureStatus
|
||||
// static native int nativeGetMapObjectStatus();
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_mapswithme_maps_editor_Editor_nativeGetMapObjectStatus(JNIEnv * env, jclass clazz)
|
||||
{
|
||||
return osm::Editor::Instance().GetFeatureStatus(g_editableMapObject.GetID().m_mwmId, g_editableMapObject.GetID().m_index);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_editor_Editor_nativeIsMapObjectUploaded(JNIEnv * env, jclass clazz)
|
||||
{
|
||||
return osm::Editor::Instance().IsFeatureUploaded(g_editableMapObject.GetID().m_mwmId, g_editableMapObject.GetID().m_index);
|
||||
}
|
||||
} // extern "C"
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package com.mapswithme.maps.editor;
|
||||
|
||||
import android.support.annotation.IntDef;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Size;
|
||||
import android.support.annotation.WorkerThread;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import com.mapswithme.maps.BuildConfig;
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
|
@ -20,6 +24,16 @@ import com.mapswithme.maps.editor.data.LocalizedStreet;
|
|||
*/
|
||||
public final class Editor
|
||||
{
|
||||
// Should correspond to core osm::FeatureStatus.
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({UNTOUCHED, DELETED, MODIFIED, CREATED})
|
||||
public @interface FeatureStatus {}
|
||||
|
||||
public static final int UNTOUCHED = 0;
|
||||
public static final int DELETED = 1;
|
||||
public static final int MODIFIED = 2;
|
||||
public static final int CREATED = 3;
|
||||
|
||||
private static final AppBackgroundTracker.OnTransitionListener sOsmUploader = new AppBackgroundTracker.OnTransitionListener()
|
||||
{
|
||||
@Override
|
||||
|
@ -158,4 +172,8 @@ public final class Editor
|
|||
public static native void nativePlaceDoesNotExist();
|
||||
|
||||
public static native boolean nativeIsHouseValid(String houseNumber);
|
||||
|
||||
@FeatureStatus
|
||||
public static native int nativeGetMapObjectStatus();
|
||||
public static native boolean nativeIsMapObjectUploaded();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue