Loading core/java/android/bluetooth/BluetoothDun.java +23 −10 Original line number Diff line number Diff line Loading @@ -98,13 +98,21 @@ public final class BluetoothDun implements BluetoothProfile { Log.w(TAG,"Unable to register BluetoothStateChangeCallback",re); } Log.d(TAG, "BluetoothDun() call bindService"); if (!context.bindService(new Intent(IBluetoothDun.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth DUN Service"); doBind(); } Log.d(TAG, "BluetoothDun(), bindService called"); boolean doBind() { Intent intent = new Intent(IBluetoothDun.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Dun Service with " + intent); return false; } return true; } /*package*/ void close() { if (VDBG) log("close()"); mServiceListener = null; Loading Loading @@ -137,15 +145,20 @@ public final class BluetoothDun implements BluetoothProfile { new IBluetoothStateChangeCallback.Stub() { @Override public void onBluetoothStateChange(boolean on) throws RemoteException { public void onBluetoothStateChange(boolean on) { //Handle enable request to bind again. Log.d(TAG, "onBluetoothStateChange on: " + on); if (on) { Log.d(TAG, "onBluetoothStateChange(on) call bindService"); if (!mContext.bindService(new Intent(IBluetoothDun.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth DUN Service"); try { if (mDunService == null) { Log.d(TAG, "onBluetoothStateChange call bindService"); doBind(); } } catch (IllegalStateException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to DUN service: ", e); } catch (SecurityException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to DUN service: ", e); } Log.d(TAG, "BluetoothDun(), bindService called"); } else { if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { Loading core/java/android/bluetooth/BluetoothHidDevice.java +22 −10 Original line number Diff line number Diff line Loading @@ -136,18 +136,21 @@ public final class BluetoothHidDevice implements BluetoothProfile { public void onBluetoothStateChange(boolean up) { Log.d(TAG, "onBluetoothStateChange: up=" + up); synchronized (mConnection) { if (!up) { Log.d(TAG,"Unbinding service..."); mService = null; mContext.unbindService(mConnection); } else { try { if (mService == null) { Log.v(TAG, "Binding service"); if (!mContext.bindService(new Intent(IBluetoothHidDevice.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind service"); Log.d(TAG,"Binding HID Device service..."); doBind(); } } catch (IllegalStateException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to HID Dev service: ", e); } catch (SecurityException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to HID Dev service: ", e); } } } Loading Loading @@ -179,7 +182,7 @@ public final class BluetoothHidDevice implements BluetoothProfile { }; BluetoothHidDevice(Context context, ServiceListener listener) { Log.v(TAG, "BluetoothInputDevice()"); Log.v(TAG, "BluetoothHidDevice"); mContext = context; mServiceListener = listener; Loading @@ -194,10 +197,19 @@ public final class BluetoothHidDevice implements BluetoothProfile { } } if (!context.bindService(new Intent(IBluetoothHidDevice.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind service"); doBind(); } boolean doBind() { Intent intent = new Intent(IBluetoothHidDevice.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth HID Device Service with " + intent); return false; } Log.d(TAG, "Bound to HID Device Service"); return true; } void close() { Loading core/java/android/bluetooth/BluetoothPan.java +12 −5 Original line number Diff line number Diff line Loading @@ -139,7 +139,6 @@ public final class BluetoothPan implements BluetoothProfile { } if (VDBG) Log.d(TAG, "BluetoothPan() call bindService"); doBind(); if (VDBG) Log.d(TAG, "BluetoothPan(), bindService called"); } boolean doBind() { Loading Loading @@ -185,12 +184,20 @@ public final class BluetoothPan implements BluetoothProfile { final private IBluetoothStateChangeCallback mStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { @Override public void onBluetoothStateChange(boolean on) throws RemoteException { public void onBluetoothStateChange(boolean on) { //Handle enable request to bind again. Log.d(TAG, "onBluetoothStateChange on: " + on); if (on) { Log.d(TAG, "onBluetoothStateChange(on) call bindService"); try { if (mPanService == null) { Log.d(TAG, "onBluetoothStateChange call bindService"); doBind(); if (VDBG) Log.d(TAG, "BluetoothPan(), bindService called"); } } catch (IllegalStateException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to PAN service: ", e); } catch (SecurityException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to PAN service: ", e); } } else { if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { Loading core/java/android/bluetooth/BluetoothSap.java +22 −10 Original line number Diff line number Diff line Loading @@ -98,11 +98,18 @@ public final class BluetoothSap implements BluetoothProfile { Log.w(TAG,"Unable to register BluetoothStateChangeCallback",re); } Log.d(TAG, "BluetoothSap() call bindService"); if (!context.bindService(new Intent(IBluetoothSap.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth SAP Service"); doBind(); } Log.d(TAG, "BluetoothSap(), bindService called"); boolean doBind() { Intent intent = new Intent(IBluetoothSap.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Sap Service with " + intent); return false; } return true; } /*package*/ void close() { Loading Loading @@ -137,15 +144,20 @@ public final class BluetoothSap implements BluetoothProfile { private IBluetoothStateChangeCallback mStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { @Override public void onBluetoothStateChange(boolean on) throws RemoteException { public void onBluetoothStateChange(boolean on) { //Handle enable request to bind again. Log.d(TAG, "onBluetoothStateChange on: " + on); if (on) { Log.d(TAG, "onBluetoothStateChange(on) call bindService"); if (!mContext.bindService(new Intent(IBluetoothSap.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth SAP Service"); try { if (mSapService == null) { Log.d(TAG, "onBluetoothStateChange call bindService"); doBind(); } } catch (IllegalStateException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to SAP service: ", e); } catch (SecurityException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to SAP service: ", e); } Log.d(TAG, "BluetoothSap(), bindService called"); } else { if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { Loading Loading
core/java/android/bluetooth/BluetoothDun.java +23 −10 Original line number Diff line number Diff line Loading @@ -98,13 +98,21 @@ public final class BluetoothDun implements BluetoothProfile { Log.w(TAG,"Unable to register BluetoothStateChangeCallback",re); } Log.d(TAG, "BluetoothDun() call bindService"); if (!context.bindService(new Intent(IBluetoothDun.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth DUN Service"); doBind(); } Log.d(TAG, "BluetoothDun(), bindService called"); boolean doBind() { Intent intent = new Intent(IBluetoothDun.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Dun Service with " + intent); return false; } return true; } /*package*/ void close() { if (VDBG) log("close()"); mServiceListener = null; Loading Loading @@ -137,15 +145,20 @@ public final class BluetoothDun implements BluetoothProfile { new IBluetoothStateChangeCallback.Stub() { @Override public void onBluetoothStateChange(boolean on) throws RemoteException { public void onBluetoothStateChange(boolean on) { //Handle enable request to bind again. Log.d(TAG, "onBluetoothStateChange on: " + on); if (on) { Log.d(TAG, "onBluetoothStateChange(on) call bindService"); if (!mContext.bindService(new Intent(IBluetoothDun.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth DUN Service"); try { if (mDunService == null) { Log.d(TAG, "onBluetoothStateChange call bindService"); doBind(); } } catch (IllegalStateException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to DUN service: ", e); } catch (SecurityException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to DUN service: ", e); } Log.d(TAG, "BluetoothDun(), bindService called"); } else { if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { Loading
core/java/android/bluetooth/BluetoothHidDevice.java +22 −10 Original line number Diff line number Diff line Loading @@ -136,18 +136,21 @@ public final class BluetoothHidDevice implements BluetoothProfile { public void onBluetoothStateChange(boolean up) { Log.d(TAG, "onBluetoothStateChange: up=" + up); synchronized (mConnection) { if (!up) { Log.d(TAG,"Unbinding service..."); mService = null; mContext.unbindService(mConnection); } else { try { if (mService == null) { Log.v(TAG, "Binding service"); if (!mContext.bindService(new Intent(IBluetoothHidDevice.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind service"); Log.d(TAG,"Binding HID Device service..."); doBind(); } } catch (IllegalStateException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to HID Dev service: ", e); } catch (SecurityException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to HID Dev service: ", e); } } } Loading Loading @@ -179,7 +182,7 @@ public final class BluetoothHidDevice implements BluetoothProfile { }; BluetoothHidDevice(Context context, ServiceListener listener) { Log.v(TAG, "BluetoothInputDevice()"); Log.v(TAG, "BluetoothHidDevice"); mContext = context; mServiceListener = listener; Loading @@ -194,10 +197,19 @@ public final class BluetoothHidDevice implements BluetoothProfile { } } if (!context.bindService(new Intent(IBluetoothHidDevice.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind service"); doBind(); } boolean doBind() { Intent intent = new Intent(IBluetoothHidDevice.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth HID Device Service with " + intent); return false; } Log.d(TAG, "Bound to HID Device Service"); return true; } void close() { Loading
core/java/android/bluetooth/BluetoothPan.java +12 −5 Original line number Diff line number Diff line Loading @@ -139,7 +139,6 @@ public final class BluetoothPan implements BluetoothProfile { } if (VDBG) Log.d(TAG, "BluetoothPan() call bindService"); doBind(); if (VDBG) Log.d(TAG, "BluetoothPan(), bindService called"); } boolean doBind() { Loading Loading @@ -185,12 +184,20 @@ public final class BluetoothPan implements BluetoothProfile { final private IBluetoothStateChangeCallback mStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { @Override public void onBluetoothStateChange(boolean on) throws RemoteException { public void onBluetoothStateChange(boolean on) { //Handle enable request to bind again. Log.d(TAG, "onBluetoothStateChange on: " + on); if (on) { Log.d(TAG, "onBluetoothStateChange(on) call bindService"); try { if (mPanService == null) { Log.d(TAG, "onBluetoothStateChange call bindService"); doBind(); if (VDBG) Log.d(TAG, "BluetoothPan(), bindService called"); } } catch (IllegalStateException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to PAN service: ", e); } catch (SecurityException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to PAN service: ", e); } } else { if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { Loading
core/java/android/bluetooth/BluetoothSap.java +22 −10 Original line number Diff line number Diff line Loading @@ -98,11 +98,18 @@ public final class BluetoothSap implements BluetoothProfile { Log.w(TAG,"Unable to register BluetoothStateChangeCallback",re); } Log.d(TAG, "BluetoothSap() call bindService"); if (!context.bindService(new Intent(IBluetoothSap.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth SAP Service"); doBind(); } Log.d(TAG, "BluetoothSap(), bindService called"); boolean doBind() { Intent intent = new Intent(IBluetoothSap.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Sap Service with " + intent); return false; } return true; } /*package*/ void close() { Loading Loading @@ -137,15 +144,20 @@ public final class BluetoothSap implements BluetoothProfile { private IBluetoothStateChangeCallback mStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { @Override public void onBluetoothStateChange(boolean on) throws RemoteException { public void onBluetoothStateChange(boolean on) { //Handle enable request to bind again. Log.d(TAG, "onBluetoothStateChange on: " + on); if (on) { Log.d(TAG, "onBluetoothStateChange(on) call bindService"); if (!mContext.bindService(new Intent(IBluetoothSap.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth SAP Service"); try { if (mSapService == null) { Log.d(TAG, "onBluetoothStateChange call bindService"); doBind(); } } catch (IllegalStateException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to SAP service: ", e); } catch (SecurityException e) { Log.e(TAG,"onBluetoothStateChange: could not bind to SAP service: ", e); } Log.d(TAG, "BluetoothSap(), bindService called"); } else { if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { Loading