aboutsummaryrefslogtreecommitdiffstats
path: root/java/org
diff options
context:
space:
mode:
authorPo Lu2023-02-17 16:27:00 +0800
committerPo Lu2023-02-17 16:27:00 +0800
commit88afd96e36e62017c9c1f2229e2748b6dfbdb39a (patch)
tree218845ef248e9ba2131abd22404e3de9dfbf3cbd /java/org
parent759e6a24ab9690541acc6ece1adebaf524d6e5ae (diff)
downloademacs-88afd96e36e62017c9c1f2229e2748b6dfbdb39a.tar.gz
emacs-88afd96e36e62017c9c1f2229e2748b6dfbdb39a.zip
Fix build and running on Android 2.2
* INSTALL.android: Document that Android 2.2 is now supported, with caveats. * configure.ac (ANDROID_MIN_SDK, ANDROID_SDK_18_OR_EARLIER) (SYSTEM_TYPE, ANDROID_STUBIFY, SIZEOF_LONG): Correctly detect things missing on Android 2.2. * java/Makefile.in (ANDROID_JAR, JARSIGNER_FLAGS): * java/debug.sh (jdb, gdbserver, line): * java/org/gnu/emacs/EmacsApplication.java (findDumpFile): * java/org/gnu/emacs/EmacsService.java (onCreate): * java/org/gnu/emacs/EmacsThread.java (EmacsThread, run): Run parameter initialization on main thread. * src/android-asset.h (struct android_asset_manager) (struct android_asset, AAssetManager_fromJava, AAssetManager_open) (AAsset_close, android_asset_create_stream) (android_asset_read_internal, AAsset_openFileDescriptor) (AAsset_getLength, AAsset_getBuffer, AAsset_read): New file. * src/android.c (android_user_full_name, android_hack_asset_fd) (android_check_compressed_file): Implement for Android 2.2. * src/process.c (Fprocess_send_eof): Don't call tcdrain if unavailable. * src/sfntfont-android.c (system_font_directories): Fix compiler warning. * src/sfntfont.c (sfntfont_read_cmap): Correctly test rc of emacs_open. * src/textconv.c (handle_pending_conversion_events_1): Mark buffer UNINIT.
Diffstat (limited to 'java/org')
-rw-r--r--java/org/gnu/emacs/EmacsApplication.java1
-rw-r--r--java/org/gnu/emacs/EmacsService.java25
-rw-r--r--java/org/gnu/emacs/EmacsThread.java9
3 files changed, 24 insertions, 11 deletions
diff --git a/java/org/gnu/emacs/EmacsApplication.java b/java/org/gnu/emacs/EmacsApplication.java
index 96328b99d1c..6a065165eb1 100644
--- a/java/org/gnu/emacs/EmacsApplication.java
+++ b/java/org/gnu/emacs/EmacsApplication.java
@@ -49,6 +49,7 @@ public class EmacsApplication extends Application
49 for a file named ``emacs-<fingerprint>.pdmp'' and delete the 49 for a file named ``emacs-<fingerprint>.pdmp'' and delete the
50 rest. */ 50 rest. */
51 filesDirectory = context.getFilesDir (); 51 filesDirectory = context.getFilesDir ();
52
52 allFiles = filesDirectory.listFiles (new FileFilter () { 53 allFiles = filesDirectory.listFiles (new FileFilter () {
53 @Override 54 @Override
54 public boolean 55 public boolean
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java
index 2acb3ead086..4d373937ab0 100644
--- a/java/org/gnu/emacs/EmacsService.java
+++ b/java/org/gnu/emacs/EmacsService.java
@@ -180,11 +180,11 @@ public class EmacsService extends Service
180 public void 180 public void
181 onCreate () 181 onCreate ()
182 { 182 {
183 AssetManager manager; 183 final AssetManager manager;
184 Context app_context; 184 Context app_context;
185 String filesDir, libDir, cacheDir, classPath; 185 final String filesDir, libDir, cacheDir, classPath;
186 double pixelDensityX; 186 final double pixelDensityX;
187 double pixelDensityY; 187 final double pixelDensityY;
188 188
189 SERVICE = this; 189 SERVICE = this;
190 handler = new Handler (Looper.getMainLooper ()); 190 handler = new Handler (Looper.getMainLooper ());
@@ -210,13 +210,18 @@ public class EmacsService extends Service
210 Log.d (TAG, "Initializing Emacs, where filesDir = " + filesDir 210 Log.d (TAG, "Initializing Emacs, where filesDir = " + filesDir
211 + ", libDir = " + libDir + ", and classPath = " + classPath); 211 + ", libDir = " + libDir + ", and classPath = " + classPath);
212 212
213 EmacsNative.setEmacsParams (manager, filesDir, libDir,
214 cacheDir, (float) pixelDensityX,
215 (float) pixelDensityY,
216 classPath, this);
217
218 /* Start the thread that runs Emacs. */ 213 /* Start the thread that runs Emacs. */
219 thread = new EmacsThread (this, needDashQ); 214 thread = new EmacsThread (this, new Runnable () {
215 @Override
216 public void
217 run ()
218 {
219 EmacsNative.setEmacsParams (manager, filesDir, libDir,
220 cacheDir, (float) pixelDensityX,
221 (float) pixelDensityY,
222 classPath, EmacsService.this);
223 }
224 }, needDashQ);
220 thread.start (); 225 thread.start ();
221 } 226 }
222 catch (IOException exception) 227 catch (IOException exception)
diff --git a/java/org/gnu/emacs/EmacsThread.java b/java/org/gnu/emacs/EmacsThread.java
index 2724d838d41..30484710651 100644
--- a/java/org/gnu/emacs/EmacsThread.java
+++ b/java/org/gnu/emacs/EmacsThread.java
@@ -28,11 +28,16 @@ public class EmacsThread extends Thread
28 /* Whether or not Emacs should be started -Q. */ 28 /* Whether or not Emacs should be started -Q. */
29 private boolean startDashQ; 29 private boolean startDashQ;
30 30
31 /* Runnable run to initialize Emacs. */
32 private Runnable paramsClosure;
33
31 public 34 public
32 EmacsThread (EmacsService service, boolean startDashQ) 35 EmacsThread (EmacsService service, Runnable paramsClosure,
36 boolean startDashQ)
33 { 37 {
34 super ("Emacs main thread"); 38 super ("Emacs main thread");
35 this.startDashQ = startDashQ; 39 this.startDashQ = startDashQ;
40 this.paramsClosure = paramsClosure;
36 } 41 }
37 42
38 @Override 43 @Override
@@ -46,6 +51,8 @@ public class EmacsThread extends Thread
46 else 51 else
47 args = new String[] { "libandroid-emacs.so", "-Q", }; 52 args = new String[] { "libandroid-emacs.so", "-Q", };
48 53
54 paramsClosure.run ();
55
49 /* Run the native code now. */ 56 /* Run the native code now. */
50 EmacsNative.initEmacs (args, EmacsApplication.dumpFileName, 57 EmacsNative.initEmacs (args, EmacsApplication.dumpFileName,
51 Build.VERSION.SDK_INT); 58 Build.VERSION.SDK_INT);