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/ImeFocusController.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/ImeFocusController.java')
| -rw-r--r-- | core/java/android/view/ImeFocusController.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/view/ImeFocusController.java b/core/java/android/view/ImeFocusController.java index 92772c1d7a44..efc0bd2785f4 100644 --- a/core/java/android/view/ImeFocusController.java +++ b/core/java/android/view/ImeFocusController.java @@ -16,16 +16,23 @@ package android.view; +import static android.view.ImeFocusControllerProto.HAS_IME_FOCUS; +import static android.view.ImeFocusControllerProto.NEXT_SERVED_VIEW; +import static android.view.ImeFocusControllerProto.SERVED_VIEW; + import android.annotation.AnyThread; import android.annotation.NonNull; import android.annotation.UiThread; import android.util.Log; +import android.util.proto.ProtoOutputStream; import android.view.inputmethod.InputMethodManager; import com.android.internal.inputmethod.InputMethodDebug; import com.android.internal.inputmethod.StartInputFlags; import com.android.internal.inputmethod.StartInputReason; +import java.util.Objects; + /** * Responsible for IME focus handling inside {@link ViewRootImpl}. * @hide @@ -280,4 +287,12 @@ public final class ImeFocusController { boolean hasImeFocus() { return mHasImeFocus; } + + void dumpDebug(ProtoOutputStream proto, long fieldId) { + final long token = proto.start(fieldId); + proto.write(HAS_IME_FOCUS, mHasImeFocus); + proto.write(SERVED_VIEW, Objects.toString(mServedView)); + proto.write(NEXT_SERVED_VIEW, Objects.toString(mNextServedView)); + proto.end(token); + } } |
