mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-04 16:15:09 +00:00
Better exception handling in sendMessage
This commit is contained in:
@@ -491,13 +491,19 @@ public class Device implements BaseLink.PackageReceiver {
|
|||||||
ArrayList<BaseLink> mLinks = new ArrayList<BaseLink>(links);
|
ArrayList<BaseLink> mLinks = new ArrayList<BaseLink>(links);
|
||||||
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
for(BaseLink link : mLinks) {
|
try {
|
||||||
if (useEncryption) {
|
for (BaseLink link : mLinks) {
|
||||||
success = link.sendPackageEncrypted(np, publicKey);
|
if (useEncryption) {
|
||||||
} else {
|
success = link.sendPackageEncrypted(np, publicKey);
|
||||||
success = link.sendPackage(np);
|
} 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) {
|
if (success) {
|
||||||
|
Reference in New Issue
Block a user