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

Commit 0feb3a6b authored by Cosmin Băieș's avatar Cosmin Băieș
Browse files

Remove redundant RuntimeExceptions from ProtoLogs

This is a follow up of [1], where some stack trace calls were replaced
with RuntimeExceptions. The intention was to simply use the exceptions
to directly get the stack trace, but this behaviour only works for
logcat, whereas ProtoLog ended up concatenating the string
"RuntimeException()" explicitly. This removes the exceptions as these
are no longer used.

  [1]: I46630d4ac860141f1142af509d24ee33568068d8

Flag: EXEMPT cleanup
Bug: 407383437
Test: presubmit
Change-Id: I1565f57b8d07e6b5df187c940890a9129f674f88
parent e3131a9b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -5382,8 +5382,7 @@ class Task extends TaskFragment {
        }

        // Slot the activity into the history root task and proceed
        ProtoLog.i(WM_DEBUG_ADD_REMOVE, "Adding activity %s to task %s callers: %s", r,
                activityTask, new RuntimeException("here"));
        ProtoLog.i(WM_DEBUG_ADD_REMOVE, "Adding activity %s to task %s", r, activityTask);

        if (isActivityTypeHomeOrRecents() && getActivityBelow(r) == null) {
            // If this is the first activity, don't do any fancy animations,
+12 −20
Original line number Diff line number Diff line
@@ -2660,9 +2660,8 @@ public class WindowManagerService extends IWindowManager.Stub
            win.mInRelayout = true;

            win.setViewVisibility(viewVisibility);
            ProtoLog.i(WM_DEBUG_SCREEN_ON,
                    "Relayout %s: oldVis=%d newVis=%d. %s", win, oldVisibility,
                            viewVisibility, new RuntimeException());
            ProtoLog.i(WM_DEBUG_SCREEN_ON, "Relayout %s: oldVis=%d newVis=%d", win, oldVisibility,
                    viewVisibility);
            if (becameVisible) {
                onWindowVisible(win);
            }
@@ -4022,10 +4021,8 @@ public class WindowManagerService extends IWindowManager.Stub
    public void enableScreenAfterBoot() {
        synchronized (mGlobalLock) {
            ProtoLog.i(WM_DEBUG_BOOT, "enableScreenAfterBoot: mDisplayEnabled=%b "
                            + "mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. "
                            + "%s",
                    mDisplayEnabled, mForceDisplayEnabled, mShowingBootMessages, mSystemBooted,
                    new RuntimeException("here"));
                            + "mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b",
                    mDisplayEnabled, mForceDisplayEnabled, mShowingBootMessages, mSystemBooted);
            if (mSystemBooted) {
                return;
            }
@@ -4050,10 +4047,8 @@ public class WindowManagerService extends IWindowManager.Stub

    void enableScreenIfNeededLocked() {
        ProtoLog.i(WM_DEBUG_BOOT, "enableScreenIfNeededLocked: mDisplayEnabled=%b "
                        + "mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. "
                        + "%s",
                mDisplayEnabled, mForceDisplayEnabled, mShowingBootMessages, mSystemBooted,
                new RuntimeException("here"));
                        + "mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b",
                mDisplayEnabled, mForceDisplayEnabled, mShowingBootMessages, mSystemBooted);
        if (mDisplayEnabled) {
            return;
        }
@@ -4085,9 +4080,8 @@ public class WindowManagerService extends IWindowManager.Stub
        synchronized (mGlobalLock) {
            ProtoLog.i(WM_DEBUG_BOOT, "performEnableScreen: mDisplayEnabled=%b"
                            + " mForceDisplayEnabled=%b" + " mShowingBootMessages=%b"
                            + " mSystemBooted=%b. %s", mDisplayEnabled,
                    mForceDisplayEnabled, mShowingBootMessages, mSystemBooted,
                    new RuntimeException("here"));
                            + " mSystemBooted=%b", mDisplayEnabled, mForceDisplayEnabled,
                    mShowingBootMessages, mSystemBooted);
            if (mDisplayEnabled) {
                return;
            }
@@ -4181,9 +4175,8 @@ public class WindowManagerService extends IWindowManager.Stub
        synchronized (mGlobalLock) {
            ProtoLog.i(WM_DEBUG_BOOT, "showBootMessage: msg=%s always=%b"
                            + " mAllowBootMessages=%b mShowingBootMessages=%b"
                            + " mSystemBooted=%b. %s", msg, always, mAllowBootMessages,
                    mShowingBootMessages, mSystemBooted,
                    new RuntimeException("here"));
                            + " mSystemBooted=%b", msg, always, mAllowBootMessages,
                    mShowingBootMessages, mSystemBooted);
            if (!mAllowBootMessages) {
                return;
            }
@@ -4207,9 +4200,8 @@ public class WindowManagerService extends IWindowManager.Stub
    public void hideBootMessagesLocked() {
        ProtoLog.i(WM_DEBUG_BOOT, "hideBootMessagesLocked: mDisplayEnabled=%b"
                        + " mForceDisplayEnabled=%b mShowingBootMessages=%b"
                        + " mSystemBooted=%b. %s", mDisplayEnabled, mForceDisplayEnabled,
                mShowingBootMessages, mSystemBooted,
                new RuntimeException("here"));
                        + " mSystemBooted=%b", mDisplayEnabled, mForceDisplayEnabled,
                mShowingBootMessages, mSystemBooted);
        if (mShowingBootMessages) {
            mShowingBootMessages = false;
            mPolicy.hideBootMessages();
+1 −2
Original line number Diff line number Diff line
@@ -385,8 +385,7 @@ class WindowStateAnimator {
                logWithStack(TAG, "Window " + this + " destroying surface "
                        + mSurfaceControl + ", session " + mSession);
            }
            ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY: %s. %s",
                    mWin, new RuntimeException());
            ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY: %s", mWin);
            destroySurface(t);
            if (mWallpaperControllerLocked.isWallpaperTarget(mWin)) {
                mWin.requestUpdateWallpaperIfNeeded();