diff options
| author | Anmol Gupta <guanmol@google.com> | 2020-04-28 06:33:33 -0700 |
|---|---|---|
| committer | Ioana Stefan <ioanastefan@google.com> | 2020-09-29 15:05:18 +0200 |
| commit | cf9e5123ce04dfe1d03b942a6a5632ca1b9b27fd (patch) | |
| tree | 441d8f2f34c67f90b97dffb95d8e7e6261f80333 /core/java/android/view/InsetsState.java | |
| parent | 7cbdbffe2b8e5419fbc2d2ac234fd61266a615b4 (diff) | |
Add proto-based client side dumping for IME tracing
This CL implements a mechanism to dump IME related client states into
a proto file which can later be imported to winscope to allow easy
debugging. A new abstract class ImeTracing.java declares the methods
related to scheduling, collecting and dumping logs. Two child class
implement these methods for server and client separately.
The Design Doc for the IME tracing project is: go/ime-tracing
Bug: 154348613
Test: start trace by calling "adb shell ime tracing start"
end trace by calling "adb shell ime tracing stop"
pull trace using "adb pull /data/misc/wmtrace/ime_trace.pb ime_trace.pb"
Change-Id: Ia89f11d5ef8a220ea7746191b18769cea5a8359d
Diffstat (limited to 'core/java/android/view/InsetsState.java')
| -rw-r--r-- | core/java/android/view/InsetsState.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/view/InsetsState.java b/core/java/android/view/InsetsState.java index c5d0a10bb108..eabb71851303 100644 --- a/core/java/android/view/InsetsState.java +++ b/core/java/android/view/InsetsState.java @@ -16,6 +16,8 @@ package android.view; +import static android.view.InsetsStateProto.DISPLAY_FRAME; +import static android.view.InsetsStateProto.SOURCES; import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_STABLE; import static android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES; import static android.view.WindowInsets.Type.SYSTEM_GESTURES; @@ -41,6 +43,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.util.ArraySet; import android.util.SparseIntArray; +import android.util.proto.ProtoOutputStream; import android.view.WindowInsets.Type; import android.view.WindowInsets.Type.InsetsType; import android.view.WindowManager.LayoutParams.SoftInputModeFlags; @@ -545,6 +548,16 @@ public class InsetsState implements Parcelable { } } + void dumpDebug(ProtoOutputStream proto, long fieldId) { + final long token = proto.start(fieldId); + InsetsSource source = mSources[ITYPE_IME]; + if (source != null) { + source.dumpDebug(proto, SOURCES); + } + mDisplayFrame.dumpDebug(proto, DISPLAY_FRAME); + proto.end(token); + } + public static String typeToString(@InternalInsetsType int type) { switch (type) { case ITYPE_STATUS_BAR: |
