Assigned
Status Update
Comments
vi...@google.com <vi...@google.com> #2
We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
No update yet.
We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
Description
Raising this issue to understand the logic in AvrcpVolumeManager.java.
When volume is changed on local device, audio module will set the volume to Bluetooth, in AvrcpVolumeManager.java, the volume will be sent to BT device, and also need to store it in SharedPreferences of Bluetooth. While, Bluetooth get the volume using mAudioManager.getLastAudibleStreamVolume(STREAM_MUSIC) for storing, other than use the "deviceVolume" provided by audio. Could you please help to understand the necessity of doing so?
/**
* Informs remote device of a system volume change and stores it.
*
* <p>See {@link #systemToAvrcpVolume}.
*
* @param deviceVolume in range (0 - {@code mDeviceMaxVolume}) received from system.
*/
void sendVolumeChanged(@NonNull BluetoothDevice device, int deviceVolume) {
if (deviceVolume == getVolume(device, -1)) {
d("sendVolumeChanged: Skipping update volume to same as current.");
return;
}
int avrcpVolume = systemToAvrcpVolume(deviceVolume);
mVolumeEventLogger.logd(
TAG,
"sendVolumeChanged:"
+ " device="
+ device
+ " avrcpVolume="
+ avrcpVolume
+ " deviceVolume="
+ deviceVolume
+ " mDeviceMaxVolume="
+ mDeviceMaxVolume);
mNativeInterface.sendVolumeChanged(device, avrcpVolume);
storeVolumeForDevice(device);
}
/**
* Retrieves system volume (0 - {@code mDeviceMaxVolume}) and calls {@link
* #storeVolumeForDevice(BluetoothDevice, int)} with {@code device}.
*/
synchronized void storeVolumeForDevice(@NonNull BluetoothDevice device) {
int storeVolume = mAudioManager.getLastAudibleStreamVolume(STREAM_MUSIC);
storeVolumeForDevice(device, storeVolume);
}
PLEASE READ:
This form is only for reporting bugs found in the Android system while
developing Android applications. Use the Developer Tools subcomponent for issues with
the developer tools.
Please describe the problem in detail. Be sure to include:
- Steps to reproduce the problem (including sample code if appropriate).
- What happened.
- What you think the correct behavior should be.
- Is this a security related issue? Yes/No
Don't forget to mention which version of Android you're using, and/or which
device the problem appears on (model and Android version).
Please also run "adb bugreport" and archive the output.
To avoid the possibility of sharing private information, please share bugreports and screenshots from Google Drive. Share files with android-bugreport@google.com and include only Google drive links in your bug. If attaching bug reports or other sensitive data directly to issues, please mark the attachment(s) as “Restricted (
Disclaimer:
Please note, by submitting this bug report, you acknowledge that Google may use information included in the bug report to diagnose technical issues and to improve our products and services, in accordance with our Privacy Policy (
Bug reports include personal information logged on your device or by apps, such as:
File names
Installed apps and usage
Email addresses of the profiles on the device
Device identifiers, such as phone number
Web history information, including URLs / URIs
Location information, including limited location history
Network information, such as IP/SSID/MAC addresses and saved or scanned APNs
System or device information, such as memory and processes