2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 09:58:08 +00:00

27 Commits

Author SHA1 Message Date
Albert Vaca Cintora
5c0c190f5a Add DeviceInfo class
It contains all the properties we need to instantiate a Device: id, name,
type, cert, capabilities and protocol version. Before, we had a mix of
passing those around as arguments or passing identity packets (ie: json).
This simplifies the Device class quite a bit.

Now, the BaseLink subclasses need to implement getDeviceInfo() interface
that returns a DeviceInfo, which is what we will pass around and eventually
use to instantiate a Device.

This means that identity packets are an implementation detail of the
LanLinkProvider and that other implementations could get the DeviceInfo
in a different way.
2023-06-20 10:27:03 +02:00
Albert Vaca Cintora
12de65f234 Rename "signal" function to match the name of the listeners' interface 2023-06-16 19:23:05 +02:00
Albert Vaca Cintora
a20fb00b7d Have a single PairingHandler for all links 2023-06-05 10:28:45 +02:00
Albert Vaca Cintora
38edbd260a Removed unused privateKey field from BaseLink 2023-05-26 19:56:59 +02:00
Albert Vaca Cintora
62cf2d6b44 Add NonNull annotations to Link classes 2023-05-26 19:54:57 +02:00
Albert Vaca Cintora
0f3ad63ee3 Make sending the payloads async
Fixes the bug described in !359. Since we made sending packets sequential
in !90 (including the payload part of the packet) we could be blocking the
queue for up to 10 seconds if the other end didn't fetch our payload.

This makes the payload part async by default but keeps the option to make
it sync, since we want that behavior in CompositeUploadFileJob.
2023-05-25 16:09:09 +00:00
Albert Vaca Cintora
ae23413971 Refactor BackgroundService
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.
2023-05-24 19:28:02 +02:00
Albert Vaca Cintora
58a304a81e Catch SocketException from sendPacket
So we get to print the error message saying which packet got lost and so
that the sending loop doesn't crash.
2023-05-24 17:08:40 +00:00
Albert Vaca Cintora
01f44f524a package -> packet typo fixes 2023-03-17 18:57:02 +01:00
Albert Vaca Cintora
0f4643e502 Project-wide optimize imports 2023-03-05 22:11:58 +01:00
Nicolas Fella
b3b74f25f4 Convert license headers to SPDX 2020-08-17 16:17:20 +02:00
Philip Cohn-Cort
9937be4791 Add threading annotations to various ::sendPacket methods
Summary:
The methods in Device.java can be used from any thread, while
the methods in BaseLink (and its subclasses) should only run
on a background thread. These annotations are picked up by Lint
to show warnings and have no effect at runtime.
2019-07-21 07:09:28 -04:00
Albert Vaca Cintora
168b16527c Remove compat with protocol 6 with RSA encryption
Since we already removed compat with protocol 7 ^.^u
2019-04-18 19:52:30 +02:00
Albert Vaca
9b70e1e61f Rename NetworkPackage -> NetworkPacket
Summary: KDE Connect, now with correct naming!

Test Plan: It still builds.

Reviewers: #kde_connect, apol, nicolasfella

Reviewed By: #kde_connect, apol, nicolasfella

Subscribers: nicolasfella, apol

Differential Revision: https://phabricator.kde.org/D11035
2018-03-05 20:07:29 +01:00
Albert Vaca
e6bc78f013 Some refactoring on sendpackage to reduce allocations of empty callbacks 2016-12-08 20:50:49 +01:00
Albert Vaca
09e1811bd8 Deprecated sendPackageEncrypted
It's only called for compatibility with old devices
2016-06-09 13:42:54 +02:00
Albert Vaca
c0d21e986c Re-use existing link instead of creating a new one 2016-03-02 11:39:49 -08:00
Albert Vaca
f5725b7c8d Merge branch 'master' into ssl
# Conflicts:
#	build.gradle
#	src/org/kde/kdeconnect/Backends/BaseLink.java
#	src/org/kde/kdeconnect/Backends/BaseLinkProvider.java
#	src/org/kde/kdeconnect/Backends/LanBackend/LanLink.java
#	src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java
#	src/org/kde/kdeconnect/Backends/LoopbackBackend/LoopbackLink.java
#	src/org/kde/kdeconnect/BackgroundService.java
#	src/org/kde/kdeconnect/Device.java
#	src/org/kde/kdeconnect/Helpers/DeviceHelper.java
#	src/org/kde/kdeconnect/UserInterface/DeviceActivity.java
#	src/org/kde/kdeconnect/UserInterface/PairActivity.java
#	tests/org/kde/kdeconnect/LanLinkProviderTest.java
#	tests/org/kde/kdeconnect/LanLinkTest.java
2015-09-11 09:24:35 -07:00
Albert Vaca
d35623a28a Fixed discoverable mode dropping connections that we didn't create 2015-09-09 03:31:39 -07:00
Aleix Pol
628142307f Reduce the amount of traffic we get
Only connect to the non-paired devices when we're on discovery mode,
otherwise disconnect from them.

Reviewed by Albert Vaca

BUG: 352424
2015-09-09 00:45:56 +02:00
Vineet Garg
ce5d2c8394 Reimplemented pairing handler interface, now it it is similar to kde version 2015-08-13 14:55:00 +05:30
Albert Vaca
a15b06cdc7 Minor fixes (mostly cosmetic) as per Android Lint analysis 2015-08-10 00:26:58 -07:00
Vineet Garg
aeb9a717d4 Removed some log statements, fixed issues 2015-06-25 19:54:37 +05:30
Vineet Garg
8128c42824 Added support to send payload over ssl 2015-06-20 20:54:39 +05:30
Albert Vaca
f0935ebb8a Trying to simplify the sendPackage logic. 2015-02-01 12:31:41 -08:00
Vineet Garg
1edca5e45c Added progress bar in notification while sending file
REVIEW: 121980
2015-01-17 16:40:57 -08:00
Albert Vaca
f01811446a Migrated project to latest Android SDK and moved sources out of 'main' dir
Sorry for the conflicts caused by moving the sources!
2014-11-22 17:04:37 -08:00