$ adb shell "settings put global settings_enable_monitor_phantom_procs false"
@end example
+@cindex C locale settings, Android
+ Emacs does not respect the locale configured for user applications
+in the system, for the selection of locales available there does not
+match that supplied by the C library. When Emacs starts on Android
+5.0 or newer, the @code{LANG} environment variable is set to
+@code{en_US.utf8}, which induces subprocesses linked against the
+Android C library to print output sensibly. Earlier versions of
+Android do not implement locales at all, on account of which the
+variable is set to @code{C} instead.
+
@cindex running emacs in the background, android
@cindex emacs killed, android
@cindex emacs in the background, android
the possibility of Java locating libemacs later. */
setenv ("EMACS_LD_LIBRARY_PATH", android_lib_dir, 1);
+ /* If the system is Android 5.0 or later, set LANG to en_US.utf8,
+ which is understood by the C library. In other instances set it
+ to C, a meaningless value, for good measure. */
+
+ if (emacs_service_object)
+ {
+ if (api_level >= 21)
+ setenv ("LANG", "en_US.utf8", 1);
+ else
+ setenv ("LANG", "C", 1);
+ }
+
/* Make a reference to the Emacs service. */
if (emacs_service_object)