2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-28 12:47:43 +00:00

36 Commits

Author SHA1 Message Date
Albert Vaca Cintora
3e96d5ecd3
Remove leftover mock line 2024-05-13 12:34:19 +02:00
Albert Vaca Cintora
c6dbadce21
Upgrade to Mockito 5, remove PowerMock and update test
PowerMock is no longer maintained and is only compatible with Mockito 3.
However, modern Mockito supports mocking static methods, so PowerMock is
no longer needed (after adjusting the tests a bit).
2024-05-13 12:31:59 +02:00
Albert Vaca Cintora
7c649be2ce Add "laptop" as a device type
For consistency with the other implementations, which distinguish the
two kinds of computers.
2023-09-18 07:31:06 +00:00
Erik Duisters
0bd326d403 Some Kotlin refactorings 2023-08-01 11:22:41 +00:00
Albert Vaca Cintora
8c1603f6e4 Add DeviceInfo class
`DeviceInfo` 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, `BaseLink` subclasses need to implement the `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.

In a future, we can add a mechanism for links to notify when their `DeviceInfo` changed.
This will allow us to better support device renames (which now are implemented by 
reconnecting to the device and don't always work) or sending the capabilities fields
later in the case of MacOS/iOS where we can't send them in a UDP packet due to the
size limit of 1500 bytes.
2023-06-27 11:14:36 +00:00
Albert Vaca Cintora
867bdfb6fb Move PairingHandler out from the UI package 2023-06-16 19:51:57 +02:00
Albert Vaca Cintora
b14df9d09c Fail earlier if we don't have a certificate 2023-06-05 10:29:27 +02:00
Albert Vaca Cintora
a20fb00b7d Have a single PairingHandler for all links 2023-06-05 10:28:45 +02:00
Albert Vaca Cintora
0f4643e502 Project-wide optimize imports 2023-03-05 22:11:58 +01:00
Albert Vaca Cintora
2b1e4dcb23 Bump deps 2023-01-02 22:00:32 +01:00
Nicolas Fella
b3b74f25f4 Convert license headers to SPDX 2020-08-17 16:17:20 +02:00
Isira Seneviratne
c6f8a2ecdc Fix test compilation errors. 2020-08-02 16:56:21 +00:00
Isira Seneviratne
fe3cbeb65b Mock ContextCompat.getSystemService() using PowerMockito. 2020-07-07 17:52:54 +05:30
Isira Seneviratne
52aafe6b8c Use ContextCompat.getSystemService() to retrieve system services without casting. 2020-07-07 16:47:39 +05:30
Philip Cohn-Cort
7e935a495e Remove old protocol v6 code from DeviceTest.java 2020-03-21 22:43:29 -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
Nicolas Fella
f1194e88c2 Use Log.e instead of printStackTrace 2019-03-31 20:09:44 +02:00
Erik Duisters
085fb1025b Capture PairingHandlerCallback and call its pairingDone method instead of calling Device.pairingDone using reflection 2019-03-04 19:24:04 +01:00
Erik Duisters
bc2836f45f Also verify that Device.PairingCallback.unpaired() is called 2019-03-04 19:22:46 +01:00
Erik Duisters
b135ffa92a Also verify that Device.PairingCallback.pairingSuccessful() is called 2019-03-04 19:21:04 +01:00
Erik Duisters
024a084b9a Add DeviceType test 2019-03-02 17:42:46 +01:00
Erik Duisters
ff51544e46 Clean up formatting 2019-03-02 17:10:08 +01:00
Nicolas Fella
30e9375106 Weaken access modifier 2019-02-28 15:47:11 +01:00
Nicolas Fella
2a32eb4bae Remove unused imports 2019-02-28 15:44:14 +01:00
Albert Vaca Cintora
b1904a6995 Fixed all tests
Now they are local tests and not Android tests
2019-02-11 21:44:55 +01:00
Nicolas Fella
f244daa5bf Organize imports 2018-12-24 17:43:46 +01:00
Nicolas Fella
a49a145d69 Only use required access modifiers 2018-10-26 23:59:20 +02:00
Nicolas Fella
59c72c2107 Simplify asserts 2018-10-26 23:00:53 +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
Nicolas Fella
fa5a37c472 Apply coding style to whole project
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
2018-03-03 16:09:52 +01:00
Albert Vaca
4d19a7cdc8 Fixed tests 2016-06-12 21:07:01 +02:00
Albert Vaca
0836453c35 Project-wise optimize imports 2016-06-09 13:42:54 +02:00
Albert Vaca
acb2888bde Fixed test imports 2016-02-17 08:45:13 -08:00
Vineet Garg
442c01a8e5 Added x86 and mips conscrypt libs
Pairing is now done through links
2015-07-01 03:25:16 +05:30
Vineet Garg
00557052ff Corrected unit tests
Settings were not save properly when certificate was null
Removed LanLinkProvider test, impossible with new design
2015-06-21 17:30:29 +05:30
Vineet Garg
3aadc94278 Added tests - DeviceTest and NetworkPackageTest 2015-06-10 12:29:53 +05:30