commit | dd5af60ace509ee06ecfe5f8abbbbaa394127798 | [log] [tgz] |
---|---|---|
author | Hai Zhang <zhanghai@google.com> | Sun Apr 18 05:24:02 2021 +0000 |
committer | Hai Zhang <zhanghai@google.com> | Sun Apr 18 05:25:02 2021 +0000 |
tree | 45a91e6dcb7900ed3b34e75d8b6be31c8c3909b6 | |
parent | e3cf6b24694e59a1b9bbf413324614020b67fe25 [diff] |
Fix ConcurrentModificationException in mocking tests. The result list of PackageManager should be new and mutable. However, the mocked PackageManager was returning the same instance, causing incorrect behavior and ConcurrentModificationException. So return new lists with doAnswer() instead. Bug: 152055112 Test: atest PermissionControllerMockingTests Change-Id: I4771597a47caa755d230f03ddae459c2ba5d42c1