Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8c58f3d authored by Josh Stone's avatar Josh Stone
Browse files

MountService: Unmount secondary volumes more carefully

Use the same message handler for unmounting both the ASEC external-
storage path and any secondary paths like emmc.  This seems to help with
additional race conditions encountered on Inc.

Change-Id: Icca71756fa6721bd85da1f35b8b8c7fc7caa1eb1
parent c5f82673
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -1235,11 +1235,8 @@ class MountService extends IMountService.Stub
                // Override for isUsbMassStorageEnabled()
                setUmsEnabling(enable);
                UmsEnableCallBack umscb = new UmsEnableCallBack(path, method, true);
                if (isExternalStorage(path)) {
                    mHandler.sendMessage(mHandler.obtainMessage(H_UNMOUNT_PM_UPDATE, umscb));
                } else {
                    umscb.handleFinished();
                }
                int msg = isExternalStorage(path) ? H_UNMOUNT_PM_UPDATE : H_UNMOUNT_MS;
                mHandler.sendMessage(mHandler.obtainMessage(msg, umscb));
                // Clear override
                setUmsEnabling(false);
            }
@@ -1305,11 +1302,8 @@ class MountService extends IMountService.Stub
            return;
        }
        UnmountCallBack ucb = new UnmountCallBack(path, force);
        if (isExternalStorage(path)) {
            mHandler.sendMessage(mHandler.obtainMessage(H_UNMOUNT_PM_UPDATE, ucb));
        } else {
            ucb.handleFinished();
        }
        int msg = isExternalStorage(path) ? H_UNMOUNT_PM_UPDATE : H_UNMOUNT_MS;
        mHandler.sendMessage(mHandler.obtainMessage(msg, ucb));
    }

    public int formatVolume(String path) {