diff options
author | eric_kuang <eric_kuang@realsil.com.cn> | 2024-03-29 15:13:21 +0800 |
---|---|---|
committer | eric_kuang.rs <eric_kuang.rs@realtek.com> | 2024-03-29 17:14:57 +0800 |
commit | 6a849711954f3ae75c63e6dece338b301ca145f0 (patch) | |
tree | 9c4b987087f802db10717526a2a7a62d7bb3a2bb | |
parent | 436d76fdfea89d393bd7f967cefcb5587c3f4819 (diff) | |
download | TvSettings-6a849711954f3ae75c63e6dece338b301ca145f0.tar.gz |
Add status judgment for profile state during the initialization process of BluetoothConnector when profile is already connected, and change state into success.
Test: Manual test
Bug: 311126415
Change-Id: I79c64180a3c7ba3d344affff40393d54fac312ef
-rw-r--r-- | Settings/src/com/android/tv/settings/accessories/BluetoothInputDeviceConnector.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Settings/src/com/android/tv/settings/accessories/BluetoothInputDeviceConnector.java b/Settings/src/com/android/tv/settings/accessories/BluetoothInputDeviceConnector.java index 20271359c..c3903717c 100644 --- a/Settings/src/com/android/tv/settings/accessories/BluetoothInputDeviceConnector.java +++ b/Settings/src/com/android/tv/settings/accessories/BluetoothInputDeviceConnector.java @@ -56,6 +56,11 @@ public class BluetoothInputDeviceConnector implements BluetoothDevicePairer.Blue } mInputProxy = (BluetoothHidHost) proxy; if (mTarget != null) { + if (BluetoothProfile.STATE_CONNECTED == mInputProxy.getConnectionState(mTarget)) { + closeInputProfileProxy(); + mOpenConnectionCallback.succeeded(); + return; + } registerInputMethodMonitor(); if (DEBUG) { Log.d(TAG, "Connecting to target: " + mTarget.getAddress()); |