Chromium Code Reviews| Index: build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java | 
| diff --git a/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java b/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java | 
| index c1682e81e049ebda1ab784f4b628f5c96a803b75..cd79259632a92c8d1aa447cec4da8dd85ef63e54 100644 | 
| --- a/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java | 
| +++ b/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java | 
| @@ -103,6 +103,10 @@ final class ClassLoaderPatcher { | 
| */ | 
| void importNativeLibs(File libDir) throws ReflectiveOperationException, IOException { | 
| Log.i(TAG, "Importing native libraries from: " + libDir); | 
| + if (!libDir.exists()) { | 
| + Log.i(TAG, "No native libs exist."); | 
| + return; | 
| + } | 
| // The library copying is not necessary on older devices, but we do it anyways to | 
| // simplify things (it's fast compared to dexing). | 
| // https://code.google.com/p/android/issues/detail?id=79480 | 
| @@ -169,14 +173,20 @@ final class ClassLoaderPatcher { | 
| private static void copyChangedFiles(File srcDir, File dstDir) throws IOException { | 
| // No need to delete stale libs since libraries are loaded explicitly. | 
| + int numNotChanged = 0; | 
| for (File f : srcDir.listFiles()) { | 
| // Note: Tried using hardlinks, but resulted in EACCES exceptions. | 
| File dest = new File(dstDir, f.getName()); | 
| - copyIfModified(f, dest); | 
| + if (!copyIfModified(f, dest)) { | 
| + numNotChanged++; | 
| + } | 
| + } | 
| + if (numNotChanged > 0) { | 
| + Log.i(TAG, numNotChanged + " libs already up-to-date."); | 
| } | 
| } | 
| - private static void copyIfModified(File src, File dest) throws IOException { | 
| + private static boolean copyIfModified(File src, File dest) throws IOException { | 
| 
 
nyquist
2016/02/10 07:08:32
Optional nit: Add a super-tiny comment as to what
 
agrieve
2016/02/10 16:47:15
Electing not to since it's private and is clear fr
 
 | 
| long lastModified = src.lastModified(); | 
| if (!dest.exists() || dest.lastModified() != lastModified) { | 
| 
 
nyquist
2016/02/10 07:08:32
Optional nit: Would it be easier to read with some
 
agrieve
2016/02/10 16:47:15
Done.
 
 | 
| Log.i(TAG, "Copying " + src + " -> " + dest); | 
| @@ -188,9 +198,9 @@ final class ClassLoaderPatcher { | 
| dest.setReadable(true, false); | 
| dest.setExecutable(true, false); | 
| dest.setLastModified(lastModified); | 
| - } else { | 
| - Log.i(TAG, "Up-to-date: " + dest); | 
| + return true; | 
| } | 
| + return false; | 
| } | 
| private void ensureAppFilesSubDirExists() { |