diff --git a/framework/java/android/bluetooth/BluetoothProfileConnector.java b/framework/java/android/bluetooth/BluetoothProfileConnector.java index 5be902b8af18b7a883ee30f29b211762c7168037..39f835b3f1b347654e07bc8fbbe913ff6dfb8ead 100644 --- a/framework/java/android/bluetooth/BluetoothProfileConnector.java +++ b/framework/java/android/bluetooth/BluetoothProfileConnector.java @@ -129,27 +129,13 @@ public abstract class BluetoothProfileConnector<T> { if (mService == null) { logDebug("Binding service..."); mCloseGuard.open("doUnbind"); - - List<Integer> mSupportedProfileList = - BluetoothAdapter.getDefaultAdapter().getSupportedProfiles(); - - if (!mSupportedProfileList.contains(mProfileId)) { - logDebug("Skip binding " + mProfileName + " service due to not supported"); - return false; - } - try { Intent intent = new Intent(mServiceName); ComponentName comp = resolveSystemService(intent, mContext.getPackageManager()); intent.setComponent(comp); - if (comp == null) { - logError("Component is null"); - return false; - } - if (!mContext.bindServiceAsUser(intent, mConnection, 0, + if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0, USER_HANDLE_CURRENT_OR_SELF)) { logError("Could not bind to Bluetooth Service with " + intent); - mContext.unbindService(mConnection); return false; } } catch (SecurityException se) {