mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 765498 - Device Storage - Gaia - ensure /sdcard is backed by a file system. r=dhylands
--HG-- extra : rebase_source : c36eaa86566f7b7bd6eeefbcbc0622ec99a33816
This commit is contained in:
parent
9ec92252b8
commit
e1404f76ef
@ -25,6 +25,10 @@
|
||||
// Microsoft's API Name hackery sucks
|
||||
#undef CreateEvent
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
#include "nsIVolumeService.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::dom::devicestorage;
|
||||
|
||||
@ -270,15 +274,26 @@ nsDOMDeviceStorage::SetRootFileForType(const nsAString& aType, const PRInt32 aIn
|
||||
NS_ASSERTION(dirService, "Must have directory service");
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
// check that /sdcard exists, if it doesn't go no further.
|
||||
NS_NewLocalFile(NS_LITERAL_STRING("/sdcard"), false, getter_AddRefs(f));
|
||||
bool check = false;
|
||||
f->Exists(&check);
|
||||
if (!check) {
|
||||
mFile = nsnull;
|
||||
mFile = nsnull;
|
||||
|
||||
nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID);
|
||||
if (!vs) {
|
||||
return typeResult;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIVolume> v;
|
||||
vs->GetVolumeByPath(NS_LITERAL_STRING("/sdcard"), getter_AddRefs(v));
|
||||
|
||||
if (!v) {
|
||||
return typeResult;
|
||||
}
|
||||
|
||||
PRInt32 state;
|
||||
v->GetState(&state);
|
||||
|
||||
if (state != nsIVolume::STATE_MOUNTED) {
|
||||
return typeResult;
|
||||
}
|
||||
f = nsnull;
|
||||
#endif
|
||||
|
||||
// Picture directory
|
||||
|
Loading…
Reference in New Issue
Block a user