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

Commit ce0f9518 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Add attachinfo information to ViewRootImpl dump

Currently, we are dumping information on ViewRootImpl, but it doesn't
include some of the critical pieces. Add attachinfo information. Also,
attach a dump of a variable that determines whether the input events
will be dropped.

Example of newly added piece of dumpsys:

      mPausedForTransition=false
      ...
      mAttachInfo=       AttachInfo:
        mHasWindowFocus=true
        mWindowVisibility=0
        mInTouchMode=true
        mUnbufferedDispatchRequested=false

Bug: 173675649
Test: adb shell dumpsys activity -v all
Change-Id: I7b8801436f74a123bf96735de30b238146413545
parent df179c3d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7098,7 +7098,7 @@ public class Activity extends ContextThemeWrapper
        if (getWindow() != null &&
                getWindow().peekDecorView() != null &&
                getWindow().peekDecorView().getViewRootImpl() != null) {
            getWindow().peekDecorView().getViewRootImpl().dump(prefix, fd, writer, args);
            getWindow().peekDecorView().getViewRootImpl().dump(prefix, writer);
        }

        mHandler.getLooper().dump(new PrintWriterPrinter(writer), prefix);
+11 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ import com.android.internal.widget.ScrollBarUtils;
import com.google.android.collect.Lists;
import com.google.android.collect.Maps;
import java.io.PrintWriter;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.ref.WeakReference;
@@ -29442,6 +29443,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            }
            return mScrollCaptureInternal;
        }
        public void dump(String prefix, PrintWriter writer) {
            String innerPrefix = prefix + "  ";
            writer.println(prefix + "AttachInfo:");
            writer.println(innerPrefix + "mHasWindowFocus=" + mHasWindowFocus);
            writer.println(innerPrefix + "mWindowVisibility=" + mWindowVisibility);
            writer.println(innerPrefix + "mInTouchMode=" + mInTouchMode);
            writer.println(innerPrefix + "mUnbufferedDispatchRequested="
                    + mUnbufferedDispatchRequested);
        }
    }
    /**
+13 −2
Original line number Diff line number Diff line
@@ -200,7 +200,6 @@ import com.android.internal.view.BaseSurfaceHolder;
import com.android.internal.view.RootViewSurfaceTaker;
import com.android.internal.view.SurfaceCallbackHelper;

import java.io.FileDescriptor;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
@@ -7687,12 +7686,18 @@ public final class ViewRootImpl implements ViewParent,
        mImeFocusController.dumpDebug(proto, IME_FOCUS_CONTROLLER);
    }

    public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
    /**
     * Dump information about this ViewRootImpl
     * @param prefix the prefix that will be prepended to each line of the produced output
     * @param writer the writer that will receive the resulting text
     */
    public void dump(String prefix, PrintWriter writer) {
        String innerPrefix = prefix + "  ";
        writer.println(prefix + "ViewRoot:");
        writer.println(innerPrefix + "mAdded=" + mAdded);
        writer.println(innerPrefix + "mRemoved=" + mRemoved);
        writer.println(innerPrefix + "mStopped=" + mStopped);
        writer.println(innerPrefix + "mPausedForTransition=" + mPausedForTransition);
        writer.println(innerPrefix + "mConsumeBatchedInputScheduled="
                + mConsumeBatchedInputScheduled);
        writer.println(innerPrefix + "mConsumeBatchedInputImmediatelyScheduled="
@@ -7707,6 +7712,12 @@ public final class ViewRootImpl implements ViewParent,
        writer.println(innerPrefix + "mIsAmbientMode="  + mIsAmbientMode);
        writer.println(innerPrefix + "mUnbufferedInputSource="
                + Integer.toHexString(mUnbufferedInputSource));
        if (mAttachInfo != null) {
            writer.print(innerPrefix + "mAttachInfo= ");
            mAttachInfo.dump(innerPrefix, writer);
        } else {
            writer.println(innerPrefix + "mAttachInfo=<null>");
        }

        mFirstInputStage.dump(innerPrefix, writer);

+1 −1
Original line number Diff line number Diff line
@@ -652,7 +652,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
        pw.println(TAG + ":");
        pw.println("  mKeyguardDisplayMode=" + mKeyguardDisplayMode);
        pw.println(mCurrentState);
        mNotificationShadeView.getViewRootImpl().dump("  ", fd, pw, args);
        mNotificationShadeView.getViewRootImpl().dump("  ", pw);
    }

    @Override