mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 13:47:41 +00:00
Clear currentShareInfo when transfer is complete
Summary: currentShareInfo needs to be nulled when a transfer is complete if not the next transfer will have incorrect notification information and will never finish Test Plan: Send 2 files from desktop to android, notification is as expected (eg (File 1 of 2) followed by (File 2 of 2) When transfer is complete send 2 files again, notification is as expected and is finished when transfer is done Reviewers: #kde_connect, albertvaka Reviewed By: #kde_connect, albertvaka Subscribers: kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D17259
This commit is contained in:
@@ -502,6 +502,7 @@ public class SharePlugin extends Plugin implements ReceiveFileRunnable.CallBack
|
||||
shareNotification.setFinished(context.getResources().getQuantityString(R.plurals.received_files_fail_title, failedFiles, failedFiles, info.numberOfFiles(), device.getName()));
|
||||
shareNotification.show();
|
||||
shareNotification = null;
|
||||
currentShareInfo = null;
|
||||
}
|
||||
|
||||
private class FinishReceivingRunnable implements Runnable {
|
||||
@@ -513,6 +514,8 @@ public class SharePlugin extends Plugin implements ReceiveFileRunnable.CallBack
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Log.i("SharePlugin", "FinishReceivingRunnable: Finishing up");
|
||||
|
||||
if (shareNotification != null) {
|
||||
//Update the notification and allow to open the file from it
|
||||
shareNotification.setFinished(context.getResources().getQuantityString(R.plurals.received_files_title, info.numberOfFiles(), info.numberOfFiles(), device.getName()));
|
||||
@@ -522,10 +525,11 @@ public class SharePlugin extends Plugin implements ReceiveFileRunnable.CallBack
|
||||
}
|
||||
|
||||
shareNotification.show();
|
||||
Log.i("SharePlugin", "FinishReceivingRunnable: Setting shareNotification to null");
|
||||
shareNotification = null;
|
||||
finishReceivingRunnable = null;
|
||||
}
|
||||
|
||||
finishReceivingRunnable = null;
|
||||
currentShareInfo = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user