Remove UidStateCallbackInfo when uid is gone

A bug was introduced by recent changes to filter out redundant process
state changes.
NPMS was caching UidStateCallbackInfo objects per uid and not clearing
it or resetting the procStateSeq when the uid went away. This resulted
in state-changes not being processed after app restarts.

For example, if an app exited from TOP, it would lose network access due
to some rules, but the last UidStateCallbackInfo would stay at TOP. If
the same app restarted, the change would be filtered out as
uninteresting even though the network rules require an update.

Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest

Bug: 326370901
Bug: 326675380
Change-Id: I016435abcfd5300f33374e5d5c144b25f81728b4
2 files changed