OSDN Git Service

libbinder: Handle transaction failures correctly
authorChristopher Wiley <wiley@google.com>
Mon, 23 Nov 2015 00:29:58 +0000 (16:29 -0800)
committerChristopher Wiley <wiley@google.com>
Thu, 3 Dec 2015 21:17:22 +0000 (21:17 +0000)
commitcff7f175c1a4f790fdc64a56695c5b4b08b6bb6e
tree26379738e200eaef410381c6af74c664e19423f9
parentb2e3095a604e16d5d80d1e3d38bb92a6c37bd127
libbinder: Handle transaction failures correctly

Java code expects status_t != OK to be caught at the JNI level in
android_util_Binder.cpp (see signalExceptionForError).  We were
incorrectly mapping this kind of failure to a special exception type
and writing that exception type to parcels.

Instead, refuse to write EX_TRANSACTION_FAILED to a parcel and return
the status value instead.

While here, remove non-trivial constructors to push authors toward the
more explicit factory methods.  Remove getException() and push authors
toward using the simpler getter methods. Fix minor camelCase issues.

Bug: 25615695
Test: system/tools/aidl integration tests still pass

Change-Id: I7cad3ac8ae8300b5ac0b466606f4934d01e503c5
include/binder/Status.h
libs/binder/Status.cpp