Repeat proxy limit callbacks if we keep going above the limit.

When we hit the high watermark for number of live proxies in a process,
we call a callback with the offending UID. ActivityManagerService will
then kill all processes belonging to this UID. The proxy limit callback
is only "re-armed" when the number of proxies for that UID drops below a
certain value again. However, because the proxies beloging to the now
dead processes will only be removed when the GC next runs, and restarted
processes may start adding new proxies in the mean time, we may actually
never drop below the lower threshold again, and never fire the callback
again, despite an ever-increasing amount of proxies.

To prevent this, repeatedly fire the limit callback for every 1000
proxies that we go over the limit. This, in combination with a GC in the
framework, should make sure that we regularly kill and clean up these
processes.

Bug: 198340142
Test: Manual
Change-Id: I8d877d409863fdae9cffd43709b647d0c1edb440
2 files changed