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

Commit 31342ca6 authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android (Google) Code Review
Browse files

Merge "Use the root case to set remote stack trace for"

parents 97d43d52 3b946f43
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.Nullable;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.ExceptionUtils;
import android.util.Log;
import android.util.Size;
import android.util.SizeF;
@@ -1866,7 +1867,14 @@ public final class Parcel {
            if (remoteStackTrace != null) {
                RemoteException cause = new RemoteException(
                        "Remote stack trace:\n" + remoteStackTrace, null, false, false);
                e.initCause(cause);
                try {
                    Throwable rootCause = ExceptionUtils.getRootCause(e);
                    if (rootCause != null) {
                        rootCause.initCause(cause);
                    }
                } catch (RuntimeException ex) {
                    Log.e(TAG, "Cannot set cause " + cause + " for " + e, ex);
                }
            }
            SneakyThrow.sneakyThrow(e);
        }