Update DfuBaseService.java

Add one second delay to avoid the traffic jam before the DFU mode is enabled
This commit is contained in:
Kun 2016-02-06 22:51:05 -07:00
parent 7d8b6a761d
commit f8c01ee2d7
1 changed files with 9 additions and 0 deletions

View File

@ -803,6 +803,15 @@ public abstract class DfuBaseService extends IntentService {
loge("Service discovery error: " + status);
mError = ERROR_CONNECTION_MASK | status;
}
// Add one second delay to avoid the traffic jam before the DFU mode is enabled
synchronized (this) {
try {
wait(1000);
} catch (InterruptedException e) {
// Do nothing
}
}
// Notify waiting thread
synchronized (mLock) {