2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 06:05:12 +00:00

Do not swallow packets silently

This commit is contained in:
Albert Vaca
2016-06-02 13:56:46 +02:00
parent 305d496bf5
commit 7759152eeb

View File

@@ -560,7 +560,7 @@ public class Device implements BaseLink.PackageReceiver {
} else if (isPaired()) {
ArrayList<String> targetPlugins = pluginsByIncomingInterface.get(np.getType());
if (targetPlugins != null) {
if (targetPlugins != null && !targetPlugins.isEmpty()) {
for (String pluginKey : targetPlugins) {
Plugin plugin = plugins.get(pluginKey);
try {
@@ -570,6 +570,8 @@ public class Device implements BaseLink.PackageReceiver {
Log.e("KDE/Device", "Exception in " + plugin.getPluginKey() + "'s onPackageReceived()");
}
}
} else {
Log.e("Device", "Ignoring packet with type " + np.getType() + " because no plugin can handle it");
}
} else {
@@ -582,7 +584,7 @@ public class Device implements BaseLink.PackageReceiver {
unpair();
ArrayList<String> targetPlugins = pluginsByIncomingInterface.get(np.getType());
if (targetPlugins != null) {
if (targetPlugins != null && !targetPlugins.isEmpty()) {
for (String pluginKey : targetPlugins) {
Plugin plugin = plugins.get(pluginKey);
try {
@@ -592,6 +594,8 @@ public class Device implements BaseLink.PackageReceiver {
Log.e("KDE/Device", "Exception in " + plugin.getDisplayName() + "'s onPackageReceived() in unPairedPackageListeners");
}
}
} else {
Log.e("Device", "Ignoring packet with type " + np.getType() + " because no plugin can handle it");
}
}