[MS31] Fix several hidden API usages

This includes:
1. Replace UserHandle.getUid(userId, appId) with public API
2. Remove Preconditions.checkArgument
3. Replace MathUtil.constrain with the one in NetworkStatsUtils
4. Remove Sets
5. Replace NetworkStack.checkNetworkStackPermission with the
   one in the PermissionUtils
6. Replace internal CollectionUtils with the one in the module
7. Inline ProtoOutputStream(fd)
8. Replace Intent.EXTRA_USER_HANDLE with Intent.EXTRA_USER

Test: atest NetworkStatsSubscriptionsMonitorTest \
      NetworkStatsServiceTest
Bug: 204830222

Change-Id: If06a27b04ad15c29052b670eefc2f6dc0d199420
4 files changed
tree: 807a9948a35125d03d7614e3287f181ca759e98d
  1. core/
  2. framework/
  3. framework-t/
  4. service-t/
  5. services/
  6. tests/