From 5e68eeac86cc0179e25a1719bb5182ea9405ee78 Mon Sep 17 00:00:00 2001 From: Anmol Gupta Date: Thu, 30 Apr 2020 21:06:56 -0700 Subject: Add proto-based InputMethodService and server side dumping for IME This CL implements a mechanism to dump InputMethodService and IME related server states into a proto file which can later be imported to Winscope to allow easy debugging. 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: Icbfb8c11e882f29eb45dea9d4c23315c48e9d619 --- .../inputmethodservice/AbstractInputMethodService.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'core/java/android/inputmethodservice/AbstractInputMethodService.java') diff --git a/core/java/android/inputmethodservice/AbstractInputMethodService.java b/core/java/android/inputmethodservice/AbstractInputMethodService.java index d7ca63a54987..3ca5207d867c 100644 --- a/core/java/android/inputmethodservice/AbstractInputMethodService.java +++ b/core/java/android/inputmethodservice/AbstractInputMethodService.java @@ -193,7 +193,17 @@ public abstract class AbstractInputMethodService extends Service * needed for a new client of the input method. */ public abstract AbstractInputMethodSessionImpl onCreateInputMethodSessionInterface(); - + + /** + * Dumps the internal state of IME to a protocol buffer output stream initialized using the + * given {@link FileDescriptor}. + * + * @param fd The file descriptor to which proto dump should be written. + * @param args The arguments passed to the dump method. + * @hide + */ + abstract void dumpProtoInternal(FileDescriptor fd, String[] args); + /** * Implement this to handle {@link android.os.Binder#dump Binder.dump()} * calls on your input method. -- cgit v1.2.3 From 796760c56efcd094ccda55551cfbbd52fbde9075 Mon Sep 17 00:00:00 2001 From: Aurimas Liutikas Date: Tue, 10 Nov 2020 15:32:51 -0800 Subject: Suppress all hidden abstract methods in constructable classes. Having a hidden abstract method for a class that can be extended means that public implementors cannot implement these hidden methods posing a risk that custom implementations will not have required abstract methods resulting in an exception. Bug: 151134792 Test: make update-api Change-Id: I758d12465fabc671be19bedeeceb16885de23c87 Exempt-From-Owner-Approval: large scale suppression of existing issues, no-op in terms of behavior --- core/java/android/inputmethodservice/AbstractInputMethodService.java | 1 + 1 file changed, 1 insertion(+) (limited to 'core/java/android/inputmethodservice/AbstractInputMethodService.java') diff --git a/core/java/android/inputmethodservice/AbstractInputMethodService.java b/core/java/android/inputmethodservice/AbstractInputMethodService.java index 3ca5207d867c..cd436374b489 100644 --- a/core/java/android/inputmethodservice/AbstractInputMethodService.java +++ b/core/java/android/inputmethodservice/AbstractInputMethodService.java @@ -202,6 +202,7 @@ public abstract class AbstractInputMethodService extends Service * @param args The arguments passed to the dump method. * @hide */ + @SuppressWarnings("HiddenAbstractMethod") abstract void dumpProtoInternal(FileDescriptor fd, String[] args); /** -- cgit v1.2.3 From 8418bef70abf31d3cbfcfa500b2e694988735557 Mon Sep 17 00:00:00 2001 From: Ioana Stefan Date: Tue, 27 Oct 2020 11:30:38 +0000 Subject: Optimized workflow for IME tracing on InputMethodService side Optimized the tracing logic for the IMS information. The InputMethodService triggers a tracing dump through the new method triggerServiceDump, exposed by the meTracing interface. This change was done to be able to support custom dumps from clients and custom dumps from InputMethodService. This change only covers the IMS information. The IMMS information will be dumped in next changes. Bug: 154348613 Test: start IME tracing by calling "adb shell ime tracing start" end IME tracing by calling "adb shell ime tracing stop" pull trace using "adb pull /data/misc/wmtrace/ime_trace_service.pb ime_trace_service.pb" Change-Id: Icda0f82d76fb7db5b2bd8d021069b1ff15a4e15b --- .../android/inputmethodservice/AbstractInputMethodService.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'core/java/android/inputmethodservice/AbstractInputMethodService.java') diff --git a/core/java/android/inputmethodservice/AbstractInputMethodService.java b/core/java/android/inputmethodservice/AbstractInputMethodService.java index cd436374b489..7cf0b10031ac 100644 --- a/core/java/android/inputmethodservice/AbstractInputMethodService.java +++ b/core/java/android/inputmethodservice/AbstractInputMethodService.java @@ -21,6 +21,7 @@ import android.annotation.NonNull; import android.app.Service; import android.content.Intent; import android.os.IBinder; +import android.util.proto.ProtoOutputStream; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.inputmethod.InputConnection; @@ -195,15 +196,13 @@ public abstract class AbstractInputMethodService extends Service public abstract AbstractInputMethodSessionImpl onCreateInputMethodSessionInterface(); /** - * Dumps the internal state of IME to a protocol buffer output stream initialized using the - * given {@link FileDescriptor}. + * Dumps the internal state of IME to a protocol buffer output stream. * - * @param fd The file descriptor to which proto dump should be written. - * @param args The arguments passed to the dump method. + * @param proto ProtoOutputStream to dump data to. * @hide */ @SuppressWarnings("HiddenAbstractMethod") - abstract void dumpProtoInternal(FileDescriptor fd, String[] args); + public abstract void dumpProtoInternal(ProtoOutputStream proto); /** * Implement this to handle {@link android.os.Binder#dump Binder.dump()} -- cgit v1.2.3 From 0653b692d1f420e799962efeeb8a26e8c57b579e Mon Sep 17 00:00:00 2001 From: Ioana Stefan Date: Fri, 13 Nov 2020 17:21:04 +0000 Subject: Add InputConnection app and service dump This change dumps information through IME tracing for the getter methods exposed by the InputConnection interface. The dump is done through the ImeTracing interface and is triggered by events in the wrapper classes used to handle InputConnection implementations corresponding to: - different apps - InputMethodService The new data is available under inputConnectionCall in the clients output proto. Bug: 154348613 Test: flash a device start IME tracing by calling "adb shell ime tracing start" end IME tracing by calling "adb shell ime tracing stop" pull generated trace files and visualize in Winscope or start tracing directly through ADB Connect and visualize traces Change-Id: Iabd6af1b858803030848a0ef5e7dd9ecfc562716 --- core/java/android/inputmethodservice/AbstractInputMethodService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/java/android/inputmethodservice/AbstractInputMethodService.java') diff --git a/core/java/android/inputmethodservice/AbstractInputMethodService.java b/core/java/android/inputmethodservice/AbstractInputMethodService.java index 7cf0b10031ac..3cd13a212a4b 100644 --- a/core/java/android/inputmethodservice/AbstractInputMethodService.java +++ b/core/java/android/inputmethodservice/AbstractInputMethodService.java @@ -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()} -- cgit v1.2.3