Summary:
Support Android 6 direct share.
BUG:362266
BackgroundService is a SIngleton now. This should only be used if strictly necessary.
Test Plan: Pick a random app with a share button, look for device entries in Sharing options (might not be there because other sharing options have higher priority)
Reviewers: #kde_connect, albertvaka
Reviewed By: #kde_connect, albertvaka
Subscribers: albertvaka, #kde_connect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D6743
Summary:
Some refactoring in the Shareplugin:
Extracted some parts into separate methods
Extracted notification into separate class
Some optical tweaks on notifications
Reviewers: #kde_connect, albertvaka
Reviewed By: #kde_connect, albertvaka
Subscribers: albertvaka, #kde_connect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D6613
Android's Storage Access Framework abstraction wants us to use mimetypes
instead of file extensions, but for some file types it can't guess a useful
mimetype. In those cases, provide the extension as part of the base name.
BUG: 376638
Only works for old-school (not-Storage Access Framework) paths, so we have
to keep track of the fact that we are using one or the other.
Also this requires the permission DOWNLOAD_WITHOUT_NOTIFICATION, but
hopefully the play store won't make users confirm this one.
This behaviour is enabled by default.
- Refactored the code to separate reading the file, sending it and
updating the notification. This last part it's now done in a standalone
sendPackage callback class.
- Added a non-async sendPacakge function to device, so we can properly
wait for a file to finish before sending the next one without using
recursive callbacks as before.
- Fixed bug that made it impossible to share more than one file from
certain apps. This was caused because we can't access content resolvers
any longer after closing the activity that was launched to "share" to.
Now we do the content resolutions first and once for all files.
- When sending more than one file, do not spam one notification for each.
- There is no need to update the notifications from the UI thread, now
we do it from a background thread instead.