From: Anuj Kumar Singh Date: Thu, 19 Oct 2023 06:39:55 +0000 (+0530) Subject: Resolve crash issue when try to unpair the device X-Git-Tag: accepted/tizen/8.0/unified/20231103.040830^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_8.0_unified;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Resolve crash issue when try to unpair the device Change-Id: I6b1c1abe3cfaa2e8a50362b1c865a7ceb9812685 Signed-off-by: Anuj Kumar Singh --- diff --git a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs index dcd86eb..64804a6 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs @@ -241,7 +241,14 @@ namespace SettingBluetooth mPaired.RemoveDevice(btDevice); if (mPaired.Count == 0) { - this.Remove(mPaired); + try + { + this.Remove(mPaired); + } + catch (Exception e) + { + Log.Debug(SettingBluetooth.LogTag, "Exception : " + e.Message); + } } Log.Info(SettingBluetooth.LogTag, "device(" + btDevice.Address + ") removed in paired list"); } @@ -530,22 +537,10 @@ namespace SettingBluetooth } break; case BtDeviceState.Unpaired: - if (mDeviceSource.FindInSearched(ev.BtDevice) == null) - { - // TODO: need to add in front of the list - try - { - mDeviceSource.AddToSearched(ev.BtDevice); - } - catch (Exception e) - { - Log.Debug(SettingBluetooth.LogTag, "Exception : " + e.Message); - } - - } if (mDeviceSource.FindInPaired(ev.BtDevice) != null) { mDeviceSource.RemoveFromPaired(ev.BtDevice); + AdapterController.AutoStart(); } break; case BtDeviceState.Connecting: diff --git a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk index 9e09004..ac1914a 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ