NETMGR: Use HIDL to talk to netd

Latest versions now will have access to netd pid file restricted to
vendor components. Due to this, netmgrd will no longer be able to
detect netd restart and could hence go out of sync leading to
incorrect installation and flushing of rules and routes.

By introducing a netd HAL, netmgrd is able to talk to netd via a
HIDL. The 1.0 version of the HAL only publishes a service for this
particular usecase. Going forward this could be used to add support
for executing ndc commands, iptables and other system calls.

Fixes these denials -

audit(1502214635.963:60): avc: denied { call } for pid=1467
comm="netmgrd" scontext=u:r:netmgrd:s0 tcontext=u:r:netd:s0
tclass=binder permissive=1
E SELinux : avc:  denied  { find } for
interface=android.system.net.netd::INetd pid=1480
scontext=u:r:netmgrd:s0
tcontext=u:object_r:system_net_netd_hwservice:s0
tclass=hwservice_manager permissive=0

CRs-Fixed: 2066870
Change-Id: Iedc97746964381b9673dc3b7c09e1d80d6efa551
1 file changed