am 4f7d278a: Follow-up fix for I68c667b0

* commit '4f7d278af62a89ef3f45cc9ebbfb076a5a352c76':
  Follow-up fix for I68c667b0
main
Ken Wakasa 2011-12-19 01:06:34 -08:00 committed by Android Git Automerger
commit 192e5b15a9
1 changed files with 4 additions and 1 deletions

View File

@ -403,7 +403,10 @@ public class Keyboard {
* point is out of range, then an array of size zero is returned.
*/
public Key[] getNearestKeys(int x, int y) {
return mProximityInfo.getNearestKeys(x, y);
// Avoid dead pixels at edges of the keyboard
final int adjustedX = Math.max(0, Math.min(x, mOccupiedWidth - 1));
final int adjustedY = Math.max(0, Math.min(y, mOccupiedHeight - 1));
return mProximityInfo.getNearestKeys(adjustedX, adjustedY);
}
public static String printableCode(int code) {