diff options
| author | Po Lu | 2023-07-31 14:18:12 +0800 |
|---|---|---|
| committer | Po Lu | 2023-07-31 14:18:12 +0800 |
| commit | 9cf166db63b7383a94dc47a6a5251c0dbe1dae9b (patch) | |
| tree | 1ce988f64a4f259a8f78d95844fb38976947ae7d /src/android.c | |
| parent | 5a8130ab967cb296d028539d10c749ee35f62e6a (diff) | |
| download | emacs-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 'src/android.c')
| -rw-r--r-- | src/android.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/android.c b/src/android.c index 8c0232a51f8..f60ff5acb54 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -1281,7 +1281,8 @@ NATIVE_NAME (setEmacsParams) (JNIEnv *env, jobject object, | |||
| 1281 | jfloat pixel_density_y, | 1281 | jfloat pixel_density_y, |
| 1282 | jfloat scaled_density, | 1282 | jfloat scaled_density, |
| 1283 | jobject class_path, | 1283 | jobject class_path, |
| 1284 | jobject emacs_service_object) | 1284 | jobject emacs_service_object, |
| 1285 | jint api_level) | ||
| 1285 | { | 1286 | { |
| 1286 | JNI_STACK_ALIGNMENT_PROLOGUE; | 1287 | JNI_STACK_ALIGNMENT_PROLOGUE; |
| 1287 | 1288 | ||
| @@ -1289,6 +1290,10 @@ NATIVE_NAME (setEmacsParams) (JNIEnv *env, jobject object, | |||
| 1289 | pthread_t thread; | 1290 | pthread_t thread; |
| 1290 | const char *java_string; | 1291 | const char *java_string; |
| 1291 | 1292 | ||
| 1293 | /* Set the Android API level early, as it is used by | ||
| 1294 | `android_vfs_init'. */ | ||
| 1295 | android_api_level = api_level; | ||
| 1296 | |||
| 1292 | /* This function should only be called from the main thread. */ | 1297 | /* This function should only be called from the main thread. */ |
| 1293 | 1298 | ||
| 1294 | android_pixel_density_x = pixel_density_x; | 1299 | android_pixel_density_x = pixel_density_x; |
| @@ -1771,7 +1776,7 @@ android_init_emacs_cursor (void) | |||
| 1771 | 1776 | ||
| 1772 | JNIEXPORT void JNICALL | 1777 | JNIEXPORT void JNICALL |
| 1773 | NATIVE_NAME (initEmacs) (JNIEnv *env, jobject object, jarray argv, | 1778 | NATIVE_NAME (initEmacs) (JNIEnv *env, jobject object, jarray argv, |
| 1774 | jobject dump_file_object, jint api_level) | 1779 | jobject dump_file_object) |
| 1775 | { | 1780 | { |
| 1776 | /* android_emacs_init is not main, so GCC is not nice enough to add | 1781 | /* android_emacs_init is not main, so GCC is not nice enough to add |
| 1777 | the stack alignment prologue. | 1782 | the stack alignment prologue. |
| @@ -1788,9 +1793,6 @@ NATIVE_NAME (initEmacs) (JNIEnv *env, jobject object, jarray argv, | |||
| 1788 | const char *c_argument; | 1793 | const char *c_argument; |
| 1789 | char *dump_file; | 1794 | char *dump_file; |
| 1790 | 1795 | ||
| 1791 | /* Set the Android API level. */ | ||
| 1792 | android_api_level = api_level; | ||
| 1793 | |||
| 1794 | android_java_env = env; | 1796 | android_java_env = env; |
| 1795 | 1797 | ||
| 1796 | nelements = (*env)->GetArrayLength (env, argv); | 1798 | nelements = (*env)->GetArrayLength (env, argv); |