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

Commit c5870267 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Add missing mApps synchronization

Test: manual
Bug: 33227052
Change-Id: I29d50f706c64b3a46f4bcb868dee6e86484ebed7
(cherry picked from commit 9b093393eead74eb3f1a8c19418d3d3a6e86761c)
parent 2d172d0f
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
@@ -244,11 +244,13 @@ import com.android.bluetooth.btservice.BluetoothProto;
     * Get an application context by ID.
     */
    App getById(int id) {
        synchronized (mApps) {
            Iterator<App> i = mApps.iterator();
            while (i.hasNext()) {
                App entry = i.next();
                if (entry.id == id) return entry;
            }
        }
        Log.e(TAG, "Context not found for ID " + id);
        return null;
    }
@@ -257,11 +259,13 @@ import com.android.bluetooth.btservice.BluetoothProto;
     * Get an application context by UUID.
     */
    App getByUuid(UUID uuid) {
        synchronized (mApps) {
            Iterator<App> i = mApps.iterator();
            while (i.hasNext()) {
                App entry = i.next();
                if (entry.uuid.equals(uuid)) return entry;
            }
        }
        Log.e(TAG, "Context not found for UUID " + uuid);
        return null;
    }
@@ -270,11 +274,13 @@ import com.android.bluetooth.btservice.BluetoothProto;
     * Get an application context by the calling Apps name.
     */
    App getByName(String name) {
        synchronized (mApps) {
            Iterator<App> i = mApps.iterator();
            while (i.hasNext()) {
                App entry = i.next();
                if (entry.name.equals(name)) return entry;
            }
        }
        Log.e(TAG, "Context not found for name " + name);
        return null;
    }