Fix netd crash in checkUserNetworkAccessLocked()

SIGABRT happens when unprivileged applications call Network.bindSocket
with a local network (netId=99). Netd statically cast a LocalNetwork
object to PhysicalNetwork, call member function getPermission().
However, the function exists in PhysicalNetwork only.

This commit makes getPermission() as a pure virtual function in the
ancestor class and implements it in each subclass.

Bug: 255954808
Test: atest netdclient_root_test
Change-Id: Ibe1eabe6ff4dc4ee124b820d596bb16c3fe371b2
9 files changed
tree: ccf827805d79a1e127b97964129540aaceaaf7c9
  1. client/
  2. include/
  3. netutils_wrappers/
  4. server/
  5. tests/
  6. .editorconfig
  7. Android.bp
  8. NOTICE
  9. OWNERS
  10. PREUPLOAD.cfg
  11. TEST_MAPPING