Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d8964cc authored by destradaa's avatar destradaa Committed by Android (Google) Code Review
Browse files

Merge "Update FlpHardwareProvider native layer, to stop raising FatalErrors." into lmp-dev

parents 3c9ad6eb ff8e6093
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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() {