Merge pull request #158 from Redirion/patch-1

Avoid using su on Android if not required
This commit is contained in:
Will Hedgecock 2018-10-09 09:17:14 -05:00 committed by GitHub
commit 68e102cca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -378,7 +378,8 @@ public final class SerialPort
try { Thread.sleep(safetySleepTime); } catch (Exception e) {}
// If this is an Android root application, we must explicitly allow serial port access to the library
if (isAndroid)
File portFile = isAndroid ? new File(comPort) : null;
if (portFile != null && (!portFile.canRead() || !portFile.canWrite()))
{
Process process = null;
try