mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 792506 - AutoMounter should not allow UMS to be disabled while USB cable is plugged in. r=qDot
This commit is contained in:
parent
be1841aacd
commit
61960aa498
@ -253,6 +253,21 @@ public:
|
||||
// AUTOMOUNTER_DISABLE_WHEN_UNPLUGGED implies "enabled until unplugged"
|
||||
aMode = AUTOMOUNTER_DISABLE;
|
||||
}
|
||||
|
||||
if ((aMode == AUTOMOUNTER_DISABLE) &&
|
||||
(mMode == AUTOMOUNTER_ENABLE) && IsUsbCablePluggedIn()) {
|
||||
// On many devices (esp non-Samsung), we can't force the disable, so we
|
||||
// need to defer until the USB cable is actually unplugged.
|
||||
// See bug 777043.
|
||||
//
|
||||
// Otherwise our attempt to disable it will fail, and we'll wind up in a bad
|
||||
// state where the AutoMounter thinks that Sharing has been turned off, but
|
||||
// the files are actually still being Shared because the attempt to unshare
|
||||
// failed.
|
||||
LOG("Attempting to disable UMS. Deferring until USB cable is unplugged.");
|
||||
aMode = AUTOMOUNTER_DISABLE_WHEN_UNPLUGGED;
|
||||
}
|
||||
|
||||
if (aMode != mMode) {
|
||||
LOG("Changing mode from '%s' to '%s'", ModeStr(mMode), ModeStr(aMode));
|
||||
mMode = aMode;
|
||||
|
Loading…
Reference in New Issue
Block a user