Don't update volume if volume level is same as current device volume.

To avoid volume control UI popups but volume level not changed, don't
popups volume control UI for remote if is same as current device volume
level.

Bug: 147735401
Test: Manual
Change-Id: I20bd4e4627311ca0d871b7f018f1b4a90e19b1ff
Merged-In: I20bd4e4627311ca0d871b7f018f1b4a90e19b1ff
diff --git a/src/com/android/bluetooth/avrcp/AvrcpVolumeManager.java b/src/com/android/bluetooth/avrcp/AvrcpVolumeManager.java
index 585caed..367b235 100644
--- a/src/com/android/bluetooth/avrcp/AvrcpVolumeManager.java
+++ b/src/com/android/bluetooth/avrcp/AvrcpVolumeManager.java
@@ -176,7 +176,8 @@
                         + " deviceVolume=" + deviceVolume
                         + " sDeviceMaxVolume=" + sDeviceMaxVolume);
         mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, deviceVolume,
-                AudioManager.FLAG_SHOW_UI | AudioManager.FLAG_BLUETOOTH_ABS_VOLUME);
+                (deviceVolume != getVolume(device, -1) ? AudioManager.FLAG_SHOW_UI : 0)
+                    | AudioManager.FLAG_BLUETOOTH_ABS_VOLUME);
         storeVolumeForDevice(device);
     }