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

RESOLVED FIXED in 1.3 Sprint 6 - 12/6

Status

Firefox OS
General
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: bhuang, Unassigned)

Tracking

(Blocks: 1 bug)

unspecified
1.3 Sprint 6 - 12/6
x86
Gonk (Firefox OS)
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(2 attachments, 8 obsolete attachments)

(Reporter)

Description

4 years ago
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
Depends on: 929860
Whiteboard: [1.3:p2]

Comment 1

4 years ago
Created attachment 824544 [details]
SD_Card_131030.pdf

Hi everyone, This is initial version of SD card. Please check.

Comment 2

4 years ago
Hi Eric, 
Fang said this question may need your help. So can you help to provide SD card icon for SW engineer ?

Comment 3

4 years ago
Created attachment 825060 [details]
icon_sdcard.png

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.

Comment 6

4 years ago
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]

Comment 9

4 years ago
(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)

Comment 10

4 years ago
Created attachment 8337647 [details]
SD_Card_131125.pdf

Hi All, I updated UX document for fix some buttons style.
Neo, thanks for your update quickly.

Comment 12

4 years ago
Created attachment 8339084 [details]
SD_Card_131127.pdf

Comment 13

4 years ago
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]
(Reporter)

Updated

4 years ago
Blocks: 945623
Blocks: 949302
No longer blocks: 945623

Comment 14

4 years ago
Created attachment 8349813 [details]
SD_Card_131219.pdf

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

Updated

4 years ago
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)
Created attachment 8387448 [details]
SD_Card_140307.pdf

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)
Created attachment 8388348 [details]
SD_Card_140310.pdf

Here is the updated spec modified by the discussion.
Attachment #8387448 - Attachment is obsolete: true
Created attachment 8389083 [details]
SD_Card_140311.pdf

Here is the updated spec modified by the discussion.
Attachment #8388348 - Attachment is obsolete: true

Comment 23

3 years ago
Created attachment 8451433 [details]
[2.1 Settings] MTP_SD card v1.0.pdf

Hello, please see attached for the latest spec for SD card. Thanks!

Updated

3 years ago
Attachment #8389083 - Attachment is obsolete: true
Created attachment 8472140 [details]
icons for notification.zip

Updated SD card icons for Notifications, all the sizes icons are in the zip file.
Attachment #825060 - Attachment is obsolete: true

Comment 25

3 years ago
The work is done in bug 945642 and bug 908916.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.