forked from organicmaps/organicmaps
[android] add: JNI bridge for track recorder.
This commit is contained in:
parent
e2b32d04f0
commit
b9c147cdbb
2 changed files with 37 additions and 0 deletions
28
android/jni/com/mapswithme/maps/TrackRecorder.cpp
Normal file
28
android/jni/com/mapswithme/maps/TrackRecorder.cpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include "Framework.hpp"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_location_TrackRecorder_nativeSetEnabled(JNIEnv * env, jclass clazz, jboolean enable)
|
||||
{
|
||||
frm()->EnableGpsTracking(enable);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_location_TrackRecorder_nativeIsEnabled(JNIEnv * env, jclass clazz)
|
||||
{
|
||||
return frm()->IsGpsTrackingEnabled();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_location_TrackRecorder_nativeSetDuration(JNIEnv * env, jclass clazz, jint hours)
|
||||
{
|
||||
frm()->SetGpsTrackingDuration(hours(hours));
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_mapswithme_maps_location_TrackRecorder_nativeGetDuration(JNIEnv * env, jclass clazz)
|
||||
{
|
||||
return frm()->GetGpsTrackingDuration();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.mapswithme.maps.location;
|
||||
|
||||
public class TrackRecorder
|
||||
{
|
||||
public static native void nativeSetEnabled(boolean enable);
|
||||
public static native boolean nativeIsEnabled();
|
||||
public static native void nativeSetDuration(int hours);
|
||||
public static native int nativeGetDuration();
|
||||
}
|
Loading…
Add table
Reference in a new issue