summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2015-06-29 11:00:15 -0700
committerChristopher Tate <ctate@google.com>2015-06-29 11:52:23 -0700
commitffd5864202a7c85620b7eb5032dc0120481705e5 (patch)
tree9b749d0a55141efd013c73f88baa3dd61ac0fd6a /core/jni
parent82b3f67711246ad5beaf7702ce16e9d433406d1e (diff)
downloadframeworks_base-ffd5864202a7c85620b7eb5032dc0120481705e5.zip
frameworks_base-ffd5864202a7c85620b7eb5032dc0120481705e5.tar.gz
frameworks_base-ffd5864202a7c85620b7eb5032dc0120481705e5.tar.bz2
Throw DeadObjectException on failed transaction, not RuntimeException
In practice we only see failed transactions with small payloads when the remote dies while the binder operation is in flight. Throw the applicable exception type rather than the generic "oops binder went haywire" one. Bug 22104446 Change-Id: I785c15617db7a1f4d505aa11f16e61551c8357ba
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_util_Binder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index e2cfa44..c139cd7 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -697,9 +697,11 @@ void signalExceptionForError(JNIEnv* env, jobject obj, status_t err,
} else {
// Heuristic: a payload smaller than this threshold "shouldn't" be too
// big, so it's probably some other, more subtle problem. In practice
- // it nearly always means that the remote process died while the binder
+ // it seems to always mean that the remote process died while the binder
// transaction was already in flight.
- exceptionToThrow = "java/lang/RuntimeException";
+ exceptionToThrow = (canThrowRemoteException)
+ ? "android/os/DeadObjectException"
+ : "java/lang/RuntimeException";
snprintf(msg, sizeof(msg)-1,
"Transaction failed on small parcel; remote process probably died");
}