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

Commit b61aa0bb authored by Satish Kodishala's avatar Satish Kodishala Committed by Gerrit - the friendly Code Review server
Browse files

BT: Allow user processes to bind to HeadsetService in guest login

In guest login, allow binding to HeadsetService for user processes.

CRs-Fixed: 959566
Change-Id: I7d35b89ddc20ebc7db9dcffb21a715108d842923
parent fc847f57
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.UserHandle;
import android.util.Log;

import java.util.ArrayList;
@@ -302,7 +303,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
        ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
        intent.setComponent(comp);
        if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
                android.os.Process.myUserHandle())) {
                UserHandle.CURRENT_OR_SELF)) {
            Log.e(TAG, "Could not bind to Bluetooth Headset Service with " + intent);
            return false;
        }