From aeb5b6392d4bb27fb431a69238fe719c40cd96a5 Mon Sep 17 00:00:00 2001 From: Wilson Wu Date: Tue, 13 Jul 2021 17:17:53 +0800 Subject: [PATCH] Add startImeTrace and stopImeTrace APIs in ImeTracing So Settings DevelopmentTiles doesn't need to create direct IInputMethodManager dependency to access system API. Bug: 175742251 Test: Manually test ime winscope works properly Test: make RunSettingsRoboTests ROBOTEST_FILTER="WinscopeTraceTest" Change-Id: Ie37790c7479f6b9064afd7fbcee7fd6f712d1a75 --- .../internal/inputmethod/ImeTracing.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/core/java/com/android/internal/inputmethod/ImeTracing.java b/core/java/com/android/internal/inputmethod/ImeTracing.java index 840e270baabae..d33f1d1766157 100644 --- a/core/java/com/android/internal/inputmethod/ImeTracing.java +++ b/core/java/com/android/internal/inputmethod/ImeTracing.java @@ -91,6 +91,28 @@ public abstract class ImeTracing { mService.startProtoDump(protoDump, source, where); } + /** + * Calling {@link IInputMethodManager#startImeTrace()}} to capture IME trace. + */ + public final void startImeTrace() { + try { + mService.startImeTrace(); + } catch (RemoteException e) { + Log.e(TAG, "Could not start ime trace." + e); + } + } + + /** + * Calling {@link IInputMethodManager#stopImeTrace()} to stop IME trace. + */ + public final void stopImeTrace() { + try { + mService.stopImeTrace(); + } catch (RemoteException e) { + Log.e(TAG, "Could not stop ime trace." + e); + } + } + /** * @param proto dump to be added to the buffer */