Review Request: Fix to Connectivity Bluetooth JNI related crash problem

Lauri Laanmets lauri.laanmets at proekspert.ee
Thu Jan 3 14:55:09 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108113/#review24568
-----------------------------------------------------------



src/connectivity/android/jni_android.cpp
<http://git.reviewboard.kde.org/r/108113/#comment18852>

    OK, that proves that the lib-loading-thread has been changed and the improvement is now more fail-safe. Looks OK but I'm not sure if it is now needed to DetachThread. The reason why this magic here on lines 38-71 is, was to get access to "android/app/Application" and BroadcastReviever.java. It was only possible in JNI_OnLoad because only that function was called by Ministro from the thread with Android App context. That is why "qtApplicationC" is saved and "nativeEnvironment" is passed on. Maybe it's not needed anymore - need to be checked.



src/connectivity/bluetooth/qbluetoothlocaldevice_android.cpp
<http://git.reviewboard.kde.org/r/108113/#comment18855>

    Why is it needed to refresh btAdapter? Is the trouble actually the fact that QBluetoothLocalDevicePrivate::initialize is now called from another thread. Maybe missing detach in JNI_OnLoad gives troubles?



src/connectivity/bluetooth/qbluetoothlocaldevice_p.h
<http://git.reviewboard.kde.org/r/108113/#comment18853>

    Only a whitespace change? Could be removed to reduce noise?



src/connectivity/bluetooth/qbluetoothsocket_android.cpp
<http://git.reviewboard.kde.org/r/108113/#comment18856>

    NewGlobalRef must also be deleted with DeleteGlobalRef, otherwise garbage collector will never destroy it and Android will have memory leaks. The exceptions are the ones created once during loading the libs, these will be removed together with the process.


- Lauri Laanmets


On Jan. 3, 2013, 1:55 p.m., Kate Alhola wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/108113/
> -----------------------------------------------------------
> 
> (Updated Jan. 3, 2013, 1:55 p.m.)
> 
> 
> Review request for Necessitas and BogDan Vatra.
> 
> 
> Description
> -------
> 
> Qt Mobility Bluetooth crashed by JNI originated errors. Two root causes found, JNI vm->getEnv on different thread and missing NewGlobalRef's 
> 
> 
> Diffs
> -----
> 
>   src/connectivity/android/jni_android.cpp 8c19b6a 
>   src/connectivity/bluetooth/qbluetoothlocaldevice_android.cpp 7513eae 
>   src/connectivity/bluetooth/qbluetoothlocaldevice_p.h e854aeb 
>   src/connectivity/bluetooth/qbluetoothsocket_android.cpp 7084a56 
> 
> Diff: http://git.reviewboard.kde.org/r/108113/diff/
> 
> 
> Testing
> -------
> 
> Tested on Samsung S3 and Acer Iconia A100 
> 
> 
> Thanks,
> 
> Kate Alhola
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/necessitas-devel/attachments/20130103/c9a82746/attachment.html>


More information about the Necessitas-devel mailing list