From e5b229e6ff1be8922295fbc6c509aba26e062b64 Mon Sep 17 00:00:00 2001 From: andrekir Date: Tue, 24 Sep 2024 07:44:25 -0300 Subject: [PATCH] fix: handle `RemoteException` in `setConfig` and `setChannel` --- .../main/java/com/geeksville/mesh/model/UIState.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/model/UIState.kt b/app/src/main/java/com/geeksville/mesh/model/UIState.kt index 71442fdb1..80df57027 100644 --- a/app/src/main/java/com/geeksville/mesh/model/UIState.kt +++ b/app/src/main/java/com/geeksville/mesh/model/UIState.kt @@ -507,11 +507,19 @@ class UIViewModel @Inject constructor( // Set the radio config (also updates our saved copy in preferences) fun setConfig(config: Config) { - meshService?.setConfig(config.toByteArray()) + try { + meshService?.setConfig(config.toByteArray()) + } catch (ex: RemoteException) { + errormsg("Set config error:", ex) + } } fun setChannel(channel: ChannelProtos.Channel) { - meshService?.setChannel(channel.toByteArray()) + try { + meshService?.setChannel(channel.toByteArray()) + } catch (ex: RemoteException) { + errormsg("Set channel error:", ex) + } } /**