Skip to content

Commit

Permalink
Synchronize list access for bound/unbound services
Browse files Browse the repository at this point in the history
bindService/unbindService may be called from any thread, so modifications
to these lists should be synchronized.

PiperOrigin-RevId: 233823898
  • Loading branch information
Googler authored and copybara-robolectric committed Feb 13, 2019
1 parent dd1d408 commit 35098f6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ public class ShadowInstrumentation {
private List<Intent.FilterComparison> startedServices = new ArrayList<>();
private List<Intent.FilterComparison> stoppedServices = new ArrayList<>();
private List<Intent> broadcastIntents = new ArrayList<>();
private List<ServiceConnection> boundServiceConnections = new ArrayList<>();
private List<ServiceConnection> unboundServiceConnections = new ArrayList<>();
private List<ServiceConnection> boundServiceConnections =
Collections.synchronizedList(new ArrayList<>());
private List<ServiceConnection> unboundServiceConnections =
Collections.synchronizedList(new ArrayList<>());
private List<Wrapper> registeredReceivers = new ArrayList<>();
// map of pid+uid to granted permissions
private final Map<Pair<Integer, Integer>, Set<String>> grantedPermissionsMap = new HashMap<>();
Expand Down

0 comments on commit 35098f6

Please sign in to comment.