Commit Graph
22 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 d6985d81eb Android: Simplify joystickAxis and queryGameInfo, drop dead JNI calls
joystickAxis copies the axes in batches on the stack instead of allocating
per event, and bounds the count by the arrays it got. queryGameInfo's cache
is a local, in a helper so it's gone before the thread manager is torn down.

Removes Android_GetFreeSpaceByFilePath (never called) with its Java side, and
isLandscape, which only existed to call NativeGetAppInfo early.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-18 01:36:35 +02:00
Henrik RydgårdandClaude Opus 5.5 a09f59910b Android: Fix JNI edge cases, read Java strings as real UTF-8
- Scoped storage no longer flips on while no activity is registered: whether
  legacy storage was preserved is fixed per install, so it's asked once.
- Free space reads as unknown (-1), not 0 bytes, without an activity.
- Strings from Java (file listings and info, crash history, the camera list,
  the input debug string) go through GetJavaString, so names with characters
  outside the BMP aren't mangled, and a null string can't crash the crash
  history.
- Requests (inputbox, browse_*) whose command can't be delivered are failed
  instead of left waiting forever.
- A font that fails to load uses the default typeface (-1) instead of font 0,
  and is retried later if there was no activity yet. Missing exception checks
  added in the text renderer.
- Method IDs and the storage callbacks are looked up once in JNI_OnLoad.
- Unknown permissions are logged correctly.

Also removes what was left of Moga support, the unused backbuffer format and
a stray MessageBox macro, and tidies System_GetCameraDeviceList.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-18 01:29:18 +02:00
Henrik Rydgård 092ab42fe7 Clean up ugly usage of the g_nativeLibDir global. Now it's local in VulkanLoader. 2026-08-06 18:12:04 +02:00
Henrik Rydgård 073ef61643 Merge the two functions, fix JNI lifetime issues
Fixes the last part of #10885 finally.
2025-09-05 10:31:51 +02:00
Henrik Rydgård b472eb8b8b Remove a lot of unnecessary string constructors 2025-08-31 15:49:29 +02:00
Henrik Rydgård edbc7afcc1 Add support for prefix filtering in directory listing. 2024-11-29 11:14:52 +01:00
Henrik Rydgård 902eed59bb Android: Make use of the (spooky) fact that Android_RemoveFile deletes recursively. 2024-01-22 11:55:38 +01:00
Dzmitry Dubrova a461800973 Implement custom driver loading for ARM64 Android devices 2023-12-14 08:53:03 +03:00
Henrik Rydgård d0ee5fc308 Path: Use string_view more to avoid allocations 2023-11-13 23:24:42 +01:00
Unknown W. Brackets 7b8350f8a8 Android: Differentiate empty dir from failure. 2022-10-09 14:42:31 -07:00
Henrik Rydgård 48310d15a9 Add metafilesystem hook to add optimized implementations of compute recursive directory size 2021-09-11 18:12:29 +02:00
Henrik Rydgård e842d395fa Add untested function Android_ComputeRecursiveDirectorySize 2021-09-11 18:11:53 +02:00
Henrik Rydgård a0a5f7a67a Minor improvements on Android 9/10. Let the user reset to root of storage.
This includes handling weird "raw:/" content URIs. These I haven't seen
on newer versions.
2021-08-04 23:22:43 +02:00
Henrik Rydgård 3ec13b8440 Two more functions 2021-07-25 17:32:12 +02:00
Henrik Rydgård 0997b8500c Convert four more functions to allow for error codes.
Note that they still don't actually use them...
2021-07-25 17:32:12 +02:00
Henrik Rydgård 2333239514 Change one storage function to use an error code. 2021-07-25 17:32:12 +02:00
Henrik Rydgård ab69b896c3 Add and hook up Android_MoveFile 2021-07-25 17:32:12 +02:00
Henrik Rydgård 729496b60a Error code support preparations 2021-07-25 17:32:09 +02:00
Henrik Rydgård d5781824eb Fix lastModified, speed up Android_FileExists. Add Android_CopyFile (unused) 2021-07-24 00:33:05 +02:00
Henrik Rydgård 4f10ff9d31 Add quick method to check file existence by content URI.
Seems to speed up bringing up the pause screen slightly (checking for
save state files).
2021-07-19 17:34:51 +02:00
Henrik Rydgård fff3850096 Add ability to rename content URI files, fixing saving save states.
buildfix
2021-07-19 17:34:50 +02:00
Henrik Rydgård 9b32ea2f55 Split out AndroidStorage.cpp from android/jni/app-android.cpp, move to Common 2021-06-07 00:26:24 +02:00