netd: Accept NetId instead of interface name in DNS resolver commands.

Conflicts:
	DnsProxyListener.cpp
	NetworkController.cpp
	NetworkController.h

Change-Id: Ic82b73de6f50d39d56c5e1a32f5b1f3ebb80bb7d
diff --git a/NetworkController.h b/NetworkController.h
index d877fcc..f1c8fda 100644
--- a/NetworkController.h
+++ b/NetworkController.h
@@ -39,11 +39,6 @@
  */
 class NetworkController {
 public:
-    enum {
-        // For use with getNetwork().
-        PID_UNSPECIFIED = 0,
-    };
-
     static bool isNetIdValid(unsigned netId);
 
     NetworkController(PermissionsController* permissionsController,
@@ -52,16 +47,14 @@
     void clearNetworkPreference();
     unsigned getDefaultNetwork() const;
     bool setDefaultNetwork(unsigned netId);
-    void setNetworkForPid(int pid, unsigned netId);
     bool setNetworkForUidRange(int uid_start, int uid_end, unsigned netId, bool forward_dns);
     bool clearNetworkForUidRange(int uid_start, int uid_end, unsigned netId);
 
     // Order of preference: UID-specific, requested_netId, PID-specific, default.
     // Specify NETID_UNSET for requested_netId if the default network is preferred.
-    // Specify PID_UNSPECIFIED for pid to ignore PID-specific overrides.
     // for_dns indicates if we're querrying the netId for a DNS request.  This avoids sending DNS
     // requests to VPNs without DNS servers.
-    unsigned getNetwork(int uid, unsigned requested_netId, int pid, bool for_dns) const;
+    unsigned getNetwork(int uid, unsigned requested_netId, bool for_dns) const;
 
     unsigned getNetworkId(const char* interface);
 
@@ -101,11 +94,9 @@
 
     mutable android::RWLock mRWLock;
     std::list<UidEntry> mUidMap;
-    std::map<int, unsigned> mPidMap;
     unsigned mDefaultNetId;
 
     std::map<std::string, unsigned> mIfaceNetidMap;
-    unsigned mNextFreeNetId;
 
     PermissionsController* const mPermissionsController;
     RouteController* const mRouteController;