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

Commit 261e089a authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Use explicit Intent for binding to service.

Change-Id: I51971a02532ad0ad8fafb0529e7adf83ed846cf4
parent 834604c6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -178,8 +178,9 @@ final class HeadsetStateMachine extends StateMachine {
        mPhoneState = new HeadsetPhoneState(context, this);
        mAudioState = BluetoothHeadset.STATE_AUDIO_DISCONNECTED;
        mAdapter = BluetoothAdapter.getDefaultAdapter();
        if (!context.bindService(new Intent(IBluetoothHeadsetPhone.class.getName()),
                                 mConnection, 0)) {
        Intent intent = new Intent(IBluetoothHeadsetPhone.class.getName());
        intent.setComponent(intent.resolveSystemService(context.getPackageManager(), 0));
        if (intent.getComponent() == null || !context.bindService(intent, mConnection, 0)) {
            Log.e(TAG, "Could not bind to Bluetooth Headset Phone Service");
        }