for some devices, the process-id is listed first

This commit is contained in:
Nathan Freitas 2014-05-02 14:58:47 -04:00
parent fd5128170a
commit 42d8ca1377
1 changed files with 9 additions and 1 deletions

View File

@ -89,9 +89,17 @@ public class TorServiceUtils implements TorServiceConstants {
{
if (line.contains(command))
{
String[] lineParts = line.split("\\s+");
procId = Integer.parseInt(lineParts[1]);
try {
procId = Integer.parseInt(lineParts[1]); //for most devices it is the second number
} catch(NumberFormatException e) {
procId = Integer.parseInt(lineParts[0]); //but for samsungs it is the first
}
break;
}