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

Commit 6cd01730 authored by Anthony Stange's avatar Anthony Stange Committed by Automerger Merge Worker
Browse files

Merge "Synchronize access to mCallbacksList" into tm-dev am: 21363f2e

parents 8c81e2aa 21363f2e
Loading
Loading
Loading
Loading
+24 −20
Original line number Diff line number Diff line
@@ -1058,11 +1058,14 @@ public class ContextHubService extends IContextHubService.Stub {
        }

        int msgVersion = 0;
        // Synchronize access to mCallbacksList to prevent more than one outstanding broadcast as
        // that will cause a crash.
        synchronized (mCallbacksList) {
            int callbacksCount = mCallbacksList.beginBroadcast();
            if (DEBUG_LOG_ENABLED) {
            Log.v(TAG, "Sending message " + msgType + " version " + msgVersion + " from hubHandle "
                    + contextHubHandle + ", appInstance " + appInstance + ", callBackCount "
                    + callbacksCount);
                Log.v(TAG, "Sending message " + msgType + " version " + msgVersion
                        + " from hubHandle " + contextHubHandle + ", appInstance " + appInstance
                        + ", callBackCount " + callbacksCount);
            }

            if (callbacksCount < 1) {
@@ -1083,6 +1086,7 @@ public class ContextHubService extends IContextHubService.Stub {
                }
            }
            mCallbacksList.finishBroadcast();
        }
        return 0;
    }