Loading android/app/src/com/android/bluetooth/map/BluetoothMapMasInstance.java +7 −4 Original line number Diff line number Diff line Loading @@ -257,9 +257,12 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler { return combinedVersionCounter; } public synchronized void startRfcommSocketListener() { /** * Start Obex Server Sockets and create the SDP record. */ public synchronized void startSocketListeners() { if (D) { Log.d(mTag, "Map Service startRfcommSocketListener"); Log.d(mTag, "Map Service startSocketListeners"); } if (mServerSession != null) { Loading Loading @@ -422,7 +425,7 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler { if (D) { Log.d(mTag, "MAP Service restartObexServerSession()"); } startRfcommSocketListener(); startSocketListeners(); } Loading Loading @@ -490,7 +493,7 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler { Log.e(mTag, "Failed to accept incomming connection - " + "shutdown"); } else { Log.e(mTag, "Failed to accept incomming connection - " + "restarting"); startRfcommSocketListener(); startSocketListeners(); } } Loading android/app/src/com/android/bluetooth/map/BluetoothMapService.java +7 −7 Original line number Diff line number Diff line Loading @@ -214,20 +214,20 @@ public class BluetoothMapService extends ProfileService { } /** * Starts the RFComm listener threads for each MAS * Starts the Socket listener threads for each MAS * @throws IOException */ private void startRfcommSocketListeners(int masId) { private void startSocketListeners(int masId) { if (masId == -1) { for (int i = 0, c = mMasInstances.size(); i < c; i++) { mMasInstances.valueAt(i).startRfcommSocketListener(); mMasInstances.valueAt(i).startSocketListeners(); } } else { BluetoothMapMasInstance masInst = mMasInstances.get(masId); // returns null for -1 if (masInst != null) { masInst.startRfcommSocketListener(); masInst.startSocketListeners(); } else { Log.w(TAG, "startRfcommSocketListeners(): Invalid MasId: " + masId); Log.w(TAG, "startSocketListeners(): Invalid MasId: " + masId); } } } Loading Loading @@ -363,7 +363,7 @@ public class BluetoothMapService extends ProfileService { break; case START_LISTENER: if (mAdapter.isEnabled()) { startRfcommSocketListeners(msg.arg1); startSocketListeners(msg.arg1); } break; case MSG_MAS_CONNECT: Loading Loading @@ -754,7 +754,7 @@ public class BluetoothMapService extends ProfileService { changed = true; /* Start the new instance */ if (mAdapter.isEnabled()) { newInst.startRfcommSocketListener(); newInst.startSocketListeners(); } } } Loading Loading
android/app/src/com/android/bluetooth/map/BluetoothMapMasInstance.java +7 −4 Original line number Diff line number Diff line Loading @@ -257,9 +257,12 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler { return combinedVersionCounter; } public synchronized void startRfcommSocketListener() { /** * Start Obex Server Sockets and create the SDP record. */ public synchronized void startSocketListeners() { if (D) { Log.d(mTag, "Map Service startRfcommSocketListener"); Log.d(mTag, "Map Service startSocketListeners"); } if (mServerSession != null) { Loading Loading @@ -422,7 +425,7 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler { if (D) { Log.d(mTag, "MAP Service restartObexServerSession()"); } startRfcommSocketListener(); startSocketListeners(); } Loading Loading @@ -490,7 +493,7 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler { Log.e(mTag, "Failed to accept incomming connection - " + "shutdown"); } else { Log.e(mTag, "Failed to accept incomming connection - " + "restarting"); startRfcommSocketListener(); startSocketListeners(); } } Loading
android/app/src/com/android/bluetooth/map/BluetoothMapService.java +7 −7 Original line number Diff line number Diff line Loading @@ -214,20 +214,20 @@ public class BluetoothMapService extends ProfileService { } /** * Starts the RFComm listener threads for each MAS * Starts the Socket listener threads for each MAS * @throws IOException */ private void startRfcommSocketListeners(int masId) { private void startSocketListeners(int masId) { if (masId == -1) { for (int i = 0, c = mMasInstances.size(); i < c; i++) { mMasInstances.valueAt(i).startRfcommSocketListener(); mMasInstances.valueAt(i).startSocketListeners(); } } else { BluetoothMapMasInstance masInst = mMasInstances.get(masId); // returns null for -1 if (masInst != null) { masInst.startRfcommSocketListener(); masInst.startSocketListeners(); } else { Log.w(TAG, "startRfcommSocketListeners(): Invalid MasId: " + masId); Log.w(TAG, "startSocketListeners(): Invalid MasId: " + masId); } } } Loading Loading @@ -363,7 +363,7 @@ public class BluetoothMapService extends ProfileService { break; case START_LISTENER: if (mAdapter.isEnabled()) { startRfcommSocketListeners(msg.arg1); startSocketListeners(msg.arg1); } break; case MSG_MAS_CONNECT: Loading Loading @@ -754,7 +754,7 @@ public class BluetoothMapService extends ProfileService { changed = true; /* Start the new instance */ if (mAdapter.isEnabled()) { newInst.startRfcommSocketListener(); newInst.startSocketListeners(); } } } Loading