aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorPo Lu2023-07-31 14:18:12 +0800
committerPo Lu2023-07-31 14:18:12 +0800
commit9cf166db63b7383a94dc47a6a5251c0dbe1dae9b (patch)
tree1ce988f64a4f259a8f78d95844fb38976947ae7d /java
parent5a8130ab967cb296d028539d10c749ee35f62e6a (diff)
downloademacs-9cf166db63b7383a94dc47a6a5251c0dbe1dae9b.tar.gz
emacs-9cf166db63b7383a94dc47a6a5251c0dbe1dae9b.zip
Initialize Android API level earlier
* java/org/gnu/emacs/EmacsNative.java (EmacsNative): * java/org/gnu/emacs/EmacsNoninteractive.java (main): * java/org/gnu/emacs/EmacsService.java (run): * java/org/gnu/emacs/EmacsThread.java (run): * src/android.c (initEmacs, setEmacsParams): Set `android_api_level' within setEmacsParams, not in initEmacs. * src/androidvfs.c: Pacify compiler warnings.
Diffstat (limited to 'java')
-rw-r--r--java/org/gnu/emacs/EmacsNative.java14
-rw-r--r--java/org/gnu/emacs/EmacsNoninteractive.java6
-rw-r--r--java/org/gnu/emacs/EmacsService.java3
-rw-r--r--java/org/gnu/emacs/EmacsThread.java4
4 files changed, 13 insertions, 14 deletions
diff --git a/java/org/gnu/emacs/EmacsNative.java b/java/org/gnu/emacs/EmacsNative.java
index ea200037218..7d72a9f192e 100644
--- a/java/org/gnu/emacs/EmacsNative.java
+++ b/java/org/gnu/emacs/EmacsNative.java
@@ -66,7 +66,9 @@ public final class EmacsNative
66 classPath must be the classpath of this app_process process, or 66 classPath must be the classpath of this app_process process, or
67 NULL. 67 NULL.
68 68
69 emacsService must be the EmacsService singleton, or NULL. */ 69 emacsService must be the EmacsService singleton, or NULL.
70
71 apiLevel is the version of Android being run. */
70 public static native void setEmacsParams (AssetManager assetManager, 72 public static native void setEmacsParams (AssetManager assetManager,
71 String filesDir, 73 String filesDir,
72 String libDir, 74 String libDir,
@@ -75,18 +77,16 @@ public final class EmacsNative
75 float pixelDensityY, 77 float pixelDensityY,
76 float scaledDensity, 78 float scaledDensity,
77 String classPath, 79 String classPath,
78 EmacsService emacsService); 80 EmacsService emacsService,
81 int apiLevel);
79 82
80 /* Initialize Emacs with the argument array ARGV. Each argument 83 /* Initialize Emacs with the argument array ARGV. Each argument
81 must contain a NULL terminated string, or else the behavior is 84 must contain a NULL terminated string, or else the behavior is
82 undefined. 85 undefined.
83 86
84 DUMPFILE is the dump file to use, or NULL if Emacs is to load 87 DUMPFILE is the dump file to use, or NULL if Emacs is to load
85 loadup.el itself. 88 loadup.el itself. */
86 89 public static native void initEmacs (String argv[], String dumpFile);
87 APILEVEL is the version of Android being used. */
88 public static native void initEmacs (String argv[], String dumpFile,
89 int apiLevel);
90 90
91 /* Abort and generate a native core dump. */ 91 /* Abort and generate a native core dump. */
92 public static native void emacsAbort (); 92 public static native void emacsAbort ();
diff --git a/java/org/gnu/emacs/EmacsNoninteractive.java b/java/org/gnu/emacs/EmacsNoninteractive.java
index aa6fa41ba97..1c7513e1cc9 100644
--- a/java/org/gnu/emacs/EmacsNoninteractive.java
+++ b/java/org/gnu/emacs/EmacsNoninteractive.java
@@ -190,14 +190,14 @@ public final class EmacsNoninteractive
190 190
191 EmacsNative.setEmacsParams (assets, filesDir, 191 EmacsNative.setEmacsParams (assets, filesDir,
192 libDir, cacheDir, 0.0f, 192 libDir, cacheDir, 0.0f,
193 0.0f, 0.0f, null, null); 193 0.0f, 0.0f, null, null,
194 Build.VERSION.SDK_INT);
194 195
195 /* Now find the dump file that Emacs should use, if it has already 196 /* Now find the dump file that Emacs should use, if it has already
196 been dumped. */ 197 been dumped. */
197 EmacsApplication.findDumpFile (context); 198 EmacsApplication.findDumpFile (context);
198 199
199 /* Start Emacs. */ 200 /* Start Emacs. */
200 EmacsNative.initEmacs (args, EmacsApplication.dumpFileName, 201 EmacsNative.initEmacs (args, EmacsApplication.dumpFileName);
201 Build.VERSION.SDK_INT);
202 } 202 }
203}; 203};
diff --git a/java/org/gnu/emacs/EmacsService.java b/java/org/gnu/emacs/EmacsService.java
index e714f75fdf2..3c1bb0855f4 100644
--- a/java/org/gnu/emacs/EmacsService.java
+++ b/java/org/gnu/emacs/EmacsService.java
@@ -291,7 +291,8 @@ public final class EmacsService extends Service
291 cacheDir, (float) pixelDensityX, 291 cacheDir, (float) pixelDensityX,
292 (float) pixelDensityY, 292 (float) pixelDensityY,
293 (float) scaledDensity, 293 (float) scaledDensity,
294 classPath, EmacsService.this); 294 classPath, EmacsService.this,
295 Build.VERSION.SDK_INT);
295 } 296 }
296 }, extraStartupArgument, 297 }, extraStartupArgument,
297 /* If any file needs to be opened, open it now. */ 298 /* If any file needs to be opened, open it now. */
diff --git a/java/org/gnu/emacs/EmacsThread.java b/java/org/gnu/emacs/EmacsThread.java
index c003ea95c50..5307015b46f 100644
--- a/java/org/gnu/emacs/EmacsThread.java
+++ b/java/org/gnu/emacs/EmacsThread.java
@@ -22,7 +22,6 @@ package org.gnu.emacs;
22import java.lang.Thread; 22import java.lang.Thread;
23import java.util.Arrays; 23import java.util.Arrays;
24 24
25import android.os.Build;
26import android.util.Log; 25import android.util.Log;
27 26
28public final class EmacsThread extends Thread 27public final class EmacsThread extends Thread
@@ -78,7 +77,6 @@ public final class EmacsThread extends Thread
78 77
79 /* Run the native code now. */ 78 /* Run the native code now. */
80 Log.d (TAG, "run: " + Arrays.toString (args)); 79 Log.d (TAG, "run: " + Arrays.toString (args));
81 EmacsNative.initEmacs (args, EmacsApplication.dumpFileName, 80 EmacsNative.initEmacs (args, EmacsApplication.dumpFileName);
82 Build.VERSION.SDK_INT);
83 } 81 }
84}; 82};