mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-31 06:05:12 +00:00
Ignore exceptions in pairingSuccessful callbacks
Bubbling up the exception to the PairingHandler makes the device become unpaired, and we only want this if the error happens persisting device info
This commit is contained in:
@@ -197,10 +197,15 @@ public class Device implements BaseLink.PacketReceiver {
|
||||
SharedPreferences preferences = context.getSharedPreferences("trusted_devices", Context.MODE_PRIVATE);
|
||||
preferences.edit().putBoolean(deviceInfo.id, true).apply();
|
||||
|
||||
reloadPluginsFromSettings();
|
||||
try {
|
||||
reloadPluginsFromSettings();
|
||||
|
||||
for (PairingHandler.PairingCallback cb : pairingCallbacks) {
|
||||
cb.pairingSuccessful();
|
||||
for (PairingHandler.PairingCallback cb : pairingCallbacks) {
|
||||
cb.pairingSuccessful();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("PairingHandler", "Exception in pairingSuccessful. Not unpairing because saving the trusted device succeeded");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user