Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fake SDCARD

26 views
Skip to first unread message

pancake

unread,
May 24, 2013, 7:24:22 AM5/24/13
to dev...@lists.mozilla.org
I would like to test camera/gallery/media apps without depending on an
SDCARD, on Android faking the sdcard is as simple as:

mount -t tmpfs none /mnt/sdcard

But this doesn't seems to fool Gonk detection.

How can I tell 'vold' or 'b2g' to not require an SDCARD for that?

Thanks

Dave Hylands

unread,
May 24, 2013, 11:55:53 AM5/24/13
to pancake, dev...@lists.mozilla.org
There is a patch in bug 838038.

If you apply that patch, and change the 4 in "storage /data/storage 4" to an X, then this will add a new storage area. You'll need to manually create the /data/storage directory.

Dave Hylands
> _______________________________________________
> dev-b2g mailing list
> dev...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-b2g
>

Alfredos (fredy) Damkalis

unread,
May 24, 2013, 1:33:45 PM5/24/13
to dev...@lists.mozilla.org
"You are not authorized to access bug #838038."

Unfortunately is not accessible, probably for security reasons or
confidential partners data. :(

Dave Hylands

unread,
May 24, 2013, 1:44:41 PM5/24/13
to Alfredos (fredy) Damkalis, dev...@lists.mozilla.org
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.
0 new messages