Adjust overflow protection
Add a total limit for number of stats entries in stats map.
TrafficController will stop tagging sockets when the total limit is hit
to prevent losing per uid stats. After the stats map have more stats
entries then the limit in total, TrafficController will block all new
tagging requests and return -EMFILE until the map is cleaned up. Also
add some unit tests to verify this behavior.
Bug: 126620214
Test: TrafficControllerTest
Change-Id: Iff3ca09b58e9aee640d879ebdceb017b7e239cbc
Merged-In: Iff3ca09b58e9aee640d879ebdceb017b7e239cbc
(cherry picked from commit 82075e528f1c651601c974ff913ff8d1cd5a77d3)
3 files changed