This does something a little weird, in that it doesn't care what
`__ANDROID_API__` is set to, but will attempt to dlopen the system
libraries, like we do for many other platform-specific pieces of SDL.
This allows us to a) not bump the minimum required Android version, which is
extremely ancient but otherwise still working, doing the right thing on old
and new hardware in the field, and b) not require the app to link against
more libraries than it previously did before the feature was available.
The downside is that it's a little messy, but it's okay for now, I think.
If a program built against one version of SDL is run in an
environment where there is an earlier version of the SDL .so library
installed, the result varies depending on platform configuration; in
the best case, it won't start at all, at worst it aborts in the
middle of the user doing "something important" (systems implementing
lazy symbol resolution). verdefs on the other hand are always checked
on startup.
The dependency information present in programs and shared libraries
is not only of value to the dynamic linker, but also to a
distribution's package management. If the dynamic linker is able to
tell that a program is not runnable per the above, a package manager
is able to come to the same conclusion — and block the installation
of a nonfunctional program+library ensemble.
Because there are a lot more symbols than there are libraries (I am
going to throw in "10^4 to 1 or worse"), package managers generally
do not evaluate symbols, but only e.g. the SONAME, NEEDED and VERNEED
fields/blocks. Because the SONAME is the same between two SDL
versions like 2.0.24, and 2.0.26, everything rests on having verdefs.
This patch proposes the addition of verdefs.
"If your app targets Android 12, you must specify the mutability of each PendingIntent object that your app creates. This additional requirement improves your app's security."
Thanks @FormularSumo and @cgutman
You can't set the intent to be immutable, otherwise the USB system can't set the device and permission in the response. This works fine on Android 12 without an immutable intent.
This prevents conflicts with hidapi linked with applications, as well as allowing applications to make use of HIDAPI on Android and other platforms that might not normally have an implementation available.
maxxus
The Dualshock 3's motion sensors don't seem to be reported by the call to EVIOCGBIT but they still send EV_ABS events. Because they're not reported by EVIOCGBIT they're not assigned a proper axis ids and the default of 0 is used, which is the valid id for the left analog sticks left/right axis.
Sylvain
SDL_android.c
src/core/android/SDL_android.c:1302:5: warning: variable 'br' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
src/core/android/SDL_android.c:1306:12: note: uninitialized use occurs here
return br;
^~
src/core/android/SDL_android.c:1270:12: note: initialize the variable 'br' to silence this warning
jint br;
^
Maybe we could add some basics warning flags, not to see all warnings, but so that new warnings are caught sooner.
I would go for -Wall -Wextra, and some -Wno-warning for the allowed warnings.