Permalink
Browse files

Fix OldAndroidZipStressTest for user builds

The test was trying to create ZipFile instances with ODEX files and
failing so add a FileNameFilter that only returns APK files.

Bug 6721995

Change-Id: Ifadcb993d37f7f08e4864c5ce5e8dc4ed7d439fb
  • Loading branch information...
Brian Muramatsu
Brian Muramatsu committed Jun 24, 2012
1 parent 1982194 commit 5e60f2b0a2d9bb5a069fbe5e898fff8520936977
Showing with 6 additions and 1 deletion.
  1. +6 −1 luni/src/test/java/libcore/java/util/zip/OldAndroidZipStressTest.java
@@ -17,6 +17,7 @@
package libcore.java.util.zip;
import java.io.File;
+import java.io.FilenameFilter;
import java.io.InputStream;
import java.security.cert.Certificate;
import java.util.Arrays;
@@ -58,7 +59,11 @@ public void checkJarCertificates(File file) throws Exception {
}
private File[] getFiles() {
- File[] result = new File("/system/app").listFiles();
+ File[] result = new File("/system/app").listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".apk");
+ }
+ });
return result != null ? result : new File[0];
}

0 comments on commit 5e60f2b

Please sign in to comment.