am d7638e6d: Merge change 25780 into eclair

Merge commit 'd7638e6de29d475623ac7f05a6fa92e92362be22' into eclair-plus-aosp

* commit 'd7638e6de29d475623ac7f05a6fa92e92362be22':
  Reject lowercase characters in checkBluetoothAddress().
This commit is contained in:
Nick Pelly
2009-09-18 13:59:55 -07:00
committed by Android Git Automerger

View File

@@ -573,6 +573,7 @@ public final class BluetoothAdapter {
/** /**
* Validate a Bluetooth address, such as "00:43:A8:23:10:F0" * Validate a Bluetooth address, such as "00:43:A8:23:10:F0"
* <p>Alphabetic characters must be uppercase to be valid.
* *
* @param address Bluetooth address as string * @param address Bluetooth address as string
* @return true if the address is valid, false otherwise * @return true if the address is valid, false otherwise
@@ -586,8 +587,9 @@ public final class BluetoothAdapter {
switch (i % 3) { switch (i % 3) {
case 0: case 0:
case 1: case 1:
if (Character.digit(c, 16) != -1) { if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) {
break; // hex character, OK // hex character, OK
break;
} }
return false; return false;
case 2: case 2: