Skip to content
Commit 59730961 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Introduce Context.BIND_SCHEDULE_LIKE_TOP_APP for visible IMEs

This CL introduces a new @hide bind flag BIND_SCHEDULE_LIKE_TOP_APP so
that visible IMEs can have the same thread scheduling policy as the
actual top app, like SCHED_FIFO for UI and RenderThread when it's
available [1] and TOP_APP_PRIORITY_BOOST otherwise [2].

Hopefully this would provide more consistent UI performance and
responsiveness between the actual top app and IME.

 [1]: I7b8a31830ad80f7efa00236928d5476998ed4e00
      33eb07f5
 [2]: Iced88269f7e2d378d5870ded1a5ccf9f259fda57
      b783e7b44bf174075f6860d295808ee462b38451

Fix: 117274342
Test: Manually verified as follows.
  1. Build aosp_blueline-userdebug and flash it.
  2. make -j EditTextVariations
  3. adb install -r \
       $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  4. adb shell am start \
       -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
  5. Tap the first edit text field to bring up the AOSP Keyboard.
  6. Make sure that top app (EditTextVariations) and the IME (AOSP
     Keyboard) have the same thread priority / scheduler policy for
     their main UI threads and RenderThreads.
      adb shell ps -p \
          `adb shell pidof com.android.inputmethod.tools.edittextvariations` \
          -T -o PID,TID,PRI,SCH,CMD
      adb shell ps -p `adb shell pidof com.android.inputmethod.latin` \
          -T -o PID,TID,PRI,SCH,CMD
     For both UI threads and RenderThreads, Thread Priority should be 29 and
     Scheduler Policy should be 0.
  7. Tap the back button to dismiss AOSP Keyboard.
  8. Make sure that Thread Priority of AOSP Keyboard is no longer boosted.
      adb shell ps -p `adb shell pidof com.android.inputmethod.latin` \
          -T -o PID,TID,PRI,SCH,CMD
     For both UI threads and RenderThreads, Thread Priority should be 19 and
     Scheduler Policy should be 0.
Change-Id: I143fb39cec55351b097e835cf8bbf9668e02d86d
parent 04b8032d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment