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

Update comments

This commit is contained in:
Albert Vaca Cintora 2023-03-17 18:35:18 +01:00
parent f2f1930cec
commit d9e641ae28

View File

@ -563,9 +563,8 @@ public class Device implements BaseLink.PacketReceiver {
reloadPluginsFromSettings();
}
//If capabilities are not supported, iterate all plugins
Collection<String> targetPlugins = pluginsByIncomingInterface.get(np.getType());
if (!targetPlugins.isEmpty()) {
if (!targetPlugins.isEmpty()) { // When a key doesn't exist the multivaluemap returns an empty collection, so we don't need to check for null
for (String pluginKey : targetPlugins) {
Plugin plugin = plugins.get(pluginKey);
try {
@ -588,10 +587,8 @@ public class Device implements BaseLink.PacketReceiver {
unpair();
//If capabilities are not supported, iterate through all plugins.
// The following code is NOT USED. It adds support for receiving packets from not trusted devices, but as of March 2023 no plugin implements "onUnpairedDevicePacketReceived".
Collection<String> targetPlugins = pluginsByIncomingInterface.get(np.getType());
// When a mapping doesn't exist, an empty collection is added to the map and
// then returned, so a null check is not necessary.
if (!targetPlugins.isEmpty()) {
for (String pluginKey : targetPlugins) {
Plugin plugin = plugins.get(pluginKey);