Avoid using su on Android if not required
on some devices the com ports already have the required file flags, so check them first to avoid unnecessary work
This commit is contained in:
parent
6ec32c65cf
commit
0578b3813b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue