2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 09:58:08 +00:00

Don't block plugins if they don't have any capabilities

Reviewed by Albert Vaca
This commit is contained in:
Aleix Pol 2015-09-12 12:25:22 +02:00
parent 3de229f1e5
commit effa740db4

View File

@ -784,6 +784,9 @@ public class Device implements BaseLink.PackageReceiver {
HashMap<String, ArrayList<String>> newPluginsByIncomingInterface = new HashMap<>();
HashMap<String, ArrayList<String>> newPluginsByOutgoingInterface = new HashMap<>();
final boolean supportsCapabilities = (incomingCapabilities != null && !incomingCapabilities.isEmpty()) ||
(incomingCapabilities != null && !outgoingCapabilities.isEmpty());
for (String pluginKey : availablePlugins) {
PluginFactory.PluginInfo pluginInfo = PluginFactory.getPluginInfo(context, pluginKey);
@ -800,8 +803,7 @@ public class Device implements BaseLink.PackageReceiver {
newSupportedIncomingInterfaces.addAll(incomingInterfaces);
}
if ((incomingCapabilities != null && !incomingCapabilities.isEmpty()) ||
(incomingCapabilities != null && !outgoingCapabilities.isEmpty())) {
if (supportsCapabilities && (!incomingInterfaces.isEmpty() || !outgoingInterfaces.isEmpty())) {
HashSet<String> supportedOut = new HashSet<>(outgoingInterfaces);
supportedOut.retainAll(incomingCapabilities); //Intersection
HashSet<String> supportedIn = new HashSet<>(incomingInterfaces);