am 8c501a3a: Merge "Addeding try/catch to card#/device# parsing in AlsaDevicesParser.java" into mnc-dev

* commit '8c501a3a56493257a59a0509697a6d04853df182':
  Addeding try/catch to card#/device# parsing in AlsaDevicesParser.java
This commit is contained in:
Paul McLean
2015-05-15 22:22:22 +00:00
committed by Android Git Automerger

View File

@@ -98,14 +98,24 @@ public class AlsaDevicesParser {
break;
case kToken_CardNum:
mCardNum = Integer.parseInt(token);
if (line.charAt(delimOffset) != '-') {
tokenIndex++; // no device # in the token stream
try {
mCardNum = Integer.parseInt(token);
if (line.charAt(delimOffset) != '-') {
tokenIndex++; // no device # in the token stream
}
} catch (NumberFormatException e) {
Slog.e(TAG, "Failed to parse card number: " token);
return false;
}
break;
case kToken_DeviceNum:
mDeviceNum = Integer.parseInt(token);
try {
mDeviceNum = Integer.parseInt(token);
} catch (NumberFormatException e) {
Slog.e(TAG, "Failed to parse device number: " token);
return false;
}
break;
case kToken_Type0: