}
@Override
+ public void setDnsIfaceForPid(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 clearDnsIfaceForPid(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();