@end menu
@node Touchscreens
-@section Using Emacs on touchscreens
+@section Using Emacs on Touchscreens
@cindex touchscreen input
Touchscreen input works by pressing and moving tools (which include
@code{touch-screen-delay}.
@node On-Screen Keyboards
-@section Using Emacs with virtual keyboards
+@section Using Emacs with Virtual Keyboards
@cindex virtual keyboards
@cindex on-screen keyboards
{
char **args;
int i;
- char *bootclasspath, *emacs_class_path;
+ char *bootclasspath, *emacs_class_path, *ld_library_path;
/* Allocate enough to hold the arguments to app_process. */
args = alloca ((10 + argc) * sizeof *args);
memset (args, 0, (10 + argc) * sizeof *args);
/* First, figure out what program to start. */
-#if defined __x86_64__ || defined __aarch64__
+#if defined __x86_64__ || defined __aarch64__ || defined __mips64
args[0] = (char *) "/system/bin/app_process64";
-#else
+#else /* i386 || regular mips || arm */
args[0] = (char *) "/system/bin/app_process";
-#endif
+#endif /* __x86_64__ || __aarch64__ || __mips64 */
/* Machines with ART require the boot classpath to be manually
specified. Machines with Dalvik however refuse to do so, as they
bootclasspath = NULL;
goto skip_setup;
}
-#else
+#else /* !HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL */
if (__ANDROID_API__ < 21)
{
bootclasspath = NULL;
goto skip_setup;
}
-#endif
+#endif /* HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL */
/* Next, obtain the boot class path. */
bootclasspath = getenv ("BOOTCLASSPATH");
return 1;
}
+ /* Restore LD_LIBRARY_PATH to its original value, the app library
+ directory, to guarantee that it is possible for Java to find the
+ Emacs C code later. */
+
+ ld_library_path = getenv ("EMACS_LD_LIBRARY_PATH");
+
+ if (ld_library_path)
+ setenv ("LD_LIBRARY_PATH", ld_library_path, 1);
+
if (bootclasspath)
{
if (asprintf (&bootclasspath, "-Djava.class.path=%s:%s",
}
else
{
-#endif
+#endif /* HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL */
args[3] = (char *) "org.gnu.emacs.EmacsNoninteractive";
/* Arguments from here on are passed to main in
args[4 + i] = argv[i];
#if HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL
}
-#endif
+#endif /* HAVE_DECL_ANDROID_GET_DEVICE_API_LEVEL */
/* Finally, try to start the app_process. */
execvp (args[0], args);
/* Set LD_LIBRARY_PATH to an appropriate value. */
setenv ("LD_LIBRARY_PATH", android_lib_dir, 1);
+ /* EMACS_LD_LIBRARY_PATH records the location of the app library
+ directory. android-emacs refers to this, since users have valid
+ reasons for changing LD_LIBRARY_PATH to a value that precludes
+ the possibility of Java locating libemacs later. */
+ setenv ("EMACS_LD_LIBRARY_PATH", android_lib_dir, 1);
+
/* Make a reference to the Emacs service. */
if (emacs_service_object)