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

Commit 87f7ae41 authored by Diya Bera's avatar Diya Bera
Browse files

Make client callbacks consurrent modification safe

Fixes: 313142986
Test: N/A

Change-Id: I9f26b23d0a9d3f5f140b4056b58c556fc5241ac8
parent 0514919a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -27,9 +27,8 @@ import android.util.Slog;

import com.android.internal.annotations.VisibleForTesting;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * Allows clients (such as keyguard) to register for notifications on when biometric lockout
@@ -42,7 +41,7 @@ public class LockoutResetDispatcher implements IBinder.DeathRecipient {

    private final Context mContext;
    @VisibleForTesting
    final List<ClientCallback> mClientCallbacks = new ArrayList<>();
    final ConcurrentLinkedQueue<ClientCallback> mClientCallbacks = new ConcurrentLinkedQueue<>();

    private static class ClientCallback {
        private static final long WAKELOCK_TIMEOUT_MS = 2000;