Add support for throttling motion events.

Change-Id: I24b3a17753e91ecda60a60fe5cd2e6b3260e033d
This commit is contained in:
Jeff Brown
2010-08-18 15:51:08 -07:00
parent 6b2c56a299
commit ae9fc03bdc
4 changed files with 134 additions and 5 deletions

View File

@@ -26,6 +26,7 @@ import android.content.res.Configuration;
import android.os.Environment;
import android.os.LocalPowerManager;
import android.os.PowerManager;
import android.os.SystemProperties;
import android.util.Slog;
import android.util.Xml;
import android.view.InputChannel;
@@ -507,5 +508,18 @@ public class InputManager {
return names.toArray(new String[names.size()]);
}
@SuppressWarnings("unused")
public int getMaxEventsPerSecond() {
int result = 0;
try {
result = Integer.parseInt(SystemProperties.get("windowsmgr.max_events_per_sec"));
} catch (NumberFormatException e) {
}
if (result < 1) {
result = 35;
}
return result;
}
}
}