Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d8412cc authored by Hemant Gupta's avatar Hemant Gupta Committed by android-build-merger
Browse files

Merge "MAP: Update API name used during Socket Listening." am: b86205f9 am: 0a032222

am: 9261e215

Change-Id: Ib85b5471a6ae281d5c751d77646a40c8036f1f7a
parents 4a0b008a 9261e215
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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) {
@@ -422,7 +425,7 @@ public class BluetoothMapMasInstance implements IObexConnectionHandler {
        if (D) {
            Log.d(mTag, "MAP Service restartObexServerSession()");
        }
        startRfcommSocketListener();
        startSocketListeners();
    }


@@ -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();
        }
    }

+7 −7
Original line number Diff line number Diff line
@@ -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);
            }
        }
    }
@@ -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:
@@ -754,7 +754,7 @@ public class BluetoothMapService extends ProfileService {
                    changed = true;
                    /* Start the new instance */
                    if (mAdapter.isEnabled()) {
                        newInst.startRfcommSocketListener();
                        newInst.startSocketListeners();
                    }
                }
            }