https://bugs.kde.org/show_bug.cgi?id=391059

            Bug ID: 391059
           Summary: SharePlugin Notification Stuck
           Product: kdeconnect
           Version: unspecified
          Platform: Neon Packages
                OS: Android 7.x
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: android-application
          Assignee: albertv...@gmail.com
          Reporter: jus...@gmx.de
  Target Milestone: ---

KDE-Connect-Android Version: 1.7.1

The SharePlugin notification is stuck ~95% of the time on my device.
The file transfer itself is successful.
The only way to get rid of the notification is to kill kde-connect.

The SharePlugin calls NotificationHelper.notifyCompat too often.
Android ignores than the final call to that function.
Logcat output: 
multiple lines of
org.kde.kdeconnect_tp W/NotificationManager: notify: id corrupted: sent
-834788870, got back 0


The bug is in the SharePlugin.receiveFile function:

if (progressPercentage != prevProgressPercentage) {
    prevProgressPercentage = progressPercentage;

    notification.setProgress((int) progressPercentage);
    notification.show();
}


A possible fix is to only update the progress every 100ms:

long lastUpdate = 0;
if (progressPercentage != prevProgressPercentage && System.currentTimeMillis()
- lastUpdate > 100) {
    prevProgressPercentage = progressPercentage;
    lastUpdate = System.currentTimeMillis();

    notification.setProgress((int) progressPercentage);
    notification.show();
}


I tested it and it works now on my Honor 7X with Android 7.
And thanks for an awesome app :)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to