From 26b594af104352c397200de2f0f40b8e2d1a1f04 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Fri, 9 Jul 2021 09:46:47 -0700 Subject: Optimize InputConnectionProtoDumper a bit This is a mechanical refactoring CL that has no behavior change. Currently all the utility methods defined in InputConnectionProtoDumper return ProtoOutputStream, while the returned instances will always be converted into byte[] eventually. With this CL, those utility methods return byte[] instances directly, which is expected to make it easier for ART/dexpreopt to do more optimizations such as code inlining because instances of ProtoOutputStream will no longer be escaped from those methods. Bug: 192412909 Test: atest CtsInputMethodTestCases Test: Manually verified that IME tracing still works Change-Id: I7b24aee5428da312972aa86b8658429b421490f8 --- core/java/android/inputmethodservice/InputMethodService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/java/android/inputmethodservice/InputMethodService.java') diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 6e4491eb0188..e0b001f5ed19 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -3415,7 +3415,7 @@ public class InputMethodService extends AbstractInputMethodService { * @hide */ @Override - public final void dumpProtoInternal(ProtoOutputStream proto, ProtoOutputStream icProto) { + public final void dumpProtoInternal(ProtoOutputStream proto, byte[] icProto) { final long token = proto.start(InputMethodServiceTraceProto.INPUT_METHOD_SERVICE); mWindow.dumpDebug(proto, SOFT_INPUT_WINDOW); proto.write(VIEWS_CREATED, mViewsCreated); @@ -3445,7 +3445,7 @@ public class InputMethodService extends AbstractInputMethodService { mTmpInsets.dumpDebug(proto, LAST_COMPUTED_INSETS); proto.write(SETTINGS_OBSERVER, Objects.toString(mSettingsObserver)); if (icProto != null) { - proto.write(INPUT_CONNECTION_CALL, icProto.getBytes()); + proto.write(INPUT_CONNECTION_CALL, icProto); } proto.end(token); } -- cgit v1.2.3