Merge "Blacklist InetAddress.parseNumericAddress for Q"
diff --git a/luni/src/main/java/libcore/io/DropBox.java b/luni/src/main/java/libcore/io/DropBox.java
deleted file mode 100644
index a0d7ba4..0000000
--- a/luni/src/main/java/libcore/io/DropBox.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package libcore.io;
-
-import dalvik.annotation.compat.UnsupportedAppUsage;
-import java.util.Base64;
-
-/**
- * @hide
- */
-@libcore.api.CorePlatformApi
-public final class DropBox {
-
-    /**
-     * Hook for customizing how events are reported.
-     */
-    private static volatile Reporter REPORTER = new DefaultReporter();
-
-    private DropBox() {
-    }
-
-    /**
-     * Used to replace default Reporter for logging events. Must be non-null.
-     */
-    @libcore.api.CorePlatformApi
-    public static void setReporter(Reporter reporter) {
-        if (reporter == null) {
-            throw new NullPointerException("reporter == null");
-        }
-        REPORTER = reporter;
-    }
-
-    /**
-     * Returns non-null Reporter.
-     */
-    public static Reporter getReporter() {
-        return REPORTER;
-    }
-
-    /**
-     * Interface to allow customization of reporting behavior.
-     *
-     * @hide
-     */
-    @libcore.api.CorePlatformApi
-    public static interface Reporter {
-        @libcore.api.CorePlatformApi
-        public void addData(String tag, byte[] data, int flags);
-
-        @libcore.api.CorePlatformApi
-        public void addText(String tag, String data);
-    }
-
-    /**
-     * Default Reporter which reports events to the log.
-     */
-    private static final class DefaultReporter implements Reporter {
-
-        public void addData(String tag, byte[] data, int flags) {
-            System.out.println(tag + ": " + Base64.getEncoder().encodeToString(data));
-        }
-
-        public void addText(String tag, String data) {
-            System.out.println(tag + ": " + data);
-        }
-    }
-
-    public static void addData(String tag, byte[] data, int flags) {
-        getReporter().addData(tag, data, flags);
-    }
-
-    @UnsupportedAppUsage
-    public static void addText(String tag, String data) {
-        getReporter().addText(tag, data);
-    }
-}
diff --git a/luni/src/main/java/libcore/io/EventLogger.java b/luni/src/main/java/libcore/io/EventLogger.java
deleted file mode 100644
index 5cdc317..0000000
--- a/luni/src/main/java/libcore/io/EventLogger.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package libcore.io;
-
-/**
- * @hide
- */
-@libcore.api.CorePlatformApi
-public final class EventLogger {
-
-    /**
-     * Hook for customizing how events are reported.
-     */
-    private static volatile Reporter REPORTER = new DefaultReporter();
-
-    private EventLogger() {
-    }
-
-    /**
-     * Used to replace default Reporter for logging events. Must be non-null.
-     */
-    @libcore.api.CorePlatformApi
-    public static void setReporter(Reporter reporter) {
-        if (reporter == null) {
-            throw new NullPointerException("reporter == null");
-        }
-        REPORTER = reporter;
-    }
-
-    /**
-     * Returns non-null Reporter.
-     */
-    public static Reporter getReporter() {
-        return REPORTER;
-    }
-
-    /**
-     * Interface to allow customization of reporting behavior.
-     *
-     * @hide
-     */
-    @libcore.api.CorePlatformApi
-    public static interface Reporter {
-        @libcore.api.CorePlatformApi
-        public void report (int code, Object... list);
-    }
-
-    /**
-     * Default Reporter which reports events to the log.
-     */
-    private static final class DefaultReporter implements Reporter {
-        @Override
-        public void report (int code, Object... list) {
-            StringBuilder sb = new StringBuilder();
-            sb.append(code);
-            for (Object o : list) {
-                sb.append(",");
-                sb.append(o.toString());
-            }
-            System.out.println(sb);
-        }
-    }
-
-    public static void writeEvent(int code, Object... list) {
-        getReporter().report(code, list);
-    }
-}
diff --git a/mmodules/core_platform_api/api/platform/current-api.txt b/mmodules/core_platform_api/api/platform/current-api.txt
index 87af58f..7c045b5 100644
--- a/mmodules/core_platform_api/api/platform/current-api.txt
+++ b/mmodules/core_platform_api/api/platform/current-api.txt
@@ -1025,23 +1025,6 @@
 
 package libcore.io {
 
-  public final class DropBox {
-    method public static void setReporter(libcore.io.DropBox.Reporter);
-  }
-
-  public static abstract interface DropBox.Reporter {
-    method public abstract void addData(java.lang.String, byte[], int);
-    method public abstract void addText(java.lang.String, java.lang.String);
-  }
-
-  public final class EventLogger {
-    method public static void setReporter(libcore.io.EventLogger.Reporter);
-  }
-
-  public static abstract interface EventLogger.Reporter {
-    method public abstract void report(int, java.lang.Object...);
-  }
-
   public class ForwardingOs implements libcore.io.Os {
     ctor protected ForwardingOs(libcore.io.Os);
     method public boolean access(java.lang.String, int) throws android.system.ErrnoException;
diff --git a/non_openjdk_java_files.bp b/non_openjdk_java_files.bp
index caad7c6..f31bca0 100644
--- a/non_openjdk_java_files.bp
+++ b/non_openjdk_java_files.bp
@@ -168,8 +168,6 @@
         "luni/src/main/java/libcore/icu/RelativeDateTimeFormatter.java",
         "luni/src/main/java/libcore/icu/TimeZoneNames.java",
         "luni/src/main/java/libcore/internal/StringPool.java",
-        "luni/src/main/java/libcore/io/DropBox.java",
-        "luni/src/main/java/libcore/io/EventLogger.java",
         "luni/src/main/java/libcore/io/ForwardingOs.java",
         "luni/src/main/java/libcore/io/IoBridge.java",
         "luni/src/main/java/libcore/io/IoUtils.java",
diff --git a/ojluni/src/main/native/EPoll.c b/ojluni/src/main/native/EPoll.c
index ea9cdf4..207ef72 100644
--- a/ojluni/src/main/native/EPoll.c
+++ b/ojluni/src/main/native/EPoll.c
@@ -60,7 +60,9 @@
      * epoll_create expects a size as a hint to the kernel about how to
      * dimension internal structures. We can't predict the size in advance.
      */
-    int epfd = epoll_create(256);
+    // Android-changed: Avoid FD leaks through epoll_create. http://b/120983106
+    // int epfd = epoll_create(256);
+    int epfd = epoll_create1(EPOLL_CLOEXEC);
     if (epfd < 0) {
        JNU_ThrowIOExceptionWithLastError(env, "epoll_create failed");
     }