diff options
author | Etan Cohen <etancohen@google.com> | 2015-03-31 12:45:23 -0700 |
---|---|---|
committer | Etan Cohen <etancohen@google.com> | 2015-04-01 09:32:40 -0700 |
commit | 50d47618300016766852523111bfc7ec991f00ea (patch) | |
tree | bff307b29743a40066b9d688ca95df1ae4b05962 /packages/SettingsLib | |
parent | eb864d4000dacad94d5135a10ed7bdeb29f31881 (diff) | |
download | frameworks_base-50d47618300016766852523111bfc7ec991f00ea.zip frameworks_base-50d47618300016766852523111bfc7ec991f00ea.tar.gz frameworks_base-50d47618300016766852523111bfc7ec991f00ea.tar.bz2 |
Merge (manually) pag/209446: Increase allowed duration to connect to HOGP profile
Original file was moved from packages/apps/Settings to frameworks/base.
Change-Id: I26912c0461780a255281a135c60cc0da2d25ae5a
Diffstat (limited to 'packages/SettingsLib')
-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(); |