mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-29 21:27:40 +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
|
//pairing to us, or connections that are already paired. TODO: Keep connections in the process of pairing
|
||||||
|
|
||||||
if (connectionSource == ConnectionStarted.Remotely) {
|
if (connectionSource == ConnectionStarted.Remotely) {
|
||||||
|
//Log.e("LinkShouldBeKeptAlive", "because the other end started the connection");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences preferences = context.getSharedPreferences("trusted_devices", Context.MODE_PRIVATE);
|
//Log.e("LinkShouldBeKeptAlive", "false");
|
||||||
if (preferences.contains(getDeviceId())) {
|
|
||||||
return true; //Already paired
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -909,6 +909,13 @@ public class Device implements BaseLink.PackageReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean deviceShouldBeKeptAlive() {
|
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) {
|
for(BaseLink l : links) {
|
||||||
if (l.linkShouldBeKeptAlive()) {
|
if (l.linkShouldBeKeptAlive()) {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user