OSDN Git Service

Clean up permissions when uids are no longer used
authorChenbo Feng <fengc@google.com>
Tue, 26 Mar 2019 01:13:34 +0000 (18:13 -0700)
committerChenbo Feng <fengc@google.com>
Wed, 3 Apr 2019 03:31:57 +0000 (20:31 -0700)
commita6817cd532d7036a2ec794f124368de94bf18621
tree537af77cf47f1875677ddbc11c1f7d31750a1227
parent436fe58cce87934a88a6e3c6d7d16e19f69a4200
Clean up permissions when uids are no longer used

The kernel eBPF maps have a blacklist to store all the uids that doesn't
have internet permission. When an app is unintalled from the device and
it is the last package on device that uses that uid, make sure we
cleaned the uid from the map and do not add no longer used uids into the
eBPF map. This action helps reduce the number of entries stored in the
map and reduce the chance of overflow the eBPF map.

Bug: 128944261
Test: PermissionMonitorTest
Change-Id: I10dd0113d00d6cf9ca39902d9721f2591d387d4a
services/core/java/com/android/server/connectivity/PermissionMonitor.java
tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java