From ff8e6093fa5c9114d3565e0fb0d87bd4df3d777c Mon Sep 17 00:00:00 2001 From: destradaa Date: Tue, 12 Aug 2014 19:04:03 -0700 Subject: [PATCH] Update FlpHardwareProvider native layer, to stop raising FatalErrors. b/16800814 Change-Id: Ic619f37c02c7e4dddc4ef06369f8730cbd66e6bd --- .../com_android_server_location_FlpHardwareProvider.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/core/jni/com_android_server_location_FlpHardwareProvider.cpp b/services/core/jni/com_android_server_location_FlpHardwareProvider.cpp index 2519ff85a49fe..37a3eaa1d045b 100644 --- a/services/core/jni/com_android_server_location_FlpHardwareProvider.cpp +++ b/services/core/jni/com_android_server_location_FlpHardwareProvider.cpp @@ -66,7 +66,12 @@ static inline void ThrowOnError( } ALOGE("Error %d in '%s'", resultCode, methodName); - env->FatalError(methodName); + // TODO: this layer needs to be refactored to return error codes to Java + // raising a FatalError is harsh, and because FLP Hardware Provider is loaded inside the system + // service, it can cause the device to reboot, or remain in a reboot loop + // a simple exception is still dumped to logcat, but it is handled more gracefully + jclass exceptionClass = env->FindClass("java/lang/RuntimeException"); + env->ThrowNew(exceptionClass, methodName); } static bool IsValidCallbackThread() {