AVRCP: Caching inactive device volume update
Remote is inactive and volume registeration
is finished than if volume will change from
remote than mRemoteVolume will update.
So if remote become active than setAbsVolume
will sent for last stored volume.
CRs-Fixed: 2480284
Change-Id: I51e8e61017cf9e9ca88fc8198019d645eecf49a2
diff --git a/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java b/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java
index 25cf2a4..c3aa19f 100644
--- a/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java
+++ b/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java
@@ -1122,15 +1122,18 @@
Log.e(TAG,"invalid index for device");
break;
}
+ byte absVol = (byte) ((byte) msg.arg1 & 0x7f); // discard MSB as it is RFD
if (DEBUG) Log.v(TAG, "MSG_NATIVE_REQ_VOLUME_CHANGE addr: " + address);
if (((!(deviceFeatures[deviceIndex].isActiveDevice)) &&
(deviceFeatures[deviceIndex].mInitialRemoteVolume != -1)) ||
(!deviceFeatures[deviceIndex].isAbsoluteVolumeSupportingDevice)) {
+ if (deviceFeatures[deviceIndex].isAbsoluteVolumeSupportingDevice) {
+ deviceFeatures[deviceIndex].mRemoteVolume = absVol;
+ }
if (DEBUG) Log.v(TAG, "MSG_NATIVE_REQ_VOLUME_CHANGE ignored");
break;
}
- byte absVol = (byte) ((byte) msg.arg1 & 0x7f); // discard MSB as it is RFD
int absolutevol = absVol;
if (DEBUG)
Log.v(TAG, "MSG_NATIVE_REQ_VOLUME_CHANGE: volume=" + absVol + " ctype="