mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-29 13:17:43 +00:00
Check for trusted only once
This commit is contained in:
parent
49d4383828
commit
010c960680
@ -332,14 +332,11 @@ public class LanLink extends BaseLink {
|
||||
//pairing to us, or connections that are already paired. TODO: Keep connections in the process of pairing
|
||||
|
||||
if (connectionSource == ConnectionStarted.Remotely) {
|
||||
//Log.e("LinkShouldBeKeptAlive", "because the other end started the connection");
|
||||
return true;
|
||||
}
|
||||
|
||||
SharedPreferences preferences = context.getSharedPreferences("trusted_devices", Context.MODE_PRIVATE);
|
||||
if (preferences.contains(getDeviceId())) {
|
||||
return true; //Already paired
|
||||
}
|
||||
|
||||
//Log.e("LinkShouldBeKeptAlive", "false");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user