Avoid crash in system server when mounting container
A race condition when mounting a container in PackageHelper may cause
the system_server to crash (uncaught exception). Calling methods are
prepared to handle null, so return null instead.
Change-Id: I852ee21a2d847e37d81c1b900c27ddf94ef24fcb
diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java
index e6e3e5f..4d934b6 100644
--- a/services/java/com/android/server/MountService.java
+++ b/services/java/com/android/server/MountService.java
@@ -1509,7 +1509,8 @@
} catch (NativeDaemonConnectorException e) {
int code = e.getCode();
if (code == VoldResponseCode.OpFailedStorageNotFound) {
- throw new IllegalArgumentException(String.format("Container '%s' not found", id));
+ Slog.i(TAG, String.format("Container '%s' not found", id));
+ return null;
} else {
throw new IllegalStateException(String.format("Unexpected response code %d", code));
}