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

Commit 37e1a549 authored by Hemant Gupta's avatar Hemant Gupta Committed by Andre Eisenbach
Browse files

MAP: Synchronize notifcationReg reply and MNS connect action.

Use Case:
1. Connect to carkit
2. Disconnect connection with carkit.
3. Reconnect to carkit

Failure:
MNS Failure during Reconnection.
User will in some timing conditions not get notification
of new messages and then turns OFF/ON the carkit.
MAS is connected fine but for MNS car sends BAD REQUEST.

Root Cause:
This isssue is reported only with one particular carkit in MCE role,
where in MNS Connect request issued before acknowleding
the setNotificationReg Request.

Fix:
Synchronize handleRegistration method in handler thread to ensure
setNotificationReg response from MSE is sent before requesting
a MNS Connect to MCE.

Change-Id: I30559c643af7733754fce551b97e31543a0cb160
parent 3b04cd5c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ public class BluetoothMapAccountLoader {
                    " - returning empty account list" );
            return children;
        } finally {
            if (mProviderClient != null)
                mProviderClient.release();
        }

+2 −2
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ public class BluetoothMnsObexClient {
    /**
     * Shutdown the MNS.
     */
    public void shutdown() {
    public synchronized void shutdown() {
        /* should shutdown handler thread first to make sure
         * handleRegistration won't be called when disconnect
         */
@@ -178,7 +178,7 @@ public class BluetoothMnsObexClient {
     * @param masId
     * @param notificationStatus
     */
    public void handleRegistration(int masId, int notificationStatus){
    public synchronized void handleRegistration(int masId, int notificationStatus){
        if(D) Log.d(TAG, "handleRegistration( " + masId + ", " + notificationStatus + ")");

        if(notificationStatus == BluetoothMapAppParams.NOTIFICATION_STATUS_NO) {