Skip to content

Commit

Permalink
Merge pull request #118 from furkanvarol/fix_concurrent_modification
Browse files Browse the repository at this point in the history
fixed ConcurrentModificationException on BeaconManager
  • Loading branch information
davidgyoung committed Feb 12, 2015
2 parents a5b7ac4 + 70d6c6c commit 563992c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/org/altbeacon/beacon/BeaconManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -569,18 +569,17 @@ private String callbackPackageName() {
}

private ServiceConnection beaconServiceConnection = new ServiceConnection() {
// Called when the connection with the service is established
public void onServiceConnected(ComponentName className, IBinder service) {
// Called when the connection with the service is established
public void onServiceConnected(ComponentName className, IBinder service) {
LogManager.d(TAG, "we have a connection to the service now");
serviceMessenger = new Messenger(service);
serviceMessenger = new Messenger(service);
synchronized(consumers) {
for (BeaconConsumer consumer : consumers.keySet()) {
Boolean alreadyConnected = consumers.get(consumer).isConnected;
if (!alreadyConnected) {
consumer.onBeaconServiceConnect();
ConsumerInfo consumerInfo = consumers.get(consumer);
consumerInfo.isConnected = true;
consumers.put(consumer, consumerInfo);
}
}
}
Expand Down

0 comments on commit 563992c

Please sign in to comment.