Merge "Remove dead obfuscatory code." into dalvik-dev
diff --git a/luni/src/main/java/java/io/File.java b/luni/src/main/java/java/io/File.java
index 2910f91..a53b3c1 100644
--- a/luni/src/main/java/java/io/File.java
+++ b/luni/src/main/java/java/io/File.java
@@ -311,6 +311,33 @@
     }
 
     /**
+     * Tests whether or not this process is allowed to execute this file.
+     * Note that this is a best-effort result; the only way to be certain is
+     * to actually attempt the operation.
+     *
+     * @return {@code true} if this file can be executed, {@code false} otherwise.
+     * @throws SecurityException
+     *             If a security manager exists and
+     *             SecurityManager.checkExec(java.lang.String) disallows read
+     *             permission to this file object
+     * @see java.lang.SecurityManager#checkExec(String)
+     *
+     * @since 1.6
+     * @hide
+     */
+    public boolean canExecute() {
+        if (path.length() == 0) {
+            return false;
+        }
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkExec(path); // Seems bogus, but this is what the RI does.
+        }
+        return canExecuteImpl(pathBytes);
+    }
+    private native boolean canExecuteImpl(byte[] filePath);
+
+    /**
      * Indicates whether the current context is allowed to read from this file.
      *
      * @return {@code true} if this file can be read, {@code false} otherwise.
@@ -326,10 +353,9 @@
         if (security != null) {
             security.checkRead(path);
         }
-        return isReadableImpl(pathBytes);
+        return canReadImpl(pathBytes);
     }
-
-    private native boolean isReadableImpl(byte[] filePath);
+    private native boolean canReadImpl(byte[] filePath);
 
     /**
      * Indicates whether the current context is allowed to write to this file.
@@ -348,10 +374,9 @@
         if (security != null) {
             security.checkWrite(path);
         }
-        return isWritableImpl(pathBytes);
+        return canWriteImpl(pathBytes);
     }
-
-    private native boolean isWritableImpl(byte[] filePath);
+    private native boolean canWriteImpl(byte[] filePath);
 
     /**
      * Returns the relative sort ordering of the paths for this file and the
@@ -756,7 +781,7 @@
      * Indicates if this file's pathname is absolute. Whether a pathname is
      * absolute is platform specific. On Android, absolute paths start with
      * the character '/'.
-     * 
+     *
      * @return {@code true} if this file's pathname is absolute, {@code false}
      *         otherwise.
      * @see #getPath
@@ -887,16 +912,38 @@
     private native boolean setLastModifiedImpl(byte[] path, long time);
 
     /**
-     * Marks this file or directory to be read-only as defined by the operating
-     * system.
+     * Equivalent to setWritable(false, false).
      *
-     * @return {@code true} if the operation is successful, {@code false}
-     *         otherwise.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies write
-     *             access to this file.
+     * @see #setWritable(boolean, boolean)
      */
     public boolean setReadOnly() {
+        return setWritable(false, false);
+    }
+
+    /**
+     * Manipulates the execute permissions for the abstract path designated by
+     * this file.
+     *
+     * @param executable
+     *            To allow execute permission if true, otherwise disallow
+     * @param ownerOnly
+     *            To manipulate execute permission only for owner if true,
+     *            otherwise for everyone. The manipulation will apply to
+     *            everyone regardless of this value if the underlying system
+     *            does not distinguish owner and other users.
+     * @return true if and only if the operation succeeded. If the user does not
+     *         have permission to change the access permissions of this abstract
+     *         pathname the operation will fail. If the underlying file system
+     *         does not support execute permission and the value of executable
+     *         is false, this operation will fail.
+     * @throws SecurityException -
+     *             If a security manager exists and
+     *             SecurityManager.checkWrite(java.lang.String) disallows write
+     *             permission to this file object
+     * @since 1.6
+     * @hide
+     */
+    public boolean setExecutable(boolean executable, boolean ownerOnly) {
         if (path.length() == 0) {
             return false;
         }
@@ -904,10 +951,141 @@
         if (security != null) {
             security.checkWrite(path);
         }
-        return setReadOnlyImpl(pathBytes);
+        return setExecutableImpl(pathBytes, executable, ownerOnly);
     }
 
-    private native boolean setReadOnlyImpl(byte[] path);
+    /**
+     * Equivalent to setExecutable(executable, true).
+     *
+     * @param executable
+     *            To allow execute permission if true, otherwise disallow
+     * @return true if and only if the operation succeeded. If the user does not
+     *         have permission to change the access permissions of this abstract
+     *         pathname the operation will fail. If the underlying file system
+     *         does not support execute permission and the value of executable
+     *         is false, this operation will fail.
+     * @throws SecurityException -
+     *             If a security manager exists and
+     *             SecurityManager.checkWrite(java.lang.String) disallows write
+     *             permission to this file object
+     * @since 1.6
+     * @hide
+     */
+    public boolean setExecutable(boolean executable) {
+        return setExecutable(executable, true);
+    }
+
+    private native boolean setExecutableImpl(byte[] path, boolean executable, boolean ownerOnly);
+
+    /**
+     * Manipulates the read permissions for the abstract path designated by this
+     * file.
+     *
+     * @param readable
+     *            To allow read permission if true, otherwise disallow
+     * @param ownerOnly
+     *            To manipulate read permission only for owner if true,
+     *            otherwise for everyone. The manipulation will apply to
+     *            everyone regardless of this value if the underlying system
+     *            does not distinguish owner and other users.
+     * @return true if and only if the operation succeeded. If the user does not
+     *         have permission to change the access permissions of this abstract
+     *         pathname the operation will fail. If the underlying file system
+     *         does not support read permission and the value of readable is
+     *         false, this operation will fail.
+     * @throws SecurityException -
+     *             If a security manager exists and
+     *             SecurityManager.checkWrite(java.lang.String) disallows write
+     *             permission to this file object
+     * @since 1.6
+     * @hide
+     */
+    public boolean setReadable(boolean readable, boolean ownerOnly) {
+        if (path.length() == 0) {
+            return false;
+        }
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkWrite(path);
+        }
+        return setReadableImpl(pathBytes, readable, ownerOnly);
+    }
+
+    /**
+     * Equivalent to setReadable(readable, true).
+     *
+     * @param readable
+     *            To allow read permission if true, otherwise disallow
+     * @return true if and only if the operation succeeded. If the user does not
+     *         have permission to change the access permissions of this abstract
+     *         pathname the operation will fail. If the underlying file system
+     *         does not support read permission and the value of readable is
+     *         false, this operation will fail.
+     * @throws SecurityException -
+     *             If a security manager exists and
+     *             SecurityManager.checkWrite(java.lang.String) disallows write
+     *             permission to this file object
+     * @since 1.6
+     * @hide
+     */
+    public boolean setReadable(boolean readable) {
+        return setReadable(readable, true);
+    }
+
+    private native boolean setReadableImpl(byte[] path, boolean readable, boolean ownerOnly);
+
+    /**
+     * Manipulates the write permissions for the abstract path designated by this
+     * file.
+     *
+     * @param writable
+     *            To allow write permission if true, otherwise disallow
+     * @param ownerOnly
+     *            To manipulate write permission only for owner if true,
+     *            otherwise for everyone. The manipulation will apply to
+     *            everyone regardless of this value if the underlying system
+     *            does not distinguish owner and other users.
+     * @return true if and only if the operation succeeded. If the user does not
+     *         have permission to change the access permissions of this abstract
+     *         pathname the operation will fail.
+     * @throws SecurityException -
+     *             If a security manager exists and
+     *             SecurityManager.checkWrite(java.lang.String) disallows write
+     *             permission to this file object
+     * @since 1.6
+     * @hide
+     */
+    public boolean setWritable(boolean writable, boolean ownerOnly) {
+        if (path.length() == 0) {
+            return false;
+        }
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkWrite(path);
+        }
+        return setWritableImpl(pathBytes, writable, ownerOnly);
+    }
+
+    /**
+     * Equivalent to setWritable(writable, true).
+     *
+     * @param writable
+     *            To allow write permission if true, otherwise disallow
+     * @return true if and only if the operation succeeded. If the user does not
+     *         have permission to change the access permissions of this abstract
+     *         pathname the operation will fail.
+     * @throws SecurityException -
+     *             If a security manager exists and
+     *             SecurityManager.checkWrite(java.lang.String) disallows write
+     *             permission to this file object
+     * @since 1.6
+     * @hide
+     */
+    public boolean setWritable(boolean writable) {
+        return setWritable(writable, true);
+    }
+
+    private native boolean setWritableImpl(byte[] path, boolean writable, boolean ownerOnly);
 
     /**
      * Returns the length of this file in bytes.
@@ -1308,7 +1486,10 @@
      * @return a URL for this file.
      * @throws java.net.MalformedURLException
      *             if the path cannot be transformed into a URL.
+     * @deprecated use {@link #toURI} and {@link java.net.URI#toURL} to get
+     * correct escaping of illegal characters.
      */
+    @Deprecated
     @SuppressWarnings("nls")
     public URL toURL() throws java.net.MalformedURLException {
         String name = getAbsoluteName();
@@ -1343,10 +1524,67 @@
         stream.writeChar(separatorChar);
     }
 
-    private void readObject(ObjectInputStream stream) throws IOException,
-            ClassNotFoundException {
+    private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
         stream.defaultReadObject();
         char inSeparator = stream.readChar();
         init(path.replace(inSeparator, separatorChar));
     }
+
+    /**
+     * Returns the total size in bytes of the partition containing this path.
+     * Returns 0 if this path does not exist.
+     *
+     * @since 1.6
+     * @hide
+     */
+    public long getTotalSpace() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkPermission(new RuntimePermission("getFileSystemAttributes"));
+        }
+        return getTotalSpaceImpl(pathBytes);
+    }
+    private native long getTotalSpaceImpl(byte[] filePath);
+
+    /**
+     * Returns the number of usable free bytes on the partition containing this path.
+     * Returns 0 if this path does not exist.
+     *
+     * <p>Note that this is likely to be an optimistic over-estimate and should not
+     * be taken as a guarantee your application can actually write this many bytes.
+     * On Android (and other Unix-based systems), this method returns the number of free bytes
+     * available to non-root users, regardless of whether you're actually running as root,
+     * and regardless of any quota or other restrictions that might apply to the user.
+     * (The {@code getFreeSpace} method returns the number of bytes potentially available to root.)
+     *
+     * @since 1.6
+     * @hide
+     */
+    public long getUsableSpace() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkPermission(new RuntimePermission("getFileSystemAttributes"));
+        }
+        return getUsableSpaceImpl(pathBytes);
+    }
+    private native long getUsableSpaceImpl(byte[] filePath);
+
+    /**
+     * Returns the number of free bytes on the partition containing this path.
+     * Returns 0 if this path does not exist.
+     *
+     * <p>Note that this is likely to be an optimistic over-estimate and should not
+     * be taken as a guarantee your application can actually write this many bytes.
+     *
+     * @since 1.6
+     * @hide
+     */
+    public long getFreeSpace() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkPermission(new RuntimePermission("getFileSystemAttributes"));
+        }
+        return getFreeSpaceImpl(pathBytes);
+    }
+    private native long getFreeSpaceImpl(byte[] filePath);
 }
diff --git a/luni/src/main/java/java/io/IOError.java b/luni/src/main/java/java/io/IOError.java
new file mode 100644
index 0000000..d47b93c
--- /dev/null
+++ b/luni/src/main/java/java/io/IOError.java
@@ -0,0 +1,38 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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 java.io;
+
+/**
+ * This error is thrown when a severe I/O error has happened.
+ * 
+ * @since 1.6
+ * @hide
+ */
+public class IOError extends Error {
+    private static final long serialVersionUID = 67100927991680413L;
+
+    /**
+     * Constructs a new instance with its cause filled in.
+     * 
+     * @param cause
+     *            The detail cause for the error.
+     */
+    public IOError(Throwable cause) {
+        super(cause);
+    }
+}
diff --git a/luni/src/main/java/java/io/IOException.java b/luni/src/main/java/java/io/IOException.java
index 24cea9f..fbd2048 100644
--- a/luni/src/main/java/java/io/IOException.java
+++ b/luni/src/main/java/java/io/IOException.java
@@ -37,11 +37,38 @@
     /**
      * Constructs a new {@code IOException} with its stack trace and detail
      * message filled in.
-     * 
+     *
      * @param detailMessage
      *            the detail message for this exception.
      */
     public IOException(String detailMessage) {
         super(detailMessage);
     }
+
+    /**
+     * Constructs a new instance of this class with detail message and cause
+     * filled in.
+     *
+     * @param message
+     *            The detail message for the exception.
+     * @param cause
+     *            The detail cause for the exception.
+     * @since 1.6
+     * @hide
+     */
+    public IOException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Constructs a new instance of this class with its detail cause filled in.
+     *
+     * @param cause
+     *            The detail cause for the exception.
+     * @since 1.6
+     * @hide
+     */
+    public IOException(Throwable cause) {
+        super(cause == null ? null : cause.toString(), cause);
+    }
 }
diff --git a/luni/src/main/native/java_io_File.cpp b/luni/src/main/native/java_io_File.cpp
index bd81361..586ebbe 100644
--- a/luni/src/main/native/java_io_File.cpp
+++ b/luni/src/main/native/java_io_File.cpp
@@ -21,16 +21,17 @@
 #include "ScopedByteArray.h"
 #include "ScopedFd.h"
 
-#include <string.h>
-#include <fcntl.h>
-#include <time.h>
-#include <utime.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <dirent.h>
 #include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/vfs.h>
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
+#include <utime.h>
 
 // BEGIN android-note: this file has been extensively rewritten to
 // remove fixed-length buffers, buffer overruns, duplication, and
@@ -105,12 +106,17 @@
     return (access(&path[0], F_OK) == 0);
 }
 
-static jboolean java_io_File_isReadableImpl(JNIEnv* env, jobject, jbyteArray pathBytes) {
+static jboolean java_io_File_canExecuteImpl(JNIEnv* env, jobject, jbyteArray pathBytes) {
+    ScopedByteArray path(env, pathBytes);
+    return (access(&path[0], X_OK) == 0);
+}
+
+static jboolean java_io_File_canReadImpl(JNIEnv* env, jobject, jbyteArray pathBytes) {
     ScopedByteArray path(env, pathBytes);
     return (access(&path[0], R_OK) == 0);
 }
 
-static jboolean java_io_File_isWritableImpl(JNIEnv* env, jobject recv, jbyteArray pathBytes) {
+static jboolean java_io_File_canWriteImpl(JNIEnv* env, jobject recv, jbyteArray pathBytes) {
     ScopedByteArray path(env, pathBytes);
     return (access(&path[0], W_OK) == 0);
 }
@@ -158,17 +164,59 @@
     return (utime(&path[0], &times) == 0);
 }
 
-static jboolean java_io_File_setReadOnlyImpl(JNIEnv* env, jobject recv, jbyteArray pathBytes) {
+static jboolean doChmod(JNIEnv* env, jbyteArray pathBytes, mode_t mask, bool set) {
     ScopedByteArray path(env, pathBytes);
-
     struct stat sb;
     if (stat(&path[0], &sb) == -1) {
         return JNI_FALSE;
     }
+    mode_t newMode = set ? (sb.st_mode | mask) : (sb.st_mode & ~mask);
+    return (chmod(&path[0], newMode) == 0);
+}
 
-    // Strictly, this is set-not-writable (i.e. we leave the execute
-    // bits untouched), but that's deliberate.
-    return (chmod(&path[0], sb.st_mode & ~0222) == 0);
+static jboolean java_io_File_setExecutableImpl(JNIEnv* env, jobject, jbyteArray pathBytes,
+        jboolean set, jboolean ownerOnly) {
+    return doChmod(env, pathBytes, ownerOnly ? S_IXUSR : (S_IXUSR | S_IXGRP | S_IXOTH), set);
+}
+
+static jboolean java_io_File_setReadableImpl(JNIEnv* env, jobject, jbyteArray pathBytes,
+        jboolean set, jboolean ownerOnly) {
+    return doChmod(env, pathBytes, ownerOnly ? S_IRUSR : (S_IRUSR | S_IRGRP | S_IROTH), set);
+}
+
+static jboolean java_io_File_setWritableImpl(JNIEnv* env, jobject, jbyteArray pathBytes,
+        jboolean set, jboolean ownerOnly) {
+    return doChmod(env, pathBytes, ownerOnly ? S_IWUSR : (S_IWUSR | S_IWGRP | S_IWOTH), set);
+}
+
+static bool doStatFs(JNIEnv* env, jbyteArray pathBytes, struct statfs& sb) {
+    ScopedByteArray path(env, pathBytes);
+    int rc = statfs(&path[0], &sb);
+    return (rc != -1);
+}
+
+static jlong java_io_File_getFreeSpace(JNIEnv* env, jobject, jbyteArray pathBytes) {
+    struct statfs sb;
+    if (!doStatFs(env, pathBytes, sb)) {
+        return 0;
+    }
+    return sb.f_bfree * sb.f_bsize; // free block count * block size in bytes.
+}
+
+static jlong java_io_File_getTotalSpace(JNIEnv* env, jobject, jbyteArray pathBytes) {
+    struct statfs sb;
+    if (!doStatFs(env, pathBytes, sb)) {
+        return 0;
+    }
+    return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes.
+}
+
+static jlong java_io_File_getUsableSpace(JNIEnv* env, jobject, jbyteArray pathBytes) {
+    struct statfs sb;
+    if (!doStatFs(env, pathBytes, sb)) {
+        return 0;
+    }
+    return sb.f_bavail * sb.f_bsize; // non-root free block count * block size in bytes.
 }
 
 // Iterates over the filenames in the given directory.
@@ -340,22 +388,28 @@
 
 static JNINativeMethod gMethods[] = {
     /* name, signature, funcPtr */
-    { "createNewFileImpl",  "([B)Z",  (void*) java_io_File_createNewFileImpl },
-    { "deleteImpl",         "([B)Z",  (void*) java_io_File_deleteImpl },
-    { "existsImpl",         "([B)Z",  (void*) java_io_File_existsImpl },
+    { "canExecuteImpl",     "([B)Z", (void*) java_io_File_canExecuteImpl },
+    { "canReadImpl",        "([B)Z", (void*) java_io_File_canReadImpl },
+    { "canWriteImpl",       "([B)Z", (void*) java_io_File_canWriteImpl },
+    { "createNewFileImpl",  "([B)Z", (void*) java_io_File_createNewFileImpl },
+    { "deleteImpl",         "([B)Z", (void*) java_io_File_deleteImpl },
+    { "existsImpl",         "([B)Z", (void*) java_io_File_existsImpl },
     { "getCanonImpl",       "([B)[B", (void*) java_io_File_getCanonImpl },
+    { "getFreeSpaceImpl",   "([B)J", (void*) java_io_File_getFreeSpace },
     { "getLinkImpl",        "([B)[B", (void*) java_io_File_getLinkImpl },
-    { "isDirectoryImpl",    "([B)Z",  (void*) java_io_File_isDirectoryImpl },
-    { "isFileImpl",         "([B)Z",  (void*) java_io_File_isFileImpl },
-    { "isReadableImpl",     "([B)Z",  (void*) java_io_File_isReadableImpl },
-    { "isWritableImpl",     "([B)Z",  (void*) java_io_File_isWritableImpl },
-    { "lastModifiedImpl",   "([B)J",  (void*) java_io_File_lastModifiedImpl },
-    { "lengthImpl",         "([B)J",  (void*) java_io_File_lengthImpl },
+    { "getTotalSpaceImpl",  "([B)J", (void*) java_io_File_getTotalSpace },
+    { "getUsableSpaceImpl", "([B)J", (void*) java_io_File_getUsableSpace },
+    { "isDirectoryImpl",    "([B)Z", (void*) java_io_File_isDirectoryImpl },
+    { "isFileImpl",         "([B)Z", (void*) java_io_File_isFileImpl },
+    { "lastModifiedImpl",   "([B)J", (void*) java_io_File_lastModifiedImpl },
+    { "lengthImpl",         "([B)J", (void*) java_io_File_lengthImpl },
     { "listImpl",           "([B)[Ljava/lang/String;", (void*) java_io_File_listImpl },
-    { "mkdirImpl",          "([B)Z",  (void*) java_io_File_mkdirImpl },
-    { "renameToImpl",       "([B[B)Z",(void*) java_io_File_renameToImpl },
+    { "mkdirImpl",          "([B)Z", (void*) java_io_File_mkdirImpl },
+    { "renameToImpl",       "([B[B)Z", (void*) java_io_File_renameToImpl },
+    { "setExecutableImpl",  "([BZZ)Z", (void*) java_io_File_setExecutableImpl },
+    { "setReadableImpl",    "([BZZ)Z", (void*) java_io_File_setReadableImpl },
+    { "setWritableImpl",    "([BZZ)Z", (void*) java_io_File_setWritableImpl },
     { "setLastModifiedImpl","([BJ)Z", (void*) java_io_File_setLastModifiedImpl },
-    { "setReadOnlyImpl",    "([B)Z",  (void*) java_io_File_setReadOnlyImpl },
 };
 int register_java_io_File(JNIEnv* env) {
     return jniRegisterNativeMethods(env, "java/io/File",
diff --git a/luni/src/test/java/java/io/FileTest.java b/luni/src/test/java/java/io/FileTest.java
index 0518c26..423b404 100644
--- a/luni/src/test/java/java/io/FileTest.java
+++ b/luni/src/test/java/java/io/FileTest.java
@@ -78,6 +78,7 @@
         // The behavior of the empty filename is an odd mixture.
         File f = new File("");
         // Mostly it behaves like an invalid path...
+        assertFalse(f.canExecute());
         assertFalse(f.canRead());
         assertFalse(f.canWrite());
         try {
@@ -107,7 +108,10 @@
         assertFalse(f.mkdirs());
         assertFalse(f.renameTo(f));
         assertFalse(f.setLastModified(123));
+        assertFalse(f.setExecutable(true));
         assertFalse(f.setReadOnly());
+        assertFalse(f.setReadable(true));
+        assertFalse(f.setWritable(true));
         // ...but sometimes it behaves like "user.dir".
         String cwd = System.getProperty("user.dir");
         assertEquals(new File(cwd), f.getAbsoluteFile());
diff --git a/tools/runner/expectations.txt b/tools/runner/expectations.txt
index 0ea91d0..b19cafe 100644
--- a/tools/runner/expectations.txt
+++ b/tools/runner/expectations.txt
@@ -18,16 +18,6 @@
 pattern .*Test failed: should get token \[, but get -1.*
 
 
-# These tests rely on Java 6 APIs
-test java.util.Arrays.Big
-result COMPILE_FAILED
-pattern .*cannot find symbol.*
-
-test java.util.Arrays.CopyMethods
-result COMPILE_FAILED
-pattern .*cannot find symbol.*
-
-
 # Dalvik doesn't include the "SunJCE" crypto provider
 test com.sun.crypto.provider.Cipher.AES.Test4513830
 result EXEC_FAILED
@@ -684,48 +674,6 @@
 pattern .*got java\.lang\.StringIndexOutOfBoundsException: null - FAILED.*
 
 
-# We don't expose Java 6 APIs
-test java.lang.String.Exceptions
-result COMPILE_FAILED
-pattern .*cannot find symbol.*new String.*
-
-test java.lang.String.Encodings
-result COMPILE_FAILED
-pattern .*cannot find symbol.*new String.*
-
-test java.io.File.GetXSpace
-result COMPILE_FAILED
-pattern .*cannot find symbol.*method getTotalSpace\(\).*
-
-test java.io.File.MaxPathLength
-result COMPILE_FAILED
-pattern .*cannot find symbol.*method getTotalSpace\(\).*
-
-test java.io.File.SetAccess (from File)
-result COMPILE_FAILED
-pattern .*method setWritable\(boolean,boolean\).*
-
-test java.io.PipedInputStream.Constructors
-result COMPILE_FAILED
-pattern .*constructor PipedInputStream\(int\).*
-
-test java.io.PipedReader.Constructors
-result COMPILE_FAILED
-pattern .*constructor PipedReader\(int\).*
-
-test java.io.File.SetAccess
-result COMPILE_FAILED
-pattern .*cannot find symbol.*method setWritable\(boolean,boolean\).*
-
-test java.io.PipedWriter.WriteAfterReaderClose
-result COMPILE_FAILED
-pattern .*cannot find symbol.*method clearError().*
-
-test java.io.PrintWriter.ClearErrorWriter
-result COMPILE_FAILED
-pattern .*cannot find symbol.*method clearError().*
-
-
 # A low-impact bug that we're ignoring: "Shared FileDescriptors get closed too early"
 #   http://code.google.com/p/android/issues/detail?id=5923
 test java.io.FileDescriptor.Finalize