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

Unverified Commit 70a8d83e authored by Dhananjay Kumar's avatar Dhananjay Kumar Committed by Michael Bestas
Browse files

audio: update WiredAccessoryManager to use ExtconUEventObserver based on events available

Update WiredAccessoryManager to use ExtconUEventObserver only if
at least one event is available with ExtconUEventObserver

CRs-Fixed: 2444687
Change-Id: I457630428a06016ab71c797efd887f55fcba70c6
parent 7e174137
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -132,7 +132,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
        }
        }




        if (ExtconUEventObserver.extconExists()) {
        if (ExtconUEventObserver.extconExists() && mExtconObserver.uEventCount() > 0) {
            if (mUseDevInputEventForAudioJack) {
            if (mUseDevInputEventForAudioJack) {
                Log.w(TAG, "Both input event and extcon are used for audio jack,"
                Log.w(TAG, "Both input event and extcon are used for audio jack,"
                        + " please just choose one.");
                        + " please just choose one.");
@@ -735,6 +735,10 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {


        }
        }


        public int uEventCount() {
            return mExtconInfos.size();
        }

        @Override
        @Override
        public Pair<Integer, Integer> parseState(ExtconInfo extconInfo, String status) {
        public Pair<Integer, Integer> parseState(ExtconInfo extconInfo, String status) {
            if (LOG) Slog.v(TAG, "status  " + status);
            if (LOG) Slog.v(TAG, "status  " + status);