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

Commit 53e94fa3 authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "[GATT] Ensure synchronized when adding a value"

parents eb37b6cb 0e85068c
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -240,11 +240,13 @@ import java.util.UUID;
        }

        synchronized (mAppsLock) {
            AppAdvertiseStats appAdvertiseStats = mAppAdvertiseStats.get(id);
            if (appAdvertiseStats == null) {
                appAdvertiseStats = new AppAdvertiseStats(appUid, id, appName, this, service);
            synchronized (this) {
                if (!mAppAdvertiseStats.containsKey(id)) {
                    AppAdvertiseStats appAdvertiseStats =
                            new AppAdvertiseStats(appUid, id, appName, this, service);
                    mAppAdvertiseStats.put(id, appAdvertiseStats);
                }
            }
            App app = getById(appUid);
            if (app == null) {
                app = new App(appUid, callback, appName);