Bluetooth A2DP suspend/resume functionality
Change-Id: I8366852fa9b6ff9dacf18db00ea1c2be0c00ff34
This commit is contained in:
committed by
android-build SharedAccount
parent
30ef37ffb7
commit
f92c106c40
@@ -133,6 +133,38 @@ public final class BluetoothA2dp {
|
||||
}
|
||||
}
|
||||
|
||||
/** Initiate suspend from an A2DP sink.
|
||||
* Listen for SINK_STATE_CHANGED_ACTION to find out when
|
||||
* suspend is completed.
|
||||
* @param device Remote BT device.
|
||||
* @return false on immediate error, true otherwise
|
||||
* @hide
|
||||
*/
|
||||
public int suspendSink(BluetoothDevice device) {
|
||||
try {
|
||||
return mService.suspendSink(device);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Initiate resume from an suspended A2DP sink.
|
||||
* Listen for SINK_STATE_CHANGED_ACTION to find out when
|
||||
* resume is completed.
|
||||
* @param device Remote BT device.
|
||||
* @return false on immediate error, true otherwise
|
||||
* @hide
|
||||
*/
|
||||
public int resumeSink(BluetoothDevice device) {
|
||||
try {
|
||||
return mService.resumeSink(device);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Check if a specified A2DP sink is connected.
|
||||
* @param device Remote BT device.
|
||||
* @return True if connected (or playing), false otherwise and on error.
|
||||
|
||||
@@ -26,6 +26,8 @@ import android.bluetooth.BluetoothDevice;
|
||||
interface IBluetoothA2dp {
|
||||
boolean connectSink(in BluetoothDevice device);
|
||||
boolean disconnectSink(in BluetoothDevice device);
|
||||
boolean suspendSink(in BluetoothDevice device);
|
||||
boolean resumeSink(in BluetoothDevice device);
|
||||
BluetoothDevice[] getConnectedSinks(); // change to Set<> once AIDL supports
|
||||
int getSinkState(in BluetoothDevice device);
|
||||
boolean setSinkPriority(in BluetoothDevice device, int priority);
|
||||
|
||||
Reference in New Issue
Block a user