diff options
| author | 2010-02-09 13:29:28 -0800 | |
|---|---|---|
| committer | 2010-02-09 13:29:28 -0800 | |
| commit | 1655e2859b575110c9197daa8cd67081d1b0d727 (patch) | |
| tree | 8238490ec06803d4d9cfee247af25544ddcb69a1 | |
| parent | cdc045dd6da3db8d4ba83560a1bbe27c2ef1e5b2 (diff) | |
| parent | 59443a673a736978361dc341f41ce4e9dae053a0 (diff) | |
Merge "MountService: Check for failure to unmount when enabling UMS and fix reversed logic"
| -rw-r--r-- | services/java/com/android/server/MountService.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java index 6de2effe388e..8d450337a13a 100644 --- a/services/java/com/android/server/MountService.java +++ b/services/java/com/android/server/MountService.java @@ -177,8 +177,12 @@ class MountService extends IMountService.Stub String vs = getVolumeState(path); if (enable && vs.equals(Environment.MEDIA_MOUNTED)) { mUmsEnabling = enable; // Override for isUsbMassStorageEnabled() - doUnmountVolume(path); + int rc = doUnmountVolume(path); mUmsEnabling = false; // Clear override + if (rc != StorageResultCode.OperationSucceeded) { + Log.e(TAG, String.format("Failed to unmount before enabling UMS (%d)", rc)); + return rc; + } } try { @@ -517,7 +521,7 @@ class MountService extends IMountService.Stub } private int doUnmountVolume(String path) { - if (getVolumeState(path).equals(Environment.MEDIA_MOUNTED)) { + if (!getVolumeState(path).equals(Environment.MEDIA_MOUNTED)) { return VoldResponseCode.OpFailedVolNotMounted; } |