@itemize @bullet
@item
Subprocesses (such as @command{ls}) can not run from the
-@file{/assets} directory.
+@file{/assets} directory; if you try to run a subprocess with
+@code{current-directory} set to @file{/assets} or a subdirectory
+thereof, it will run from the home directory instead.
@item
There are no @file{.} and @file{..} directories inside the
public boolean
onSomeKindOfMotionEvent (MotionEvent event)
{
- if (!event.isFromSource (InputDevice.SOURCE_CLASS_POINTER))
+ /* isFromSource is not available until API level 18. */
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2)
+ {
+ if (!event.isFromSource (InputDevice.SOURCE_CLASS_POINTER))
+ return false;
+ }
+ else if (event.getSource () != InputDevice.SOURCE_CLASS_POINTER)
return false;
switch (event.getAction ())
/* Cursor off. Will be switched on again in gui_update_window_end. */
gui_clear_cursor (w);
+ /* To avoid sequence point problems, make sure to only call
+ FRAME_ANDROID_DRAWABLE once. */
android_copy_area (FRAME_ANDROID_DRAWABLE (f),
- FRAME_ANDROID_DRAWABLE (f),
+ FRAME_ANDROID_WINDOW (f),
f->output_data.android->normal_gc,
x, from_y, width, height, x, to_y);
directory if it's unreachable. If ENCODE is true, return as a string
suitable for a system call; otherwise, return a string in its
internal representation. Signal an error if the result would not be
- an accessible directory. */
+ an accessible directory.
+
+ If the default directory lies inside a special directory which
+ cannot be made the current working directory, and ENCODE is also
+ set, simply return the home directory. */
Lisp_Object
get_current_directory (bool encode)
if (NILP (dir))
dir = build_string ("~");
+#if defined HAVE_ANDROID && !defined ANDROID_STUBIFY
+
+ /* If DIR is an asset directory or a content directory, return
+ the home directory instead. */
+
+ if (encode && (!strcmp (SSDATA (dir), "/assets")
+ || !strncmp (SSDATA (dir), "/assets/", 8)
+ || !strcmp (SSDATA (dir), "/content")
+ || !strncmp (SSDATA (dir), "/content/", 9)))
+ dir = build_string ("~");
+
+#endif /* HAVE_ANDROID && ANDROID_STUBIFY */
+
dir = expand_and_dir_to_file (dir);
Lisp_Object encoded_dir = ENCODE_FILE (remove_slash_colon (dir));