Tell each VM to flush their DNS cache.
bug:3095357
Change-Id: I93de24e3e5a7d8b94d55f4facfffc863a2b8c202
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 47efddb..174b6da 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -85,6 +85,7 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
+import java.net.InetAddress;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -585,6 +586,11 @@
TimeZone.setDefault(null);
}
+ public void clearDnsCache() {
+ // a non-standard API to get this to libcore
+ InetAddress.clearDnsCache();
+ }
+
public void processInBackground() {
mH.removeMessages(H.GC_WHEN_IDLE);
mH.sendMessage(mH.obtainMessage(H.GC_WHEN_IDLE));