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
1 file changed