Fix device clicked event duplication issue 77/300177/1 accepted/tizen/8.0/unified/20231019.051741 tizen_8.0_m2_release
authorWootak Jung <wootak.jung@samsung.com>
Wed, 18 Oct 2023 03:19:35 +0000 (12:19 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Wed, 18 Oct 2023 04:24:39 +0000 (13:24 +0900)
Change-Id: I3b6c0847c700d3fd7cb7ea7f3c6cb7dc6f0c4654
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.rpk

index 0da84c8009b940e3260056ea20044f1a0120a10b..4da444d1d880d4647f2b32ec39578753a1e70569 100644 (file)
@@ -95,37 +95,53 @@ namespace SettingBluetooth
 
             if (device.BtDevice.IsPaired)
             {
-                if (device.BtDevice.IsA2dpSupported)
+                if (device.BtDevice.DeviceState == BtDeviceState.Connecting ||
+                        device.BtDevice.DeviceState == BtDeviceState.Disconnecting)
                 {
-                    if (device.BtDevice.IsA2dpConnected)
-                    {
-                        DisconnectA2dp(device.BtDevice);
-                    }
-                    else
-                    {
-                        ConnectA2dp(device.BtDevice);
-                    }
+                    Log.Error(SettingBluetooth.LogTag, "Operation is in progress");
                 }
-                else if (device.BtDevice.IsHidSupported)
+                else
                 {
-                    if (device.BtDevice.IsHidConnected)
+                    if (device.BtDevice.IsA2dpSupported)
+                    {
+                        if (device.BtDevice.IsA2dpConnected)
+                        {
+                            DisconnectA2dp(device.BtDevice);
+                        }
+                        else
+                        {
+                            ConnectA2dp(device.BtDevice);
+                        }
+                    }
+                    else if (device.BtDevice.IsHidSupported)
                     {
-                        DisconnectHid(device.BtDevice);
+                        if (device.BtDevice.IsHidConnected)
+                        {
+                            DisconnectHid(device.BtDevice);
+                        }
+                        else
+                        {
+                            ConnectHid(device.BtDevice);
+                        }
                     }
                     else
                     {
-                        ConnectHid(device.BtDevice);
+                        Log.Info(SettingBluetooth.LogTag, "No available profile");
                     }
                 }
-                else
-                {
-                    Log.Info(SettingBluetooth.LogTag, "No available profile");
-                }
             }
             else
             {
-                Log.Info(SettingBluetooth.LogTag, "Pair to the remote device");
-                device.BtDevice.Pair();
+                if (device.BtDevice.DeviceState == BtDeviceState.Pairing ||
+                        device.BtDevice.DeviceState == BtDeviceState.Unpairing)
+                {
+                    Log.Error(SettingBluetooth.LogTag, "Operation is in progress");
+                }
+                else
+                {
+                    Log.Info(SettingBluetooth.LogTag, "Pair to the remote device");
+                    device.BtDevice.Pair();
+                }
             }
         }
     }
index 38a8ee7799b25b6dce1413d1c9d9c6497119c2fe..2fb9614289c77349f3e6742a2d7d55c4317295c9 100644 (file)
@@ -55,6 +55,7 @@ namespace SettingBluetooth
             };
             unpairButton.Clicked += (obj, ev) =>
             {
+                Log.Info(SettingBluetooth.LogTag, "Unpair to the remote device");
                 device.BtDevice.Unpair();
                 window.GetDefaultNavigator().Pop();
             };
index 8cc3aef46898ff2b6e17226db59f19c26c01eb57..9e09004bcf4706e157c720667619f9d14805e6f9 100644 (file)
Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ