Merge "Get rid of not specifying a user errors in bluetooth."
This commit is contained in:
committed by
Android (Google) Code Review
commit
7d86734297
@@ -162,7 +162,8 @@ public final class BluetoothA2dp implements BluetoothProfile {
|
|||||||
Intent intent = new Intent(IBluetoothA2dp.class.getName());
|
Intent intent = new Intent(IBluetoothA2dp.class.getName());
|
||||||
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
||||||
intent.setComponent(comp);
|
intent.setComponent(comp);
|
||||||
if (comp == null || !mContext.bindService(intent, mConnection, 0)) {
|
if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
|
||||||
|
android.os.Process.myUserHandle())) {
|
||||||
Log.e(TAG, "Could not bind to Bluetooth A2DP Service with " + intent);
|
Log.e(TAG, "Could not bind to Bluetooth A2DP Service with " + intent);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,7 +280,8 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
Intent intent = new Intent(IBluetoothHeadset.class.getName());
|
Intent intent = new Intent(IBluetoothHeadset.class.getName());
|
||||||
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
||||||
intent.setComponent(comp);
|
intent.setComponent(comp);
|
||||||
if (comp == null || !mContext.bindService(intent, mConnection, 0)) {
|
if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
|
||||||
|
android.os.Process.myUserHandle())) {
|
||||||
Log.e(TAG, "Could not bind to Bluetooth Headset Service with " + intent);
|
Log.e(TAG, "Could not bind to Bluetooth Headset Service with " + intent);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -487,7 +487,8 @@ public final class BluetoothHealth implements BluetoothProfile {
|
|||||||
Intent intent = new Intent(IBluetoothHealth.class.getName());
|
Intent intent = new Intent(IBluetoothHealth.class.getName());
|
||||||
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
||||||
intent.setComponent(comp);
|
intent.setComponent(comp);
|
||||||
if (comp == null || !mContext.bindService(intent, mConnection, 0)) {
|
if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
|
||||||
|
android.os.Process.myUserHandle())) {
|
||||||
Log.e(TAG, "Could not bind to Bluetooth Health Service with " + intent);
|
Log.e(TAG, "Could not bind to Bluetooth Health Service with " + intent);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,7 +259,8 @@ public final class BluetoothInputDevice implements BluetoothProfile {
|
|||||||
Intent intent = new Intent(IBluetoothInputDevice.class.getName());
|
Intent intent = new Intent(IBluetoothInputDevice.class.getName());
|
||||||
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
||||||
intent.setComponent(comp);
|
intent.setComponent(comp);
|
||||||
if (comp == null || !mContext.bindService(intent, mConnection, 0)) {
|
if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
|
||||||
|
android.os.Process.myUserHandle())) {
|
||||||
Log.e(TAG, "Could not bind to Bluetooth HID Service with " + intent);
|
Log.e(TAG, "Could not bind to Bluetooth HID Service with " + intent);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ import android.content.ComponentName;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.os.RemoteException;
|
import android.os.*;
|
||||||
import android.os.IBinder;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -105,7 +104,8 @@ public final class BluetoothMap implements BluetoothProfile {
|
|||||||
Intent intent = new Intent(IBluetoothMap.class.getName());
|
Intent intent = new Intent(IBluetoothMap.class.getName());
|
||||||
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
||||||
intent.setComponent(comp);
|
intent.setComponent(comp);
|
||||||
if (comp == null || !mContext.bindService(intent, mConnection, 0)) {
|
if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
|
||||||
|
android.os.Process.myUserHandle())) {
|
||||||
Log.e(TAG, "Could not bind to Bluetooth MAP Service with " + intent);
|
Log.e(TAG, "Could not bind to Bluetooth MAP Service with " + intent);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,8 @@ public final class BluetoothPan implements BluetoothProfile {
|
|||||||
Intent intent = new Intent(IBluetoothPan.class.getName());
|
Intent intent = new Intent(IBluetoothPan.class.getName());
|
||||||
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
||||||
intent.setComponent(comp);
|
intent.setComponent(comp);
|
||||||
if (comp == null || !mContext.bindService(intent, mConnection, 0)) {
|
if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
|
||||||
|
android.os.Process.myUserHandle())) {
|
||||||
Log.e(TAG, "Could not bind to Bluetooth Pan Service with " + intent);
|
Log.e(TAG, "Could not bind to Bluetooth Pan Service with " + intent);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,8 @@ public class BluetoothPbap {
|
|||||||
Intent intent = new Intent(IBluetoothPbap.class.getName());
|
Intent intent = new Intent(IBluetoothPbap.class.getName());
|
||||||
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
|
||||||
intent.setComponent(comp);
|
intent.setComponent(comp);
|
||||||
if (comp == null || !mContext.bindService(intent, mConnection, 0)) {
|
if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
|
||||||
|
android.os.Process.myUserHandle())) {
|
||||||
Log.e(TAG, "Could not bind to Bluetooth Pbap Service with " + intent);
|
Log.e(TAG, "Could not bind to Bluetooth Pbap Service with " + intent);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user