Fix to do not show dialog when try to disconnect in detail view 51/282851/1
authorWootak Jung <wootak.jung@samsung.com>
Wed, 12 Oct 2022 08:18:42 +0000 (17:18 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Wed, 12 Oct 2022 08:18:42 +0000 (17:18 +0900)
Change-Id: Ifb49ed3295f4ea040dead3d7f9c2922e573a2349
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs
SettingBluetooth/SettingBluetooth/View/BtDetailView.cs
packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk

index 88e55352985c05cf496054ae2a4e5b5915fa638f..d6c06e41a1735f6ae8e737be1a37540249bca7ec 100644 (file)
@@ -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)
index 9f67aaa3471af9adc07505f325e87cbaef331624..f2b7aa2e25f997734752073b4bb40cf5f1d8e8ae 100644 (file)
@@ -82,7 +82,7 @@ namespace SettingBluetooth
                     }
                     else
                     {
-                        DeviceController.DisconnectA2dp(device.BtDevice);
+                        DeviceController.DisconnectA2dp(device.BtDevice, false);
                     }
                 };
                 mediaAudioItem.Extra = mediaAudioSwitch;
index 4aa70efcbe5c3ebc498ba0f16390a379ad9eb5c1..b1f79870f23be11197e9e197cfcae3cd95b74c39 100644 (file)
Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.tpk differ