Merge "Don't auto connect reverse tethering after pairing." into honeycomb
This commit is contained in:
@@ -140,7 +140,7 @@ class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> {
|
|||||||
if (isConnected()) {
|
if (isConnected()) {
|
||||||
askDisconnect();
|
askDisconnect();
|
||||||
} else if (bondState == BluetoothDevice.BOND_BONDED) {
|
} else if (bondState == BluetoothDevice.BOND_BONDED) {
|
||||||
connect();
|
connect(true);
|
||||||
} else if (bondState == BluetoothDevice.BOND_NONE) {
|
} else if (bondState == BluetoothDevice.BOND_NONE) {
|
||||||
pair();
|
pair();
|
||||||
}
|
}
|
||||||
@@ -264,18 +264,18 @@ class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> {
|
|||||||
super.finalize();
|
super.finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void connect() {
|
public void connect(boolean connectAllProfiles) {
|
||||||
if (!ensurePaired()) return;
|
if (!ensurePaired()) return;
|
||||||
|
|
||||||
mConnectAttempted = SystemClock.elapsedRealtime();
|
mConnectAttempted = SystemClock.elapsedRealtime();
|
||||||
|
|
||||||
connectWithoutResettingTimer(true);
|
connectWithoutResettingTimer(connectAllProfiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/ void onBondingDockConnect() {
|
/*package*/ void onBondingDockConnect() {
|
||||||
// Attempt to connect if UUIDs are available. Otherwise,
|
// Attempt to connect if UUIDs are available. Otherwise,
|
||||||
// we will connect when the ACTION_UUID intent arrives.
|
// we will connect when the ACTION_UUID intent arrives.
|
||||||
connect();
|
connect(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void connectWithoutResettingTimer(boolean connectAllProfiles) {
|
private void connectWithoutResettingTimer(boolean connectAllProfiles) {
|
||||||
@@ -646,7 +646,7 @@ class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> {
|
|||||||
if (mDevice.isBluetoothDock()) {
|
if (mDevice.isBluetoothDock()) {
|
||||||
onBondingDockConnect();
|
onBondingDockConnect();
|
||||||
} else if (mConnectAfterPairing) {
|
} else if (mConnectAfterPairing) {
|
||||||
connect();
|
connect(false);
|
||||||
}
|
}
|
||||||
mConnectAfterPairing = false;
|
mConnectAfterPairing = false;
|
||||||
}
|
}
|
||||||
|
@@ -663,7 +663,7 @@ public class DockService extends Service implements AlertDialog.OnMultiChoiceCli
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (profileManager.getPreferred(device) == auto) {
|
if (profileManager.getPreferred(device) == auto) {
|
||||||
cachedDevice.connect();
|
cachedDevice.connect(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -735,7 +735,7 @@ public class DockService extends Service implements AlertDialog.OnMultiChoiceCli
|
|||||||
|
|
||||||
if (callConnect) {
|
if (callConnect) {
|
||||||
if (DEBUG) Log.d(TAG, "applyBtSettings - Connecting");
|
if (DEBUG) Log.d(TAG, "applyBtSettings - Connecting");
|
||||||
cachedDevice.connect();
|
cachedDevice.connect(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user