2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-01 06:35:09 +00:00

Check for trusted only once

This commit is contained in:
Albert Vaca
2016-06-17 09:59:31 +02:00
parent 49d4383828
commit 010c960680
2 changed files with 9 additions and 5 deletions

View File

@@ -909,6 +909,13 @@ public class Device implements BaseLink.PackageReceiver {
}
public boolean deviceShouldBeKeptAlive() {
SharedPreferences preferences = context.getSharedPreferences("trusted_devices", Context.MODE_PRIVATE);
if (preferences.contains(getDeviceId())) {
//Log.e("DeviceShouldBeKeptAlive", "because it's a paired device");
return true; //Already paired
}
for(BaseLink l : links) {
if (l.linkShouldBeKeptAlive()) {
return true;