Closed Bug 781978 Opened 12 years ago Closed 12 years ago

AutoMounter should initialize ums.mode to 0

Categories

(Firefox OS Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(blocking-basecamp:+)

RESOLVED FIXED
blocking-basecamp +

People

(Reporter: dhylands, Assigned: dhylands)

Details

Attachments

(1 file)

Currently, the AutoMounter is using a setting called ums.mode to control whether its enabled or not (ums.enabled is the setting controlled by the user).

ums.mode should be initialized to zero each time the AutoMounter starts (which is each time that B2G starts). The gaia/apps/system/js/storage.js file takes care of setting ums.mode appropriately to match the ume.enabled/lock-screen status.
Attachment #651066 - Flags: review?(anygregor)
blocking-basecamp: ? → +
Comment on attachment 651066 [details] [diff] [review]
Bug 781978 - Automounter should initialize ums.mode to zero

># HG changeset patch
># User Dave Hylands <dhylands@gmail.com>
>
>Bug 781978 - Automounter should initialize ums.mode to zero
>
>diff --git a/dom/system/gonk/AutoMounter.cpp b/dom/system/gonk/AutoMounter.cpp
>index 138633eb..c835744 100644
>--- a/dom/system/gonk/AutoMounter.cpp
>+++ b/dom/system/gonk/AutoMounter.cpp
>@@ -230,27 +230,40 @@ public:
>       mAutoVolume[volIndex]->UnregisterObserver(&mVolumeEventObserver);
>     }
>     Volume::UnregisterObserver(&mVolumeEventObserver);
>     VolumeManager::UnregisterStateObserver(&mVolumeManagerStateObserver);
>   }
> 
>   void UpdateState();
> 
>+  const char *ModeStr(int32_t aMode)
>+  {
>+    switch (aMode) {
>+      case AUTOMOUNTER_DISABLE:                 return "Disable";
>+      case AUTOMOUNTER_ENABLE:                  return "Enable";
>+      case AUTOMOUNTER_DISABLE_WHEN_UNPLUGGED:  return "DisableWhenUnplugged";
>+    }
>+    return "???";

Maybe Unknown or ErrorMode? ??? is not very informative.
Attachment #651066 - Flags: review?(anygregor) → review+
So the whole ModeStr is just a function used for debugging. You should never see ???. It means that something was added to the enum without adding the enum to the ModeStr function.

To me the ??? seems out of place (intended).
I decided to change it to "??? Unknown ???"
"
https://hg.mozilla.org/mozilla-central/rev/2076b10db1df
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: