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
This commit is contained in:
Ming-Shin Lu
2022-10-20 22:01:46 +08:00
parent 0eee4af3a5
commit bb42ab032d
3 changed files with 8 additions and 2 deletions

View File

@@ -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);

View File

@@ -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];
}

View File

@@ -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;
}