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

Better exception handling in sendMessage

This commit is contained in:
Albert Vaca
2014-04-15 22:17:27 +02:00
parent a79e8f83ce
commit 76fd6d1e08

View File

@@ -491,13 +491,19 @@ public class Device implements BaseLink.PackageReceiver {
ArrayList<BaseLink> mLinks = new ArrayList<BaseLink>(links);
boolean success = false;
for(BaseLink link : mLinks) {
if (useEncryption) {
success = link.sendPackageEncrypted(np, publicKey);
} else {
success = link.sendPackage(np);
try {
for (BaseLink link : mLinks) {
if (useEncryption) {
success = link.sendPackageEncrypted(np, publicKey);
} else {
success = link.sendPackage(np);
}
if (success) break;
}
if (success) break;
} catch(Exception e) {
e.printStackTrace();
Log.e("sendPackage","Error while sending package");
success = false;
}
if (success) {