1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Android: Segmentation fault fix, PendingIntent flag, and other fixes (#12960)

* Android: Segmentation fault fix, PendingIntent flag, and other fixes

- Information about the crosshair is sent after camera initialization.
- Since API 31, PendingIntent requires mutability flag.
- super (class) is called in onRequestPermissionsResult().
- GameActivity suppresses "unused" warning since most of its methods are called from native code.
- Non-null safety is added for nullable function calls.
- Warning/error logging is added for various function calls' return value.

* Move utility functions into Utils.java

- Some nullable functions are changed to be non-null functions.
- Some null checking outside it is removed.
- More annotations are added to functions and parameters.
This commit is contained in:
Muhammad Rifqi Priyo Susanto 2022-11-30 22:50:06 +07:00 committed by GitHub
parent 055fc69c11
commit 281f9a9f88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 47 additions and 24 deletions

View file

@ -1421,7 +1421,6 @@ bool Game::createClient(const GameStartData &start_data)
if (g_touchscreengui) {
g_touchscreengui->init(texture_src);
g_touchscreengui->hide();
g_touchscreengui->setUseCrosshair(!isNoCrosshairAllowed());
}
#endif
if (!connectToServer(start_data, &could_connect, &connect_aborted))
@ -1458,6 +1457,11 @@ bool Game::createClient(const GameStartData &start_data)
if (client->modsLoaded())
client->getScript()->on_camera_ready(camera);
client->setCamera(camera);
#ifdef HAVE_TOUCHSCREENGUI
if (g_touchscreengui) {
g_touchscreengui->setUseCrosshair(!isNoCrosshairAllowed());
}
#endif
/* Clouds
*/