Skip to content
Commit 8776acf7 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

SeekBarVolumizer: fix handling of routing change

Bug cause: when audio routing changes, SeekBarVolumizer handles
the STREAM_DEVICES_CHANGED_ACTION intent action. When this
event is associated with a charging animation, the Fragment
handling the sliders causes VolumeSeekBarPreference.onActivityPause
to call SeekBarVolumizer.stop, which in turns sets a stop time,
and thus causes isDelay to always be false while the action
is handled. As a result the volume sliders are not updated
with the new values.
Fix: when the routing is not handled, post a message to
reevaluate the conditions for update at a later time.

Other fix: when handling STREAM_DEVICES_CHANGED_ACTION,
first consider if the device is using stream types, and only
then test for isDelay(), otherwise the VolumeGroup code
path is wrongly executed.

Optimization: do not cause AudioManager to
construct a list of AudioProductStrategy for each
event, just query once in constructor and cache the
result.

Bug: 265446544
Test: with Settings > Sound open, dock/undock the device
  (on a dock w/ speakers)

Change-Id: I1ac02854328aa16aacc9db77921cdf4cae019ead
parent f7fa5cb4
Loading
Loading
Loading
Loading
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