diff options
author | Dianne Hackborn <hackbod@google.com> | 2013-09-14 01:04:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-14 01:04:05 +0000 |
commit | fc9122ecae06339283602bdc78c5d704d95e3f29 (patch) | |
tree | b33d6b9e8f6212473dc601acba6f444274ffcfb4 /core/java/android/os | |
parent | 5f68f717019433ce4fa284386ba48bd1b571073a (diff) | |
parent | 7e7144218e8681fff2065a891de517bad6fe1b38 (diff) | |
download | frameworks_base-fc9122ecae06339283602bdc78c5d704d95e3f29.zip frameworks_base-fc9122ecae06339283602bdc78c5d704d95e3f29.tar.gz frameworks_base-fc9122ecae06339283602bdc78c5d704d95e3f29.tar.bz2 |
Merge "Implement #10666712: NetworkOnMainThreadException should be..." into klp-dev
Diffstat (limited to 'core/java/android/os')
-rw-r--r-- | core/java/android/os/Parcel.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java index 46b0150..fec2a3e 100644 --- a/core/java/android/os/Parcel.java +++ b/core/java/android/os/Parcel.java @@ -228,6 +228,7 @@ public final class Parcel { private static final int EX_ILLEGAL_ARGUMENT = -3; 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_HAS_REPLY_HEADER = -128; // special; see below private static native int nativeDataSize(int nativePtr); @@ -1321,6 +1322,7 @@ public final class Parcel { * <li>{@link IllegalStateException} * <li>{@link NullPointerException} * <li>{@link SecurityException} + * <li>{@link NetworkOnMainThreadException} * </ul> * * @param e The Exception to be written. @@ -1340,6 +1342,8 @@ public final class Parcel { code = EX_NULL_POINTER; } else if (e instanceof IllegalStateException) { code = EX_ILLEGAL_STATE; + } else if (e instanceof NetworkOnMainThreadException) { + code = EX_NETWORK_MAIN_THREAD; } writeInt(code); StrictMode.clearGatheredViolations(); @@ -1455,6 +1459,8 @@ public final class Parcel { throw new NullPointerException(msg); case EX_ILLEGAL_STATE: throw new IllegalStateException(msg); + case EX_NETWORK_MAIN_THREAD: + throw new NetworkOnMainThreadException(); } throw new RuntimeException("Unknown exception code: " + code + " msg " + msg); |