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

Commit e89eeac5 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Added input freeze reason string.

To help debug b/27576902

Bug: 27576902
Change-Id: Ic3d2bb25842593efb11e195a1bbe19bed3bf7067
parent d646b3d6
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;

import android.app.ActivityManagerNative;
import android.graphics.Rect;
import android.os.Debug;
import android.os.RemoteException;
import android.util.Log;
import android.util.Slog;
@@ -36,6 +37,7 @@ import com.android.server.input.InputApplicationHandle;
import com.android.server.input.InputManagerService;
import com.android.server.input.InputWindowHandle;

import java.io.PrintWriter;
import java.util.Arrays;

final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
@@ -47,6 +49,9 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
    // When true, prevents input dispatch from proceeding until set to false again.
    private boolean mInputDispatchFrozen;

    // The reason the input is currently frozen or null if the input isn't frozen.
    private String mInputFreezeReason = null;

    // When true, input dispatch proceeds normally.  Otherwise all events are dropped.
    // Initially false, so that input does not get dispatched until boot is finished at
    // which point the ActivityManager will enable dispatching.
@@ -480,6 +485,10 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
            }

            mInputDispatchFrozen = true;

            if (DEBUG_INPUT || true) {
                mInputFreezeReason = Debug.getCallers(6);
            }
            updateInputDispatchModeLw();
        }
    }
@@ -491,6 +500,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
            }

            mInputDispatchFrozen = false;
            mInputFreezeReason = null;
            updateInputDispatchModeLw();
        }
    }
@@ -509,4 +519,10 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
    private void updateInputDispatchModeLw() {
        mService.mInputManager.setInputDispatchMode(mInputDispatchEnabled, mInputDispatchFrozen);
    }

    void dump(PrintWriter pw, String prefix) {
        if (mInputFreezeReason != null) {
            pw.println(prefix + "mInputFreezeReason=" + mInputFreezeReason);
        }
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -9907,6 +9907,9 @@ public class WindowManagerService extends IWindowManager.Stub
                    pw.print(mLastFinishedFreezeSource);
                }
                pw.println();

        mInputMonitor.dump(pw, "  ");

        if (dumpAll) {
            pw.print("  mSystemDecorLayer="); pw.print(mSystemDecorLayer);
                    pw.print(" mScreenRect="); pw.println(mScreenRect.toShortString());