Currently, that's the only way to do it.

Once bug 865347 lands, then we'll be able to add arbitrary volumes through an 
API.

It would be pretty straight forward to convert the patch I hacked up into 
something that allow the volume name and location to be specified as a pref. We 
could tie this into bug 865347 in that it could use the same preferences to 
persist the volume information.

Dave Hylands

----- Original Message -----
> From: "Andreas Gal" <[email protected]>
> To: "pancake" <[email protected]>
> Cc: [email protected]
> Sent: Monday, May 27, 2013 8:35:44 PM
> Subject: Re: [b2g] Fake SDCARD
> 
> 
> We definitely want a pref for this instead of the define.
> 
> Thanks,
> 
> Andreas
> 
> > pancake <mailto:[email protected]>
> > May 27, 2013 3:25 AM
> > There's no way to do this without recompiling? I was thinking an a
> > preference or system trick.
> >
> >
> >
> > _______________________________________________
> > dev-b2g mailing list
> > [email protected]
> > https://lists.mozilla.org/listinfo/dev-b2g
> > Dave Hylands <mailto:[email protected]>
> > May 24, 2013 10:44 AM
> > Sorry, The patch is fairly simple, so I'll just put it here:
> >
> > diff --git a/dom/system/gonk/VolumeManager.cpp
> > b/dom/system/gonk/VolumeManager.cpp
> > --- a/dom/system/gonk/VolumeManager.cpp
> > +++ b/dom/system/gonk/VolumeManager.cpp
> > @@ -288,16 +288,24 @@ VolumeManager::OnLineRead(int aFd, nsDep
> > if (responseCode >= ResponseCode::UnsolicitedInformational) {
> > // These are unsolicited broadcasts. We intercept these and process
> > // them ourselves
> > HandleBroadcast(responseCode, responseLine);
> > } else {
> > // Everything else is considered to be part of the command
> > response.
> > if (mCommands.size() > 0) {
> > VolumeCommand* cmd = mCommands.front();
> > +#if 1
> > + if ((responseCode >= ResponseCode::CommandOkay) &&
> > + (strcmp(cmd->CmdStr(), "volume list") == 0)) {
> > + nsDependentCString fakeResponseLine("storage /data/storage X");
> > + cmd->HandleResponse((int)ResponseCode::VolumeListResult,
> > + fakeResponseLine);
> > + }
> > +#endif
> > cmd->HandleResponse(responseCode, responseLine);
> > if (responseCode >= ResponseCode::CommandOkay) {
> > // That's a terminating response. We can remove the command.
> > mCommands.pop();
> > mCommandPending = false;
> > // Start the next command, if there is one.
> > WriteCommandData();
> > }
> >
> > For v1.1, it goes in the OnFileCanReadWithoutBlocking function, and
> > line 288 is around line 315 instead. The surrounding block of code
> > should be very similar.
> >
> > Dave Hylands
> >
> > ----- Original Message -----
> > _______________________________________________
> > dev-b2g mailing list
> > [email protected]
> > https://lists.mozilla.org/listinfo/dev-b2g
> _______________________________________________
> dev-b2g mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-b2g
> 
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to