]> git.eshelyaron.com Git - emacs.git/commit
Restore functionality on Android 2.2
authorPo Lu <luangruo@yahoo.com>
Wed, 12 Jun 2024 08:44:21 +0000 (16:44 +0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 12 Jun 2024 09:29:35 +0000 (11:29 +0200)
commitf4ab96a068a23968a339bab4448b92faefd24c21
tree2a10ff27f128ae01e7b6469f9229715dcd44e203
parentcbe521889d288e94bba57413f4e263f059c93783
Restore functionality on Android 2.2

* java/Makefile.in (install_temp): Do not compress
directory-tree and generate such files in a special format that
stores file sizes.

* lib-src/asset-directory-tool.c (struct directory_tree): New
field st_size.
(need_file_size): New variable.
(main_1, main_2, main): Write file sizes before sibling offsets
if `--api-8' is specified.

* src/android-asset.h (struct android_asset_manager): New field
open.
(struct android_asset): New field name.
(AAssetManager_fromJava): Load AssetManager#open.
(AAssetManager_open): If a directory tree has already been
loaded, search for a matching asset and load its size thence, to
avoid the requirement of an AssetFileDescriptor.
(AAsset_close): Don't assume asset->fd exists.  Release
asset->name.
(AAsset_getLength): Likewise.
(android_asset_create_stream): If asset->name exists, call
AssetManager#open, in order to open compressed files.

* src/androidvfs.c (OLD_ANDROID_ASSETS): Define to 1 on API 8.
(android_extract_long, android_scan_directory_tree): Mark
arguments as const.  Adjust offsets when OLD_ANDROID_ASSETS.
(android_is_directory, android_init_assets, android_afs_readdir):
Likewise.

* src/lread.c (lread_fstat): Define to sys_fstat, not fstat.

(cherry picked from commit 02e70821b3800a082aec215a9ab8adbfafe9ad76)
java/Makefile.in
lib-src/asset-directory-tool.c
src/android-asset.h
src/androidvfs.c
src/lread.c