From 33d738a10209d4dc882a65285d6e71cfaeabe769 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 12 Sep 2014 14:23:58 -0700 Subject: Allow throwing UnsupportedOperationException across Binder. Change-Id: I3a9b81958886033d546c3a20331716dbb9492365 --- core/java/android/os/Parcel.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java index d1ad0ad..5230128 100644 --- a/core/java/android/os/Parcel.java +++ b/core/java/android/os/Parcel.java @@ -236,6 +236,7 @@ public final class Parcel { private static final int EX_NULL_POINTER = -4; private static final int EX_ILLEGAL_STATE = -5; private static final int EX_NETWORK_MAIN_THREAD = -6; + private static final int EX_UNSUPPORTED_OPERATION = -7; private static final int EX_HAS_REPLY_HEADER = -128; // special; see below private static native int nativeDataSize(long nativePtr); @@ -1427,6 +1428,8 @@ public final class Parcel { code = EX_ILLEGAL_STATE; } else if (e instanceof NetworkOnMainThreadException) { code = EX_NETWORK_MAIN_THREAD; + } else if (e instanceof UnsupportedOperationException) { + code = EX_UNSUPPORTED_OPERATION; } writeInt(code); StrictMode.clearGatheredViolations(); @@ -1545,6 +1548,8 @@ public final class Parcel { throw new IllegalStateException(msg); case EX_NETWORK_MAIN_THREAD: throw new NetworkOnMainThreadException(); + case EX_UNSUPPORTED_OPERATION: + throw new UnsupportedOperationException(msg); } throw new RuntimeException("Unknown exception code: " + code + " msg " + msg); -- cgit v1.1