Lines Matching defs:env

54 static inline void CheckExceptions(JNIEnv* env, const char* methodName) {
55 if(!env->ExceptionCheck()) {
60 LOGE_EX(env);
61 env->ExceptionClear();
65 JNIEnv* env,
77 jclass exceptionClass = env->FindClass("java/lang/RuntimeException");
78 env->ThrowNew(exceptionClass, methodName);
82 JNIEnv* env = AndroidRuntime::getJNIEnv();
84 if(sCallbackEnv == NULL || sCallbackEnv != env) {
85 ALOGE("CallbackThread check fail: env=%p, expected=%p", env, sCallbackEnv);
198 static void ClassInit(JNIEnv* env, jclass clazz) {
202 sSetVersion = env->GetMethodID(
206 sOnLocationReport = env->GetMethodID(
210 sOnDataReport = env->GetMethodID(
215 sOnBatchingCapabilities = env->GetMethodID(
219 sOnBatchingStatus = env->GetMethodID(
223 sOnGeofencingCapabilities = env->GetMethodID(
227 sOnGeofenceTransition = env->GetMethodID(
232 sOnGeofenceMonitorStatus = env->GetMethodID(
237 sOnGeofenceAdd = env->GetMethodID(clazz, "onGeofenceAdd", "(II)V");
238 sOnGeofenceRemove = env->GetMethodID(clazz, "onGeofenceRemove", "(II)V");
239 sOnGeofencePause = env->GetMethodID(clazz, "onGeofencePause", "(II)V");
240 sOnGeofenceResume = env->GetMethodID(clazz, "onGeofenceResume", "(II)V");
279 JNIEnv* env,
285 jclass locationClass = env->GetObjectClass(locationObject);
287 jmethodID getLatitude = env->GetMethodID(locationClass, "getLatitude", "()D");
288 location.latitude = env->CallDoubleMethod(locationObject, getLatitude);
289 jmethodID getLongitude = env->GetMethodID(locationClass, "getLongitude", "()D");
290 location.longitude = env->CallDoubleMethod(locationObject, getLongitude);
291 jmethodID getTime = env->GetMethodID(locationClass, "getTime", "()J");
292 location.timestamp = env->CallLongMethod(locationObject, getTime);
295 jmethodID hasAltitude = env->GetMethodID(locationClass, "hasAltitude", "()Z");
296 if (env->CallBooleanMethod(locationObject, hasAltitude)) {
297 jmethodID getAltitude = env->GetMethodID(locationClass, "getAltitude", "()D");
298 location.altitude = env->CallDoubleMethod(locationObject, getAltitude);
302 jmethodID hasSpeed = env->GetMethodID(locationClass, "hasSpeed", "()Z");
303 if (env->CallBooleanMethod(locationObject, hasSpeed)) {
304 jmethodID getSpeed = env->GetMethodID(locationClass, "getSpeed", "()F");
305 location.speed = env->CallFloatMethod(locationObject, getSpeed);
309 jmethodID hasBearing = env->GetMethodID(locationClass, "hasBearing", "()Z");
310 if (env->CallBooleanMethod(locationObject, hasBearing)) {
311 jmethodID getBearing = env->GetMethodID(locationClass, "getBearing", "()F");
312 location.bearing = env->CallFloatMethod(locationObject, getBearing);
316 jmethodID hasAccuracy = env->GetMethodID(locationClass, "hasAccuracy", "()Z");
317 if (env->CallBooleanMethod(locationObject, hasAccuracy)) {
318 jmethodID getAccuracy = env->GetMethodID(
323 location.accuracy = env->CallFloatMethod(locationObject, getAccuracy);
329 env->DeleteLocalRef(locationClass);
336 JNIEnv* env,
339 jclass batchOptionsClass = env->GetObjectClass(batchOptionsObject);
341 jmethodID getMaxPower = env->GetMethodID(
346 batchOptions.max_power_allocation_mW = env->CallDoubleMethod(
351 jmethodID getPeriod = env->GetMethodID(
356 batchOptions.period_ns = env->CallLongMethod(batchOptionsObject, getPeriod);
358 jmethodID getSourcesToUse = env->GetMethodID(
363 batchOptions.sources_to_use = env->CallIntMethod(
368 jmethodID getSmallestDisplacementMeters = env->GetMethodID(
374 = env->CallFloatMethod(batchOptionsObject, getSmallestDisplacementMeters);
376 jmethodID getFlags = env->GetMethodID(batchOptionsClass, "getFlags", "()I");
377 batchOptions.flags = env->CallIntMethod(batchOptionsObject, getFlags);
379 env->DeleteLocalRef(batchOptionsClass);
386 JNIEnv* env,
389 jclass geofenceRequestClass = env->GetObjectClass(geofenceRequestObject);
391 jmethodID getId = env->GetMethodID(geofenceRequestClass, "getId", "()I");
392 geofence.geofence_id = env->CallIntMethod(geofenceRequestObject, getId);
394 jmethodID getType = env->GetMethodID(geofenceRequestClass, "getType", "()I");
397 GeofenceType type = (GeofenceType)env->CallIntMethod(geofenceRequestObject, getType);
399 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
404 jmethodID getLatitude = env->GetMethodID(
408 circle.latitude = env->CallDoubleMethod(geofenceRequestObject, getLatitude);
410 jmethodID getLongitude = env->GetMethodID(
414 circle.longitude = env->CallDoubleMethod(geofenceRequestObject, getLongitude);
416 jmethodID getRadius = env->GetMethodID(geofenceRequestClass, "getRadius", "()D");
417 circle.radius_m = env->CallDoubleMethod(geofenceRequestObject, getRadius);
420 jmethodID getMonitorTransitions = env->GetMethodID(
424 options->monitor_transitions = env->CallIntMethod(
428 jmethodID getUnknownTimer = env->GetMethodID(
432 options->unknown_timer_ms = env->CallIntMethod(geofenceRequestObject, getUnknownTimer);
434 jmethodID getNotificationResponsiveness = env->GetMethodID(
438 options->notification_responsivenes_ms = env->CallIntMethod(
442 jmethodID getLastTransition = env->GetMethodID(
446 options->last_transition = env->CallIntMethod(geofenceRequestObject, getLastTransition);
449 env->GetMethodID(geofenceRequestClass, "getSourceTechnologies", "()I");
450 options->sources_to_use = env->CallIntMethod(geofenceRequestObject, getSourceTechnologies);
452 env->DeleteLocalRef(geofenceRequestClass);
772 static void Init(JNIEnv* env, jobject obj) {
774 sCallbacksObj = env->NewGlobalRef(obj);
779 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
793 static jboolean IsSupported(JNIEnv* /* env */, jclass /* clazz */) {
800 static jint GetBatchSize(JNIEnv* env, jobject /* object */) {
802 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
809 JNIEnv* env,
814 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
818 TranslateFromObject(env, optionsObject, options);
820 ThrowOnError(env, result, __FUNCTION__);
824 JNIEnv* env,
829 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
833 TranslateFromObject(env, optionsObject, options);
835 ThrowOnError(env, result, __FUNCTION__);
838 static void StopBatching(JNIEnv* env, jobject /* object */, jint id) {
840 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
846 static void Cleanup(JNIEnv* env, jobject /* object */) {
848 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
854 env->DeleteGlobalRef(sCallbacksObj);
859 static void GetBatchedLocation(JNIEnv* env, jobject /* object */, jint lastNLocations) {
861 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
867 static void FlushBatchedLocations(JNIEnv* env, jobject /* object */) {
869 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
875 static void InjectLocation(JNIEnv* env, jobject /* object */, jobject locationObject) {
878 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
887 TranslateFromObject(env, locationObject, location);
899 static void InjectDiagnosticData(JNIEnv* env, jobject /* object */, jstring stringData) {
902 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
906 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
909 int length = env->GetStringLength(stringData);
910 const jchar* data = env->GetStringChars(stringData, /* isCopy */ NULL);
912 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
916 ThrowOnError(env, result, __FUNCTION__);
923 static void InjectDeviceContext(JNIEnv* env, jobject /* object */, jint enabledMask) {
925 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
929 ThrowOnError(env, result, __FUNCTION__);
937 JNIEnv* env,
942 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
946 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
949 jint geofenceRequestsCount = env->GetArrayLength(geofenceRequestsArray);
956 ThrowOnError(env, FLP_RESULT_INSUFFICIENT_MEMORY, __FUNCTION__);
962 jobject geofenceObject = env->GetObjectArrayElement(geofenceRequestsArray, i);
964 TranslateGeofenceFromGeofenceHardwareRequestParcelable(env, geofenceObject, geofences[i]);
965 env->DeleteLocalRef(geofenceObject);
978 static void PauseGeofence(JNIEnv* env, jobject /* object */, jint geofenceId) {
980 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
987 JNIEnv* env,
992 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
999 JNIEnv* env,
1008 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
1023 JNIEnv* env,
1027 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
1030 jsize geofenceIdsCount = env->GetArrayLength(geofenceIdsArray);
1031 jint* geofenceIds = env->GetIntArrayElements(geofenceIdsArray, /* isCopy */ NULL);
1033 ThrowOnError(env, FLP_RESULT_ERROR, __FUNCTION__);
1037 env->ReleaseIntArrayElements(geofenceIdsArray, geofenceIds, 0 /*mode*/);
1092 int register_android_server_location_FlpHardwareProvider(JNIEnv* env) {
1094 env,