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

Re-use existing link instead of creating a new one

This commit is contained in:
Albert Vaca
2016-03-02 11:39:49 -08:00
parent baee1771f5
commit c0d21e986c
6 changed files with 110 additions and 105 deletions

View File

@@ -874,13 +874,13 @@ public class Device implements BaseLink.PackageReceiver {
}
}
public BaseLink.ConnectionStarted getConnectionSource() {
public boolean deviceShouldBeKeptAlive() {
for(BaseLink l : links) {
if (l.getConnectionSource() == BaseLink.ConnectionStarted.Locally) {
return BaseLink.ConnectionStarted.Locally;
if (l.linkShouldBeKeptAlive()) {
return true;
}
}
return BaseLink.ConnectionStarted.Remotely;
return false;
}
}