From: Wootak Jung Date: Wed, 12 Oct 2022 08:18:42 +0000 (+0900) Subject: Fix to do not show dialog when try to disconnect in detail view X-Git-Tag: accepted/tizen/unified/20221111.105330~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a3f6956db4ac4e132d77a952235ffb9915eac57;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Fix to do not show dialog when try to disconnect in detail view Change-Id: Ifb49ed3295f4ea040dead3d7f9c2922e573a2349 Signed-off-by: Wootak Jung --- diff --git a/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs b/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs index 88e5535..d6c06e4 100644 --- a/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs +++ b/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs @@ -38,19 +38,27 @@ namespace SettingBluetooth.Controller device.ConnectAudio(); } - internal static void DisconnectA2dp(BtDevice btDevice) + internal static void DisconnectA2dp(BtDevice btDevice, bool showDialog = true) { - var disconnectButton = new Button() + if (showDialog) { - Text = Resources.IDS_BT_SK_DISCONNECT, - }; - disconnectButton.Clicked += (obj, ev) => + var disconnectButton = new Button() + { + Text = Resources.IDS_BT_SK_DISCONNECT, + }; + disconnectButton.Clicked += (obj, ev) => + { + Log.Info(Program.LogTag, "Disconnect to the remote audio device"); + btDevice.DisconnectAudio(); + PopDialog(); + }; + ShowDialog(btDevice, disconnectButton); + } + else { Log.Info(Program.LogTag, "Disconnect to the remote audio device"); btDevice.DisconnectAudio(); - PopDialog(); - }; - ShowDialog(btDevice, disconnectButton); + } } private static void ConnectHid(BtDevice device) diff --git a/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs b/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs index 9f67aaa..f2b7aa2 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDetailView.cs @@ -82,7 +82,7 @@ namespace SettingBluetooth } else { - DeviceController.DisconnectA2dp(device.BtDevice); + DeviceController.DisconnectA2dp(device.BtDevice, false); } }; mediaAudioItem.Extra = mediaAudioSwitch; diff --git a/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk b/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk index 4aa70ef..b1f7987 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk differ