Skip to content

Commit 0692127

Browse files
Dhananjay Kumarluk1337
authored andcommitted
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
1 parent d831234 commit 0692127

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

services/core/java/com/android/server/WiredAccessoryManager.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private void onSystemReady() {
129129
}
130130

131131

132-
if (ExtconUEventObserver.extconExists()) {
132+
if (ExtconUEventObserver.extconExists() && mExtconObserver.uEventCount() > 0) {
133133
if (mUseDevInputEventForAudioJack) {
134134
Log.w(TAG, "Both input event and extcon are used for audio jack,"
135135
+ " please just choose one.");
@@ -713,6 +713,10 @@ private void init() {
713713

714714
}
715715

716+
public int uEventCount() {
717+
return mExtconInfos.size();
718+
}
719+
716720
@Override
717721
public Pair<Integer, Integer> parseState(ExtconInfo extconInfo, String status) {
718722
if (LOG) Slog.v(TAG, "status " + status);

0 commit comments

Comments
 (0)