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

Commit 0692127e authored by Dhananjay Kumar's avatar Dhananjay Kumar Committed by Łukasz Patron
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 d8312348
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -129,7 +129,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.");
@@ -713,6 +713,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);