Resolve the bluetooth gadget issues 93/298293/1 accepted/tizen/unified/20230908.083307
authorAnuj Kumar Singh <anujk.singh@samsung.com>
Tue, 5 Sep 2023 04:48:18 +0000 (10:18 +0530)
committerAnuj Kumar Singh <anujk.singh@samsung.com>
Tue, 5 Sep 2023 04:48:18 +0000 (10:18 +0530)
This patch resolve the following issues:
- Bluetooth connection screen closesd automatically after connectiong to headphone.
- Bluetooth disconnection button not showing after headphone connected.
- After BT device disconnection [unpair] BT connection window disappears.
- After connecting to mobile devices , device list disappears.

Change-Id: I27049dce20feb22147a394104675ac024cf80be8
Signed-off-by: Anuj Kumar Singh <anujk.singh@samsung.com>
SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs
SettingBluetooth/SettingBluetooth/Model/BtDevice.cs
SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs
packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk

index 90e3e2de9c5c2126c70d35b6b3421ee3a7db8c36..c188e6352853a9baa739ea6427dfb4d9f41c69af 100644 (file)
@@ -30,7 +30,7 @@ namespace SettingBluetooth
             };
 
             //DialogPage.ShowAlertDialog(Resources.IDS_BT_HEADER_DISCONNECT_DEVICE_ABB, String.Format(Resources.IDS_WMGR_POP_THIS_WILL_END_YOUR_CONNECTION_WITH_PS, btDevice.Name), cancelButton, disconnectButton);
-            SettingCore.RoundedDialogPage.ShowAlertDialog("Disconnect device", String.Format("This will end your connection with { 0 }.", btDevice.Name), cancelButton, disconnectButton);
+            SettingCore.RoundedDialogPage.ShowAlertDialog("Disconnect device", String.Format("This will end your connection with {0}.", btDevice.Name), cancelButton, disconnectButton);
         }
 
         internal static void ConnectA2dp(BtDevice device)
index 434738a636c65337b572319fb3d4987c557ddc17..93fb89ae701465c2a07b2cffd32a812f83b3dd2a 100644 (file)
@@ -225,6 +225,7 @@ namespace SettingBluetooth
                 mDeviceState = BtDeviceState.Paired;
                 BtModel.NotifyDeviceChanged(this);
                 //BtModel.NotifyOperationStateChanged(BtOperationState.Activated);
+                BtModel.NotifyOperationStateChanged(BtOperationState.Connecting);
                 if (mIsA2dpSupported)
                 {
                     Log.Info(SettingBluetooth.LogTag, "Automatically connect to the remote audio device after pairing");
@@ -364,7 +365,7 @@ namespace SettingBluetooth
                 mBluetoothAudio.Connect(BluetoothAudioProfileType.AdvancedAudioDistribution);
                 mDeviceState = BtDeviceState.Connecting;
                 BtModel.NotifyDeviceChanged(this);
-                //BtModel.NotifyOperationStateChanged(BtOperationState.Connecting);
+                BtModel.NotifyOperationStateChanged(BtOperationState.Connecting);
             }
             catch (Exception e)
             {
index 2d94d00fdc071f6ad708a6ea9fcb4fc9d848de2e..09dafeacbc5d26060c7a1971ddc80d56d9bc5c8b 100644 (file)
@@ -284,6 +284,7 @@ namespace SettingBluetooth
         internal void RemoveFromPaired(BtDevice btDevice)
         {
             mPaired.RemoveDevice(btDevice);
+            mPaired.Clear();
             if (mPaired.Count == 0)
             {
                 this.Remove(mPaired);
@@ -556,7 +557,15 @@ namespace SettingBluetooth
                 case BtDeviceState.Unpaired:
                     if (mDeviceSource.FindInSearched(ev.BtDevice) == null)
                     {
-                        mDeviceSource.AddToSearched(ev.BtDevice); // TODO: need to add in front of the list
+                         // 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)
                     {
index 0a35e66f38d7ae1f90d42c24398b1c8b4ce3ba90..b721e143e982fd6b72af84ebf09b3da457e553c3 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