Fix auto connect logic and add scan stop logic if destroyed 72/290972/1 accepted/tizen/unified/20230411.161259
authorWootak Jung <wootak.jung@samsung.com>
Thu, 6 Apr 2023 01:32:49 +0000 (10:32 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 6 Apr 2023 01:32:49 +0000 (10:32 +0900)
Change-Id: I5bba7241fb4d9c2ba79c605ba01286a07727aafb
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
SettingBluetooth/SettingBluetooth/Model/BtDevice.cs
SettingBluetooth/SettingBluetooth/Model/BtModelImpl.cs
SettingBluetooth/SettingBluetooth/SettingBluetooth.cs
SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs
packaging/org.tizen.SettingView-1.1.3-10213.tpk [deleted file]
packaging/org.tizen.SettingView-1.1.3-10221.tpk [new file with mode: 0644]
packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk
packaging/org.tizen.example.NUIGadgetViewer-1.0.0.tpk [deleted file]
packaging/org.tizen.settings.main-1.1.3.rpk [deleted file]

index 22ac570403bd08cce88ef05fbd8c6b03be986dae..ce6efe04fd8810b86e10f9eccc3229d49e0e8c5b 100644 (file)
@@ -225,6 +225,16 @@ namespace SettingBluetooth
                 mDeviceState = BtDeviceState.Paired;
                 BtModel.NotifyDeviceChanged(this);
                 //BtModel.NotifyOperationStateChanged(BtOperationState.Activated);
+                if (mIsA2dpSupported)
+                {
+                    Log.Info(SettingBluetooth.LogTag, "Automatically connect to the remote audio device after pairing");
+                    ConnectAudio();
+                }
+                else if (mIsHidSupported)
+                {
+                    Log.Info(SettingBluetooth.LogTag, "Automatically connect to the remote hid device after pairing");
+                    ConnectHid();
+                }
             }
             else
             {
index 40af19380f839eb0035b6ca1a172233d0c1d35fa..67b65a55f7ec7398b9e3fa39217e8ac10a165718 100644 (file)
@@ -65,7 +65,14 @@ namespace SettingBluetooth
             foreach (BluetoothDevice device in devices)
             {
                 Log.Info(SettingBluetooth.LogTag, "GetBondedDevices. Address: " + device.Address + ", Name: " + device.Name);
-                btDevice = new BtDevice(device, BtDeviceState.Paired);
+                if (device.IsConnected)
+                {
+                    btDevice = new BtDevice(device, BtDeviceState.Connected);
+                }
+                else
+                {
+                    btDevice = new BtDevice(device, BtDeviceState.Paired);
+                }
                 args = new BtDeviceChangedEventArgs(btDevice);
                 mDeviceChanged?.Invoke(null, args);
             }
index 887a248250c6a05d81dd29aeca61db3cf6b2e5ce..d469b9ea365a6e298e0471300e38563c1379720a 100644 (file)
@@ -65,6 +65,10 @@ namespace SettingBluetooth
         protected override void OnDestroy()
         {
             Log.Info(LogTag, "OnDestroy");
+            if (BtModel.IsScanning)
+            {
+                BtModel.StopDiscovery();
+            }
             base.OnDestroy();
         }
 
index 58f1675cbf2ff65c47cd523ff987e5e931da1ecd..26990a975b538d1e10b9fd96187f0b11c0bbf041 100644 (file)
@@ -547,10 +547,6 @@ namespace SettingBluetooth
                     if (mDeviceSource.FindInPaired(ev.BtDevice) == null)
                     {
                         mDeviceSource.AddToPaired(ev.BtDevice);
-                        if (ev.BtDevice.IsA2dpSupported)
-                        {
-                            DeviceController.ConnectA2dp(ev.BtDevice);
-                        }
                     }
                     else // audio disconnected case
                     {
@@ -580,6 +576,10 @@ namespace SettingBluetooth
                         mDeviceSource.AddToPaired(ev.BtDevice);
                         mDeviceSource.UpdateState(ev.BtDevice);
                     }
+                    else
+                    {
+                        mDeviceSource.AddToPaired(ev.BtDevice);
+                    }
                     break;
                 case BtDeviceState.Disconnecting:
                     if (mDeviceSource.FindInPaired(ev.BtDevice) != null)
diff --git a/packaging/org.tizen.SettingView-1.1.3-10213.tpk b/packaging/org.tizen.SettingView-1.1.3-10213.tpk
deleted file mode 100644 (file)
index fe06883..0000000
Binary files a/packaging/org.tizen.SettingView-1.1.3-10213.tpk and /dev/null differ
diff --git a/packaging/org.tizen.SettingView-1.1.3-10221.tpk b/packaging/org.tizen.SettingView-1.1.3-10221.tpk
new file mode 100644 (file)
index 0000000..4881358
Binary files /dev/null and b/packaging/org.tizen.SettingView-1.1.3-10221.tpk differ
index 02fb09f8cbf5d7a86688ec27e4ba92ef1689914a..108723e4338a46580af478bcaa9e1d40dc4eb3ac 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
diff --git a/packaging/org.tizen.example.NUIGadgetViewer-1.0.0.tpk b/packaging/org.tizen.example.NUIGadgetViewer-1.0.0.tpk
deleted file mode 100644 (file)
index a6fb99f..0000000
Binary files a/packaging/org.tizen.example.NUIGadgetViewer-1.0.0.tpk and /dev/null differ
diff --git a/packaging/org.tizen.settings.main-1.1.3.rpk b/packaging/org.tizen.settings.main-1.1.3.rpk
deleted file mode 100644 (file)
index 855591b..0000000
Binary files a/packaging/org.tizen.settings.main-1.1.3.rpk and /dev/null differ