diff options
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index e1cb878..64b4452 100755 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -104,6 +104,7 @@ public final class CachedBluetoothDevice implements Comparable<CachedBluetoothDe // See mConnectAttempted private static final long MAX_UUID_DELAY_FOR_AUTO_CONNECT = 5000; + private static final long MAX_HOGP_DELAY_FOR_AUTO_CONNECT = 30000; /** Auto-connect after pairing only if locally initiated. */ private boolean mConnectAfterPairing; @@ -525,9 +526,11 @@ public final class CachedBluetoothDevice implements Comparable<CachedBluetoothDe */ void onUuidChanged() { updateProfiles(); + ParcelUuid[] uuids = mDevice.getUuids(); + long timeout = MAX_UUID_DELAY_FOR_AUTO_CONNECT; if (DEBUG) { - Log.e(TAG, "onUuidChanged: Time since last connect" + Log.d(TAG, "onUuidChanged: Time since last connect" + (SystemClock.elapsedRealtime() - mConnectAttempted)); } @@ -535,9 +538,11 @@ public final class CachedBluetoothDevice implements Comparable<CachedBluetoothDe * If a connect was attempted earlier without any UUID, we will do the * connect now. */ + if (BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.Hogp)) { + timeout = MAX_HOGP_DELAY_FOR_AUTO_CONNECT; + } if (!mProfiles.isEmpty() - && (mConnectAttempted + MAX_UUID_DELAY_FOR_AUTO_CONNECT) > SystemClock - .elapsedRealtime()) { + && (mConnectAttempted + timeout) > SystemClock.elapsedRealtime()) { connectWithoutResettingTimer(false); } dispatchAttributesChanged(); |