From 867bdfb6fb3c81a5b749fe99da4e0b5ac0ff0b1d Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Fri, 16 Jun 2023 19:51:57 +0200 Subject: [PATCH] Move PairingHandler out from the UI package --- src/org/kde/kdeconnect/Device.java | 1 - src/org/kde/kdeconnect/KdeConnect.java | 1 - .../kde/kdeconnect/{UserInterface => }/PairingHandler.java | 4 +--- src/org/kde/kdeconnect/UserInterface/DeviceFragment.kt | 1 + tests/org/kde/kdeconnect/DeviceTest.java | 5 ----- 5 files changed, 2 insertions(+), 10 deletions(-) rename src/org/kde/kdeconnect/{UserInterface => }/PairingHandler.java (98%) diff --git a/src/org/kde/kdeconnect/Device.java b/src/org/kde/kdeconnect/Device.java index 0f1b51e2..a0110ec2 100644 --- a/src/org/kde/kdeconnect/Device.java +++ b/src/org/kde/kdeconnect/Device.java @@ -34,7 +34,6 @@ import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper; import org.kde.kdeconnect.Plugins.Plugin; import org.kde.kdeconnect.Plugins.PluginFactory; import org.kde.kdeconnect.UserInterface.MainActivity; -import org.kde.kdeconnect.UserInterface.PairingHandler; import org.kde.kdeconnect_tp.R; import java.io.IOException; diff --git a/src/org/kde/kdeconnect/KdeConnect.java b/src/org/kde/kdeconnect/KdeConnect.java index 9a769adc..6a8de5e2 100644 --- a/src/org/kde/kdeconnect/KdeConnect.java +++ b/src/org/kde/kdeconnect/KdeConnect.java @@ -22,7 +22,6 @@ import org.kde.kdeconnect.Helpers.SecurityHelpers.RsaHelper; import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper; import org.kde.kdeconnect.Plugins.Plugin; import org.kde.kdeconnect.Plugins.PluginFactory; -import org.kde.kdeconnect.UserInterface.PairingHandler; import org.kde.kdeconnect.UserInterface.ThemeUtil; import java.security.cert.Certificate; diff --git a/src/org/kde/kdeconnect/UserInterface/PairingHandler.java b/src/org/kde/kdeconnect/PairingHandler.java similarity index 98% rename from src/org/kde/kdeconnect/UserInterface/PairingHandler.java rename to src/org/kde/kdeconnect/PairingHandler.java index 6ff92a82..1d53e7d7 100644 --- a/src/org/kde/kdeconnect/UserInterface/PairingHandler.java +++ b/src/org/kde/kdeconnect/PairingHandler.java @@ -4,12 +4,10 @@ * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ -package org.kde.kdeconnect.UserInterface; +package org.kde.kdeconnect; import android.util.Log; -import org.kde.kdeconnect.Device; -import org.kde.kdeconnect.NetworkPacket; import org.kde.kdeconnect_tp.R; import java.util.Timer; diff --git a/src/org/kde/kdeconnect/UserInterface/DeviceFragment.kt b/src/org/kde/kdeconnect/UserInterface/DeviceFragment.kt index 43966fa2..932cb13c 100644 --- a/src/org/kde/kdeconnect/UserInterface/DeviceFragment.kt +++ b/src/org/kde/kdeconnect/UserInterface/DeviceFragment.kt @@ -34,6 +34,7 @@ import org.kde.kdeconnect.Device import org.kde.kdeconnect.Device.PluginsChangedListener import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper import org.kde.kdeconnect.KdeConnect +import org.kde.kdeconnect.PairingHandler import org.kde.kdeconnect.Plugins.BatteryPlugin.BatteryPlugin import org.kde.kdeconnect.Plugins.MprisPlugin.MprisPlugin import org.kde.kdeconnect.Plugins.Plugin diff --git a/tests/org/kde/kdeconnect/DeviceTest.java b/tests/org/kde/kdeconnect/DeviceTest.java index c42974ed..23c4bd13 100644 --- a/tests/org/kde/kdeconnect/DeviceTest.java +++ b/tests/org/kde/kdeconnect/DeviceTest.java @@ -9,7 +9,6 @@ package org.kde.kdeconnect; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; @@ -33,7 +32,6 @@ import org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider; import org.kde.kdeconnect.Helpers.DeviceHelper; import org.kde.kdeconnect.Helpers.SecurityHelpers.RsaHelper; import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper; -import org.kde.kdeconnect.UserInterface.PairingHandler; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; @@ -41,10 +39,7 @@ import org.powermock.modules.junit4.PowerMockRunner; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.security.KeyPair; -import java.security.KeyPairGenerator; import java.security.cert.Certificate; -import java.security.cert.CertificateEncodingException; import java.security.cert.CertificateException; @RunWith(PowerMockRunner.class)