private A2dpSinkStateMachine(A2dpSinkService svc, Context context) {
    super("A2dpSinkStateMachine");
    mService = svc;
    mContext = context;
    mAdapter = BluetoothAdapter.getDefaultAdapter();

    // for sink soft handsoff and multicast are disabled
    initNative(maxA2dpSinkConnections, multiCastState);

    mDisconnected = new Disconnected();
    mPending = new Pending();
    mConnected = new Connected();

    addState(mDisconnected);
    addState(mPending);
    addState(mConnected);

    setInitialState(mDisconnected);

    PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
    mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "BluetoothA2dpSinkService");

    mIntentBroadcastHandler = new IntentBroadcastHandler();

    mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    if (!USE_AUDIOTRACK) mAudioManager.registerAudioPortUpdateListener(mAudioPortListener);
  }