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

Commit b819caad authored by Hans Boehm's avatar Hans Boehm
Browse files

Remove most fillInStackTrace() calls from core

Throwable's constructor already calls it, and it is
quite expensive. Removed calls were redundant.

Bug: 373764538
Flag: EXEMPT bugfix

Change-Id: Iad26d10f3c6d89e772a1430ecf842c8cfb24effd
parent 2814d858
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -5286,7 +5286,6 @@ public class ActivityManager {
        if (!exported) {
            /*
            RuntimeException here = new RuntimeException("here");
            here.fillInStackTrace();
            Slog.w(TAG, "Permission denied: checkComponentPermission() owningUid=" + owningUid,
                    here);
            */
+0 −1
Original line number Diff line number Diff line
@@ -1835,7 +1835,6 @@ public class ApplicationPackageManager extends PackageManager {

                if (false) {
                    RuntimeException e = new RuntimeException("here");
                    e.fillInStackTrace();
                    Log.w(TAG, "Getting drawable 0x" + Integer.toHexString(resId)
                                    + " from package " + packageName
                                    + ": app scale=" + r.getCompatibilityInfo().applicationScale
+0 −5
Original line number Diff line number Diff line
@@ -1648,7 +1648,6 @@ public final class LoadedApk {
                        }
                        RuntimeException ex = new IllegalArgumentException(
                                "Originally unregistered here:");
                        ex.fillInStackTrace();
                        rd.setUnregisterLocation(ex);
                        holder.put(r, rd);
                    }
@@ -1848,7 +1847,6 @@ public final class LoadedApk {
            mInstrumentation = instrumentation;
            mRegistered = registered;
            mLocation = new IntentReceiverLeaked(null);
            mLocation.fillInStackTrace();
        }

        void validate(Context context, Handler activityThread) {
@@ -1988,7 +1986,6 @@ public final class LoadedApk {
                        }
                        RuntimeException ex = new IllegalArgumentException(
                                "Originally unbound here:");
                        ex.fillInStackTrace();
                        sd.setUnbindLocation(ex);
                        holder.put(c, sd);
                    }
@@ -2064,7 +2061,6 @@ public final class LoadedApk {
            mActivityThread = activityThread;
            mActivityExecutor = null;
            mLocation = new ServiceConnectionLeaked(null);
            mLocation.fillInStackTrace();
            mFlags = flags;
        }

@@ -2076,7 +2072,6 @@ public final class LoadedApk {
            mActivityThread = null;
            mActivityExecutor = activityExecutor;
            mLocation = new ServiceConnectionLeaked(null);
            mLocation.fillInStackTrace();
            mFlags = flags;
        }

+43 −46
Original line number Diff line number Diff line
@@ -778,7 +778,6 @@ class LoaderManagerImpl extends LoaderManager {
        if (DEBUG) Log.v(TAG, "Starting in " + this);
        if (mStarted) {
            RuntimeException e = new RuntimeException("here");
            e.fillInStackTrace();
            Log.w(TAG, "Called doStart when already started: " + this, e);
            return;
        }
@@ -796,7 +795,6 @@ class LoaderManagerImpl extends LoaderManager {
        if (DEBUG) Log.v(TAG, "Stopping in " + this);
        if (!mStarted) {
            RuntimeException e = new RuntimeException("here");
            e.fillInStackTrace();
            Log.w(TAG, "Called doStop when not started: " + this, e);
            return;
        }
@@ -811,7 +809,6 @@ class LoaderManagerImpl extends LoaderManager {
        if (DEBUG) Log.v(TAG, "Retaining in " + this);
        if (!mStarted) {
            RuntimeException e = new RuntimeException("here");
            e.fillInStackTrace();
            Log.w(TAG, "Called doRetain when not started: " + this, e);
            return;
        }
+0 −3
Original line number Diff line number Diff line
@@ -1137,7 +1137,6 @@ public class ResourcesManager {
        synchronized (mLock) {
            if (DEBUG) {
                Throwable here = new Throwable();
                here.fillInStackTrace();
                Slog.w(TAG, "!! Create resources for key=" + key, here);
            }

@@ -1158,7 +1157,6 @@ public class ResourcesManager {
        synchronized (mLock) {
            if (DEBUG) {
                Throwable here = new Throwable();
                here.fillInStackTrace();
                Slog.w(TAG, "!! Get resources for activity=" + activityToken + " key=" + key, here);
            }

@@ -1302,7 +1300,6 @@ public class ResourcesManager {

                if (DEBUG) {
                    Throwable here = new Throwable();
                    here.fillInStackTrace();
                    Slog.d(TAG, "updating resources override for activity=" + activityToken
                            + " from oldConfig="
                            + Configuration.resourceQualifierString(oldConfig)
Loading