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

Commit a2d0bd49 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix USB power regression when connecting USB headset during phone/voip...

Merge "Fix USB power regression when connecting USB headset during phone/voip call." into udc-dev am: 37ccbe73 am: 9a3a9d21

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23810764



Change-Id: Iac7f18afccf0a3b5d323e95711b4471687070cb1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7c10aa6d 9a3a9d21
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ public final class UsbAlsaDevice {
    private String mDeviceName = "";
    private String mDeviceDescription = "";

    private boolean mHasJackDetect = true;

    public UsbAlsaDevice(IAudioService audioService, int card, int device, String deviceAddress,
            boolean hasOutput, boolean hasInput,
            boolean isInputHeadset, boolean isOutputHeadset, boolean isDock) {
@@ -168,8 +170,14 @@ public final class UsbAlsaDevice {
        if (mJackDetector != null) {
            return;
        }
        if (!mHasJackDetect) {
            return;
        }
        // If no jack detect capabilities exist, mJackDetector will be null.
        mJackDetector = UsbAlsaJackDetector.startJackDetect(this);
        if (mJackDetector == null) {
            mHasJackDetect = false;
        }
    }

    /** Stops a jack-detection thread. */
@@ -182,8 +190,8 @@ public final class UsbAlsaDevice {

    /** Start using this device as the selected USB Audio Device. */
    public synchronized void start() {
        startInput();
        startOutput();
        startInput();
    }

    /** Start using this device as the selected USB input device. */
@@ -208,8 +216,8 @@ public final class UsbAlsaDevice {

    /** Stop using this device as the selected USB Audio Device. */
    public synchronized void stop() {
        stopInput();
        stopOutput();
        stopInput();
    }

    /** Stop using this device as the selected USB input device. */