Allow safety sleep to take effect before the su request in Android.
This commit is contained in:
parent
e1e4441484
commit
5d96988de3
|
@ -351,6 +351,10 @@ public final class SerialPort
|
|||
if (isOpened)
|
||||
return true;
|
||||
|
||||
// Force a sleep to ensure that the port does not become unusable due to rapid closing/opening on the part of the user
|
||||
if (safetySleepTime > 0)
|
||||
try { Thread.sleep(safetySleepTime); } catch (Exception e) { e.printStackTrace(); }
|
||||
|
||||
// If this is an Android root application, we must explicitly allow serial port access to the library
|
||||
if (isAndroid)
|
||||
{
|
||||
|
@ -382,10 +386,6 @@ public final class SerialPort
|
|||
}
|
||||
}
|
||||
|
||||
// Force a sleep to ensure that the port does not become unusable due to rapid closing/opening on the part of the user
|
||||
if (safetySleepTime > 0)
|
||||
try { Thread.sleep(safetySleepTime); } catch (Exception e) { e.printStackTrace(); }
|
||||
|
||||
if ((portHandle = openPortNative()) > 0)
|
||||
{
|
||||
inputStream = new SerialPortInputStream();
|
||||
|
|
Loading…
Reference in New Issue