Skip to content
Snippets Groups Projects
Commit b49456ff authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Gerrit Code Review
Browse files

Merge "leaudio: Add set volume API"

parents b6cf963b bc3859a4
No related branches found
No related tags found
No related merge requests found
......@@ -511,6 +511,30 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
}
}
/**
* Set volume for the streaming devices
*
* @param volume volume to set
* @hide
*/
@RequiresBluetoothConnectPermission
@RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED})
public void setVolume(int volume) {
if (VDBG) log("setVolume(vol: " + volume + " )");
try {
final IBluetoothLeAudio service = getService();
if (service != null && mAdapter.isEnabled()) {
service.setVolume(volume, mAttributionSource);
return;
}
if (service == null) Log.w(TAG, "Proxy not attached to service");
return;
} catch (RemoteException e) {
Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable()));
return;
}
}
/**
* Set connection policy of the profile
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment