android-project


Log

Author Commit Date CI Message
Sam Lantinga 257c8972 2016-09-29T16:52:48 Fixed bug 3426 - Fixes for joystick related issues ny00 This report is going to cover three issues, with a suggestion for fixes. For reference, tests were done using an installation of android-x86-5.1-rc1.iso within a VirtualBox session. I've actually used an adapter that accepts up to two Playstation 1/2 controllers. A ZIP file should be attached, with the following contents: - The patch file itself. - Outputs of joysticks lists from testjoystick with different orders (before fixing bug). - Game controllers database entries (for reference). --- Different outputs for different platforms may stem from different tools being used; The Android mapping was manually constructed using a previously available mapping as a base. --- Note that it turns out the Linux mapping is already out there in some form: https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt And so, let's begin listing the issues: 1. While changeset https://hg.libsdl.org/SDL/rev/9b540bea3cf1 has good intentions, it appears to make various input devices being mistakenly detected as SDL joysticks. I got lists of the devices from joysticktest, given in the ZIP file. "badordering.txt" is what I get if the device has been plugged since a reboot of the virtual machine, while I've gotten "goodordering.txt" after hot-plugging the USB adapter. As expected, only in the latter case I could use the controller in the test program (assuming it isn't modified). To take care of this, I updated pollInputDevices and added the function SDLActivity.isDeviceSDLJoystick, in order to have a better filter. Note that it also checks that the device id is non-negative, since VIRTUAL_KEYBOARD appears to include a SOURCE_DPAD, and I should probably keep accepting it as an SDL_joystick (good if you want, say, to support multiple independent d-pad devices). I hope the device id filter does not break support for the virtual remote (mentioned in the changeset above). 2. So there's a weird glitch here, where the game controller is reported to have SOURCE_KEYBOARD and SOURCE_JOYSTICK, while each controller button press/release emits a KeyEvent with SOURCE_KEYBOARD only. So obviously any test going over the event's own sources is expected to fail. It is possible to try and filter by the key code, but then there are the dpad key codes, which can also be emitted by actual PC keyboard's key presses/releases (the arrow keys). So instead, I just call the newly added isDeviceSDLJoystick function again and check if the input device (not the event) has any source considered to be a joystick/gamepad for us. 3. Finally, if SDL2 properly detects an SDL_Joystick being connected, but it is not opened, then whenever a KeyEvent is received after a button press/release from the same controller, SDLActivity.onNativePadDown/onNativePadUp returns a negative value. In such a case, the onKey handler continues to check for SOURCE_KEYBOARD (and possibly also SOURCE_MOUSE), which is clearly not desired. And so, in the given patch, the return values of onNativePadDown and onNativePadUp are ignored and "true" is returned either way. (Note: Maybe the native functions should be modified to have the return value of "void".) Finally, as another side-note, I've noticed that the various bitwise tests for sources are wrong. For instance, to check if an InputDevice 'device' has source SOURCE_JOYSTICK, the value (device.getSources() & SOURCE_JOYSTICK) should be compared to SOURCE_JOYSTICK, not 0. However, I think there's enough that this patch covers. At the least, isDeviceSDLJoystick partially solves this.
Sam Lantinga f369d165 2016-09-29T16:40:34 Fixed bug 3427 - Android accelerometer z-axis incorrect Alex Szpakowski As seen here https://bitbucket.org/rude/love/issues/1202/accelerometer-z-axis , the Java code for sending accelerometer data to SDL's C code has an incorrect Z-axis calculation.
Philipp Wiesemann 379a4304 2016-08-30T21:15:46 Android: Removed unused internal function.
Ryan C. Gordon 8f0af773 2016-08-11T22:04:49 android: implement audio capture support.
Philipp Wiesemann 3853f7cd 2016-07-27T20:47:08 Android: Updated a comment.
Philipp Wiesemann 242c3480 2016-07-27T20:46:18 Android: Replaced deprecated AbsoluteLayout with RelativeLayout. Fixes Bugzilla #2211.
Cole Campbell 8f17b203 2016-07-04T10:39:32 Commit KEYCODE_SPACE as text input on Android
Philipp Wiesemann bb9dcf57 2016-04-25T22:17:38 Android: Updated name of README file.
Philipp Wiesemann 88f51937 2016-01-26T22:20:05 Android: Fixed ignoring a return value while handling motion events. This should not have caused problems yet because the return value was identical.
Philipp Wiesemann 2191abb2 2016-01-13T19:31:03 Android: Fixed finishing Activity on some devices if right mouse button pressed. Partially fixes Bugzilla #3227.
Philipp Wiesemann 46cb8510 2016-01-12T22:22:24 Android: Fixed a comment.
Philipp Wiesemann 2a4855f9 2015-10-15T22:26:00 Android: Added missing import statement. It did not compile without.
Ryan C. Gordon 82603b60 2015-10-15T12:52:00 Fix some Android keyboards that didn't work properly. This conversation came from Joshua Granick on Twitter, starting here: https://twitter.com/singmajesty/status/653640543675641857 "We found an issue where certain Android keyboards (like the S6 with predictive text) wouldn't work ... Certain keyboards use a predictive text mode that does not dispatch a traditional onKey events, which is troublesome ... but telling the OS to use a "visible password" keyboard helps deal with this problem ... perhaps there's some other way (onKeyPreIme?) to do "textediting" events, but for now, this should be a fast fix ... I hear it affects the Galaxy Tab A 8.0", Galaxy S6, Asus ZenPhone 2, maybe others"
Philipp Wiesemann 5bc93cc5 2015-10-07T21:16:40 Android: Added a new method in SDLSurface.
Philipp Wiesemann 10daf1f4 2015-09-27T20:12:47 Android: Removed three internal functions not used by SDL. They were not needed internally since the switch to the common EGL backend. Thanks to the SDL mailing list for pointing out that the functions seem unused.
Philipp Wiesemann 40364541 2015-09-18T21:26:28 Android: Improved last error message for failed APK expansion file use.
Philipp Wiesemann 625d39b1 2015-09-17T22:36:11 Android: Added additional error messages for APK expansion file use.
Philipp Wiesemann 6e7c479e 2015-09-17T22:30:24 Android: Fixed trying to read from APK expansion files without version hint set. This also fixed overwriting the asset error message which is more useful if no APK expansion files are available and the requested file was not found.
Philipp Wiesemann 92ca42d9 2015-09-17T22:24:54 Android: Renamed SDLActivity's Java method used for APK expansion files. The name was not correct.
Philipp Wiesemann 68b3b542 2015-09-17T22:14:37 Android: Removed empty onDraw() override method from SDLActivity. It was redundant because SDLActivity already inherits an empty method from the base class SurfaceView (which does not implement it but inherits it from View). Visibility of onDraw() in SDLActivity is now protected again instead of public.
Philipp Wiesemann a4a5483f 2015-09-05T20:21:35 Android: Fixed unused variable warning.
Philipp Wiesemann 2b6f6422 2015-09-05T20:21:06 Android: Fixed missing break warning.
Philipp Wiesemann 0e45984f 2015-06-21T17:33:46 Fixed crash if initialization of EGL failed but was tried again later. The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly uninitialized data structure if loading the library first failed. A later try to use EGL then skipped initialization and assumed it was previously successful because the data structure now already existed. This led to at least one crash in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was dereferenced to make a call to eglBindAPI().