## Summary
Previously, URLs shared to offline targets via the ShareActivity were
delivered to them once they became online. This change extends this
behavior to direct share targets.
## Test Plan
Test 1
* Make sure a PC device is already paired with the phone. Let's say the name of this device is "PC".
* Make PC unreachable, e.g., close the KDE app on it.
* On the phone, open Chrome and share a couple of webpages to KDE's PC's direct share target.
* Open the KDE app on the PC.
* Observe that the webpages are opened on PC.
Test 2
* Make sure a PC device is already paired with the phone. Let's say the name of this device is "PC".
* Make PC unreachable, e.g., close the KDE app on it.
* On the phone, share a file to KDE's PC's direct share target.
* Open the KDE app on the PC.
* Observe that the file is sent to PC.
Test 3
* Make sure two PC devices are already paired with the phone. Let's say the name of these devices are "PC1" and "PC2".
* Make PC1 and PC2 unreachable, e.g., close the KDE app on them.
* On the phone, open Chrome and share a couple of webpages to KDE's PC1's direct share target.
* Open the KDE app on the PC2.
* Observe that the webpages are NOT opened on PC2.
* Open the KDE app on the PC1.
* Observe that the webpages are opened on PC1.
Test 4
* Make sure a PC device is already paired with the phone. Let's say the name of this device is "PC".
* Make PC reachable, e.g., have the KDE app open on it.
* Try to share a URL from the phone to the KDE's PC's direct share target.
* Observe that the URL opens instantly on the PC.
Added a new KdeConnect Application class that holds the Devices now, while
BackgroundService "only" takes care of the LinkProviders.
Since KdeConnect subclasses Application we have the guarantee that it will
exist as long as our process does, so we can use it as a singleton. This
removes the "BackgroundService.RunCommand" hack (which sent an Intent that
would awake BackgroundService in case it wasn't running already and then
call our code in a callback). This saves lots of round trips between the
system and us and makes things simpler (and stack traces useful) by making
the code sequential.
We already had an Application subclass that I moved to a new helper, which
now the KdeConnect class initializes together with all the other helpers.
Apply Material3 to dialogs, image buttons, switches and preferences.
Merge the landscape and portrait layouts for the MPRIS controls.
Move setting theme to application start instead of applying to every activity.
* Remove usage of deprecated WiFi ConnectivityManager
* Only listen for non-cellular network changes (where we can find devices)
* Do not listen for network changes also from PairingFragment
## Summary
Spawning new threads in Java is costly. This MR aims to use a common thread pool instead.
I've replaced all cases where a new thread is started just to perform a task in the background. This does not include cases where a reference to the newly created thread is kept as a part of application logic – this is probably a problem in itself, but it exceeds the scope of this quick optimization. ;)
There was a couple of cases where a new thread was spawned just to sleep for a while an then change the state on a View on the main thread. I've replaced those with posting those deferred tasks to the View's message queue.
## Test Plan
Everything should work the same as it has before, just a bit faster and easier on the memory.
Changes:
1. In the menu, the design of the selected item was changed, the icon of the current device was added and the image was removed
2. Changed the accent color to orange
3. Separators have been removed from almost all lists
4. The design of the selected item was changed in the menu, the icon of the current device was added and the image was removed
4. Changed the color of the toolbar to white or black (depending on the theme)
Summary:
Allow in progress file transfers to be canceled
BUG: 349956
{F6373048}
{F6373050}
{F6373051}
Test Plan:
Send a large file from desktop to android
Press cancel in the progress notification
Result: the file transfer is cancelled and the cancelled file is deleted from storage
Reviewers: #kde_connect, nicolasfella, albertvaka
Reviewed By: #kde_connect, albertvaka
Subscribers: albertvaka, nicolasfella, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D16491
Summary: Use the new AndroidX libraries instead of the legacy support libraries
Test Plan: Apply patch and verify everything works as before
Reviewers: #kde_connect, nicolasfella
Reviewed By: #kde_connect, nicolasfella
Subscribers: shubham, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D17818
Summary: D12212 broke the devices list in the SharePlugin. No devices was shown even when there were devices available.
Test Plan: Open up share devices list with 0/1 devices available
Reviewers: #kde_connect, albertvaka
Reviewed By: #kde_connect, albertvaka
Subscribers: kdeconnect, #kde_connect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D12334
Summary: Let Android Studio replace anonymous types with lambdas. No manual code change.
Test Plan: Compile and superficial behaviour test
Reviewers: #kde_connect, philipc
Reviewed By: #kde_connect, philipc
Subscribers: philipc, #kde_connect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D12229
Summary:
BUG: 375376
This revision adds dark mode support to the app ( T7044 ). It does so by injecting
theme information into each activity, and making sure that all Views
define their colors by reference to theme attributes.
In order to make this work, all of the buttons with images (like the list
of available devices) now are tinted according to the theme.
While all versions of android support the theme, only devices running
Android ICS or higher will have a toggle button in the drawer.
Test Plan: Open all the screens, both with and without the dark theme on.
Reviewers: #kde_connect, mtijink, #vdg, nicolasfella
Reviewed By: #kde_connect, mtijink, nicolasfella
Subscribers: apol, ngraham, nicolasfella, mtijink
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D11694
Summary: Sorry for the huge diff, but all I did was applying Android Studio's 'Reformat Code' to all files. If everyone does that before submitting a patch we can keep it clean easily.
Test Plan: Compiles
Reviewers: #kde_connect, mtijink
Reviewed By: #kde_connect, mtijink
Subscribers: mtijink, sredman, #kde_connect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D10905
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