Merge: android: click event on button release, better errors and safer `JavaString...
authorJean Privat <jean@pryen.org>
Fri, 7 Oct 2016 19:40:27 +0000 (15:40 -0400)
committerJean Privat <jean@pryen.org>
Fri, 7 Oct 2016 19:40:27 +0000 (15:40 -0400)
Some small tweaks to the Android support:

* `JavaString::to_s` used to crash (at the JNI level) if the associated Java string was null. This was a counterintuitive behavior when the Nit object is non-nullable. This PR prevents this error by returning something similar to the default `Object::to_s` when the underlying Java value is null (for `JavaString` and others). This makes it crash proof, but one should still check if `JavaString::is_java_null` before using the value returned by `to_s` when an actual string is expected.

* Some Java exceptions raised by the Android implementation of `http_get` do not have a message. This PR looks through the causes of such exceptions to find the first available message.

* Also, fix `on_click & ButtonPressEvent` to be raised only when a button is released (instead of at the initial touch).

Pull-Request: #2319
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>


Trivial merge