Loading android/app/src/com/android/bluetooth/mapclient/MapClientService.java +4 −4 Original line number Diff line number Diff line Loading @@ -189,20 +189,20 @@ public class MapClientService extends ProfileService { } public synchronized List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { Log.d(TAG, "getDevicesMatchingConnectionStates" + Arrays.toString(states)); if (DBG) Log.d(TAG, "getDevicesMatchingConnectionStates" + Arrays.toString(states)); List<BluetoothDevice> deviceList = new ArrayList<>(); Set<BluetoothDevice> bondedDevices = mAdapter.getBondedDevices(); int connectionState; for (BluetoothDevice device : bondedDevices) { connectionState = getConnectionState(device); Log.d(TAG, "Device: " + device + "State: " + connectionState); if (DBG) Log.d(TAG, "Device: " + device + "State: " + connectionState); for (int i = 0; i < states.length; i++) { if (connectionState == states[i]) { deviceList.add(device); } } } Log.d(TAG, deviceList.toString()); if (DBG) Log.d(TAG, deviceList.toString()); return deviceList; } Loading Loading @@ -487,7 +487,7 @@ public class MapClientService extends ProfileService { if (service == null) { return false; } Log.d(TAG, "Checking Permission of sendMessage"); if (DBG) Log.d(TAG, "Checking Permission of sendMessage"); mService.enforceCallingOrSelfPermission(Manifest.permission.SEND_SMS, "Need SEND_SMS permission"); Loading android/app/src/com/android/bluetooth/mapclient/MasClient.java +11 −10 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ public class MasClient { + mSdpMasRecord.getRfcommCannelNumber()); } mSocket = mRemoteDevice.createRfcommSocket(mSdpMasRecord.getRfcommCannelNumber()); Log.d(TAG, mRemoteDevice.toString() + "Socket: " + mSocket.toString()); if (DBG) Log.d(TAG, mRemoteDevice.toString() + "Socket: " + mSocket.toString()); mSocket.connect(); mTransport = new BluetoothObexTransport(mSocket); Loading @@ -118,7 +118,7 @@ public class MasClient { oap.addToHeaderSet(headerset); headerset = mSession.connect(headerset); Log.d(TAG, "Connection results" + headerset.getResponseCode()); if (DBG) Log.d(TAG, "Connection results" + headerset.getResponseCode()); if (headerset.getResponseCode() == ResponseCodes.OBEX_HTTP_OK) { if (DBG) { Loading Loading @@ -201,22 +201,23 @@ public class MasClient { @Override public void handleMessage(Message msg) { MasClient inst = mInst.get(); if (!inst.mConnected && msg.what != CONNECT) { Log.w(TAG, "Cannot execute " + msg + " when not CONNECTED."); return; } switch (msg.what) { case CONNECT: if (!inst.mConnected) { inst.connect(); } break; case DISCONNECT: if (inst.mConnected) { inst.disconnect(); } break; case REQUEST: if (inst.mConnected) { inst.executeRequest((Request) msg.obj); } break; } } Loading android/app/src/com/android/bluetooth/mapclient/MceStateMachine.java +4 −8 Original line number Diff line number Diff line Loading @@ -487,10 +487,8 @@ final class MceStateMachine extends StateMachine { case MSG_NOTIFICATION: EventReport ev = (EventReport) msg.obj; if (DBG) { Log.d(TAG, "Message Type = " + ev.getType()); } if (DBG) { Log.d(TAG, "Message handle = " + ev.getHandle()); Log.d(TAG, "Message Type = " + ev.getType() + ", Message handle = " + ev.getHandle()); } switch (ev.getType()) { Loading Loading @@ -683,10 +681,8 @@ final class MceStateMachine extends StateMachine { void receiveEvent(EventReport ev) { if (DBG) { Log.d(TAG, "Message Type = " + ev.getType()); } if (DBG) { Log.d(TAG, "Message handle = " + ev.getHandle()); Log.d(TAG, "Message Type = " + ev.getType() + ", Message handle = " + ev.getHandle()); } sendMessage(MSG_NOTIFICATION, ev); } Loading Loading
android/app/src/com/android/bluetooth/mapclient/MapClientService.java +4 −4 Original line number Diff line number Diff line Loading @@ -189,20 +189,20 @@ public class MapClientService extends ProfileService { } public synchronized List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { Log.d(TAG, "getDevicesMatchingConnectionStates" + Arrays.toString(states)); if (DBG) Log.d(TAG, "getDevicesMatchingConnectionStates" + Arrays.toString(states)); List<BluetoothDevice> deviceList = new ArrayList<>(); Set<BluetoothDevice> bondedDevices = mAdapter.getBondedDevices(); int connectionState; for (BluetoothDevice device : bondedDevices) { connectionState = getConnectionState(device); Log.d(TAG, "Device: " + device + "State: " + connectionState); if (DBG) Log.d(TAG, "Device: " + device + "State: " + connectionState); for (int i = 0; i < states.length; i++) { if (connectionState == states[i]) { deviceList.add(device); } } } Log.d(TAG, deviceList.toString()); if (DBG) Log.d(TAG, deviceList.toString()); return deviceList; } Loading Loading @@ -487,7 +487,7 @@ public class MapClientService extends ProfileService { if (service == null) { return false; } Log.d(TAG, "Checking Permission of sendMessage"); if (DBG) Log.d(TAG, "Checking Permission of sendMessage"); mService.enforceCallingOrSelfPermission(Manifest.permission.SEND_SMS, "Need SEND_SMS permission"); Loading
android/app/src/com/android/bluetooth/mapclient/MasClient.java +11 −10 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ public class MasClient { + mSdpMasRecord.getRfcommCannelNumber()); } mSocket = mRemoteDevice.createRfcommSocket(mSdpMasRecord.getRfcommCannelNumber()); Log.d(TAG, mRemoteDevice.toString() + "Socket: " + mSocket.toString()); if (DBG) Log.d(TAG, mRemoteDevice.toString() + "Socket: " + mSocket.toString()); mSocket.connect(); mTransport = new BluetoothObexTransport(mSocket); Loading @@ -118,7 +118,7 @@ public class MasClient { oap.addToHeaderSet(headerset); headerset = mSession.connect(headerset); Log.d(TAG, "Connection results" + headerset.getResponseCode()); if (DBG) Log.d(TAG, "Connection results" + headerset.getResponseCode()); if (headerset.getResponseCode() == ResponseCodes.OBEX_HTTP_OK) { if (DBG) { Loading Loading @@ -201,22 +201,23 @@ public class MasClient { @Override public void handleMessage(Message msg) { MasClient inst = mInst.get(); if (!inst.mConnected && msg.what != CONNECT) { Log.w(TAG, "Cannot execute " + msg + " when not CONNECTED."); return; } switch (msg.what) { case CONNECT: if (!inst.mConnected) { inst.connect(); } break; case DISCONNECT: if (inst.mConnected) { inst.disconnect(); } break; case REQUEST: if (inst.mConnected) { inst.executeRequest((Request) msg.obj); } break; } } Loading
android/app/src/com/android/bluetooth/mapclient/MceStateMachine.java +4 −8 Original line number Diff line number Diff line Loading @@ -487,10 +487,8 @@ final class MceStateMachine extends StateMachine { case MSG_NOTIFICATION: EventReport ev = (EventReport) msg.obj; if (DBG) { Log.d(TAG, "Message Type = " + ev.getType()); } if (DBG) { Log.d(TAG, "Message handle = " + ev.getHandle()); Log.d(TAG, "Message Type = " + ev.getType() + ", Message handle = " + ev.getHandle()); } switch (ev.getType()) { Loading Loading @@ -683,10 +681,8 @@ final class MceStateMachine extends StateMachine { void receiveEvent(EventReport ev) { if (DBG) { Log.d(TAG, "Message Type = " + ev.getType()); } if (DBG) { Log.d(TAG, "Message handle = " + ev.getHandle()); Log.d(TAG, "Message Type = " + ev.getType() + ", Message handle = " + ev.getHandle()); } sendMessage(MSG_NOTIFICATION, ev); } Loading