Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1dd3f8a authored by StevenHarperUK's avatar StevenHarperUK
Browse files

Bugfix: Dock events can have state greater than 1

On Samsung devices the USB audio is being routed for every dock event
It is ignoring the checkbox (in advanced settings) to not route audio

This bug was introduced with this patch
http://review.cyanogenmod.com/#/c/24830/

The state of an event can be 2 or 4 depending on the dock type

This patch switches for looking for state > 0 rather than  state ==1

Change-Id: I978d18ec36e74e821a6d300136377158901cdf50
parent bc5b61de
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ class WiredAccessoryObserver extends UEventObserver {
                // The choice is made in the GalaxyS2Settings.apk
                // device/samsung/i9100/DeviceSettings/src/com/cyanogenmod/settings/device/DockFragmentActivity.java
                // This sends an Intent to this class
                if ((!dockAudioEnabled) && (state == 1)) {
                if ((!dockAudioEnabled) && (state > 0)) {
                    Slog.e(TAG, "Ignoring dock event as Audio routing disabled " + event);
                    return;
                }