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

Commit 59dda3d6 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Fix a concurrent modification in ProximityCheck" into main

parents 24eec3ba 20a7ca2f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -86,11 +86,12 @@ public class ProximityCheck implements Runnable {
    }

    private void onProximityEvent(ThresholdSensorEvent proximityEvent) {
        mCallbacks.forEach(
        List<Consumer<Boolean>> oldCallbacks = mCallbacks;
        mCallbacks = new ArrayList<>();
        oldCallbacks.forEach(
                booleanConsumer ->
                        booleanConsumer.accept(
                                proximityEvent == null ? null : proximityEvent.getBelow()));
        mCallbacks.clear();
        unregister();
        mRegistered.set(false);
    }