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
Loading
Please register or sign in to comment