OSDN Git Service

Merge "Ensure that debug builds crash again if there is a BinderProxy leak."
[android-x86/frameworks-base.git] / core / java / android / os / Binder.java
index 86e5829..1b707bd 100644 (file)
@@ -460,6 +460,11 @@ public class Binder implements IBinder {
      *
      * <p>If you want to call this, call transact().
      *
+     * <p>Implementations that are returning a result should generally use
+     * {@link Parcel#writeNoException() Parcel.writeNoException} and
+     * {@link Parcel#writeException(Exception) Parcel.writeException} to propagate
+     * exceptions back to the caller.</p>
+     *
      * @param code The action to perform.  This should
      * be a number between {@link #FIRST_CALL_TRANSACTION} and
      * {@link #LAST_CALL_TRANSACTION}.
@@ -716,13 +721,6 @@ public class Binder implements IBinder {
                 reply.writeException(e);
             }
             res = true;
-        } catch (OutOfMemoryError e) {
-            // Unconditionally log this, since this is generally unrecoverable.
-            Log.e(TAG, "Caught an OutOfMemoryError from the binder stub implementation.", e);
-            RuntimeException re = new RuntimeException("Out of memory", e);
-            reply.setDataPosition(0);
-            reply.writeException(re);
-            res = true;
         } finally {
             if (tracingEnabled) {
                 Trace.traceEnd(Trace.TRACE_TAG_ALWAYS);