summaryrefslogtreecommitdiffstats
path: root/core/jni/android_view_InputChannel.cpp
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-02-26 15:39:12 -0800
committerJeff Brown <jeffbrown@google.com>2011-02-26 15:39:12 -0800
commit02cafc9f6ec018ae31ca9032be67a2d8d410736a (patch)
tree7666074d15d2c9500831ded41b443c387b4f9658 /core/jni/android_view_InputChannel.cpp
parent505312482782a600e997c91712f03f83c7a70428 (diff)
downloadframeworks_base-02cafc9f6ec018ae31ca9032be67a2d8d410736a.zip
frameworks_base-02cafc9f6ec018ae31ca9032be67a2d8d410736a.tar.gz
frameworks_base-02cafc9f6ec018ae31ca9032be67a2d8d410736a.tar.bz2
Log errors reading input channel from parcel.
Bug: 3378634 Change-Id: I47908e48b8348f0366dcef545e828b65d99d81a6
Diffstat (limited to 'core/jni/android_view_InputChannel.cpp')
-rw-r--r--core/jni/android_view_InputChannel.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/core/jni/android_view_InputChannel.cpp b/core/jni/android_view_InputChannel.cpp
index 4a4393a..0c2801c 100644
--- a/core/jni/android_view_InputChannel.cpp
+++ b/core/jni/android_view_InputChannel.cpp
@@ -186,9 +186,21 @@ static void android_view_InputChannel_nativeReadFromParcel(JNIEnv* env, jobject
bool isInitialized = parcel->readInt32();
if (isInitialized) {
String8 name = parcel->readString8();
- int32_t ashmemFd = dup(parcel->readFileDescriptor());
- int32_t receivePipeFd = dup(parcel->readFileDescriptor());
- int32_t sendPipeFd = dup(parcel->readFileDescriptor());
+ int32_t parcelAshmemFd = parcel->readFileDescriptor();
+ int32_t ashmemFd = dup(parcelAshmemFd);
+ if (ashmemFd < 0) {
+ LOGE("Error %d dup ashmem fd %d.", errno, parcelAshmemFd);
+ }
+ int32_t parcelReceivePipeFd = parcel->readFileDescriptor();
+ int32_t receivePipeFd = dup(parcelReceivePipeFd);
+ if (receivePipeFd < 0) {
+ LOGE("Error %d dup receive pipe fd %d.", errno, parcelReceivePipeFd);
+ }
+ int32_t parcelSendPipeFd = parcel->readFileDescriptor();
+ int32_t sendPipeFd = dup(parcelSendPipeFd);
+ if (sendPipeFd < 0) {
+ LOGE("Error %d dup send pipe fd %d.", errno, parcelSendPipeFd);
+ }
if (ashmemFd < 0 || receivePipeFd < 0 || sendPipeFd < 0) {
if (ashmemFd >= 0) ::close(ashmemFd);
if (receivePipeFd >= 0) ::close(receivePipeFd);