From 6fb6ea7e2bcbec7b559fa1ae9b8dd5d1a774c75e Mon Sep 17 00:00:00 2001 From: Erik Duisters Date: Fri, 30 Nov 2018 16:29:44 +0100 Subject: [PATCH] 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 --- .../kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java b/src/org/kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java index 17619d35..434c003f 100644 --- a/src/org/kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java +++ b/src/org/kde/kdeconnect/Plugins/SharePlugin/SharePlugin.java @@ -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; } } }