Loading core/java/android/bluetooth/BluetoothA2dp.java +1 −3 Original line number Diff line number Diff line Loading @@ -337,9 +337,7 @@ public final class BluetoothA2dp implements BluetoothProfile { if (mService != null && isEnabled() && isValidDevice(device)) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON && priority != BluetoothProfile.PRIORITY_UNDEFINED && priority != BluetoothProfile.PRIORITY_AUTO_CONNECT) { priority != BluetoothProfile.PRIORITY_ON){ return false; } try { Loading core/java/android/bluetooth/BluetoothHeadset.java +1 −3 Original line number Diff line number Diff line Loading @@ -455,9 +455,7 @@ public final class BluetoothHeadset implements BluetoothProfile { if (mService != null && isEnabled() && isValidDevice(device)) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON && priority != BluetoothProfile.PRIORITY_UNDEFINED && priority != BluetoothProfile.PRIORITY_AUTO_CONNECT) { priority != BluetoothProfile.PRIORITY_ON) { return false; } try { Loading core/java/android/bluetooth/BluetoothPbap.java 100644 → 100755 +64 −5 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class BluetoothPbap { private IBluetoothPbap mService; private final Context mContext; private ServiceListener mServiceListener; private BluetoothAdapter mAdapter; /** There was an error trying to obtain the state */ public static final int STATE_ERROR = -1; Loading @@ -96,7 +97,7 @@ public class BluetoothPbap { * this callback before making IPC calls on the BluetoothPbap * service. */ public void onServiceConnected(); public void onServiceConnected(BluetoothPbap proxy); /** * Called to notify the client that this proxy object has been Loading @@ -108,12 +109,54 @@ public class BluetoothPbap { public void onServiceDisconnected(); } final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (DBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mService = null; mContext.unbindService(mConnection); } catch (Exception re) { Log.e(TAG,"",re); } } } else { synchronized (mConnection) { try { if (mService == null) { if (DBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService( new Intent(IBluetoothPbap.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth PBAP Service"); } } } catch (Exception re) { Log.e(TAG,"",re); } } } } }; /** * Create a BluetoothPbap proxy object. */ public BluetoothPbap(Context context, ServiceListener l) { mContext = context; mServiceListener = l; mAdapter = BluetoothAdapter.getDefaultAdapter(); IBluetoothManager mgr = mAdapter.getBluetoothManager(); if (mgr != null) { try { mgr.registerStateChangeCallback(mBluetoothStateChangeCallback); } catch (RemoteException e) { Log.e(TAG,"",e); } } if (!context.bindService(new Intent(IBluetoothPbap.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Pbap Service"); } Loading @@ -134,9 +177,25 @@ public class BluetoothPbap { * are ok. */ public synchronized void close() { if (mConnection != null) { IBluetoothManager mgr = mAdapter.getBluetoothManager(); if (mgr != null) { try { mgr.unregisterStateChangeCallback(mBluetoothStateChangeCallback); } catch (Exception e) { Log.e(TAG,"",e); } } synchronized (mConnection) { if (mService != null) { try { mService = null; mContext.unbindService(mConnection); mConnection = null; } catch (Exception re) { Log.e(TAG,"",re); } } } mServiceListener = null; } Loading Loading @@ -240,7 +299,7 @@ public class BluetoothPbap { if (DBG) log("Proxy object connected"); mService = IBluetoothPbap.Stub.asInterface(service); if (mServiceListener != null) { mServiceListener.onServiceConnected(); mServiceListener.onServiceConnected(BluetoothPbap.this); } } public void onServiceDisconnected(ComponentName className) { Loading core/java/android/bluetooth/BluetoothProfile.java +0 −7 Original line number Diff line number Diff line Loading @@ -114,13 +114,6 @@ public interface BluetoothProfile { * */ public static final int PRIORITY_UNDEFINED = -1; /** * This Intent is sent to initiate the other profile connections which are enabled * @hide **/ public static final String ACTION_CONNECT_OTHER_PROFILES = "android.bluetooth.profile.CONNECT_OTHER_PROFILES"; /** * Get connected devices for this specific profile. * Loading Loading
core/java/android/bluetooth/BluetoothA2dp.java +1 −3 Original line number Diff line number Diff line Loading @@ -337,9 +337,7 @@ public final class BluetoothA2dp implements BluetoothProfile { if (mService != null && isEnabled() && isValidDevice(device)) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON && priority != BluetoothProfile.PRIORITY_UNDEFINED && priority != BluetoothProfile.PRIORITY_AUTO_CONNECT) { priority != BluetoothProfile.PRIORITY_ON){ return false; } try { Loading
core/java/android/bluetooth/BluetoothHeadset.java +1 −3 Original line number Diff line number Diff line Loading @@ -455,9 +455,7 @@ public final class BluetoothHeadset implements BluetoothProfile { if (mService != null && isEnabled() && isValidDevice(device)) { if (priority != BluetoothProfile.PRIORITY_OFF && priority != BluetoothProfile.PRIORITY_ON && priority != BluetoothProfile.PRIORITY_UNDEFINED && priority != BluetoothProfile.PRIORITY_AUTO_CONNECT) { priority != BluetoothProfile.PRIORITY_ON) { return false; } try { Loading
core/java/android/bluetooth/BluetoothPbap.java 100644 → 100755 +64 −5 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class BluetoothPbap { private IBluetoothPbap mService; private final Context mContext; private ServiceListener mServiceListener; private BluetoothAdapter mAdapter; /** There was an error trying to obtain the state */ public static final int STATE_ERROR = -1; Loading @@ -96,7 +97,7 @@ public class BluetoothPbap { * this callback before making IPC calls on the BluetoothPbap * service. */ public void onServiceConnected(); public void onServiceConnected(BluetoothPbap proxy); /** * Called to notify the client that this proxy object has been Loading @@ -108,12 +109,54 @@ public class BluetoothPbap { public void onServiceDisconnected(); } final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (DBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mService = null; mContext.unbindService(mConnection); } catch (Exception re) { Log.e(TAG,"",re); } } } else { synchronized (mConnection) { try { if (mService == null) { if (DBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService( new Intent(IBluetoothPbap.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth PBAP Service"); } } } catch (Exception re) { Log.e(TAG,"",re); } } } } }; /** * Create a BluetoothPbap proxy object. */ public BluetoothPbap(Context context, ServiceListener l) { mContext = context; mServiceListener = l; mAdapter = BluetoothAdapter.getDefaultAdapter(); IBluetoothManager mgr = mAdapter.getBluetoothManager(); if (mgr != null) { try { mgr.registerStateChangeCallback(mBluetoothStateChangeCallback); } catch (RemoteException e) { Log.e(TAG,"",e); } } if (!context.bindService(new Intent(IBluetoothPbap.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Pbap Service"); } Loading @@ -134,9 +177,25 @@ public class BluetoothPbap { * are ok. */ public synchronized void close() { if (mConnection != null) { IBluetoothManager mgr = mAdapter.getBluetoothManager(); if (mgr != null) { try { mgr.unregisterStateChangeCallback(mBluetoothStateChangeCallback); } catch (Exception e) { Log.e(TAG,"",e); } } synchronized (mConnection) { if (mService != null) { try { mService = null; mContext.unbindService(mConnection); mConnection = null; } catch (Exception re) { Log.e(TAG,"",re); } } } mServiceListener = null; } Loading Loading @@ -240,7 +299,7 @@ public class BluetoothPbap { if (DBG) log("Proxy object connected"); mService = IBluetoothPbap.Stub.asInterface(service); if (mServiceListener != null) { mServiceListener.onServiceConnected(); mServiceListener.onServiceConnected(BluetoothPbap.this); } } public void onServiceDisconnected(ComponentName className) { Loading
core/java/android/bluetooth/BluetoothProfile.java +0 −7 Original line number Diff line number Diff line Loading @@ -114,13 +114,6 @@ public interface BluetoothProfile { * */ public static final int PRIORITY_UNDEFINED = -1; /** * This Intent is sent to initiate the other profile connections which are enabled * @hide **/ public static final String ACTION_CONNECT_OTHER_PROFILES = "android.bluetooth.profile.CONNECT_OTHER_PROFILES"; /** * Get connected devices for this specific profile. * Loading