Reimplement inferRestrictedCapability without new exposed API

Method inferRestrictedCapability() was moved from frameworks/base
to libs/net and it is using an API NetworkCapabilities.getCapabilities()
which is a new exposed API in S. However, the change of moving the
method will downstream to the branches without the new exposed API.
Thus, reimplement this method without new exposed API.

Ignore-AOSP-First: code conflict
Bug: 178777253
Bug: 130869457
Test: NetworkStaticLibTests
Change-Id: Ib88fe2b831e968513f221443ed62a09c02150882
1 file changed
tree: 29fe61bcffdb9d600b2dd293c6c4a120f9599fff
  1. staticlibs/