Loading core/java/android/inputmethodservice/AbstractInputMethodService.java +2 −1 Original line number Diff line number Diff line Loading @@ -199,10 +199,11 @@ public abstract class AbstractInputMethodService extends Service * Dumps the internal state of IME to a protocol buffer output stream. * * @param proto ProtoOutputStream to dump data to. * @param icProto {@link InputConnection} call data in proto format. * @hide */ @SuppressWarnings("HiddenAbstractMethod") public abstract void dumpProtoInternal(ProtoOutputStream proto); public abstract void dumpProtoInternal(ProtoOutputStream proto, ProtoOutputStream icProto); /** * Implement this to handle {@link android.os.Binder#dump Binder.dump()} Loading core/java/android/inputmethodservice/InputMethodService.java +23 −10 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.inputmethodservice.InputMethodServiceProto.EXTRACTED_TOKEN import static android.inputmethodservice.InputMethodServiceProto.EXTRACT_VIEW_HIDDEN; import static android.inputmethodservice.InputMethodServiceProto.FULLSCREEN_APPLIED; import static android.inputmethodservice.InputMethodServiceProto.INPUT_BINDING; import static android.inputmethodservice.InputMethodServiceProto.INPUT_CONNECTION_CALL; import static android.inputmethodservice.InputMethodServiceProto.INPUT_EDITOR_INFO; import static android.inputmethodservice.InputMethodServiceProto.INPUT_STARTED; import static android.inputmethodservice.InputMethodServiceProto.INPUT_VIEW_STARTED; Loading Loading @@ -742,7 +743,8 @@ public class InputMethodService extends AbstractInputMethodService { return; } ImeTracing.getInstance().triggerServiceDump( "InputMethodService.InputMethodImpl#hideSoftInput", InputMethodService.this); "InputMethodService.InputMethodImpl#hideSoftInput", InputMethodService.this, null /* icProto */); final boolean wasVisible = isInputViewShown(); Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.hideSoftInput"); Loading Loading @@ -798,7 +800,8 @@ public class InputMethodService extends AbstractInputMethodService { } Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.showSoftInput"); ImeTracing.getInstance().triggerServiceDump( "InputMethodService.InputMethodImpl#showSoftInput", InputMethodService.this); "InputMethodService.InputMethodImpl#showSoftInput", InputMethodService.this, null /* icProto */); final boolean wasVisible = isInputViewShown(); if (dispatchOnShowInputRequested(flags, false)) { Loading Loading @@ -2182,7 +2185,8 @@ public class InputMethodService extends AbstractInputMethodService { return; } ImeTracing.getInstance().triggerServiceDump("InputMethodService#showWindow", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#showWindow", this, null /* icProto */); Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.showWindow"); mDecorViewWasVisible = mDecorViewVisible; mInShowWindow = true; Loading Loading @@ -2260,7 +2264,8 @@ public class InputMethodService extends AbstractInputMethodService { */ private void applyVisibilityInInsetsConsumerIfNecessary(boolean setVisible) { ImeTracing.getInstance().triggerServiceDump( "InputMethodService#applyVisibilityInInsetsConsumerIfNecessary", this); "InputMethodService#applyVisibilityInInsetsConsumerIfNecessary", this, null /* icProto */); mPrivOps.applyImeVisibility(setVisible ? mCurShowInputToken : mCurHideInputToken, setVisible); } Loading @@ -2285,7 +2290,8 @@ public class InputMethodService extends AbstractInputMethodService { public void hideWindow() { if (DEBUG) Log.v(TAG, "CALL: hideWindow"); ImeTracing.getInstance().triggerServiceDump("InputMethodService#hideWindow", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#hideWindow", this, null /* icProto */); mWindowVisible = false; finishViews(false /* finishingInput */); if (mDecorViewVisible) { Loading Loading @@ -2356,7 +2362,8 @@ public class InputMethodService extends AbstractInputMethodService { void doFinishInput() { if (DEBUG) Log.v(TAG, "CALL: doFinishInput"); ImeTracing.getInstance().triggerServiceDump("InputMethodService#doFinishInput", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#doFinishInput", this, null /* icProto */); finishViews(true /* finishingInput */); if (mInputStarted) { mInlineSuggestionSessionController.notifyOnFinishInput(); Loading @@ -2372,7 +2379,8 @@ public class InputMethodService extends AbstractInputMethodService { if (!restarting && mInputStarted) { doFinishInput(); } ImeTracing.getInstance().triggerServiceDump("InputMethodService#doStartInput", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#doStartInput", this, null /* icProto */); mInputStarted = true; mStartedInputConnection = ic; mInputEditorInfo = attribute; Loading Loading @@ -2531,7 +2539,8 @@ public class InputMethodService extends AbstractInputMethodService { * @param flags Provides additional operating flags. */ public void requestHideSelf(int flags) { ImeTracing.getInstance().triggerServiceDump("InputMethodService#requestHideSelf", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#requestHideSelf", this, null /* icProto */); mPrivOps.hideMySoftInput(flags); } Loading @@ -2544,7 +2553,8 @@ public class InputMethodService extends AbstractInputMethodService { * @param flags Provides additional operating flags. */ public final void requestShowSelf(int flags) { ImeTracing.getInstance().triggerServiceDump("InputMethodService#requestShowSelf", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#requestShowSelf", this, null /* icProto */); mPrivOps.showMySoftInput(flags); } Loading Loading @@ -3364,7 +3374,7 @@ public class InputMethodService extends AbstractInputMethodService { * @hide */ @Override public final void dumpProtoInternal(ProtoOutputStream proto) { public final void dumpProtoInternal(ProtoOutputStream proto, ProtoOutputStream icProto) { final long token = proto.start(InputMethodServiceTraceProto.INPUT_METHOD_SERVICE); mWindow.dumpDebug(proto, SOFT_INPUT_WINDOW); proto.write(VIEWS_CREATED, mViewsCreated); Loading Loading @@ -3393,6 +3403,9 @@ public class InputMethodService extends AbstractInputMethodService { proto.write(STATUS_ICON, mStatusIcon); mTmpInsets.dumpDebug(proto, LAST_COMPUTED_INSETS); proto.write(SETTINGS_OBSERVER, Objects.toString(mSettingsObserver)); if (icProto != null) { proto.write(INPUT_CONNECTION_CALL, icProto.getBytes()); } proto.end(token); } } core/java/android/util/imetracing/ImeTracing.java +7 −2 Original line number Diff line number Diff line Loading @@ -110,15 +110,20 @@ public abstract class ImeTracing { * * @param where Place where the trace was triggered. * @param immInstance The {@link InputMethodManager} instance to dump. * @param icProto {@link android.view.inputmethod.InputConnection} call data in proto format. */ public abstract void triggerClientDump(String where, InputMethodManager immInstance); public abstract void triggerClientDump(String where, InputMethodManager immInstance, ProtoOutputStream icProto); /** * Starts a proto dump of the currently connected InputMethodService information. * * @param where Place where the trace was triggered. * @param service The {@link android.inputmethodservice.InputMethodService} to be dumped. * @param icProto {@link android.view.inputmethod.InputConnection} call data in proto format. */ public abstract void triggerServiceDump(String where, AbstractInputMethodService service); public abstract void triggerServiceDump(String where, AbstractInputMethodService service, ProtoOutputStream icProto); /** * Starts a proto dump of the InputMethodManagerService information. Loading core/java/android/util/imetracing/ImeTracingClientImpl.java +6 −4 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ class ImeTracingClientImpl extends ImeTracing { } @Override public void triggerClientDump(String where, @NonNull InputMethodManager immInstance) { public void triggerClientDump(String where, @NonNull InputMethodManager immInstance, ProtoOutputStream icProto) { if (!isEnabled() || !isAvailable()) { return; } Loading @@ -59,7 +60,7 @@ class ImeTracingClientImpl extends ImeTracing { try { ProtoOutputStream proto = new ProtoOutputStream(); immInstance.dumpDebug(proto); immInstance.dumpDebug(proto, icProto); sendToService(proto.getBytes(), IME_TRACING_FROM_CLIENT, where); } catch (RemoteException e) { Log.e(TAG, "Exception while sending ime-related client dump to server", e); Loading @@ -69,7 +70,8 @@ class ImeTracingClientImpl extends ImeTracing { } @Override public void triggerServiceDump(String where, @NonNull AbstractInputMethodService service) { public void triggerServiceDump(String where, @NonNull AbstractInputMethodService service, ProtoOutputStream icProto) { if (!isEnabled() || !isAvailable()) { return; } Loading @@ -83,7 +85,7 @@ class ImeTracingClientImpl extends ImeTracing { try { ProtoOutputStream proto = new ProtoOutputStream(); service.dumpProtoInternal(proto); service.dumpProtoInternal(proto, icProto); sendToService(proto.getBytes(), IME_TRACING_FROM_IMS, where); } catch (RemoteException e) { Log.e(TAG, "Exception while sending ime-related service dump to server", e); Loading core/java/android/util/imetracing/ImeTracingServerImpl.java +4 −2 Original line number Diff line number Diff line Loading @@ -133,12 +133,14 @@ class ImeTracingServerImpl extends ImeTracing { } @Override public void triggerClientDump(String where, InputMethodManager immInstance) { public void triggerClientDump(String where, InputMethodManager immInstance, ProtoOutputStream icProto) { // Intentionally left empty, this is implemented in ImeTracingClientImpl } @Override public void triggerServiceDump(String where, AbstractInputMethodService service) { public void triggerServiceDump(String where, AbstractInputMethodService service, ProtoOutputStream icProto) { // Intentionally left empty, this is implemented in ImeTracingClientImpl } Loading Loading
core/java/android/inputmethodservice/AbstractInputMethodService.java +2 −1 Original line number Diff line number Diff line Loading @@ -199,10 +199,11 @@ public abstract class AbstractInputMethodService extends Service * Dumps the internal state of IME to a protocol buffer output stream. * * @param proto ProtoOutputStream to dump data to. * @param icProto {@link InputConnection} call data in proto format. * @hide */ @SuppressWarnings("HiddenAbstractMethod") public abstract void dumpProtoInternal(ProtoOutputStream proto); public abstract void dumpProtoInternal(ProtoOutputStream proto, ProtoOutputStream icProto); /** * Implement this to handle {@link android.os.Binder#dump Binder.dump()} Loading
core/java/android/inputmethodservice/InputMethodService.java +23 −10 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.inputmethodservice.InputMethodServiceProto.EXTRACTED_TOKEN import static android.inputmethodservice.InputMethodServiceProto.EXTRACT_VIEW_HIDDEN; import static android.inputmethodservice.InputMethodServiceProto.FULLSCREEN_APPLIED; import static android.inputmethodservice.InputMethodServiceProto.INPUT_BINDING; import static android.inputmethodservice.InputMethodServiceProto.INPUT_CONNECTION_CALL; import static android.inputmethodservice.InputMethodServiceProto.INPUT_EDITOR_INFO; import static android.inputmethodservice.InputMethodServiceProto.INPUT_STARTED; import static android.inputmethodservice.InputMethodServiceProto.INPUT_VIEW_STARTED; Loading Loading @@ -742,7 +743,8 @@ public class InputMethodService extends AbstractInputMethodService { return; } ImeTracing.getInstance().triggerServiceDump( "InputMethodService.InputMethodImpl#hideSoftInput", InputMethodService.this); "InputMethodService.InputMethodImpl#hideSoftInput", InputMethodService.this, null /* icProto */); final boolean wasVisible = isInputViewShown(); Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.hideSoftInput"); Loading Loading @@ -798,7 +800,8 @@ public class InputMethodService extends AbstractInputMethodService { } Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.showSoftInput"); ImeTracing.getInstance().triggerServiceDump( "InputMethodService.InputMethodImpl#showSoftInput", InputMethodService.this); "InputMethodService.InputMethodImpl#showSoftInput", InputMethodService.this, null /* icProto */); final boolean wasVisible = isInputViewShown(); if (dispatchOnShowInputRequested(flags, false)) { Loading Loading @@ -2182,7 +2185,8 @@ public class InputMethodService extends AbstractInputMethodService { return; } ImeTracing.getInstance().triggerServiceDump("InputMethodService#showWindow", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#showWindow", this, null /* icProto */); Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.showWindow"); mDecorViewWasVisible = mDecorViewVisible; mInShowWindow = true; Loading Loading @@ -2260,7 +2264,8 @@ public class InputMethodService extends AbstractInputMethodService { */ private void applyVisibilityInInsetsConsumerIfNecessary(boolean setVisible) { ImeTracing.getInstance().triggerServiceDump( "InputMethodService#applyVisibilityInInsetsConsumerIfNecessary", this); "InputMethodService#applyVisibilityInInsetsConsumerIfNecessary", this, null /* icProto */); mPrivOps.applyImeVisibility(setVisible ? mCurShowInputToken : mCurHideInputToken, setVisible); } Loading @@ -2285,7 +2290,8 @@ public class InputMethodService extends AbstractInputMethodService { public void hideWindow() { if (DEBUG) Log.v(TAG, "CALL: hideWindow"); ImeTracing.getInstance().triggerServiceDump("InputMethodService#hideWindow", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#hideWindow", this, null /* icProto */); mWindowVisible = false; finishViews(false /* finishingInput */); if (mDecorViewVisible) { Loading Loading @@ -2356,7 +2362,8 @@ public class InputMethodService extends AbstractInputMethodService { void doFinishInput() { if (DEBUG) Log.v(TAG, "CALL: doFinishInput"); ImeTracing.getInstance().triggerServiceDump("InputMethodService#doFinishInput", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#doFinishInput", this, null /* icProto */); finishViews(true /* finishingInput */); if (mInputStarted) { mInlineSuggestionSessionController.notifyOnFinishInput(); Loading @@ -2372,7 +2379,8 @@ public class InputMethodService extends AbstractInputMethodService { if (!restarting && mInputStarted) { doFinishInput(); } ImeTracing.getInstance().triggerServiceDump("InputMethodService#doStartInput", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#doStartInput", this, null /* icProto */); mInputStarted = true; mStartedInputConnection = ic; mInputEditorInfo = attribute; Loading Loading @@ -2531,7 +2539,8 @@ public class InputMethodService extends AbstractInputMethodService { * @param flags Provides additional operating flags. */ public void requestHideSelf(int flags) { ImeTracing.getInstance().triggerServiceDump("InputMethodService#requestHideSelf", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#requestHideSelf", this, null /* icProto */); mPrivOps.hideMySoftInput(flags); } Loading @@ -2544,7 +2553,8 @@ public class InputMethodService extends AbstractInputMethodService { * @param flags Provides additional operating flags. */ public final void requestShowSelf(int flags) { ImeTracing.getInstance().triggerServiceDump("InputMethodService#requestShowSelf", this); ImeTracing.getInstance().triggerServiceDump("InputMethodService#requestShowSelf", this, null /* icProto */); mPrivOps.showMySoftInput(flags); } Loading Loading @@ -3364,7 +3374,7 @@ public class InputMethodService extends AbstractInputMethodService { * @hide */ @Override public final void dumpProtoInternal(ProtoOutputStream proto) { public final void dumpProtoInternal(ProtoOutputStream proto, ProtoOutputStream icProto) { final long token = proto.start(InputMethodServiceTraceProto.INPUT_METHOD_SERVICE); mWindow.dumpDebug(proto, SOFT_INPUT_WINDOW); proto.write(VIEWS_CREATED, mViewsCreated); Loading Loading @@ -3393,6 +3403,9 @@ public class InputMethodService extends AbstractInputMethodService { proto.write(STATUS_ICON, mStatusIcon); mTmpInsets.dumpDebug(proto, LAST_COMPUTED_INSETS); proto.write(SETTINGS_OBSERVER, Objects.toString(mSettingsObserver)); if (icProto != null) { proto.write(INPUT_CONNECTION_CALL, icProto.getBytes()); } proto.end(token); } }
core/java/android/util/imetracing/ImeTracing.java +7 −2 Original line number Diff line number Diff line Loading @@ -110,15 +110,20 @@ public abstract class ImeTracing { * * @param where Place where the trace was triggered. * @param immInstance The {@link InputMethodManager} instance to dump. * @param icProto {@link android.view.inputmethod.InputConnection} call data in proto format. */ public abstract void triggerClientDump(String where, InputMethodManager immInstance); public abstract void triggerClientDump(String where, InputMethodManager immInstance, ProtoOutputStream icProto); /** * Starts a proto dump of the currently connected InputMethodService information. * * @param where Place where the trace was triggered. * @param service The {@link android.inputmethodservice.InputMethodService} to be dumped. * @param icProto {@link android.view.inputmethod.InputConnection} call data in proto format. */ public abstract void triggerServiceDump(String where, AbstractInputMethodService service); public abstract void triggerServiceDump(String where, AbstractInputMethodService service, ProtoOutputStream icProto); /** * Starts a proto dump of the InputMethodManagerService information. Loading
core/java/android/util/imetracing/ImeTracingClientImpl.java +6 −4 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ class ImeTracingClientImpl extends ImeTracing { } @Override public void triggerClientDump(String where, @NonNull InputMethodManager immInstance) { public void triggerClientDump(String where, @NonNull InputMethodManager immInstance, ProtoOutputStream icProto) { if (!isEnabled() || !isAvailable()) { return; } Loading @@ -59,7 +60,7 @@ class ImeTracingClientImpl extends ImeTracing { try { ProtoOutputStream proto = new ProtoOutputStream(); immInstance.dumpDebug(proto); immInstance.dumpDebug(proto, icProto); sendToService(proto.getBytes(), IME_TRACING_FROM_CLIENT, where); } catch (RemoteException e) { Log.e(TAG, "Exception while sending ime-related client dump to server", e); Loading @@ -69,7 +70,8 @@ class ImeTracingClientImpl extends ImeTracing { } @Override public void triggerServiceDump(String where, @NonNull AbstractInputMethodService service) { public void triggerServiceDump(String where, @NonNull AbstractInputMethodService service, ProtoOutputStream icProto) { if (!isEnabled() || !isAvailable()) { return; } Loading @@ -83,7 +85,7 @@ class ImeTracingClientImpl extends ImeTracing { try { ProtoOutputStream proto = new ProtoOutputStream(); service.dumpProtoInternal(proto); service.dumpProtoInternal(proto, icProto); sendToService(proto.getBytes(), IME_TRACING_FROM_IMS, where); } catch (RemoteException e) { Log.e(TAG, "Exception while sending ime-related service dump to server", e); Loading
core/java/android/util/imetracing/ImeTracingServerImpl.java +4 −2 Original line number Diff line number Diff line Loading @@ -133,12 +133,14 @@ class ImeTracingServerImpl extends ImeTracing { } @Override public void triggerClientDump(String where, InputMethodManager immInstance) { public void triggerClientDump(String where, InputMethodManager immInstance, ProtoOutputStream icProto) { // Intentionally left empty, this is implemented in ImeTracingClientImpl } @Override public void triggerServiceDump(String where, AbstractInputMethodService service) { public void triggerServiceDump(String where, AbstractInputMethodService service, ProtoOutputStream icProto) { // Intentionally left empty, this is implemented in ImeTracingClientImpl } Loading