LocationManager: expose more information from the backend to the apps

note: GnssStatus was accidentally bundled into ab5b600bf1
This commit is contained in:
Mis012
2025-03-26 21:25:39 +01:00
parent d2e2ab37bc
commit 12121d2d48
5 changed files with 87 additions and 9 deletions

View File

@@ -14,12 +14,13 @@ static void location_updated (
gchar* description,
gint64 timestamp_s,
gint64 timestamp_ms,
JavaVM *jvm
) {
JavaVM *jvm)
{
JNIEnv *env;
(*jvm)->GetEnv(jvm, (void**)&env, JNI_VERSION_1_6);
jclass class = (*env)->FindClass(env, "android/location/LocationManager");
(*env)->CallStaticVoidMethod(env, class, _STATIC_METHOD(class, "locationUpdated", "(DDD)V"), latitude, longitude, heading);
jlong timestamp = timestamp_s * 1000 + timestamp_ms;
(*env)->CallStaticVoidMethod(env, class, _STATIC_METHOD(class, "locationUpdated", "(DDDDDDJ)V"), latitude, longitude, altitude, accuracy, speed, heading, timestamp);
}
JNIEXPORT void JNICALL Java_android_location_LocationManager_nativeGetLocation(JNIEnv *env, jobject) {