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

Only unpair when receiving unknown packages if I'm not requesting pairing

In case the other device thinks we are paired and answers my identity
packet with unexpected stuff.
This commit is contained in:
Albert Vaca
2015-03-22 22:44:17 -07:00
parent fb2b1232fb
commit 46c70639ac

View File

@@ -475,12 +475,7 @@ public class Device implements BaseLink.PackageReceiver {
for (PairingCallback cb : pairingCallback) cb.unpaired();
}
} else if (!isPaired()) {
unpair();
Log.e("onPackageReceived","Device not paired, ignoring package!");
} else {
} else if (isPaired()) {
for (Plugin plugin : plugins.values()) {
try {
@@ -491,6 +486,15 @@ public class Device implements BaseLink.PackageReceiver {
}
}
} else {
Log.e("onPackageReceived","Device not paired, ignoring package!");
if (pairStatus != PairStatus.Requested) {
unpair();
}
}
}