Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34f5e042 authored by Paul McLean's avatar Paul McLean
Browse files

Addeding try/catch to card#/device# parsing in AlsaDevicesParser.java

Not the cause of, but related to...
Bug: 19082426

Change-Id: I296c67989debc932838b39d63fdb57396448c50c
parent fed0196b
Loading
Loading
Loading
Loading
+14 −4
Original line number Original line Diff line number Diff line
@@ -98,14 +98,24 @@ public class AlsaDevicesParser {
                        break;
                        break;


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


                    case kToken_DeviceNum:
                    case kToken_DeviceNum:
                        try {
                            mDeviceNum = Integer.parseInt(token);
                            mDeviceNum = Integer.parseInt(token);
                        } catch (NumberFormatException e) {
                            Slog.e(TAG, "Failed to parse device number: " token);
                            return false;
                        }
                        break;
                        break;


                    case kToken_Type0:
                    case kToken_Type0: