Copy arguments from NetworkAgent registration early

These objects have a non-trivial lifetime, as they will be
stored while the NetworkMonitor (which lives in another
process) starts. Agents that live in the system server will
still have a reference to the passed arguments and might
want to keep and mutate them for their own purposes. To
avoid bad surprises, ConnectivityService should copy these
objects before the function returns.

This patch should not cause any additional copies, because
the copies that used to happen after the monitor has started
are now not necessary and are removed.

Bug: 238139913
Test: FrameworksNetTests
Change-Id: I1cdd14e7a247dc01a3d73f528c3f3d77bd103be5
1 file changed