Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2627373f authored by Stanley Tng's avatar Stanley Tng Committed by android-build-merger
Browse files

Merge "Increase the timeout for Hearing Aids Pairing" into qt-dev

am: e0c0b071

Change-Id: I46927903f6a3ded45e4b4e485fbd98c357705059
parents e665dc6b e0c0b071
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>

    // See mConnectAttempted
    private static final long MAX_UUID_DELAY_FOR_AUTO_CONNECT = 5000;
    // Some Hearing Aids (especially the 2nd device) needs more time to do service discovery
    private static final long MAX_HEARING_AIDS_DELAY_FOR_AUTO_CONNECT = 15000;
    private static final long MAX_HOGP_DELAY_FOR_AUTO_CONNECT = 30000;

    private final Context mContext;
@@ -223,7 +225,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
                // various profiles
                // If UUIDs are not available yet, connect will be happen
                // upon arrival of the ACTION_UUID intent.
                Log.d(TAG, "No profiles. Maybe we will connect later");
                Log.d(TAG, "No profiles. Maybe we will connect later for device " + mDevice);
                return;
            }

@@ -608,10 +610,12 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
        long timeout = MAX_UUID_DELAY_FOR_AUTO_CONNECT;
        if (BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.Hogp)) {
            timeout = MAX_HOGP_DELAY_FOR_AUTO_CONNECT;
        } else if (BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.HearingAid)) {
            timeout = MAX_HEARING_AIDS_DELAY_FOR_AUTO_CONNECT;
        }

        if (BluetoothUtils.D) {
            Log.d(TAG, "onUuidChanged: Time since last connect"
            Log.d(TAG, "onUuidChanged: Time since last connect="
                    + (SystemClock.elapsedRealtime() - mConnectAttempted));
        }