Use round() instead of ceil() in calculation of a2dp vol slider position
The avrcp MESSAGE_VOLUME_CHANGED requests volumes in the range 0-127. In convertToAudioStreamVolume() this value is scaled to a (typically much smaller, e.g. 0-15) integer value representing the volume slider step to be presented in the UI. Depending on the resolution in the volume requests from the a2dp device and the resolution of the UI volume slider, some of the requested volumes might be mapped onto the same UI slider positions. If ceil() is exchanged for round() in convertToAudioStreamVolume() the problem with double mapped volumes vanishes in most realistic cases. Change-Id: I89d9ac4b8c330fd4fd2a02984bd628961f2cb035
Loading
Please register or sign in to comment