Loading core/java/android/bluetooth/BluetoothA2dp.java +7 −6 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import java.util.List; public final class BluetoothA2dp implements BluetoothProfile { private static final String TAG = "BluetoothA2dp"; private static final boolean DBG = true; private static final boolean VDBG = false; /** * Intent used to broadcast the change in connection state of the A2DP Loading Loading @@ -113,7 +114,7 @@ public final class BluetoothA2dp implements BluetoothProfile { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (DBG) Log.d(TAG,"Unbinding service..."); if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mService = null; Loading @@ -126,7 +127,7 @@ public final class BluetoothA2dp implements BluetoothProfile { synchronized (mConnection) { try { if (mService == null) { if (DBG) Log.d(TAG,"Binding service..."); if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothA2dp.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth A2DP Service"); } Loading Loading @@ -269,7 +270,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getConnectedDevices() { if (DBG) log("getConnectedDevices()"); if (VDBG) log("getConnectedDevices()"); if (mService != null && isEnabled()) { try { return mService.getConnectedDevices(); Loading @@ -286,7 +287,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (DBG) log("getDevicesMatchingStates()"); if (VDBG) log("getDevicesMatchingStates()"); if (mService != null && isEnabled()) { try { return mService.getDevicesMatchingConnectionStates(states); Loading @@ -303,7 +304,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * {@inheritDoc} */ public int getConnectionState(BluetoothDevice device) { if (DBG) log("getState(" + device + ")"); if (VDBG) log("getState(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading Loading @@ -365,7 +366,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * @hide */ public int getPriority(BluetoothDevice device) { if (DBG) log("getPriority(" + device + ")"); if (VDBG) log("getPriority(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading core/java/android/bluetooth/BluetoothHeadset.java +12 −11 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import java.util.List; public final class BluetoothHeadset implements BluetoothProfile { private static final String TAG = "BluetoothHeadset"; private static final boolean DBG = true; private static final boolean VDBG = false; /** * Intent used to broadcast the change in connection state of the Headset Loading Loading @@ -226,7 +227,7 @@ public final class BluetoothHeadset implements BluetoothProfile { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (DBG) Log.d(TAG,"Unbinding service..."); if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mService = null; Loading @@ -239,7 +240,7 @@ public final class BluetoothHeadset implements BluetoothProfile { synchronized (mConnection) { try { if (mService == null) { if (DBG) Log.d(TAG,"Binding service..."); if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothHeadset.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Headset Service"); } Loading Loading @@ -281,7 +282,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * are ok. */ /*package*/ void close() { if (DBG) log("close()"); if (VDBG) log("close()"); IBluetoothManager mgr = mAdapter.getBluetoothManager(); if (mgr != null) { Loading Loading @@ -387,7 +388,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getConnectedDevices() { if (DBG) log("getConnectedDevices()"); if (VDBG) log("getConnectedDevices()"); if (mService != null && isEnabled()) { try { return mService.getConnectedDevices(); Loading @@ -404,7 +405,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (DBG) log("getDevicesMatchingStates()"); if (VDBG) log("getDevicesMatchingStates()"); if (mService != null && isEnabled()) { try { return mService.getDevicesMatchingConnectionStates(states); Loading @@ -421,7 +422,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * {@inheritDoc} */ public int getConnectionState(BluetoothDevice device) { if (DBG) log("getConnectionState(" + device + ")"); if (VDBG) log("getConnectionState(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading Loading @@ -483,7 +484,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * @hide */ public int getPriority(BluetoothDevice device) { if (DBG) log("getPriority(" + device + ")"); if (VDBG) log("getPriority(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading Loading @@ -566,7 +567,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * false otherwise or on error */ public boolean isAudioConnected(BluetoothDevice device) { if (DBG) log("isAudioConnected()"); if (VDBG) log("isAudioConnected()"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading Loading @@ -594,7 +595,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * @hide */ public int getBatteryUsageHint(BluetoothDevice device) { if (DBG) log("getBatteryUsageHint()"); if (VDBG) log("getBatteryUsageHint()"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading Loading @@ -661,7 +662,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * @hide */ public int getAudioState(BluetoothDevice device) { if (DBG) log("getAudioState"); if (VDBG) log("getAudioState"); if (mService != null && !isDisabled()) { try { return mService.getAudioState(device); Loading @@ -683,7 +684,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * @hide */ public boolean isAudioOn() { if (DBG) log("isAudioOn()"); if (VDBG) log("isAudioOn()"); if (mService != null && isEnabled()) { try { return mService.isAudioOn(); Loading core/java/android/bluetooth/BluetoothHealth.java +6 −5 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import java.util.List; public final class BluetoothHealth implements BluetoothProfile { private static final String TAG = "BluetoothHealth"; private static final boolean DBG = true; private static final boolean VDBG = false; /** * Health Profile Source Role - the health device. Loading Loading @@ -102,7 +103,7 @@ public final class BluetoothHealth implements BluetoothProfile { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (DBG) Log.d(TAG,"Unbinding service..."); if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mService = null; Loading @@ -115,7 +116,7 @@ public final class BluetoothHealth implements BluetoothProfile { synchronized (mConnection) { try { if (mService == null) { if (DBG) Log.d(TAG,"Binding service..."); if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothHealth.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Health Service"); } Loading Loading @@ -148,7 +149,7 @@ public final class BluetoothHealth implements BluetoothProfile { BluetoothHealthCallback callback) { if (!isEnabled() || name == null) return false; if (DBG) log("registerSinkApplication(" + name + ":" + dataType + ")"); if (VDBG) log("registerSinkApplication(" + name + ":" + dataType + ")"); return registerAppConfiguration(name, dataType, SINK_ROLE, CHANNEL_TYPE_ANY, callback); } Loading @@ -174,7 +175,7 @@ public final class BluetoothHealth implements BluetoothProfile { boolean result = false; if (!isEnabled() || !checkAppParam(name, role, channelType, callback)) return result; if (DBG) log("registerApplication(" + name + ":" + dataType + ")"); if (VDBG) log("registerApplication(" + name + ":" + dataType + ")"); BluetoothHealthCallbackWrapper wrapper = new BluetoothHealthCallbackWrapper(callback); BluetoothHealthAppConfiguration config = new BluetoothHealthAppConfiguration(name, dataType, role, channelType); Loading Loading @@ -488,7 +489,7 @@ public final class BluetoothHealth implements BluetoothProfile { } /*package*/ void close() { if (DBG) log("close()"); if (VDBG) log("close()"); IBluetoothManager mgr = mAdapter.getBluetoothManager(); if (mgr != null) { try { Loading core/java/android/bluetooth/BluetoothInputDevice.java +10 −9 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import java.util.List; public final class BluetoothInputDevice implements BluetoothProfile { private static final String TAG = "BluetoothInputDevice"; private static final boolean DBG = true; private static final boolean VDBG = false; /** * Intent used to broadcast the change in connection state of the Input Loading Loading @@ -191,7 +192,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (DBG) Log.d(TAG,"Unbinding service..."); if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mService = null; Loading @@ -204,7 +205,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { synchronized (mConnection) { try { if (mService == null) { if (DBG) Log.d(TAG,"Binding service..."); if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothInputDevice.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth HID Service"); } Loading Loading @@ -243,7 +244,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { } /*package*/ void close() { if (DBG) log("close()"); if (VDBG) log("close()"); IBluetoothManager mgr = mAdapter.getBluetoothManager(); if (mgr != null) { try { Loading Loading @@ -344,7 +345,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getConnectedDevices() { if (DBG) log("getConnectedDevices()"); if (VDBG) log("getConnectedDevices()"); if (mService != null && isEnabled()) { try { return mService.getConnectedDevices(); Loading @@ -361,7 +362,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (DBG) log("getDevicesMatchingStates()"); if (VDBG) log("getDevicesMatchingStates()"); if (mService != null && isEnabled()) { try { return mService.getDevicesMatchingConnectionStates(states); Loading @@ -378,7 +379,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * {@inheritDoc} */ public int getConnectionState(BluetoothDevice device) { if (DBG) log("getState(" + device + ")"); if (VDBG) log("getState(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.getConnectionState(device); Loading Loading @@ -438,7 +439,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * @hide */ public int getPriority(BluetoothDevice device) { if (DBG) log("getPriority(" + device + ")"); if (VDBG) log("getPriority(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.getPriority(device); Loading Loading @@ -519,7 +520,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * @hide */ public boolean getProtocolMode(BluetoothDevice device) { if (DBG) log("getProtocolMode(" + device + ")"); if (VDBG) log("getProtocolMode(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.getProtocolMode(device); Loading Loading @@ -570,7 +571,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * @hide */ public boolean getReport(BluetoothDevice device, byte reportType, byte reportId, int bufferSize) { if (DBG) log("getReport(" + device + "), reportType=" + reportType + " reportId=" + reportId + "bufferSize=" + bufferSize); if (VDBG) log("getReport(" + device + "), reportType=" + reportType + " reportId=" + reportId + "bufferSize=" + bufferSize); if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.getReport(device, reportType, reportId, bufferSize); Loading core/java/android/bluetooth/BluetoothPan.java +7 −6 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import java.util.List; public final class BluetoothPan implements BluetoothProfile { private static final String TAG = "BluetoothPan"; private static final boolean DBG = true; private static final boolean VDBG = false; /** * Intent used to broadcast the change in connection state of the Pan Loading Loading @@ -145,7 +146,7 @@ public final class BluetoothPan implements BluetoothProfile { } /*package*/ void close() { if (DBG) log("close()"); if (VDBG) log("close()"); if (mConnection != null) { mContext.unbindService(mConnection); mConnection = null; Loading Loading @@ -175,7 +176,7 @@ public final class BluetoothPan implements BluetoothProfile { } Log.d(TAG, "BluetoothPan(), bindService called"); } else { if (DBG) Log.d(TAG,"Unbinding service..."); if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mPanService = null; Loading Loading @@ -266,7 +267,7 @@ public final class BluetoothPan implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getConnectedDevices() { if (DBG) log("getConnectedDevices()"); if (VDBG) log("getConnectedDevices()"); if (mPanService != null && isEnabled()) { try { return mPanService.getConnectedDevices(); Loading @@ -283,7 +284,7 @@ public final class BluetoothPan implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (DBG) log("getDevicesMatchingStates()"); if (VDBG) log("getDevicesMatchingStates()"); if (mPanService != null && isEnabled()) { try { return mPanService.getDevicesMatchingConnectionStates(states); Loading @@ -300,7 +301,7 @@ public final class BluetoothPan implements BluetoothProfile { * {@inheritDoc} */ public int getConnectionState(BluetoothDevice device) { if (DBG) log("getState(" + device + ")"); if (VDBG) log("getState(" + device + ")"); if (mPanService != null && isEnabled() && isValidDevice(device)) { try { Loading @@ -324,7 +325,7 @@ public final class BluetoothPan implements BluetoothProfile { } public boolean isTetheringOn() { if (DBG) log("isTetheringOn()"); if (VDBG) log("isTetheringOn()"); try { return mPanService.isTetheringOn(); } catch (RemoteException e) { Loading Loading
core/java/android/bluetooth/BluetoothA2dp.java +7 −6 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import java.util.List; public final class BluetoothA2dp implements BluetoothProfile { private static final String TAG = "BluetoothA2dp"; private static final boolean DBG = true; private static final boolean VDBG = false; /** * Intent used to broadcast the change in connection state of the A2DP Loading Loading @@ -113,7 +114,7 @@ public final class BluetoothA2dp implements BluetoothProfile { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (DBG) Log.d(TAG,"Unbinding service..."); if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mService = null; Loading @@ -126,7 +127,7 @@ public final class BluetoothA2dp implements BluetoothProfile { synchronized (mConnection) { try { if (mService == null) { if (DBG) Log.d(TAG,"Binding service..."); if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothA2dp.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth A2DP Service"); } Loading Loading @@ -269,7 +270,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getConnectedDevices() { if (DBG) log("getConnectedDevices()"); if (VDBG) log("getConnectedDevices()"); if (mService != null && isEnabled()) { try { return mService.getConnectedDevices(); Loading @@ -286,7 +287,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (DBG) log("getDevicesMatchingStates()"); if (VDBG) log("getDevicesMatchingStates()"); if (mService != null && isEnabled()) { try { return mService.getDevicesMatchingConnectionStates(states); Loading @@ -303,7 +304,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * {@inheritDoc} */ public int getConnectionState(BluetoothDevice device) { if (DBG) log("getState(" + device + ")"); if (VDBG) log("getState(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading Loading @@ -365,7 +366,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * @hide */ public int getPriority(BluetoothDevice device) { if (DBG) log("getPriority(" + device + ")"); if (VDBG) log("getPriority(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading
core/java/android/bluetooth/BluetoothHeadset.java +12 −11 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import java.util.List; public final class BluetoothHeadset implements BluetoothProfile { private static final String TAG = "BluetoothHeadset"; private static final boolean DBG = true; private static final boolean VDBG = false; /** * Intent used to broadcast the change in connection state of the Headset Loading Loading @@ -226,7 +227,7 @@ public final class BluetoothHeadset implements BluetoothProfile { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (DBG) Log.d(TAG,"Unbinding service..."); if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mService = null; Loading @@ -239,7 +240,7 @@ public final class BluetoothHeadset implements BluetoothProfile { synchronized (mConnection) { try { if (mService == null) { if (DBG) Log.d(TAG,"Binding service..."); if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothHeadset.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Headset Service"); } Loading Loading @@ -281,7 +282,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * are ok. */ /*package*/ void close() { if (DBG) log("close()"); if (VDBG) log("close()"); IBluetoothManager mgr = mAdapter.getBluetoothManager(); if (mgr != null) { Loading Loading @@ -387,7 +388,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getConnectedDevices() { if (DBG) log("getConnectedDevices()"); if (VDBG) log("getConnectedDevices()"); if (mService != null && isEnabled()) { try { return mService.getConnectedDevices(); Loading @@ -404,7 +405,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (DBG) log("getDevicesMatchingStates()"); if (VDBG) log("getDevicesMatchingStates()"); if (mService != null && isEnabled()) { try { return mService.getDevicesMatchingConnectionStates(states); Loading @@ -421,7 +422,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * {@inheritDoc} */ public int getConnectionState(BluetoothDevice device) { if (DBG) log("getConnectionState(" + device + ")"); if (VDBG) log("getConnectionState(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading Loading @@ -483,7 +484,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * @hide */ public int getPriority(BluetoothDevice device) { if (DBG) log("getPriority(" + device + ")"); if (VDBG) log("getPriority(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading Loading @@ -566,7 +567,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * false otherwise or on error */ public boolean isAudioConnected(BluetoothDevice device) { if (DBG) log("isAudioConnected()"); if (VDBG) log("isAudioConnected()"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading Loading @@ -594,7 +595,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * @hide */ public int getBatteryUsageHint(BluetoothDevice device) { if (DBG) log("getBatteryUsageHint()"); if (VDBG) log("getBatteryUsageHint()"); if (mService != null && isEnabled() && isValidDevice(device)) { try { Loading Loading @@ -661,7 +662,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * @hide */ public int getAudioState(BluetoothDevice device) { if (DBG) log("getAudioState"); if (VDBG) log("getAudioState"); if (mService != null && !isDisabled()) { try { return mService.getAudioState(device); Loading @@ -683,7 +684,7 @@ public final class BluetoothHeadset implements BluetoothProfile { * @hide */ public boolean isAudioOn() { if (DBG) log("isAudioOn()"); if (VDBG) log("isAudioOn()"); if (mService != null && isEnabled()) { try { return mService.isAudioOn(); Loading
core/java/android/bluetooth/BluetoothHealth.java +6 −5 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import java.util.List; public final class BluetoothHealth implements BluetoothProfile { private static final String TAG = "BluetoothHealth"; private static final boolean DBG = true; private static final boolean VDBG = false; /** * Health Profile Source Role - the health device. Loading Loading @@ -102,7 +103,7 @@ public final class BluetoothHealth implements BluetoothProfile { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (DBG) Log.d(TAG,"Unbinding service..."); if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mService = null; Loading @@ -115,7 +116,7 @@ public final class BluetoothHealth implements BluetoothProfile { synchronized (mConnection) { try { if (mService == null) { if (DBG) Log.d(TAG,"Binding service..."); if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothHealth.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Health Service"); } Loading Loading @@ -148,7 +149,7 @@ public final class BluetoothHealth implements BluetoothProfile { BluetoothHealthCallback callback) { if (!isEnabled() || name == null) return false; if (DBG) log("registerSinkApplication(" + name + ":" + dataType + ")"); if (VDBG) log("registerSinkApplication(" + name + ":" + dataType + ")"); return registerAppConfiguration(name, dataType, SINK_ROLE, CHANNEL_TYPE_ANY, callback); } Loading @@ -174,7 +175,7 @@ public final class BluetoothHealth implements BluetoothProfile { boolean result = false; if (!isEnabled() || !checkAppParam(name, role, channelType, callback)) return result; if (DBG) log("registerApplication(" + name + ":" + dataType + ")"); if (VDBG) log("registerApplication(" + name + ":" + dataType + ")"); BluetoothHealthCallbackWrapper wrapper = new BluetoothHealthCallbackWrapper(callback); BluetoothHealthAppConfiguration config = new BluetoothHealthAppConfiguration(name, dataType, role, channelType); Loading Loading @@ -488,7 +489,7 @@ public final class BluetoothHealth implements BluetoothProfile { } /*package*/ void close() { if (DBG) log("close()"); if (VDBG) log("close()"); IBluetoothManager mgr = mAdapter.getBluetoothManager(); if (mgr != null) { try { Loading
core/java/android/bluetooth/BluetoothInputDevice.java +10 −9 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import java.util.List; public final class BluetoothInputDevice implements BluetoothProfile { private static final String TAG = "BluetoothInputDevice"; private static final boolean DBG = true; private static final boolean VDBG = false; /** * Intent used to broadcast the change in connection state of the Input Loading Loading @@ -191,7 +192,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (DBG) Log.d(TAG,"Unbinding service..."); if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mService = null; Loading @@ -204,7 +205,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { synchronized (mConnection) { try { if (mService == null) { if (DBG) Log.d(TAG,"Binding service..."); if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothInputDevice.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth HID Service"); } Loading Loading @@ -243,7 +244,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { } /*package*/ void close() { if (DBG) log("close()"); if (VDBG) log("close()"); IBluetoothManager mgr = mAdapter.getBluetoothManager(); if (mgr != null) { try { Loading Loading @@ -344,7 +345,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getConnectedDevices() { if (DBG) log("getConnectedDevices()"); if (VDBG) log("getConnectedDevices()"); if (mService != null && isEnabled()) { try { return mService.getConnectedDevices(); Loading @@ -361,7 +362,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (DBG) log("getDevicesMatchingStates()"); if (VDBG) log("getDevicesMatchingStates()"); if (mService != null && isEnabled()) { try { return mService.getDevicesMatchingConnectionStates(states); Loading @@ -378,7 +379,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * {@inheritDoc} */ public int getConnectionState(BluetoothDevice device) { if (DBG) log("getState(" + device + ")"); if (VDBG) log("getState(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.getConnectionState(device); Loading Loading @@ -438,7 +439,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * @hide */ public int getPriority(BluetoothDevice device) { if (DBG) log("getPriority(" + device + ")"); if (VDBG) log("getPriority(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.getPriority(device); Loading Loading @@ -519,7 +520,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * @hide */ public boolean getProtocolMode(BluetoothDevice device) { if (DBG) log("getProtocolMode(" + device + ")"); if (VDBG) log("getProtocolMode(" + device + ")"); if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.getProtocolMode(device); Loading Loading @@ -570,7 +571,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { * @hide */ public boolean getReport(BluetoothDevice device, byte reportType, byte reportId, int bufferSize) { if (DBG) log("getReport(" + device + "), reportType=" + reportType + " reportId=" + reportId + "bufferSize=" + bufferSize); if (VDBG) log("getReport(" + device + "), reportType=" + reportType + " reportId=" + reportId + "bufferSize=" + bufferSize); if (mService != null && isEnabled() && isValidDevice(device)) { try { return mService.getReport(device, reportType, reportId, bufferSize); Loading
core/java/android/bluetooth/BluetoothPan.java +7 −6 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import java.util.List; public final class BluetoothPan implements BluetoothProfile { private static final String TAG = "BluetoothPan"; private static final boolean DBG = true; private static final boolean VDBG = false; /** * Intent used to broadcast the change in connection state of the Pan Loading Loading @@ -145,7 +146,7 @@ public final class BluetoothPan implements BluetoothProfile { } /*package*/ void close() { if (DBG) log("close()"); if (VDBG) log("close()"); if (mConnection != null) { mContext.unbindService(mConnection); mConnection = null; Loading Loading @@ -175,7 +176,7 @@ public final class BluetoothPan implements BluetoothProfile { } Log.d(TAG, "BluetoothPan(), bindService called"); } else { if (DBG) Log.d(TAG,"Unbinding service..."); if (VDBG) Log.d(TAG,"Unbinding service..."); synchronized (mConnection) { try { mPanService = null; Loading Loading @@ -266,7 +267,7 @@ public final class BluetoothPan implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getConnectedDevices() { if (DBG) log("getConnectedDevices()"); if (VDBG) log("getConnectedDevices()"); if (mPanService != null && isEnabled()) { try { return mPanService.getConnectedDevices(); Loading @@ -283,7 +284,7 @@ public final class BluetoothPan implements BluetoothProfile { * {@inheritDoc} */ public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { if (DBG) log("getDevicesMatchingStates()"); if (VDBG) log("getDevicesMatchingStates()"); if (mPanService != null && isEnabled()) { try { return mPanService.getDevicesMatchingConnectionStates(states); Loading @@ -300,7 +301,7 @@ public final class BluetoothPan implements BluetoothProfile { * {@inheritDoc} */ public int getConnectionState(BluetoothDevice device) { if (DBG) log("getState(" + device + ")"); if (VDBG) log("getState(" + device + ")"); if (mPanService != null && isEnabled() && isValidDevice(device)) { try { Loading @@ -324,7 +325,7 @@ public final class BluetoothPan implements BluetoothProfile { } public boolean isTetheringOn() { if (DBG) log("isTetheringOn()"); if (VDBG) log("isTetheringOn()"); try { return mPanService.isTetheringOn(); } catch (RemoteException e) { Loading