Skip to content
Snippets Groups Projects
Commit 9d3aaa10 authored by Olivier St-Onge's avatar Olivier St-Onge
Browse files

Prevent ConcurrentModificationException for IndividualSensorPrivacyControllerImpl

Using ListenerSet instead of ArraySet as suggested by com.android.systemui.statusbar.policy.CallbackController

Fix: 343290231
Test: manually using the sensor privacy tiles
Test: presubmits
Flag: EXEMPT bugfix
Change-Id: I9c1ca7fb733b39181b405a85655357e8367a928b
parent d0962cf0
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ import android.util.SparseBooleanArray;
import androidx.annotation.NonNull;
import com.android.internal.camera.flags.Flags;
import com.android.systemui.util.ListenerSet;
import java.util.Set;
......@@ -43,7 +44,7 @@ public class IndividualSensorPrivacyControllerImpl implements IndividualSensorPr
private final SparseBooleanArray mSoftwareToggleState = new SparseBooleanArray();
private final SparseBooleanArray mHardwareToggleState = new SparseBooleanArray();
private Boolean mRequiresAuthentication;
private final Set<Callback> mCallbacks = new ArraySet<>();
private final ListenerSet<Callback> mCallbacks = new ListenerSet<>();
public IndividualSensorPrivacyControllerImpl(
@NonNull SensorPrivacyManager sensorPrivacyManager) {
......@@ -115,7 +116,7 @@ public class IndividualSensorPrivacyControllerImpl implements IndividualSensorPr
@Override
public void addCallback(@NonNull Callback listener) {
mCallbacks.add(listener);
mCallbacks.addIfAbsent(listener);
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment