2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-29 13:17:43 +00:00

Don't complain about our own packet types

This commit is contained in:
Albert Vaca 2016-06-06 23:56:01 +02:00
parent a1dd4fe2cc
commit e9e93423f1
2 changed files with 11 additions and 2 deletions

View File

@ -643,7 +643,7 @@ public class Device implements BaseLink.PackageReceiver {
hackToMakeRetrocompatiblePacketTypes(np);
if (protocolVersion >= 6 && !supportedOutgoingInterfaces.contains(np.getType())) {
if (protocolVersion >= 6 && !supportedOutgoingInterfaces.contains(np.getType()) && !NetworkPackage.protocolPackageTypes.contains(np.getType())) {
Log.e("Device/sendPackage", "Plugin tried to send an unsupported package: " + np.getType());
Log.e("Device/sendPackage", "Supported package types: " + Arrays.toString(supportedOutgoingInterfaces.toArray()));
}

View File

@ -33,6 +33,8 @@ import org.kde.kdeconnect.Helpers.DeviceHelper;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
public class NetworkPackage {
@ -41,7 +43,14 @@ public class NetworkPackage {
public final static String PACKAGE_TYPE_IDENTITY = "kdeconnect.identity";
public final static String PACKAGE_TYPE_PAIR = "kdeconnect.pair";
public final static String PACKAGE_TYPE_ENCRYPTED = "kdeconnect.encrypted";
public static final String PACKAGE_TYPE_CAPABILITIES = "kdeconnect.capabilities";
public final static String PACKAGE_TYPE_CAPABILITIES = "kdeconnect.capabilities";
public static Set<String> protocolPackageTypes = new HashSet<String>() {{
add(PACKAGE_TYPE_IDENTITY);
add(PACKAGE_TYPE_PAIR);
add(PACKAGE_TYPE_ENCRYPTED);
add(PACKAGE_TYPE_CAPABILITIES);
}};
private long mId;
String mType;