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

Commit 63149c18 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Gerrit Code Review
Browse files

Merge "Add missing mApps synchronization"

parents 5be30156 a2a5ee28
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;
    }