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

Using capabilities, packages no longer need to validate received packages

This commit is contained in:
Albert Vaca
2016-06-02 15:35:44 +02:00
parent 05e031d41f
commit b7d9cb5d81
10 changed files with 7 additions and 25 deletions

View File

@@ -54,6 +54,7 @@ import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -562,7 +563,7 @@ public class Device implements BaseLink.PackageReceiver {
} else if (isPaired()) {
//If capabilities are not supported, iterate all plugins
Collection<String> targetPlugins = (protocolVersion > 6)? pluginsByIncomingInterface.get(np.getType()) : plugins.keySet();
Collection<String> targetPlugins = pluginsByIncomingInterface.get(np.getType());
if (targetPlugins != null && !targetPlugins.isEmpty()) {
for (String pluginKey : targetPlugins) {
Plugin plugin = plugins.get(pluginKey);
@@ -587,7 +588,7 @@ public class Device implements BaseLink.PackageReceiver {
unpair();
//If capabilities are not supported, iterate all plugins
Collection<String> targetPlugins = (protocolVersion > 6)? pluginsByIncomingInterface.get(np.getType()) : plugins.keySet();
Collection<String> targetPlugins = pluginsByIncomingInterface.get(np.getType());
if (targetPlugins != null && !targetPlugins.isEmpty()) {
for (String pluginKey : targetPlugins) {
Plugin plugin = plugins.get(pluginKey);