diff options
| author | 2011-11-09 17:48:54 -0800 | |
|---|---|---|
| committer | 2011-11-10 07:55:47 -0800 | |
| commit | 532147b308580ec6360dba4c19c41bf4708bfd93 (patch) | |
| tree | 66e344678557fe125c1269ad6568d2daecbd49b2 | |
| parent | eae6c9972d91b9af58c3bf7ba0235c0a3e95c408 (diff) | |
increase the rate at which we dispatch events.
Previously, the input dispatch rate was capped by default to 55.
This worked fine for systems with a refresh rate of 55 or lower. But on
devices with a higher frame rate (such as stingray at 60 fps), we do not
receive events as fast as the rendering system wants to redraw the frames, so
we would occasionally miss events between frames, resulting in a visual
stutter during drag operations where the dragged object would essentially
stay still for a frame.
This fix increases the default rate to 90, or 1.5 times the highest typical
refresh rate of our devices.
Change-Id: Id8622185b3da93f9f6505157d2e6f3f33e36bd04
| -rw-r--r-- | services/java/com/android/server/wm/InputManager.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/services/java/com/android/server/wm/InputManager.java b/services/java/com/android/server/wm/InputManager.java index df7e0e18b7f5..a4f0a0c24f8c 100644 --- a/services/java/com/android/server/wm/InputManager.java +++ b/services/java/com/android/server/wm/InputManager.java @@ -675,7 +675,13 @@ public class InputManager implements Watchdog.Monitor { } catch (NumberFormatException e) { } if (result < 1) { - result = 55; + // This number equates to the refresh rate * 1.5. The rate should be at least + // equal to the screen refresh rate. We increase the rate by 50% to compensate for + // the discontinuity between the actual rate that events come in at (they do + // not necessarily come in constantly and are not handled synchronously). + // Ideally, we would use Display.getRefreshRate(), but as this does not necessarily + // return a sensible result, we use '60' as our default assumed refresh rate. + result = 90; } return result; } |