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

Commit bb5c19b6 authored by Hemant Gupta's avatar Hemant Gupta Committed by Android Git Automerger
Browse files

am aad1ef6e: MAP: Fix MNS observer sync and sendevent exception issue.

* commit 'aad1ef6e':
  MAP: Fix MNS observer sync and sendevent exception issue.
parents 10505cd3 aad1ef6e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -262,8 +262,8 @@ public class BluetoothMapContentObserver {
        Log.d(TAG, "sendEvent: " + evt.eventType + " " + evt.handle + " "
        + evt.folder + " " + evt.oldFolder + " " + evt.msgType.name());

        if (mMnsClient == null) {
            Log.d(TAG, "sendEvent: No MNS client registered - don't send event");
        if (mMnsClient == null || mMnsClient.isConnected() == false) {
            Log.d(TAG, "sendEvent: No MNS client registered or connected- don't send event");
            return;
        }

+6 −4
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ public class BluetoothMnsObexClient {
     * Disconnect the connection to MNS server.
     * Call this when the MAS client requests a de-registration on events.
     */
    public void disconnect() {
    public synchronized void disconnect() {
        try {
            if (mClientSession != null) {
                mClientSession.disconnect(null);
@@ -203,12 +203,14 @@ public class BluetoothMnsObexClient {
            /* Connect if we do not have a connection, and start the content observers providing
             * this thread as Handler.
             */
            if(mObserverRegistered == false) {
            synchronized (this) {
                if(mObserverRegistered == false && mObserver != null) {
                    mObserver.registerObserver(this, masId);
                    mObserverRegistered = true;
                }
            }
        }
    }

    public void connect() {
        Log.d(TAG, "handleRegistration: connect 2");