Loading framework/java/android/bluetooth/BluetoothProfileConnector.java +1 −15 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading
framework/java/android/bluetooth/BluetoothProfileConnector.java +1 −15 Original line number Diff line number Diff line Loading @@ -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) { Loading