During encryption, don't throw exceptions for unknown vold state

This is a temporary fix until we get something better.  During the
encryption process, vold does not respond to commands because it is
blocked doing the encryption.  Because it doesn't respond, this code
times out, sets the state to null, and thows an exception.  For now,
just don't throw an exception if the device is encrypting.

Change-Id: I7e821ec2addd60475fb10834df533beccb2650fe
This commit is contained in:
Ken Sumrall
2011-07-14 11:35:06 -07:00
parent 28fa07e15f
commit 18db5c5690

View File

@@ -1339,7 +1339,11 @@ class MountService extends IMountService.Stub implements INativeDaemonConnectorC
String state = mVolumeStates.get(mountPoint);
if (state == null) {
Slog.w(TAG, "getVolumeState(" + mountPoint + "): Unknown volume");
throw new IllegalArgumentException();
if (SystemProperties.get("vold.encrypt_progress").length() != 0) {
state = Environment.MEDIA_REMOVED;
} else {
throw new IllegalArgumentException();
}
}
return state;