Ensure getAllDownloadStates order is stable
HashMap.values does not guarantee a stable order, but our tests assert that the order is stable. It's probably a nice property that the order is the same as that in which downloads are added, so this change makes the order stable, with that order. A future change will likely improve the way this works, by changing the internal thread "downloads" variable to have type ArrayList<Download>, at which point the internal thread can just pass a read-only copy of its list to the main thread whenever a state changes. PiperOrigin-RevId: 242460725
Showing
with
21 additions
and
10 deletions
Please
register
or
sign in
to comment