Merge "Fix crash caused by toHex returning exception"
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java
index 59570bf..79cd867 100644
--- a/services/core/java/com/android/server/MountService.java
+++ b/services/core/java/com/android/server/MountService.java
@@ -2371,9 +2371,16 @@
final NativeDaemonEvent event;
try {
event = mConnector.execute("cryptfs", "getpw");
+ if ("-1".equals(event.getMessage())) {
+ // -1 equals no password
+ return null;
+ }
return fromHex(event.getMessage());
} catch (NativeDaemonConnectorException e) {
throw e.rethrowAsParcelableException();
+ } catch (IllegalArgumentException e) {
+ Slog.e(TAG, "Invalid response to getPassword");
+ return null;
}
}