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

Commit 0147bdb3 authored by Mike Lockwood's avatar Mike Lockwood Committed by Android (Google) Code Review
Browse files

Merge "Rename UsbAudioManager to UsbAlsaManager"

parents 1bb25d4d d2de5a42
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -39,10 +39,10 @@ import java.io.PrintWriter;
import java.util.HashMap;

/**
 * UsbAudioManager manages USB audio devices.
 * UsbAlsaManager manages USB audio and MIDI devices.
 */
public class UsbAudioManager {
    private static final String TAG = UsbAudioManager.class.getSimpleName();
public class UsbAlsaManager {
    private static final String TAG = UsbAlsaManager.class.getSimpleName();
    private static final boolean DEBUG = false;

    private static final String ALSA_DIRECTORY = "/dev/snd/";
@@ -132,7 +132,7 @@ public class UsbAudioManager {
        }
    };

    /* package */ UsbAudioManager(Context context) {
    /* package */ UsbAlsaManager(Context context) {
        mContext = context;
    }

+6 −6
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ public class UsbHostManager {
    private ArrayList<UsbInterface> mNewInterfaces;
    private ArrayList<UsbEndpoint> mNewEndpoints;

    private UsbAudioManager mUsbAudioManager;
    private UsbAlsaManager mUsbAlsaManager;

    @GuardedBy("mLock")
    private UsbSettingsManager mCurrentSettings;
@@ -69,7 +69,7 @@ public class UsbHostManager {
        mContext = context;
        mHostBlacklist = context.getResources().getStringArray(
                com.android.internal.R.array.config_usbHostBlacklist);
        mUsbAudioManager = new UsbAudioManager(context);
        mUsbAlsaManager = new UsbAlsaManager(context);
    }

    public void setCurrentSettings(UsbSettingsManager settings) {
@@ -222,7 +222,7 @@ public class UsbHostManager {
                mDevices.put(mNewDevice.getDeviceName(), mNewDevice);
                Slog.d(TAG, "Added device " + mNewDevice);
                getCurrentSettings().deviceAttached(mNewDevice);
                mUsbAudioManager.deviceAdded(mNewDevice);
                mUsbAlsaManager.deviceAdded(mNewDevice);
            } else {
                Slog.e(TAG, "mNewDevice is null in endUsbDeviceAdded");
            }
@@ -238,14 +238,14 @@ public class UsbHostManager {
        synchronized (mLock) {
            UsbDevice device = mDevices.remove(deviceName);
            if (device != null) {
                mUsbAudioManager.deviceRemoved(device);
                mUsbAlsaManager.deviceRemoved(device);
                getCurrentSettings().deviceDetached(device);
            }
        }
    }

    public void systemReady() {
        mUsbAudioManager.systemReady();
        mUsbAlsaManager.systemReady();

        synchronized (mLock) {
            // Create a thread to call into native code to wait for USB host events.
@@ -292,7 +292,7 @@ public class UsbHostManager {
                pw.println("    " + name + ": " + mDevices.get(name));
            }
        }
        mUsbAudioManager.dump(fd, pw);
        mUsbAlsaManager.dump(fd, pw);
    }

    private native void monitorUsbHostBus();