From: Anuj Kumar Singh Date: Tue, 5 Sep 2023 04:48:18 +0000 (+0530) Subject: Resolve the bluetooth gadget issues X-Git-Tag: accepted/tizen/unified/20230908.083307^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2db4d9e79dadbf32ab7ef46412263c23bde3bbe8;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Resolve the bluetooth gadget issues 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 --- diff --git a/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs b/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs index 90e3e2d..c188e63 100644 --- a/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs +++ b/SettingBluetooth/SettingBluetooth/Controller/DeviceController.cs @@ -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) diff --git a/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs b/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs index 434738a..93fb89a 100644 --- a/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs +++ b/SettingBluetooth/SettingBluetooth/Model/BtDevice.cs @@ -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) { diff --git a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs index 2d94d00..09dafea 100644 --- a/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs +++ b/SettingBluetooth/SettingBluetooth/View/BtDeviceView.cs @@ -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) { diff --git a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk index 0a35e66..b721e14 100644 Binary files a/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk and b/packaging/org.tizen.cssetting-bluetooth-1.0.0.rpk differ