You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove Arrays.asList from critical stubbing path in GenericMetadataSupport (#3610)
On Android, the implementation of `java.util.Arrays.ArrayList.toArray` has a
non-trivial implementation that ends up calling into `android.os.Process.myUid()`.
Consequently, attempting to stub static methods in `android.os.Process` with
`doReturn` will end up calling into `myUid()` before the stubbing completes,
triggering an infinite recursion.
To work around that, replace the `addAll(asList(...))` call with `Collections.addAll`.
As an added benefit this avoids an array copy.
This upstreams https://r.android.com/3500336.
0 commit comments