From bb42ab032d5acd83c093b0aa254cb16705bfbeef Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Thu, 20 Oct 2022 22:01:46 +0800 Subject: [PATCH] Dump InputMethodManager#{mServedView, mNextServedView} for ime tracing As CL[1] migrated {mServedView, mNextServedView} from ImeFocusController to InputMethodManager and removed its proto dump, we add it back to imputmethodmanager.proto to keep it tracked in winscope for debugging. (And deprecate the original fields in imefocuscontroller.proto) [1]:Ie3446e1d0f62c489195e31fc7f073020884d6cae Bug: 244504062 Test: manual as following steps: 1) rebuild rom image and winscope 2) flash the rom and reboot the device 3) run the built winscope and connect with the device 4) start record trace by winscope page 5) stop recording and verify {servedView, nextServedView} can be shown on the ImeClient Tracing panel. Change-Id: I1ffb63a2e1e73591e7bf349d88e1e56728ab0953 --- core/java/android/view/inputmethod/InputMethodManager.java | 4 ++++ core/proto/android/view/imefocuscontroller.proto | 4 ++-- core/proto/android/view/inputmethod/inputmethodmanager.proto | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 867b8260ec5e1..dc6f66b90a198 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -30,7 +30,9 @@ import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodCl import static android.view.inputmethod.InputMethodManagerProto.ACTIVE; import static android.view.inputmethod.InputMethodManagerProto.CUR_ID; import static android.view.inputmethod.InputMethodManagerProto.FULLSCREEN_MODE; +import static android.view.inputmethod.InputMethodManagerProto.NEXT_SERVED_VIEW; import static android.view.inputmethod.InputMethodManagerProto.SERVED_CONNECTING; +import static android.view.inputmethod.InputMethodManagerProto.SERVED_VIEW; import static com.android.internal.inputmethod.StartInputReason.BOUND_TO_IMMS; @@ -3983,6 +3985,8 @@ public final class InputMethodManager { proto.write(FULLSCREEN_MODE, mFullscreenMode); proto.write(ACTIVE, mActive); proto.write(SERVED_CONNECTING, mServedConnecting); + proto.write(SERVED_VIEW, Objects.toString(mServedView)); + proto.write(NEXT_SERVED_VIEW, Objects.toString(mNextServedView)); proto.end(token); if (mCurRootView != null) { mCurRootView.dumpDebug(proto, VIEW_ROOT_IMPL); diff --git a/core/proto/android/view/imefocuscontroller.proto b/core/proto/android/view/imefocuscontroller.proto index ff9dee69207bb..ccde9b7a79668 100644 --- a/core/proto/android/view/imefocuscontroller.proto +++ b/core/proto/android/view/imefocuscontroller.proto @@ -25,6 +25,6 @@ option java_multiple_files = true; */ message ImeFocusControllerProto { optional bool has_ime_focus = 1; - optional string served_view = 2; - optional string next_served_view = 3; + optional string served_view = 2 [deprecated = true]; + optional string next_served_view = 3 [deprecated = true]; } \ No newline at end of file diff --git a/core/proto/android/view/inputmethod/inputmethodmanager.proto b/core/proto/android/view/inputmethod/inputmethodmanager.proto index 9fed0ef95a274..ea5f1e8f3be2a 100644 --- a/core/proto/android/view/inputmethod/inputmethodmanager.proto +++ b/core/proto/android/view/inputmethod/inputmethodmanager.proto @@ -29,4 +29,6 @@ message InputMethodManagerProto { optional int32 display_id = 3; optional bool active = 4; optional bool served_connecting = 5; + optional string served_view = 6; + optional string next_served_view = 7; } \ No newline at end of file