summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/NetworkManagementService.java
diff options
context:
space:
mode:
authorMattias Falk <mattias.falk@sonyericsson.com>2011-08-23 14:15:13 +0200
committerRobert Greenwalt <rgreenwalt@google.com>2013-02-06 17:43:28 -0800
commit8b47b3601f82f299bb8c135af0639b72b67230e6 (patch)
tree4173efedd4513a3ed40d2314db9ab7946d9ae316 /services/java/com/android/server/NetworkManagementService.java
parent9c4012b31b0c09cb14689bd96a71aae42c8a00cd (diff)
Second pass tying into dns cache per interface
Set dns servers for secondary nets and attach the processes (pids) that are using the secondary nets to the secondary nets associated dns cache. bug:5465296 Change-Id: I1eaf92d5c6b81d287e9fb2763b3d972d9de34395
Diffstat (limited to 'services/java/com/android/server/NetworkManagementService.java')
-rw-r--r--services/java/com/android/server/NetworkManagementService.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 0a5459380372..2b0d8243a7ee 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -1468,6 +1468,32 @@ public class NetworkManagementService extends INetworkManagementService.Stub
}
@Override
+ public void setDnsInterfaceForPid(String iface, int pid) throws IllegalStateException {
+ mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
+ try {
+ String cmd = "resolver setifaceforpid " + iface + " " + pid;
+
+ mConnector.execute(cmd);
+ } catch (NativeDaemonConnectorException e) {
+ throw new IllegalStateException(
+ "Error communicating with native deamon to set interface for pid" + iface, e);
+ }
+ }
+
+ @Override
+ public void clearDnsInterfaceForPid(int pid) throws IllegalStateException {
+ mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
+ try {
+ String cmd = "resolver clearifaceforpid " + pid;
+
+ mConnector.execute(cmd);
+ } catch (NativeDaemonConnectorException e) {
+ throw new IllegalStateException(
+ "Error communicating with native deamon to clear interface for pid " + pid, e);
+ }
+ }
+
+ /** {@inheritDoc} */
public void monitor() {
if (mConnector != null) {
mConnector.monitor();