Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f6af94c authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Binder: Don't attempt to catch OutOfMemoryError

This will be caught by surrounding code and will result in an
abort that will contain details of the exception + the associated
state of each thread. Catching the OOME in this manner is
counter-productive because we're immediately allocating inside the
catch, which is likely to cause more problems (and obscure the original
exception) unless there was an intervening GC.

Bug: 62514767
Test: make

Change-Id: I5a17707036c832d65480f18989faaf6747a29877
parent c276c79e
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -687,13 +687,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);