auto import from //branches/cupcake/...@137197
This commit is contained in:
@@ -127,7 +127,10 @@ public class BluetoothDiscoverableEnabler implements Preference.OnPreferenceChan
|
||||
|
||||
int timeout = getDiscoverableTimeout();
|
||||
manager.setDiscoverableTimeout(timeout);
|
||||
|
||||
|
||||
mCheckBoxPreference.setSummaryOn(
|
||||
mContext.getResources().getString(R.string.bluetooth_is_discoverable, timeout));
|
||||
|
||||
long endTimestamp = System.currentTimeMillis() + timeout * 1000;
|
||||
persistDiscoverableEndTimestamp(endTimestamp);
|
||||
|
||||
|
@@ -132,6 +132,12 @@ public abstract class LocalBluetoothProfileManager {
|
||||
|
||||
@Override
|
||||
public int connect(String address) {
|
||||
List<String> sinks = mService.listConnectedSinks();
|
||||
if (sinks != null) {
|
||||
for (String sinkAddress : sinks) {
|
||||
mService.disconnectSink(sinkAddress);
|
||||
}
|
||||
}
|
||||
return mService.connectSink(address);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user