mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
dismiss only after delay to remove stuck notification
Signed-off-by: Felix Nüsse <felix.nuesse@t-online.de>
This commit is contained in:
parent
f8e960105a
commit
d48ffc769e
1 changed files with 12 additions and 0 deletions
|
@ -119,6 +119,8 @@ public class FileDownloader extends Service
|
||||||
|
|
||||||
private long conflictUploadId;
|
private long conflictUploadId;
|
||||||
|
|
||||||
|
public boolean mStartedDownload = false;
|
||||||
|
|
||||||
@Inject UserAccountManager accountManager;
|
@Inject UserAccountManager accountManager;
|
||||||
@Inject UploadsStorageManager uploadsStorageManager;
|
@Inject UploadsStorageManager uploadsStorageManager;
|
||||||
@Inject LocalBroadcastManager localBroadcastManager;
|
@Inject LocalBroadcastManager localBroadcastManager;
|
||||||
|
@ -420,6 +422,15 @@ public class FileDownloader extends Service
|
||||||
mService.downloadFile(next);
|
mService.downloadFile(next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mService.mStartedDownload=false;
|
||||||
|
(new Handler()).postDelayed(new Runnable(){
|
||||||
|
public void run() {
|
||||||
|
if(!mService.mStartedDownload){
|
||||||
|
mService.mNotificationManager.cancel(R.string.downloader_download_in_progress_ticker);
|
||||||
|
}
|
||||||
|
}}, 2000);
|
||||||
|
|
||||||
|
|
||||||
Log_OC.d(TAG, "Stopping after command with id " + msg.arg1);
|
Log_OC.d(TAG, "Stopping after command with id " + msg.arg1);
|
||||||
mService.mNotificationManager.cancel(FOREGROUND_SERVICE_ID);
|
mService.mNotificationManager.cancel(FOREGROUND_SERVICE_ID);
|
||||||
mService.stopForeground(true);
|
mService.stopForeground(true);
|
||||||
|
@ -435,6 +446,7 @@ public class FileDownloader extends Service
|
||||||
*/
|
*/
|
||||||
private void downloadFile(String downloadKey) {
|
private void downloadFile(String downloadKey) {
|
||||||
|
|
||||||
|
mStartedDownload = true;
|
||||||
mCurrentDownload = mPendingDownloads.get(downloadKey);
|
mCurrentDownload = mPendingDownloads.get(downloadKey);
|
||||||
|
|
||||||
if (mCurrentDownload != null) {
|
if (mCurrentDownload != null) {
|
||||||
|
|
Loading…
Reference in a new issue