Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bde5d34 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

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
      fb17e5ae

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 '<input type="text" />' in the WevView section.
10. Tap an input field '<input type="email" />' in the WevView section.
11. Hit Ctrl-C.
12. Verify trace event names from the sample A11yIME.

Change-Id: If89cfaec108a15aa168cfa32c689ca832b410324
parent a9448a67
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
    }