diff options
author | Lukacs Berki <lberki@google.com> | 2015-07-28 12:44:21 +0000 |
---|---|---|
committer | Lukacs Berki <lberki@google.com> | 2015-07-29 15:58:51 +0000 |
commit | f285a18f20eb4a5209b56dd9887c7c36ee57aa1d (patch) | |
tree | b85cd260fffde352f9649bcd397630b50986ef74 /src/tools/android/java/com/google/devtools/build/android/incrementaldeployment | |
parent | e6a2ebc876e9d8c23442fb8e9b037aec93ca538f (diff) |
Fix fallout from []: it broke "blaze mobile-install" when no --native_lib arguments were passed to the install script.
--
MOS_MIGRATED_REVID=99271033
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/incrementaldeployment')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/incrementaldeployment/StubApplication.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment/StubApplication.java b/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment/StubApplication.java index 6ddcd1b3da..223da8442e 100644 --- a/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment/StubApplication.java +++ b/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment/StubApplication.java @@ -328,10 +328,11 @@ public class StubApplication extends Application { File newManifestFile = new File(nativeLibDir, "native_manifest"); File incrementalDir = new File("/data/data/" + packageName + "/incrementallib"); File installedManifestFile = new File(incrementalDir, "manifest"); + String defaultNativeLibDir = "/data/data/" + packageName + "/lib"; if (!newManifestFile.exists()) { // Native libraries are not installed incrementally. Just use the regular directory. - return "/data/data/" + packageName + "/lib"; + return defaultNativeLibDir; } Map<String, String> newManifest = parseManifest(newManifestFile); @@ -339,6 +340,9 @@ public class StubApplication extends Application { Set<String> libsToDelete = new HashSet<String>(); Set<String> libsToUpdate = new HashSet<String>(); + String realNativeLibDir = newManifest.isEmpty() + ? defaultNativeLibDir : incrementalDir.toString(); + if (!incrementalDir.exists()) { if (!incrementalDir.mkdirs()) { throw new IOException("Could not mkdir " + incrementalDir); @@ -370,7 +374,7 @@ public class StubApplication extends Application { if (libsToDelete.isEmpty() && libsToUpdate.isEmpty()) { // Nothing to be done. Be lazy. - return incrementalDir.toString(); + return realNativeLibDir; } // Delete the installed manifest file. If anything below goes wrong, everything will be @@ -398,7 +402,8 @@ public class StubApplication extends Application { // time we get here we can start with a clean slate. installedManifestFile.delete(); } - return incrementalDir.toString(); + + return realNativeLibDir; } private static Map<String, String> parseManifest(File file) throws IOException { |