Add an RPC to replace a UID firewall rule.

Also add a binder_test that exercises binder RPCs to the real
netd service running on the device

Bug: 21725996
Bug: 27239233
Change-Id: Ic83d81605021a0578d6cd32f889290be61d76125
diff --git a/server/FirewallController.h b/server/FirewallController.h
index d3ef777..e96f185 100644
--- a/server/FirewallController.h
+++ b/server/FirewallController.h
@@ -18,6 +18,7 @@
 #define _FIREWALL_CONTROLLER_H
 
 #include <string>
+#include <vector>
 
 #include <utils/RWLock.h>
 
@@ -62,6 +63,8 @@
 
     int enableChildChains(ChildChain, bool);
 
+    int replaceUidChain(const char*, bool, const std::vector<int32_t>&);
+
     static const char* TABLE;
 
     static const char* LOCAL_INPUT;
@@ -75,6 +78,10 @@
 
     android::RWLock lock;
 
+protected:
+    friend class FirewallControllerTest;
+    std::string makeUidRules(const char *name, bool isWhitelist, const std::vector<int32_t>& uids);
+
 private:
     FirewallType mFirewallType;
     int attachChain(const char*, const char*);