Closed Bug 921105 Opened 11 years ago Closed 10 years ago

[Devices][User Story] Storage management: SD card formatting, mount and unmount.

Categories

(Firefox OS Graveyard :: General, defect)

x86
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
1.3 Sprint 6 - 12/6

People

(Reporter: bhuang, Unassigned)

References

Details

(Whiteboard: [ucid:Device4, 1.3:p2, ft:devices])

Attachments

(2 files, 8 obsolete files)

User story:
As a user, I want to be able to clear the contents of an inserted SD card and format it so it can be used in the device.
Depends on: 841660
Whiteboard: [1.3:p2]
Attached file SD_Card_131030.pdf (obsolete) —
Hi everyone, This is initial version of SD card. Please check.
Hi Eric, 
Fang said this question may need your help. So can you help to provide SD card icon for SW engineer ?
Attached image icon_sdcard.png (obsolete) —
Here is the SD card icon for it.
Hi Neo,

I have a question about format SDCard while some app are using it. For example, a user is playing music, then the user leave Music app and launch Settings app. The user is able to format SDCard while music is playing in the background. What the expected result do we need to handle? Many apps might meet the problem while they're accessing SDCard in the background. These apps will need to handle the scenario. Thanks.
Flags: needinfo?(nhsieh)
I'd expect this to be handled in a similar fashion to sharing with the PC.

We should cause the status through device storage to change early, which gives the apps a chance to close all of their files, but we don't actually initiate sharing while there are any files open.

The flow for sharing is as follows:

1 - User enables sharing (and cable is plugged in, etc)
2 - AutoMounter detects setting change and conditions are right
3 - AutoMounter calls vol->SetIsSharing
4 - AutoMounter checks for open files and doesn't share if any files are open
5 - AutoMounter sets up a timer to retry shortly

The call to SetIsSharing get rippled up from the Volume through to nsVolume, and the nsVolumeService::UpdateVolume detects that the IsSharing state changed, so it sends out NS_VOLUME_STATE_CHANGED to any listeners.

nsDOMDeviceStorage::Observe gets the NS_VOLUME_STATE_CHANGED notification and calls DeviceStorageFile::GetStatus, which detects that vol->IsSharing is set and changes the status to sharing (even though the volume state is still showing as mounted), so it reports the status to gallery etc as sharing.

Since the app (i.e. gallery) has been told that the vol status is now sharing, it will close all of its files.

The timer setup in the AutoMounter will fire and detects that the files are all closed, so it goes ahead and initates the unmount/share.

For Formatting, we should add a Volume::SetIsFormatting and device storage should probably report the status as unavailable rather than sharing (unavailable will cause the DB to be wiped and a rescan - which is what we want for a format).

nsVolume::Set and nsVolume::Equals both need to be updated to know about the new mIsFormatting (so that mIsFormatting gets propogated from the Volume class to the nsVolume class and so that its considered to be state change.
Hi Ian,
I think we can interrupt all SD card related Apps process when system pop up the double confirm window. I will assume if users enter this kind of level in settings and double confirm the format action means users already know this is "format". So we don't need let user confirm to stop all background Apps. (All Apps means even one unknown task is writting some logs into SD card.) 
Is that make sense to you?
Flags: needinfo?(nhsieh)
(In reply to Neo Hsieh from comment #6)
> Hi Ian,
> I think we can interrupt all SD card related Apps process when system pop up
> the double confirm window. I will assume if users enter this kind of level
> in settings and double confirm the format action means users already know
> this is "format". So we don't need let user confirm to stop all background
> Apps. (All Apps means even one unknown task is writting some logs into SD
> card.) 
> Is that make sense to you?

I just want to stress that it isn't acceptable to unmount the sdcard while there are open files.
ni? ahuang for comment 7
Flags: needinfo?(ahuang)
Target Milestone: --- → 1.3 Sprint 6 - 12/6
Whiteboard: [1.3:p2] → [UCID:Device4, 1.3:p2, FT:devices]
(In reply to Dave Hylands [:dhylands] from comment #7)
> I just want to stress that it isn't acceptable to unmount the sdcard while
> there are open files.

(In reply to Joe Cheng [:jcheng] from comment #8)
> ni? ahuang for comment 7

Yeah, I'm considering this as what we did on usb mass storage case, in bug 841661
Flags: needinfo?(ahuang)
Attached file SD_Card_131125.pdf (obsolete) —
Hi All, I updated UX document for fix some buttons style.
Neo, thanks for your update quickly.
Attached file SD_Card_131127.pdf (obsolete) —
Update whiteboard tag to follow format [ucid:{id}, {release}:p{1,2}, ft:{team-id}]
Whiteboard: [UCID:Device4, 1.3:p2, FT:devices] → [ucid:Device4, 1.3:p2, ft:devices]
Blocks: 1.4-devices
Attached file SD_Card_131219.pdf (obsolete) —
Please check new UX document for support multi-partition situation
Flags: needinfo?(iliu)
That is clear for me. Thanks.:)
Flags: needinfo?(iliu)
Note: 

The latest spec. is located at https://bugzilla.mozilla.org/show_bug.cgi?id=929860#c16 . Since there is an integrated flow for storage management, format and mount/unmount, it's better to rename the summary.
Summary: [Devices][User Story] SD card formatting → [Devices][User Story] Storage management: SD card formatting, mount and unmount.
Note:

Since Bug 841660 and Bug 929860 are landed, it's ready to format SD Card now.
The integrated flow is blocked via bug 945642(mount/unmount flow).
Depends on: 945642
Depends on: 971612
Hi Omega,

I just go through Storage Management spec again. I have some confused in page 7(flow 3) and 8(flow 3).

In p7, flow 3, after a user unmount SD card, we will see "Mount SD card" button in the menu. It also means that a user is not able to format the unmounted SD card.(Unmount button enabled, Format button disabled)

In p8, flow 3, after inserted an unformatted or un-readable format SD card. It's available to format it. There is a "Format SD card" button in the menu.(Unmount button disabled, Format button enabled)

In fact the two scenario, SD card is in unmounted status. But their definition is different. Somehow, the flow is making me confused that one is able to unmount/format. The other is not. Per offline discussion with Alan, we are able to format SD card in unmounted state. Shall we need to disable format and mount button in this case? Thanks.
Flags: needinfo?(ofeng)
Attached file SD_Card_140307.pdf (obsolete) —
Here is the updated spec modified by the discussion.
Attachment #824544 - Attachment is obsolete: true
Attachment #8337647 - Attachment is obsolete: true
Attachment #8339084 - Attachment is obsolete: true
Attachment #8349813 - Attachment is obsolete: true
Flags: needinfo?(ofeng)
Attached file SD_Card_140310.pdf (obsolete) —
Here is the updated spec modified by the discussion.
Attachment #8387448 - Attachment is obsolete: true
Attached file SD_Card_140311.pdf (obsolete) —
Here is the updated spec modified by the discussion.
Attachment #8388348 - Attachment is obsolete: true
Hello, please see attached for the latest spec for SD card. Thanks!
Attachment #8389083 - Attachment is obsolete: true
Updated SD card icons for Notifications, all the sizes icons are in the zip file.
Attachment #825060 - Attachment is obsolete: true
The work is done in bug 945642 and bug 908916.
Status: NEW → RESOLVED
Closed: 10 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: