OSDN Git Service

Richer ParcelFileDescriptor close events.
authorJeff Sharkey <jsharkey@android.com>
Sun, 11 Aug 2013 19:54:42 +0000 (12:54 -0700)
committerJeff Sharkey <jsharkey@android.com>
Fri, 16 Aug 2013 21:34:43 +0000 (14:34 -0700)
commitda5a3e12f4f8f965c57d6f93c74190f43ea233f3
tree2476c82e8b84347f3e61cde21ba864f154ec1e22
parent2241d45c68739e5bdf187ba3325ee237ef143e21
Richer ParcelFileDescriptor close events.

When reading from the end of a pipe or socket, there is no way to
tell if the other end has finished successfully, encountered an error,
or outright crashed.  To solve this, we create a second socketpair()
as a communication channel between the two ends of a pipe or
socket pair, sending a status code with details about why the
ParcelFileDescriptor was closed.

The writer end of a pipe or socket can closeWithError() to send a
message to the reader end.  When the reader encounters EOF, they
call checkError() to detect if any error occured.  This also detects
the case where the remote process died without sending a success
message.

This design is also extended to support regular files on disk, using
the communication channel above to detect various remote close events
or crashes, and delivering that event to a supplied OnCloseListener.

Replaces JNI with best-practice Libcore.os calls, and deprecates
some flags to match Context.

Bug: 10330121
Change-Id: I8cfa1e4fb6f57397667c7f785106193e0faccad3
api/current.txt
core/java/android/content/ContentResolver.java
core/java/android/os/Parcel.java
core/java/android/os/ParcelFileDescriptor.java
core/jni/Android.mk
core/jni/AndroidRuntime.cpp
core/jni/android_os_ParcelFileDescriptor.cpp [deleted file]