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

Commit e0fdc6d4 authored by Daniel Hillenbrand's avatar Daniel Hillenbrand Committed by Gerrit Code Review
Browse files

Merge "WiredAccessoryObserver: Headset detection for sony msm7x27a" into jellybean

parents e67ffb95 1f439d29
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -123,13 +123,18 @@ class WiredAccessoryObserver extends UEventObserver {
        List<UEventInfo> retVal = new ArrayList<UEventInfo>();
        UEventInfo uei;

        // Monitor h2w
        // Monitor headset_sensor for sony msm7x27a otherwise fall back to h2w
        uei = new UEventInfo("headset_sensor", BIT_HEADSET, BIT_HEADSET_NO_MIC);
        if (uei.checkSwitchExists()) {
            retVal.add(uei);
        } else {
            uei = new UEventInfo("h2w", BIT_HEADSET, BIT_HEADSET_NO_MIC);
            if (uei.checkSwitchExists()) {
                retVal.add(uei);
            } else {
                Slog.w(TAG, "This kernel does not have wired headset support");
            }
        }

        // Monitor USB
        uei = new UEventInfo("usb_audio", BIT_USB_HEADSET_ANLG, BIT_USB_HEADSET_DGTL);
@@ -303,7 +308,7 @@ class WiredAccessoryObserver extends UEventObserver {
        boolean h2wStateChange = true;
        boolean usbStateChange = true;
        // reject all suspect transitions: only accept state changes from:
        // - a: 0 heaset to 1 headset
        // - a: 0 headset to 1 headset
        // - b: 1 headset to 0 headset
        if (LOG) Slog.v(TAG, "newState = "+newState+", headsetState = "+headsetState+","
            + "mHeadsetState = "+mHeadsetState);