|
33 | 33 | import java.security.MessageDigest; |
34 | 34 | import java.security.NoSuchAlgorithmException; |
35 | 35 | import java.util.Arrays; |
| 36 | +import java.util.Collections; |
36 | 37 | import java.util.HashMap; |
37 | | -import java.util.HashSet; |
38 | 38 | import java.util.LinkedList; |
39 | 39 | import java.util.List; |
40 | 40 | import java.util.Map; |
41 | 41 | import java.util.Objects; |
42 | 42 | import java.util.Set; |
| 43 | +import java.util.concurrent.ConcurrentHashMap; |
43 | 44 |
|
44 | 45 | import static android.os.Build.VERSION.SDK_INT; |
45 | 46 | import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; |
@@ -201,11 +202,11 @@ public synchronized void unbind(String action, ServiceConnection connection) { |
201 | 202 | public class Connection { |
202 | 203 | private final String actionString; |
203 | 204 | private final boolean requireMicrog; |
204 | | - private final Set<ServiceConnection> connectionForwards = new HashSet<ServiceConnection>(); |
205 | | - private boolean bound = false; |
206 | | - private boolean connected = false; |
207 | | - private IBinder binder; |
208 | | - private ComponentName component; |
| 205 | + private final Set<ServiceConnection> connectionForwards = Collections.newSetFromMap(new ConcurrentHashMap<>()); |
| 206 | + private volatile boolean bound = false; |
| 207 | + private volatile boolean connected = false; |
| 208 | + private volatile IBinder binder; |
| 209 | + private volatile ComponentName component; |
209 | 210 | private ServiceConnection serviceConnection = new ServiceConnection() { |
210 | 211 | @Override |
211 | 212 | public void onServiceConnected(ComponentName componentName, IBinder iBinder) { |
|
0 commit comments