Merge pull request #72 from colinmadere/release

Fix lingering "Disconnecting" notification
This commit is contained in:
Aleksander Nowakowski 2017-09-29 13:01:28 +02:00 committed by GitHub
commit ae9a424a4c
1 changed files with 2 additions and 1 deletions

View File

@ -1396,8 +1396,9 @@ public abstract class DfuBaseService extends IntentService implements DfuProgres
return;
// the notification may not be refreshed too quickly as the ABORT button becomes not clickable
// If new state is an end-state, update regardless so it will not stick around in "Disconnecting" state
final long now = SystemClock.elapsedRealtime();
if (now - mLastNotificationTime < 250)
if (now - mLastNotificationTime < 250 && !(PROGRESS_COMPLETED == progress || PROGRESS_ABORTED == progress))
return;
mLastNotificationTime = now;