From 4bde5d34033039bc920b856f7bb4ad82731e07e1 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Thu, 14 Apr 2022 12:31:38 -0700 Subject: [PATCH] Let A11yIME use its own method name for systrace This is a follow up CL to our previous CL [1], which copied many things from android.inputmethodservice.InputMethodService to android.accessibilityservice.InputMethod. As a result currently those two classes share the same systrace method names as follows. * IMS.startInput * IMS.restartInput With this CL, those systrace method names will be renamed to * AccessibilityService.startInput * AccessibilityService.restartInput so that readers can understand which implementation is used without having to check its process name. There should be no user-observable behavior change in this CL. [1]: Ia651a811093a939d00c081be1961e24ed3ad0356 fb17e5ae7a9e1a095d114d8dde76f14578b6c233 Fix: 229118866 Test: Manually verified as follows 1. Build aosp_coral-userdebug and flash it. 2. make -j EditTextVariations 3. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/arm64/EditTextVariations.apk 4. make -j SampleInputMethodAccessibilityService 5. adb install -r $OUT/system/app/SampleInputMethodAccessibilityService/SampleInputMethodAccessibilityService.apk 6. adb shell settings put secure enabled_accessibility_services com.example.android.sampleinputmethodaccessibilityservice/com.example.android.sampleinputmethodaccessibilityservice.SampleInputMethodAccessibilityService 7. external/perfetto/tools/record_android_trace wm 8. adb shell am start -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations 9. Tap an input field '' in the WevView section. 10. Tap an input field '' in the WevView section. 11. Hit Ctrl-C. 12. Verify trace event names from the sample A11yIME. Change-Id: If89cfaec108a15aa168cfa32c689ca832b410324 --- core/java/android/accessibilityservice/InputMethod.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/accessibilityservice/InputMethod.java b/core/java/android/accessibilityservice/InputMethod.java index c0e5e84d369a..fa75713e2879 100644 --- a/core/java/android/accessibilityservice/InputMethod.java +++ b/core/java/android/accessibilityservice/InputMethod.java @@ -192,14 +192,14 @@ public class InputMethod { final void startInput(@Nullable InputConnection ic, @NonNull EditorInfo attribute) { Log.v(LOG_TAG, "startInput(): editor=" + attribute); - Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.startInput"); + Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "AccessibilityService.startInput"); doStartInput(ic, attribute, false /* restarting */); Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); } final void restartInput(@Nullable InputConnection ic, @NonNull EditorInfo attribute) { Log.v(LOG_TAG, "restartInput(): editor=" + attribute); - Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.restartInput"); + Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "AccessibilityService.restartInput"); doStartInput(ic, attribute, true /* restarting */); Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); }