From 8a4d57d6f70fa381c312a287ae6fe6e2996048cd Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Fri, 11 Jul 2014 14:42:15 -0700 Subject: [PATCH 01/23] Bug 1029533 - Initial standup of MTP server. r=echou Note: This will be off by default. Currently, you need to do: adb shell setprop sys.usb.config mtp,adb in order to activate the MTP server. --- configure.in | 4 +- dom/system/gonk/AutoMounter.cpp | 68 ++- dom/system/gonk/MozMtpCommon.h | 44 ++ dom/system/gonk/MozMtpDatabase.cpp | 792 +++++++++++++++++++++++++++++ dom/system/gonk/MozMtpDatabase.h | 161 ++++++ dom/system/gonk/MozMtpServer.cpp | 80 +++ dom/system/gonk/MozMtpServer.h | 32 ++ dom/system/gonk/moz.build | 4 + toolkit/library/libxul.mk | 1 + 9 files changed, 1170 insertions(+), 16 deletions(-) create mode 100644 dom/system/gonk/MozMtpCommon.h create mode 100644 dom/system/gonk/MozMtpDatabase.cpp create mode 100644 dom/system/gonk/MozMtpDatabase.h create mode 100644 dom/system/gonk/MozMtpServer.cpp create mode 100644 dom/system/gonk/MozMtpServer.h diff --git a/configure.in b/configure.in index d91d92e94d3..a5ef647eaaa 100644 --- a/configure.in +++ b/configure.in @@ -242,7 +242,7 @@ if test -n "$gonkdir" ; then MOZ_RTSP=1 ;; 17|18) - GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include" + GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include -I$gonkdir/frameworks/av/media/mtp" if test -d "$gonkdir/external/bluetooth/bluez"; then GONK_INCLUDES="$GONK_INCLUDES -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib" MOZ_B2G_BT=1 @@ -262,7 +262,7 @@ if test -n "$gonkdir" ; then AC_DEFINE(MOZ_OMX_ENCODER) ;; 19) - GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include" + GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include -I$gonkdir/frameworks/av/media/mtp" MOZ_B2G_CAMERA=1 MOZ_B2G_BT=1 MOZ_B2G_BT_BLUEDROID=1 diff --git a/dom/system/gonk/AutoMounter.cpp b/dom/system/gonk/AutoMounter.cpp index b0e5d7d10a4..4d7e7023bdc 100644 --- a/dom/system/gonk/AutoMounter.cpp +++ b/dom/system/gonk/AutoMounter.cpp @@ -25,6 +25,7 @@ #include "mozilla/FileUtils.h" #include "mozilla/Hal.h" #include "mozilla/StaticPtr.h" +#include "MozMtpServer.h" #include "nsAutoPtr.h" #include "nsMemory.h" #include "nsString.h" @@ -35,6 +36,7 @@ #include "VolumeManager.h" using namespace mozilla::hal; +USING_MTP_NAMESPACE /************************************************************************** * @@ -69,6 +71,7 @@ using namespace mozilla::hal; #define ICS_SYS_USB_FUNCTIONS "/sys/devices/virtual/android_usb/android0/functions" #define ICS_SYS_UMS_DIRECTORY "/sys/devices/virtual/android_usb/android0/f_mass_storage" +#define ICS_SYS_MTP_DIRECTORY "/sys/devices/virtual/android_usb/android0/f_mtp" #define ICS_SYS_USB_STATE "/sys/devices/virtual/android_usb/android0/state" #define USE_DEBUG 0 @@ -229,6 +232,9 @@ public: } } + void StartMtpServer(); + void StopMtpServer(); + void UpdateState(); const char* ModeStr(int32_t aMode) @@ -347,6 +353,7 @@ private: }; static StaticRefPtr sAutoMounter; +static StaticRefPtr sMozMtpServer; /***************************************************************************/ @@ -398,6 +405,25 @@ AutoMounterResponseCallback::ResponseReceived(const VolumeCommand* aCommand) } } +void +AutoMounter::StartMtpServer() +{ + if (sMozMtpServer) { + // Mtp Server is already running - nothing to do + return; + } + LOG("Starting MtpServer"); + sMozMtpServer = new MozMtpServer(); + sMozMtpServer->Run(); +} + +void +AutoMounter::StopMtpServer() +{ + LOG("Stopping MtpServer"); + sMozMtpServer = nullptr; +} + /***************************************************************************/ void @@ -441,22 +467,23 @@ AutoMounter::UpdateState() bool umsAvail = false; bool umsEnabled = false; + bool mtpAvail = false; + bool mtpEnabled = false; if (access(ICS_SYS_USB_FUNCTIONS, F_OK) == 0) { + char functionsStr[60]; + if (!ReadSysFile(ICS_SYS_USB_FUNCTIONS, functionsStr, sizeof(functionsStr))) { + ERR("Error reading file '%s': %s", ICS_SYS_USB_FUNCTIONS, strerror(errno)); + functionsStr[0] = '\0'; + } umsAvail = (access(ICS_SYS_UMS_DIRECTORY, F_OK) == 0); if (umsAvail) { - char functionsStr[60]; - if (ReadSysFile(ICS_SYS_USB_FUNCTIONS, functionsStr, sizeof(functionsStr))) { - umsEnabled = strstr(functionsStr, "mass_storage") != nullptr; - } else { - ERR("Error reading file '%s': %s", ICS_SYS_USB_FUNCTIONS, strerror(errno)); - umsEnabled = false; - } - } else { - umsEnabled = false; + umsEnabled = strstr(functionsStr, "mass_storage") != nullptr; + } + mtpAvail = (access(ICS_SYS_MTP_DIRECTORY, F_OK) == 0); + if (mtpAvail) { + mtpEnabled = strstr(functionsStr, "mtp") != nullptr; } - } else { - umsAvail = ReadSysFile(GB_SYS_UMS_ENABLE, &umsEnabled); } bool usbCablePluggedIn = IsUsbCablePluggedIn(); @@ -469,9 +496,19 @@ AutoMounter::UpdateState() } } - bool tryToShare = (umsAvail && umsEnabled && enabled && usbCablePluggedIn); - LOG("UpdateState: umsAvail:%d umsEnabled:%d mode:%d usbCablePluggedIn:%d tryToShare:%d", - umsAvail, umsEnabled, mMode, usbCablePluggedIn, tryToShare); + bool tryToShare = (((umsAvail && umsEnabled) || (mtpAvail && mtpEnabled)) + && enabled && usbCablePluggedIn); + LOG("UpdateState: ums:%d%d mtp:%d%d mode:%d usbCablePluggedIn:%d tryToShare:%d", + umsAvail, umsEnabled, mtpAvail, mtpEnabled, mMode, usbCablePluggedIn, tryToShare); + + if (mtpAvail && mtpEnabled) { + if (enabled && usbCablePluggedIn) { + StartMtpServer(); + } else { + StopMtpServer(); + } + return; + } bool filesOpen = false; static unsigned filesOpenDelayCount = 0; @@ -902,6 +939,9 @@ AutoMounterUnmountVolume(const nsCString& aVolumeName) void ShutdownAutoMounter() { + if (sAutoMounter) { + sAutoMounter->StopMtpServer(); + } sAutoMounterSetting = nullptr; sUsbCableObserver = nullptr; diff --git a/dom/system/gonk/MozMtpCommon.h b/dom/system/gonk/MozMtpCommon.h new file mode 100644 index 00000000000..72769f87f5c --- /dev/null +++ b/dom/system/gonk/MozMtpCommon.h @@ -0,0 +1,44 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_system_mozmtpcommon_h__ +#define mozilla_system_mozmtpcommon_h__ + +#include "mozilla/Types.h" +#include + +#define MTP_LOG(msg, ...) \ + __android_log_print(ANDROID_LOG_INFO, "MozMtp", \ + "%s: " msg, __FUNCTION__, ##__VA_ARGS__) \ + +#define MTP_ERR(msg, ...) \ + __android_log_print(ANDROID_LOG_ERROR, "MozMtp", \ + "%s: " msg, __FUNCTION__, ##__VA_ARGS__) \ + +#define BEGIN_MTP_NAMESPACE \ + namespace mozilla { namespace system { namespace mtp { +#define END_MTP_NAMESPACE \ + } /* namespace mtp */ } /* namespace system */ } /* namespace mozilla */ +#define USING_MTP_NAMESPACE \ + using namespace mozilla::system::mtp; + +namespace android { + class MOZ_EXPORT MtpServer; + class MOZ_EXPORT MtpStorage; + class MOZ_EXPORT MtpDatabase; + class MOZ_EXPORT MtpDataPacket; + class MOZ_EXPORT MtpProperty; +} + +#include +#include +#include +#include +#include +#include +#include + +#endif // mozilla_system_mtpcommon_h__ diff --git a/dom/system/gonk/MozMtpDatabase.cpp b/dom/system/gonk/MozMtpDatabase.cpp new file mode 100644 index 00000000000..889d9b7edfb --- /dev/null +++ b/dom/system/gonk/MozMtpDatabase.cpp @@ -0,0 +1,792 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "MozMtpDatabase.h" + +#include "mozilla/ArrayUtils.h" +#include "mozilla/Scoped.h" +#include "nsIFile.h" +#include "nsPrintfCString.h" +#include "prio.h" + +#include +#include + +using namespace android; +using namespace mozilla; + +namespace mozilla { +MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedCloseDir, PRDir, PR_CloseDir) +} + +BEGIN_MTP_NAMESPACE + +static const char * +ObjectPropertyAsStr(MtpObjectProperty aProperty) +{ + switch (aProperty) { + case MTP_PROPERTY_STORAGE_ID: return "MTP_PROPERTY_STORAGE_ID"; + case MTP_PROPERTY_OBJECT_FORMAT: return "MTP_PROPERTY_OBJECT_FORMAT"; + case MTP_PROPERTY_OBJECT_SIZE: return "MTP_PROPERTY_OBJECT_SIZE"; + case MTP_PROPERTY_WIDTH: return "MTP_PROPERTY_WIDTH"; + case MTP_PROPERTY_HEIGHT: return "MTP_PROPERTY_HEIGHT"; + case MTP_PROPERTY_IMAGE_BIT_DEPTH: return "MTP_PROPERTY_IMAGE_BIT_DEPTH"; + case MTP_PROPERTY_DISPLAY_NAME: return "MTP_PROPERTY_DISPLAY_NAME"; + } + return "MTP_PROPERTY_???"; +} + +MozMtpDatabase::MozMtpDatabase(const char *aDir) +{ + MTP_LOG(""); + + // We use the index into the array as the handle. Since zero isn't a valid + // index, we stick a dummy entry there. + + RefPtr dummy; + + mDb.AppendElement(dummy); + + ReadVolume("sdcard", aDir); +} + +//virtual +MozMtpDatabase::~MozMtpDatabase() +{ + MTP_LOG(""); +} + +void +MozMtpDatabase::AddEntry(DbEntry *entry) +{ + entry->mHandle = GetNextHandle(); + MOZ_ASSERT(mDb.Length() == entry->handle); + mDb.AppendElement(entry); + + MTP_LOG("AddEntry: Handle: 0x%08x Parent: 0x%08x Path:'%s'", + entry->mHandle, entry->mParent, entry->mPath.get()); +} + +TemporaryRef +MozMtpDatabase::GetEntry(MtpObjectHandle aHandle) +{ + RefPtr entry; + + if (aHandle > 0 && aHandle < mDb.Length()) { + entry = mDb[aHandle]; + } + return entry; +} + +void +MozMtpDatabase::RemoveEntry(MtpObjectHandle aHandle) +{ + if (aHandle > 0 && aHandle < mDb.Length()) { + mDb[aHandle] = nullptr; + } +} + +nsCString +MozMtpDatabase::BaseName(const nsCString& path) +{ + nsCOMPtr file; + NS_NewNativeLocalFile(path, false, getter_AddRefs(file)); + if (file) { + nsCString leafName; + file->GetNativeLeafName(leafName); + return leafName; + } + return path; +} + +void +MozMtpDatabase::ParseDirectory(const char *aDir, MtpObjectHandle aParent) +{ + ScopedCloseDir dir; + + if (!(dir = PR_OpenDir(aDir))) { + MTP_ERR("Unable to open directory '%s'", aDir); + return; + } + + PRDirEntry* dirEntry; + while ((dirEntry = PR_ReadDir(dir, PR_SKIP_BOTH))) { + nsPrintfCString filename("%s/%s", aDir, dirEntry->name); + PRFileInfo64 fileInfo; + if (PR_GetFileInfo64(filename.get(), &fileInfo) != PR_SUCCESS) { + MTP_ERR("Unable to retrieve file information for '%s'", filename.get()); + continue; + } + + RefPtr entry = new DbEntry; + + entry->mStorageID = MTP_STORAGE_FIXED_RAM; + entry->mParent = aParent; + entry->mObjectName = dirEntry->name; + entry->mDisplayName = dirEntry->name; + entry->mPath = filename; + entry->mDateCreated = fileInfo.creationTime; + entry->mDateModified = fileInfo.modifyTime; + + if (fileInfo.type == PR_FILE_FILE) { + entry->mObjectFormat = MTP_FORMAT_DEFINED; + //TODO: Check how 64-bit filesize are dealt with + entry->mObjectSize = fileInfo.size; + AddEntry(entry); + } else if (fileInfo.type == PR_FILE_DIRECTORY) { + entry->mObjectFormat = MTP_FORMAT_ASSOCIATION; + entry->mObjectSize = 0; + AddEntry(entry); + ParseDirectory(filename.get(), entry->mHandle); + } + } +} + +void +MozMtpDatabase::ReadVolume(const char *volumeName, const char *aDir) +{ + //TODO: Add an assert re thread being run on + + PRFileInfo fileInfo; + + if (PR_GetFileInfo(aDir, &fileInfo) != PR_SUCCESS) { + MTP_ERR("'%s' doesn't exist", aDir); + return; + } + if (fileInfo.type != PR_FILE_DIRECTORY) { + MTP_ERR("'%s' isn't a directory", aDir); + return; + } + + RefPtr entry = new DbEntry; + + entry->mStorageID = MTP_STORAGE_FIXED_RAM; + entry->mParent = MTP_PARENT_ROOT; + entry->mObjectName = volumeName; + entry->mDisplayName = volumeName; + entry->mPath = aDir; + entry->mObjectFormat = MTP_FORMAT_ASSOCIATION; + entry->mObjectSize = 0; + + AddEntry(entry); + + ParseDirectory(aDir, entry->mHandle); +} + +// called from SendObjectInfo to reserve a database entry for the incoming file +//virtual +MtpObjectHandle +MozMtpDatabase::beginSendObject(const char* aPath, + MtpObjectFormat aFormat, + MtpObjectHandle aParent, + MtpStorageID aStorageID, + uint64_t aSize, + time_t aModified) +{ + if (!aParent) { + MTP_LOG("aParent is NULL"); + return kInvalidObjectHandle; + } + + RefPtr entry = new DbEntry; + + entry->mStorageID = aStorageID; + entry->mParent = aParent; + entry->mPath = aPath; + entry->mObjectName = BaseName(entry->mPath); + entry->mDisplayName = entry->mObjectName; + entry->mObjectFormat = aFormat; + entry->mObjectSize = aSize; + + AddEntry(entry); + + MTP_LOG("Handle: 0x%08x Parent: 0x%08x Path: '%s'", entry->mHandle, aParent, aPath); + + return entry->mHandle; +} + +// called to report success or failure of the SendObject file transfer +// success should signal a notification of the new object's creation, +// failure should remove the database entry created in beginSendObject + +//virtual +void +MozMtpDatabase::endSendObject(const char* aPath, + MtpObjectHandle aHandle, + MtpObjectFormat aFormat, + bool succeeded) +{ + MTP_LOG("Handle: 0x%08x Path: '%s'", aHandle, aPath); + if (!succeeded) { + RemoveEntry(aHandle); + } +} + +//virtual +MtpObjectHandleList* +MozMtpDatabase::getObjectList(MtpStorageID aStorageID, + MtpObjectFormat aFormat, + MtpObjectHandle aParent) +{ + MTP_LOG("StorageID: 0x%08x Format: 0x%04x Parent: 0x%08x", + aStorageID, aFormat, aParent); + + //TODO: Optimize + + ScopedDeletePtr list; + + list = new MtpObjectHandleList(); + + DbArray::size_type numEntries = mDb.Length(); + DbArray::index_type entryIndex; + for (entryIndex = 1; entryIndex < numEntries; entryIndex++) { + RefPtr entry = mDb[entryIndex]; + if (entry->mParent == aParent) { + list->push(entry->mHandle); + } + } + return list.forget(); +} + +//virtual +int +MozMtpDatabase::getNumObjects(MtpStorageID aStorageID, + MtpObjectFormat aFormat, + MtpObjectHandle aParent) +{ + MTP_LOG(""); + + return mDb.Length() - 1; +} + +//virtual +MtpObjectFormatList* +MozMtpDatabase::getSupportedPlaybackFormats() +{ + static const uint16_t init_data[] = {MTP_FORMAT_PNG}; + + MtpObjectFormatList *list = new MtpObjectFormatList(); + list->appendArray(init_data, MOZ_ARRAY_LENGTH(init_data)); + + MTP_LOG("returning MTP_FORMAT_PNG"); + return list; +} + +//virtual +MtpObjectFormatList* +MozMtpDatabase::getSupportedCaptureFormats() +{ + static const uint16_t init_data[] = {MTP_FORMAT_ASSOCIATION, MTP_FORMAT_PNG}; + + MtpObjectFormatList *list = new MtpObjectFormatList(); + list->appendArray(init_data, MOZ_ARRAY_LENGTH(init_data)); + MTP_LOG("returning MTP_FORMAT_PNG"); + return list; +} + +static const MtpObjectProperty sSupportedObjectProperties[] = +{ + MTP_PROPERTY_STORAGE_ID, + MTP_PROPERTY_PARENT_OBJECT, + MTP_PROPERTY_OBJECT_FORMAT, + MTP_PROPERTY_OBJECT_SIZE, + MTP_PROPERTY_OBJECT_FILE_NAME, // just the filename - no directory + MTP_PROPERTY_PROTECTION_STATUS, // UINT16 - always 0 + MTP_PROPERTY_DATE_MODIFIED, + MTP_PROPERTY_DATE_ADDED, +}; + +//virtual +MtpObjectPropertyList* +MozMtpDatabase::getSupportedObjectProperties(MtpObjectFormat aFormat) +{ + MTP_LOG(""); + MtpObjectPropertyList *list = new MtpObjectPropertyList(); + list->appendArray(sSupportedObjectProperties, + MOZ_ARRAY_LENGTH(sSupportedObjectProperties)); + return list; +} + +//virtual +MtpDevicePropertyList* +MozMtpDatabase::getSupportedDeviceProperties() +{ + MTP_LOG(""); + static const uint16_t init_data[] = { MTP_DEVICE_PROPERTY_UNDEFINED }; + + MtpDevicePropertyList *list = new MtpDevicePropertyList(); + list->appendArray(init_data, MOZ_ARRAY_LENGTH(init_data)); + return list; +} + +//virtual +MtpResponseCode +MozMtpDatabase::getObjectPropertyValue(MtpObjectHandle aHandle, + MtpObjectProperty aProperty, + MtpDataPacket& aPacket) +{ + RefPtr entry = GetEntry(aHandle); + if (!entry) { + MTP_ERR("Invalid Handle: 0x%08x", aHandle); + return MTP_RESPONSE_INVALID_OBJECT_HANDLE; + } + + MTP_LOG("Handle: 0x%08x '%s' Property: %s 0x%08x", + aHandle, entry->mDisplayName.get(), ObjectPropertyAsStr(aProperty), aProperty); + + switch (aProperty) + { + case MTP_PROPERTY_STORAGE_ID: aPacket.putUInt32(entry->mStorageID); break; + case MTP_PROPERTY_PARENT_OBJECT: aPacket.putUInt32(entry->mParent); break; + case MTP_PROPERTY_OBJECT_FORMAT: aPacket.putUInt32(entry->mObjectFormat); break; + case MTP_PROPERTY_OBJECT_SIZE: aPacket.putUInt32(entry->mObjectSize); break; + case MTP_PROPERTY_DISPLAY_NAME: aPacket.putString(entry->mDisplayName.get()); break; + + default: + MTP_LOG("Invalid Property: 0x%08x", aProperty); + return MTP_RESPONSE_INVALID_OBJECT_PROP_CODE; + } + + return MTP_RESPONSE_OK; +} + +//virtual +MtpResponseCode +MozMtpDatabase::setObjectPropertyValue(MtpObjectHandle aHandle, + MtpObjectProperty aProperty, + MtpDataPacket& aPacket) +{ + MTP_LOG("Handle: 0x%08x (NOT SUPPORTED)", aHandle); + return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; +} + +//virtual +MtpResponseCode +MozMtpDatabase::getDevicePropertyValue(MtpDeviceProperty aProperty, + MtpDataPacket& aPacket) +{ + MTP_LOG("(GENERAL ERROR)"); + return MTP_RESPONSE_GENERAL_ERROR; +} + +//virtual +MtpResponseCode +MozMtpDatabase::setDevicePropertyValue(MtpDeviceProperty aProperty, + MtpDataPacket& aPacket) +{ + MTP_LOG("(NOT SUPPORTED)"); + return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; +} + +//virtual +MtpResponseCode +MozMtpDatabase::resetDeviceProperty(MtpDeviceProperty aProperty) +{ + MTP_LOG("(NOT SUPPORTED)"); + return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; +} + +void +MozMtpDatabase::QueryEntries(MozMtpDatabase::MatchType aMatchType, + uint32_t aMatchField1, + uint32_t aMatchField2, + DbArray &result) +{ + DbArray::size_type numEntries = mDb.Length(); + DbArray::index_type entryIdx; + RefPtr entry; + + result.Clear(); + + switch (aMatchType) { + + case MatchAll: + for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { + if (mDb[entryIdx]) { + result.AppendElement(mDb[entryIdx]); + } + } + break; + + case MatchHandle: + for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { + entry = mDb[entryIdx]; + if (entry && entry->mHandle == aMatchField1) { + result.AppendElement(entry); + // Handles are unique - return the one that we found. + return; + } + } + break; + + case MatchParent: + for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { + entry = mDb[entryIdx]; + if (entry && entry->mParent == aMatchField1) { + result.AppendElement(entry); + } + } + break; + + case MatchFormat: + for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { + entry = mDb[entryIdx]; + if (entry && entry->mObjectFormat == aMatchField1) { + result.AppendElement(entry); + } + } + break; + + case MatchHandleFormat: + for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { + entry = mDb[entryIdx]; + if (entry && entry->mHandle == aMatchField1) { + if (entry->mObjectFormat == aMatchField2) { + result.AppendElement(entry); + } + // Only 1 entry can match my aHandle. So we can return early. + return; + } + } + break; + + case MatchParentFormat: + for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { + entry = mDb[entryIdx]; + if (entry && entry->mParent == aMatchField1 && entry->mObjectFormat == aMatchField2) { + result.AppendElement(entry); + } + } + break; + + default: + MOZ_ASSERT(!"Invalid MatchType"); + } +} + +//virtual +MtpResponseCode +MozMtpDatabase::getObjectPropertyList(MtpObjectHandle aHandle, + uint32_t aFormat, + uint32_t aProperty, + int aGroupCode, + int aDepth, + MtpDataPacket& aPacket) +{ + MTP_LOG("Handle: 0x%08x Format: 0x%08x aProperty: 0x%08x aGroupCode: %d aDepth %d (NOT SUPPORTED)", + aHandle, aFormat, aProperty, aGroupCode, aDepth); + + if (aDepth > 1) { + return MTP_RESPONSE_SPECIFICATION_BY_DEPTH_UNSUPPORTED; + } + if (aGroupCode != 0) { + return MTP_RESPONSE_SPECIFICATION_BY_GROUP_UNSUPPORTED; + } + + MatchType matchType = MatchAll; + uint32_t matchField1 = 0; + uint32_t matchField2 = 0; + + // aHandle == 0 implies all objects at the root level + // further specificed by aFormat and/or aDepth + + if (aFormat == 0) { + if (aHandle == 0xffffffff) { + // select all objects + matchType = MatchAll; + } else { + if (aDepth == 1) { + // select objects whose Parent matches aHandle + matchType = MatchParent; + matchField1 = aHandle; + } else { + // select object whose handle matches aHandle + matchType = MatchHandle; + matchField1 = aHandle; + } + } + } else { + if (aHandle == 0xffffffff) { + // select all objects whose format matches aFormat + matchType = MatchFormat; + matchField1 = aFormat; + } else { + if (aDepth == 1) { + // select objects whose Parent is aHandle and format matches aFormat + matchType = MatchParentFormat; + matchField1 = aHandle; + matchField2 = aFormat; + } else { + // select objects whose handle is aHandle and format matches aFormat + matchType = MatchHandleFormat; + matchField1 = aHandle; + matchField2 = aFormat; + } + } + } + + DbArray result; + QueryEntries(matchType, matchField1, matchField2, result); + + const MtpObjectProperty *objectPropertyList; + size_t numObjectProperties = 0; + MtpObjectProperty objectProperty; + + if (aProperty == 0xffffffff) { + // return all supported properties + numObjectProperties = MOZ_ARRAY_LENGTH(sSupportedObjectProperties); + objectPropertyList = sSupportedObjectProperties; + } else { + // return property indicated by aProperty + numObjectProperties = 1; + objectProperty = aProperty; + objectPropertyList = &objectProperty; + } + + DbArray::size_type numEntries = result.Length(); + DbArray::index_type entryIdx; + + aPacket.putUInt32(numEntries); + for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { + RefPtr entry = result[entryIdx]; + + for (size_t propertyIdx = 0; propertyIdx < numObjectProperties; propertyIdx++) { + aPacket.putUInt32(entry->mHandle); + MtpObjectProperty prop = objectPropertyList[propertyIdx]; + aPacket.putUInt16(prop); + switch (prop) { + + case MTP_PROPERTY_STORAGE_ID: + aPacket.putUInt16(MTP_TYPE_UINT32); + aPacket.putUInt32(entry->mStorageID); + break; + + case MTP_PROPERTY_PARENT_OBJECT: + aPacket.putUInt16(MTP_TYPE_UINT32); + aPacket.putUInt32(entry->mParent); + break; + + case MTP_PROPERTY_OBJECT_FORMAT: + aPacket.putUInt16(MTP_TYPE_UINT16); + aPacket.putUInt16(entry->mObjectFormat); + break; + + case MTP_PROPERTY_OBJECT_SIZE: + aPacket.putUInt16(MTP_TYPE_UINT64); + aPacket.putUInt64(entry->mObjectSize); + break; + + case MTP_PROPERTY_OBJECT_FILE_NAME: + aPacket.putUInt16(MTP_TYPE_STR); + aPacket.putString(entry->mObjectName.get()); + break; + + case MTP_PROPERTY_PROTECTION_STATUS: + aPacket.putUInt16(MTP_TYPE_UINT16); + aPacket.putUInt16(0); // 0 = No Protection + break; + + case MTP_PROPERTY_DATE_MODIFIED: { + aPacket.putUInt16(MTP_TYPE_STR); + PRExplodedTime explodedTime; + PR_ExplodeTime(entry->mDateModified, PR_LocalTimeParameters, &explodedTime); + char dateStr[20]; + PR_FormatTime(dateStr, sizeof(dateStr), "%Y%m%dT%H%M%S", &explodedTime); + aPacket.putString(dateStr); + break; + } + + case MTP_PROPERTY_DATE_ADDED: { + aPacket.putUInt16(MTP_TYPE_STR); + PRExplodedTime explodedTime; + PR_ExplodeTime(entry->mDateCreated, PR_LocalTimeParameters, &explodedTime); + char dateStr[20]; + PR_FormatTime(dateStr, sizeof(dateStr), "%Y%m%dT%H%M%S", &explodedTime); + aPacket.putString(dateStr); + break; + } + + default: + MTP_ERR("Unrecognized property code: %u", prop); + return MTP_RESPONSE_GENERAL_ERROR; + } + } + } + return MTP_RESPONSE_OK; +} + +//virtual +MtpResponseCode +MozMtpDatabase::getObjectInfo(MtpObjectHandle aHandle, + MtpObjectInfo& aInfo) +{ + RefPtr entry = GetEntry(aHandle); + if (!entry) { + MTP_ERR("Handle 0x%08x is invalid", aHandle); + return MTP_RESPONSE_INVALID_OBJECT_HANDLE; + } + + MTP_LOG("Handle: 0x%08x Display:'%s' Object:'%s'", aHandle, entry->mDisplayName.get(), entry->mObjectName.get()); + + aInfo.mHandle = aHandle; + aInfo.mStorageID = entry->mStorageID; + aInfo.mFormat = entry->mObjectFormat; + aInfo.mProtectionStatus = 0x0; + aInfo.mCompressedSize = 0; + aInfo.mThumbFormat = entry->mObjectFormat; + aInfo.mThumbCompressedSize = 20*20*4; + aInfo.mThumbPixWidth = 20; + aInfo.mThumbPixHeight =20; + aInfo.mImagePixWidth = 20; + aInfo.mImagePixHeight = 20; + aInfo.mImagePixDepth = 4; + aInfo.mParent = entry->mParent; + aInfo.mAssociationType = 0; + aInfo.mAssociationDesc = 0; + aInfo.mSequenceNumber = 0; + aInfo.mName = ::strdup(entry->mObjectName.get()); + aInfo.mDateCreated = 0; + aInfo.mDateModified = 0; + aInfo.mKeywords = ::strdup("fxos,touch"); + + return MTP_RESPONSE_OK; +} + +//virtual +void* +MozMtpDatabase::getThumbnail(MtpObjectHandle aHandle, size_t& aOutThumbSize) +{ + MTP_LOG("Handle: 0x%08x (returning nullptr)", aHandle); + + aOutThumbSize = 0; + + return nullptr; +} + +//virtual +MtpResponseCode +MozMtpDatabase::getObjectFilePath(MtpObjectHandle aHandle, + MtpString& aOutFilePath, + int64_t& aOutFileLength, + MtpObjectFormat& aOutFormat) +{ + RefPtr entry = GetEntry(aHandle); + if (!entry) { + MTP_ERR("Handle 0x%08x is invalid", aHandle); + return MTP_RESPONSE_INVALID_OBJECT_HANDLE; + } + + MTP_LOG("Handle: 0x%08x FilePath: '%s'", aHandle, entry->mPath.get()); + + aOutFilePath = entry->mPath.get(); + aOutFileLength = entry->mObjectSize; + aOutFormat = entry->mObjectFormat; + + return MTP_RESPONSE_OK; +} + +//virtual +MtpResponseCode +MozMtpDatabase::deleteFile(MtpObjectHandle aHandle) +{ + MTP_LOG("Handle: 0x%08x (NOT SUPPORTED)", aHandle); + + //TODO + + return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; +} + +#if 0 +//virtual +MtpResponseCode +MozMtpDatabase::moveFile(MtpObjectHandle aHandle, MtpObjectHandle aNewParent) +{ + MTP_LOG("Handle: 0x%08x NewParent: 0x%08x", aHandle, aNewParent); + + // change parent + + return MTP_RESPONSE_OK +} + +//virtual +MtpResponseCode +MozMtpDatabase::copyFile(MtpObjectHandle aHandle, MtpObjectHandle aNewParent) +{ + MTP_LOG("Handle: 0x%08x NewParent: 0x%08x", aHandle, aNewParent); + + // duplicate DbEntry + // change parent + + return MTP_RESPONSE_OK +} +#endif + +//virtual +MtpObjectHandleList* +MozMtpDatabase::getObjectReferences(MtpObjectHandle aHandle) +{ + MTP_LOG("Handle: 0x%08x (returning nullptr)", aHandle); + return nullptr; +} + +//virtual +MtpResponseCode +MozMtpDatabase::setObjectReferences(MtpObjectHandle aHandle, + MtpObjectHandleList* aReferences) +{ + MTP_LOG("Handle: 0x%08x (NOT SUPPORTED)", aHandle); + return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; +} + +//virtual +MtpProperty* +MozMtpDatabase::getObjectPropertyDesc(MtpObjectProperty aProperty, + MtpObjectFormat aFormat) +{ + MTP_LOG("Property: %s 0x%08x", ObjectPropertyAsStr(aProperty), aProperty); + + // TODO: Perhaps Filesize should be 64-bit? + + MtpProperty* result = nullptr; + switch (aProperty) + { + case MTP_PROPERTY_STORAGE_ID: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; + case MTP_PROPERTY_OBJECT_FORMAT: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; + case MTP_PROPERTY_OBJECT_SIZE: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; + case MTP_PROPERTY_WIDTH: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; + case MTP_PROPERTY_HEIGHT: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; + case MTP_PROPERTY_IMAGE_BIT_DEPTH: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; + case MTP_PROPERTY_DISPLAY_NAME: result = new MtpProperty(aProperty, MTP_TYPE_STR); break; + default: + break; + } + + return result; +} + +//virtual +MtpProperty* +MozMtpDatabase::getDevicePropertyDesc(MtpDeviceProperty aProperty) +{ + MTP_LOG("(returning MTP_DEVICE_PROPERTY_UNDEFINED)"); + return new MtpProperty(MTP_DEVICE_PROPERTY_UNDEFINED, MTP_TYPE_UNDEFINED); +} + +//virtual +void +MozMtpDatabase::sessionStarted() +{ + MTP_LOG(""); +} + +//virtual +void +MozMtpDatabase::sessionEnded() +{ + MTP_LOG(""); +} + +END_MTP_NAMESPACE diff --git a/dom/system/gonk/MozMtpDatabase.h b/dom/system/gonk/MozMtpDatabase.h new file mode 100644 index 00000000000..7edd3ca5c5b --- /dev/null +++ b/dom/system/gonk/MozMtpDatabase.h @@ -0,0 +1,161 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_system_mozmtpdatabase_h__ +#define mozilla_system_mozmtpdatabase_h__ + +#include "MozMtpCommon.h" + +#include "mozilla/RefPtr.h" +#include "nsCOMPtr.h" +#include "nsISupportsImpl.h" +#include "nsString.h" +#include "nsTArray.h" + +BEGIN_MTP_NAMESPACE // mozilla::system::mtp + +using namespace android; + +class MozMtpDatabase : public MtpDatabase +{ +public: + MozMtpDatabase(const char *aDir); + virtual ~MozMtpDatabase(); + + // called from SendObjectInfo to reserve a database entry for the incoming file + virtual MtpObjectHandle beginSendObject(const char* aPath, + MtpObjectFormat aFormat, + MtpObjectHandle aParent, + MtpStorageID aStorageID, + uint64_t aSize, + time_t aModified); + + // called to report success or failure of the SendObject file transfer + // success should signal a notification of the new object's creation, + // failure should remove the database entry created in beginSendObject + virtual void endSendObject(const char* aPath, + MtpObjectHandle aHandle, + MtpObjectFormat aFormat, + bool aSucceeded); + + virtual MtpObjectHandleList* getObjectList(MtpStorageID aStorageID, + MtpObjectFormat aFormat, + MtpObjectHandle aParent); + + virtual int getNumObjects(MtpStorageID aStorageID, + MtpObjectFormat aFormat, + MtpObjectHandle aParent); + + virtual MtpObjectFormatList* getSupportedPlaybackFormats(); + + virtual MtpObjectFormatList* getSupportedCaptureFormats(); + + virtual MtpObjectPropertyList* getSupportedObjectProperties(MtpObjectFormat aFormat); + + virtual MtpDevicePropertyList* getSupportedDeviceProperties(); + + virtual MtpResponseCode getObjectPropertyValue(MtpObjectHandle aHandle, + MtpObjectProperty aProperty, + MtpDataPacket& aPacket); + + virtual MtpResponseCode setObjectPropertyValue(MtpObjectHandle aHandle, + MtpObjectProperty aProperty, + MtpDataPacket& aPacket); + + virtual MtpResponseCode getDevicePropertyValue(MtpDeviceProperty aProperty, + MtpDataPacket& aPacket); + + virtual MtpResponseCode setDevicePropertyValue(MtpDeviceProperty aProperty, + MtpDataPacket& aPacket); + + virtual MtpResponseCode resetDeviceProperty(MtpDeviceProperty aProperty); + + virtual MtpResponseCode getObjectPropertyList(MtpObjectHandle aHandle, + uint32_t aFormat, + uint32_t aProperty, + int aGroupCode, + int aDepth, + MtpDataPacket& aPacket); + + virtual MtpResponseCode getObjectInfo(MtpObjectHandle aHandle, + MtpObjectInfo& aInfo); + + virtual void* getThumbnail(MtpObjectHandle aHandle, size_t& aOutThumbSize); + + virtual MtpResponseCode getObjectFilePath(MtpObjectHandle aHandle, + MtpString& aOutFilePath, + int64_t& aOutFileLength, + MtpObjectFormat& aOutFormat); + + virtual MtpResponseCode deleteFile(MtpObjectHandle aHandle); + + virtual MtpObjectHandleList* getObjectReferences(MtpObjectHandle aHandle); + + virtual MtpResponseCode setObjectReferences(MtpObjectHandle aHandle, + MtpObjectHandleList* aReferences); + + virtual MtpProperty* getObjectPropertyDesc(MtpObjectProperty aProperty, + MtpObjectFormat aFormat); + + virtual MtpProperty* getDevicePropertyDesc(MtpDeviceProperty aProperty); + + virtual void sessionStarted(); + + virtual void sessionEnded(); + +private: + + struct DbEntry + { + NS_INLINE_DECL_REFCOUNTING(DbEntry) + + MtpObjectHandle mHandle; // uint32_t + MtpStorageID mStorageID; // uint32_t + nsCString mObjectName; + MtpObjectFormat mObjectFormat; // uint16_t + MtpObjectHandle mParent; // uint32_t + uint64_t mObjectSize; + nsCString mDisplayName; + nsCString mPath; + PRTime mDateCreated; + PRTime mDateModified; + }; + typedef nsTArray > DbArray; + + DbArray mDb; + + enum MatchType + { + MatchAll, + MatchHandle, + MatchParent, + MatchFormat, + MatchHandleFormat, + MatchParentFormat, + }; + + + void AddEntry(DbEntry *aEntry); + mozilla::TemporaryRef GetEntry(MtpObjectHandle aHandle); + void RemoveEntry(MtpObjectHandle aHandle); + void QueryEntries(MatchType aMatchType, uint32_t aMatchField1, + uint32_t aMatchField2, DbArray& aResult); + + nsCString BaseName(const nsCString& aPath); + + + MtpObjectHandle GetNextHandle() + { + return mDb.Length(); + } + + void ParseDirectory(const char *aDir, MtpObjectHandle aParent); + void ReadVolume(const char *aVolumeName, const char *aDir); +}; + +END_MTP_NAMESPACE + +#endif // mozilla_system_mozmtpdatabase_h__ diff --git a/dom/system/gonk/MozMtpServer.cpp b/dom/system/gonk/MozMtpServer.cpp new file mode 100644 index 00000000000..43df913dcc9 --- /dev/null +++ b/dom/system/gonk/MozMtpServer.cpp @@ -0,0 +1,80 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "MozMtpServer.h" +#include "MozMtpDatabase.h" + +#include +#include +#include + +#include +#include +#include + +#include + +#include "mozilla/FileUtils.h" +#include "mozilla/Scoped.h" +#include "nsThreadUtils.h" + +using namespace android; +using namespace mozilla; +USING_MTP_NAMESPACE + +class MtpServerRunnable : public nsRunnable +{ +public: + nsresult Run() + { + const char *mtpUsbFilename = "/dev/mtp_usb"; + const char *productName = "FirefoxOS"; + const char *storageDir = "/storage/sdcard"; + + mFd = open(mtpUsbFilename, O_RDWR); + if (mFd.get() < 0) { + MTP_LOG("open of '%s' failed", mtpUsbFilename); + return NS_OK; + } + + MTP_LOG("MozMtpServer open done, fd: %d. Start reading.", mFd.get()); + + ScopedDeletePtr database; + ScopedDeletePtr server; + ScopedDeletePtr storage; + + database = new MozMtpDatabase(storageDir); + server = new MtpServer(mFd.get(), database, false, 1023, 0664, 0775); + storage = new MtpStorage(MTP_STORAGE_FIXED_RAM, // id + storageDir, // filePath + productName, // description + 100uLL * 1024uLL * 1024uLL, // reserveSpace + false, // removable + 2uLL * 1024uLL * 1024uLL * 1024uLL); // maxFileSize + + server->addStorage(storage); + + MTP_LOG("MozMtpServer started"); + server->run(); + MTP_LOG("MozMtpServer finished"); + + return NS_OK; + } + +private: + ScopedClose mFd; +}; + +void +MozMtpServer::Run() +{ + nsresult rv = NS_NewNamedThread("MtpServer", getter_AddRefs(mServerThread)); + if (NS_WARN_IF(NS_FAILED(rv))) { + return; + } + MOZ_ASSERT(mServerThread); + mServerThread->Dispatch(new MtpServerRunnable(), 0); +} diff --git a/dom/system/gonk/MozMtpServer.h b/dom/system/gonk/MozMtpServer.h new file mode 100644 index 00000000000..c7c6a6f8b2c --- /dev/null +++ b/dom/system/gonk/MozMtpServer.h @@ -0,0 +1,32 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_system_mozmtpserver_h__ +#define mozilla_system_mozmtpserver_h__ + +#include "MozMtpCommon.h" + +#include "nsCOMPtr.h" +#include "nsIThread.h" + +BEGIN_MTP_NAMESPACE + +class MozMtpServer +{ +public: + NS_INLINE_DECL_REFCOUNTING(MozMtpServer) + + void Run(); + +private: + nsCOMPtr mServerThread; +}; + +END_MTP_NAMESPACE + +#endif // mozilla_system_mozmtpserver_h__ + + diff --git a/dom/system/gonk/moz.build b/dom/system/gonk/moz.build index 159cfa32098..73a36133da2 100644 --- a/dom/system/gonk/moz.build +++ b/dom/system/gonk/moz.build @@ -41,6 +41,8 @@ SOURCES += [ 'AutoMounter.cpp', 'AutoMounterSetting.cpp', 'GonkGPSGeolocationProvider.cpp', + 'MozMtpDatabase.cpp', + 'MozMtpServer.cpp', 'NetworkUtils.cpp', 'NetworkWorker.cpp', 'nsVolume.cpp', @@ -57,6 +59,8 @@ SOURCES += [ 'VolumeServiceTest.cpp', ] +CXXFLAGS += ['-I%s/frameworks/av/media/mtp' % CONFIG['ANDROID_SOURCE']] + if CONFIG['ENABLE_TESTS']: XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini'] diff --git a/toolkit/library/libxul.mk b/toolkit/library/libxul.mk index 4e556df0320..d424d64a3cb 100644 --- a/toolkit/library/libxul.mk +++ b/toolkit/library/libxul.mk @@ -134,6 +134,7 @@ OS_LIBS += \ -lstagefright_omx \ -lbinder \ -lgui \ + -lmtp \ $(NULL) endif From a54dba84e4cbfd0a522ff2b87352b8bdd4a074ee Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Fri, 11 Jul 2014 15:38:59 -0700 Subject: [PATCH 02/23] Backed out changeset 48c4d4a97a4b (bug 1029533) for build bustage --- configure.in | 4 +- dom/system/gonk/AutoMounter.cpp | 68 +-- dom/system/gonk/MozMtpCommon.h | 44 -- dom/system/gonk/MozMtpDatabase.cpp | 792 ----------------------------- dom/system/gonk/MozMtpDatabase.h | 161 ------ dom/system/gonk/MozMtpServer.cpp | 80 --- dom/system/gonk/MozMtpServer.h | 32 -- dom/system/gonk/moz.build | 4 - toolkit/library/libxul.mk | 1 - 9 files changed, 16 insertions(+), 1170 deletions(-) delete mode 100644 dom/system/gonk/MozMtpCommon.h delete mode 100644 dom/system/gonk/MozMtpDatabase.cpp delete mode 100644 dom/system/gonk/MozMtpDatabase.h delete mode 100644 dom/system/gonk/MozMtpServer.cpp delete mode 100644 dom/system/gonk/MozMtpServer.h diff --git a/configure.in b/configure.in index a5ef647eaaa..d91d92e94d3 100644 --- a/configure.in +++ b/configure.in @@ -242,7 +242,7 @@ if test -n "$gonkdir" ; then MOZ_RTSP=1 ;; 17|18) - GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include -I$gonkdir/frameworks/av/media/mtp" + GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include" if test -d "$gonkdir/external/bluetooth/bluez"; then GONK_INCLUDES="$GONK_INCLUDES -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib" MOZ_B2G_BT=1 @@ -262,7 +262,7 @@ if test -n "$gonkdir" ; then AC_DEFINE(MOZ_OMX_ENCODER) ;; 19) - GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include -I$gonkdir/frameworks/av/media/mtp" + GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include" MOZ_B2G_CAMERA=1 MOZ_B2G_BT=1 MOZ_B2G_BT_BLUEDROID=1 diff --git a/dom/system/gonk/AutoMounter.cpp b/dom/system/gonk/AutoMounter.cpp index 4d7e7023bdc..b0e5d7d10a4 100644 --- a/dom/system/gonk/AutoMounter.cpp +++ b/dom/system/gonk/AutoMounter.cpp @@ -25,7 +25,6 @@ #include "mozilla/FileUtils.h" #include "mozilla/Hal.h" #include "mozilla/StaticPtr.h" -#include "MozMtpServer.h" #include "nsAutoPtr.h" #include "nsMemory.h" #include "nsString.h" @@ -36,7 +35,6 @@ #include "VolumeManager.h" using namespace mozilla::hal; -USING_MTP_NAMESPACE /************************************************************************** * @@ -71,7 +69,6 @@ USING_MTP_NAMESPACE #define ICS_SYS_USB_FUNCTIONS "/sys/devices/virtual/android_usb/android0/functions" #define ICS_SYS_UMS_DIRECTORY "/sys/devices/virtual/android_usb/android0/f_mass_storage" -#define ICS_SYS_MTP_DIRECTORY "/sys/devices/virtual/android_usb/android0/f_mtp" #define ICS_SYS_USB_STATE "/sys/devices/virtual/android_usb/android0/state" #define USE_DEBUG 0 @@ -232,9 +229,6 @@ public: } } - void StartMtpServer(); - void StopMtpServer(); - void UpdateState(); const char* ModeStr(int32_t aMode) @@ -353,7 +347,6 @@ private: }; static StaticRefPtr sAutoMounter; -static StaticRefPtr sMozMtpServer; /***************************************************************************/ @@ -405,25 +398,6 @@ AutoMounterResponseCallback::ResponseReceived(const VolumeCommand* aCommand) } } -void -AutoMounter::StartMtpServer() -{ - if (sMozMtpServer) { - // Mtp Server is already running - nothing to do - return; - } - LOG("Starting MtpServer"); - sMozMtpServer = new MozMtpServer(); - sMozMtpServer->Run(); -} - -void -AutoMounter::StopMtpServer() -{ - LOG("Stopping MtpServer"); - sMozMtpServer = nullptr; -} - /***************************************************************************/ void @@ -467,23 +441,22 @@ AutoMounter::UpdateState() bool umsAvail = false; bool umsEnabled = false; - bool mtpAvail = false; - bool mtpEnabled = false; if (access(ICS_SYS_USB_FUNCTIONS, F_OK) == 0) { - char functionsStr[60]; - if (!ReadSysFile(ICS_SYS_USB_FUNCTIONS, functionsStr, sizeof(functionsStr))) { - ERR("Error reading file '%s': %s", ICS_SYS_USB_FUNCTIONS, strerror(errno)); - functionsStr[0] = '\0'; - } umsAvail = (access(ICS_SYS_UMS_DIRECTORY, F_OK) == 0); if (umsAvail) { - umsEnabled = strstr(functionsStr, "mass_storage") != nullptr; - } - mtpAvail = (access(ICS_SYS_MTP_DIRECTORY, F_OK) == 0); - if (mtpAvail) { - mtpEnabled = strstr(functionsStr, "mtp") != nullptr; + char functionsStr[60]; + if (ReadSysFile(ICS_SYS_USB_FUNCTIONS, functionsStr, sizeof(functionsStr))) { + umsEnabled = strstr(functionsStr, "mass_storage") != nullptr; + } else { + ERR("Error reading file '%s': %s", ICS_SYS_USB_FUNCTIONS, strerror(errno)); + umsEnabled = false; + } + } else { + umsEnabled = false; } + } else { + umsAvail = ReadSysFile(GB_SYS_UMS_ENABLE, &umsEnabled); } bool usbCablePluggedIn = IsUsbCablePluggedIn(); @@ -496,19 +469,9 @@ AutoMounter::UpdateState() } } - bool tryToShare = (((umsAvail && umsEnabled) || (mtpAvail && mtpEnabled)) - && enabled && usbCablePluggedIn); - LOG("UpdateState: ums:%d%d mtp:%d%d mode:%d usbCablePluggedIn:%d tryToShare:%d", - umsAvail, umsEnabled, mtpAvail, mtpEnabled, mMode, usbCablePluggedIn, tryToShare); - - if (mtpAvail && mtpEnabled) { - if (enabled && usbCablePluggedIn) { - StartMtpServer(); - } else { - StopMtpServer(); - } - return; - } + bool tryToShare = (umsAvail && umsEnabled && enabled && usbCablePluggedIn); + LOG("UpdateState: umsAvail:%d umsEnabled:%d mode:%d usbCablePluggedIn:%d tryToShare:%d", + umsAvail, umsEnabled, mMode, usbCablePluggedIn, tryToShare); bool filesOpen = false; static unsigned filesOpenDelayCount = 0; @@ -939,9 +902,6 @@ AutoMounterUnmountVolume(const nsCString& aVolumeName) void ShutdownAutoMounter() { - if (sAutoMounter) { - sAutoMounter->StopMtpServer(); - } sAutoMounterSetting = nullptr; sUsbCableObserver = nullptr; diff --git a/dom/system/gonk/MozMtpCommon.h b/dom/system/gonk/MozMtpCommon.h deleted file mode 100644 index 72769f87f5c..00000000000 --- a/dom/system/gonk/MozMtpCommon.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_system_mozmtpcommon_h__ -#define mozilla_system_mozmtpcommon_h__ - -#include "mozilla/Types.h" -#include - -#define MTP_LOG(msg, ...) \ - __android_log_print(ANDROID_LOG_INFO, "MozMtp", \ - "%s: " msg, __FUNCTION__, ##__VA_ARGS__) \ - -#define MTP_ERR(msg, ...) \ - __android_log_print(ANDROID_LOG_ERROR, "MozMtp", \ - "%s: " msg, __FUNCTION__, ##__VA_ARGS__) \ - -#define BEGIN_MTP_NAMESPACE \ - namespace mozilla { namespace system { namespace mtp { -#define END_MTP_NAMESPACE \ - } /* namespace mtp */ } /* namespace system */ } /* namespace mozilla */ -#define USING_MTP_NAMESPACE \ - using namespace mozilla::system::mtp; - -namespace android { - class MOZ_EXPORT MtpServer; - class MOZ_EXPORT MtpStorage; - class MOZ_EXPORT MtpDatabase; - class MOZ_EXPORT MtpDataPacket; - class MOZ_EXPORT MtpProperty; -} - -#include -#include -#include -#include -#include -#include -#include - -#endif // mozilla_system_mtpcommon_h__ diff --git a/dom/system/gonk/MozMtpDatabase.cpp b/dom/system/gonk/MozMtpDatabase.cpp deleted file mode 100644 index 889d9b7edfb..00000000000 --- a/dom/system/gonk/MozMtpDatabase.cpp +++ /dev/null @@ -1,792 +0,0 @@ -/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "MozMtpDatabase.h" - -#include "mozilla/ArrayUtils.h" -#include "mozilla/Scoped.h" -#include "nsIFile.h" -#include "nsPrintfCString.h" -#include "prio.h" - -#include -#include - -using namespace android; -using namespace mozilla; - -namespace mozilla { -MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedCloseDir, PRDir, PR_CloseDir) -} - -BEGIN_MTP_NAMESPACE - -static const char * -ObjectPropertyAsStr(MtpObjectProperty aProperty) -{ - switch (aProperty) { - case MTP_PROPERTY_STORAGE_ID: return "MTP_PROPERTY_STORAGE_ID"; - case MTP_PROPERTY_OBJECT_FORMAT: return "MTP_PROPERTY_OBJECT_FORMAT"; - case MTP_PROPERTY_OBJECT_SIZE: return "MTP_PROPERTY_OBJECT_SIZE"; - case MTP_PROPERTY_WIDTH: return "MTP_PROPERTY_WIDTH"; - case MTP_PROPERTY_HEIGHT: return "MTP_PROPERTY_HEIGHT"; - case MTP_PROPERTY_IMAGE_BIT_DEPTH: return "MTP_PROPERTY_IMAGE_BIT_DEPTH"; - case MTP_PROPERTY_DISPLAY_NAME: return "MTP_PROPERTY_DISPLAY_NAME"; - } - return "MTP_PROPERTY_???"; -} - -MozMtpDatabase::MozMtpDatabase(const char *aDir) -{ - MTP_LOG(""); - - // We use the index into the array as the handle. Since zero isn't a valid - // index, we stick a dummy entry there. - - RefPtr dummy; - - mDb.AppendElement(dummy); - - ReadVolume("sdcard", aDir); -} - -//virtual -MozMtpDatabase::~MozMtpDatabase() -{ - MTP_LOG(""); -} - -void -MozMtpDatabase::AddEntry(DbEntry *entry) -{ - entry->mHandle = GetNextHandle(); - MOZ_ASSERT(mDb.Length() == entry->handle); - mDb.AppendElement(entry); - - MTP_LOG("AddEntry: Handle: 0x%08x Parent: 0x%08x Path:'%s'", - entry->mHandle, entry->mParent, entry->mPath.get()); -} - -TemporaryRef -MozMtpDatabase::GetEntry(MtpObjectHandle aHandle) -{ - RefPtr entry; - - if (aHandle > 0 && aHandle < mDb.Length()) { - entry = mDb[aHandle]; - } - return entry; -} - -void -MozMtpDatabase::RemoveEntry(MtpObjectHandle aHandle) -{ - if (aHandle > 0 && aHandle < mDb.Length()) { - mDb[aHandle] = nullptr; - } -} - -nsCString -MozMtpDatabase::BaseName(const nsCString& path) -{ - nsCOMPtr file; - NS_NewNativeLocalFile(path, false, getter_AddRefs(file)); - if (file) { - nsCString leafName; - file->GetNativeLeafName(leafName); - return leafName; - } - return path; -} - -void -MozMtpDatabase::ParseDirectory(const char *aDir, MtpObjectHandle aParent) -{ - ScopedCloseDir dir; - - if (!(dir = PR_OpenDir(aDir))) { - MTP_ERR("Unable to open directory '%s'", aDir); - return; - } - - PRDirEntry* dirEntry; - while ((dirEntry = PR_ReadDir(dir, PR_SKIP_BOTH))) { - nsPrintfCString filename("%s/%s", aDir, dirEntry->name); - PRFileInfo64 fileInfo; - if (PR_GetFileInfo64(filename.get(), &fileInfo) != PR_SUCCESS) { - MTP_ERR("Unable to retrieve file information for '%s'", filename.get()); - continue; - } - - RefPtr entry = new DbEntry; - - entry->mStorageID = MTP_STORAGE_FIXED_RAM; - entry->mParent = aParent; - entry->mObjectName = dirEntry->name; - entry->mDisplayName = dirEntry->name; - entry->mPath = filename; - entry->mDateCreated = fileInfo.creationTime; - entry->mDateModified = fileInfo.modifyTime; - - if (fileInfo.type == PR_FILE_FILE) { - entry->mObjectFormat = MTP_FORMAT_DEFINED; - //TODO: Check how 64-bit filesize are dealt with - entry->mObjectSize = fileInfo.size; - AddEntry(entry); - } else if (fileInfo.type == PR_FILE_DIRECTORY) { - entry->mObjectFormat = MTP_FORMAT_ASSOCIATION; - entry->mObjectSize = 0; - AddEntry(entry); - ParseDirectory(filename.get(), entry->mHandle); - } - } -} - -void -MozMtpDatabase::ReadVolume(const char *volumeName, const char *aDir) -{ - //TODO: Add an assert re thread being run on - - PRFileInfo fileInfo; - - if (PR_GetFileInfo(aDir, &fileInfo) != PR_SUCCESS) { - MTP_ERR("'%s' doesn't exist", aDir); - return; - } - if (fileInfo.type != PR_FILE_DIRECTORY) { - MTP_ERR("'%s' isn't a directory", aDir); - return; - } - - RefPtr entry = new DbEntry; - - entry->mStorageID = MTP_STORAGE_FIXED_RAM; - entry->mParent = MTP_PARENT_ROOT; - entry->mObjectName = volumeName; - entry->mDisplayName = volumeName; - entry->mPath = aDir; - entry->mObjectFormat = MTP_FORMAT_ASSOCIATION; - entry->mObjectSize = 0; - - AddEntry(entry); - - ParseDirectory(aDir, entry->mHandle); -} - -// called from SendObjectInfo to reserve a database entry for the incoming file -//virtual -MtpObjectHandle -MozMtpDatabase::beginSendObject(const char* aPath, - MtpObjectFormat aFormat, - MtpObjectHandle aParent, - MtpStorageID aStorageID, - uint64_t aSize, - time_t aModified) -{ - if (!aParent) { - MTP_LOG("aParent is NULL"); - return kInvalidObjectHandle; - } - - RefPtr entry = new DbEntry; - - entry->mStorageID = aStorageID; - entry->mParent = aParent; - entry->mPath = aPath; - entry->mObjectName = BaseName(entry->mPath); - entry->mDisplayName = entry->mObjectName; - entry->mObjectFormat = aFormat; - entry->mObjectSize = aSize; - - AddEntry(entry); - - MTP_LOG("Handle: 0x%08x Parent: 0x%08x Path: '%s'", entry->mHandle, aParent, aPath); - - return entry->mHandle; -} - -// called to report success or failure of the SendObject file transfer -// success should signal a notification of the new object's creation, -// failure should remove the database entry created in beginSendObject - -//virtual -void -MozMtpDatabase::endSendObject(const char* aPath, - MtpObjectHandle aHandle, - MtpObjectFormat aFormat, - bool succeeded) -{ - MTP_LOG("Handle: 0x%08x Path: '%s'", aHandle, aPath); - if (!succeeded) { - RemoveEntry(aHandle); - } -} - -//virtual -MtpObjectHandleList* -MozMtpDatabase::getObjectList(MtpStorageID aStorageID, - MtpObjectFormat aFormat, - MtpObjectHandle aParent) -{ - MTP_LOG("StorageID: 0x%08x Format: 0x%04x Parent: 0x%08x", - aStorageID, aFormat, aParent); - - //TODO: Optimize - - ScopedDeletePtr list; - - list = new MtpObjectHandleList(); - - DbArray::size_type numEntries = mDb.Length(); - DbArray::index_type entryIndex; - for (entryIndex = 1; entryIndex < numEntries; entryIndex++) { - RefPtr entry = mDb[entryIndex]; - if (entry->mParent == aParent) { - list->push(entry->mHandle); - } - } - return list.forget(); -} - -//virtual -int -MozMtpDatabase::getNumObjects(MtpStorageID aStorageID, - MtpObjectFormat aFormat, - MtpObjectHandle aParent) -{ - MTP_LOG(""); - - return mDb.Length() - 1; -} - -//virtual -MtpObjectFormatList* -MozMtpDatabase::getSupportedPlaybackFormats() -{ - static const uint16_t init_data[] = {MTP_FORMAT_PNG}; - - MtpObjectFormatList *list = new MtpObjectFormatList(); - list->appendArray(init_data, MOZ_ARRAY_LENGTH(init_data)); - - MTP_LOG("returning MTP_FORMAT_PNG"); - return list; -} - -//virtual -MtpObjectFormatList* -MozMtpDatabase::getSupportedCaptureFormats() -{ - static const uint16_t init_data[] = {MTP_FORMAT_ASSOCIATION, MTP_FORMAT_PNG}; - - MtpObjectFormatList *list = new MtpObjectFormatList(); - list->appendArray(init_data, MOZ_ARRAY_LENGTH(init_data)); - MTP_LOG("returning MTP_FORMAT_PNG"); - return list; -} - -static const MtpObjectProperty sSupportedObjectProperties[] = -{ - MTP_PROPERTY_STORAGE_ID, - MTP_PROPERTY_PARENT_OBJECT, - MTP_PROPERTY_OBJECT_FORMAT, - MTP_PROPERTY_OBJECT_SIZE, - MTP_PROPERTY_OBJECT_FILE_NAME, // just the filename - no directory - MTP_PROPERTY_PROTECTION_STATUS, // UINT16 - always 0 - MTP_PROPERTY_DATE_MODIFIED, - MTP_PROPERTY_DATE_ADDED, -}; - -//virtual -MtpObjectPropertyList* -MozMtpDatabase::getSupportedObjectProperties(MtpObjectFormat aFormat) -{ - MTP_LOG(""); - MtpObjectPropertyList *list = new MtpObjectPropertyList(); - list->appendArray(sSupportedObjectProperties, - MOZ_ARRAY_LENGTH(sSupportedObjectProperties)); - return list; -} - -//virtual -MtpDevicePropertyList* -MozMtpDatabase::getSupportedDeviceProperties() -{ - MTP_LOG(""); - static const uint16_t init_data[] = { MTP_DEVICE_PROPERTY_UNDEFINED }; - - MtpDevicePropertyList *list = new MtpDevicePropertyList(); - list->appendArray(init_data, MOZ_ARRAY_LENGTH(init_data)); - return list; -} - -//virtual -MtpResponseCode -MozMtpDatabase::getObjectPropertyValue(MtpObjectHandle aHandle, - MtpObjectProperty aProperty, - MtpDataPacket& aPacket) -{ - RefPtr entry = GetEntry(aHandle); - if (!entry) { - MTP_ERR("Invalid Handle: 0x%08x", aHandle); - return MTP_RESPONSE_INVALID_OBJECT_HANDLE; - } - - MTP_LOG("Handle: 0x%08x '%s' Property: %s 0x%08x", - aHandle, entry->mDisplayName.get(), ObjectPropertyAsStr(aProperty), aProperty); - - switch (aProperty) - { - case MTP_PROPERTY_STORAGE_ID: aPacket.putUInt32(entry->mStorageID); break; - case MTP_PROPERTY_PARENT_OBJECT: aPacket.putUInt32(entry->mParent); break; - case MTP_PROPERTY_OBJECT_FORMAT: aPacket.putUInt32(entry->mObjectFormat); break; - case MTP_PROPERTY_OBJECT_SIZE: aPacket.putUInt32(entry->mObjectSize); break; - case MTP_PROPERTY_DISPLAY_NAME: aPacket.putString(entry->mDisplayName.get()); break; - - default: - MTP_LOG("Invalid Property: 0x%08x", aProperty); - return MTP_RESPONSE_INVALID_OBJECT_PROP_CODE; - } - - return MTP_RESPONSE_OK; -} - -//virtual -MtpResponseCode -MozMtpDatabase::setObjectPropertyValue(MtpObjectHandle aHandle, - MtpObjectProperty aProperty, - MtpDataPacket& aPacket) -{ - MTP_LOG("Handle: 0x%08x (NOT SUPPORTED)", aHandle); - return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; -} - -//virtual -MtpResponseCode -MozMtpDatabase::getDevicePropertyValue(MtpDeviceProperty aProperty, - MtpDataPacket& aPacket) -{ - MTP_LOG("(GENERAL ERROR)"); - return MTP_RESPONSE_GENERAL_ERROR; -} - -//virtual -MtpResponseCode -MozMtpDatabase::setDevicePropertyValue(MtpDeviceProperty aProperty, - MtpDataPacket& aPacket) -{ - MTP_LOG("(NOT SUPPORTED)"); - return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; -} - -//virtual -MtpResponseCode -MozMtpDatabase::resetDeviceProperty(MtpDeviceProperty aProperty) -{ - MTP_LOG("(NOT SUPPORTED)"); - return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; -} - -void -MozMtpDatabase::QueryEntries(MozMtpDatabase::MatchType aMatchType, - uint32_t aMatchField1, - uint32_t aMatchField2, - DbArray &result) -{ - DbArray::size_type numEntries = mDb.Length(); - DbArray::index_type entryIdx; - RefPtr entry; - - result.Clear(); - - switch (aMatchType) { - - case MatchAll: - for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { - if (mDb[entryIdx]) { - result.AppendElement(mDb[entryIdx]); - } - } - break; - - case MatchHandle: - for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { - entry = mDb[entryIdx]; - if (entry && entry->mHandle == aMatchField1) { - result.AppendElement(entry); - // Handles are unique - return the one that we found. - return; - } - } - break; - - case MatchParent: - for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { - entry = mDb[entryIdx]; - if (entry && entry->mParent == aMatchField1) { - result.AppendElement(entry); - } - } - break; - - case MatchFormat: - for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { - entry = mDb[entryIdx]; - if (entry && entry->mObjectFormat == aMatchField1) { - result.AppendElement(entry); - } - } - break; - - case MatchHandleFormat: - for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { - entry = mDb[entryIdx]; - if (entry && entry->mHandle == aMatchField1) { - if (entry->mObjectFormat == aMatchField2) { - result.AppendElement(entry); - } - // Only 1 entry can match my aHandle. So we can return early. - return; - } - } - break; - - case MatchParentFormat: - for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { - entry = mDb[entryIdx]; - if (entry && entry->mParent == aMatchField1 && entry->mObjectFormat == aMatchField2) { - result.AppendElement(entry); - } - } - break; - - default: - MOZ_ASSERT(!"Invalid MatchType"); - } -} - -//virtual -MtpResponseCode -MozMtpDatabase::getObjectPropertyList(MtpObjectHandle aHandle, - uint32_t aFormat, - uint32_t aProperty, - int aGroupCode, - int aDepth, - MtpDataPacket& aPacket) -{ - MTP_LOG("Handle: 0x%08x Format: 0x%08x aProperty: 0x%08x aGroupCode: %d aDepth %d (NOT SUPPORTED)", - aHandle, aFormat, aProperty, aGroupCode, aDepth); - - if (aDepth > 1) { - return MTP_RESPONSE_SPECIFICATION_BY_DEPTH_UNSUPPORTED; - } - if (aGroupCode != 0) { - return MTP_RESPONSE_SPECIFICATION_BY_GROUP_UNSUPPORTED; - } - - MatchType matchType = MatchAll; - uint32_t matchField1 = 0; - uint32_t matchField2 = 0; - - // aHandle == 0 implies all objects at the root level - // further specificed by aFormat and/or aDepth - - if (aFormat == 0) { - if (aHandle == 0xffffffff) { - // select all objects - matchType = MatchAll; - } else { - if (aDepth == 1) { - // select objects whose Parent matches aHandle - matchType = MatchParent; - matchField1 = aHandle; - } else { - // select object whose handle matches aHandle - matchType = MatchHandle; - matchField1 = aHandle; - } - } - } else { - if (aHandle == 0xffffffff) { - // select all objects whose format matches aFormat - matchType = MatchFormat; - matchField1 = aFormat; - } else { - if (aDepth == 1) { - // select objects whose Parent is aHandle and format matches aFormat - matchType = MatchParentFormat; - matchField1 = aHandle; - matchField2 = aFormat; - } else { - // select objects whose handle is aHandle and format matches aFormat - matchType = MatchHandleFormat; - matchField1 = aHandle; - matchField2 = aFormat; - } - } - } - - DbArray result; - QueryEntries(matchType, matchField1, matchField2, result); - - const MtpObjectProperty *objectPropertyList; - size_t numObjectProperties = 0; - MtpObjectProperty objectProperty; - - if (aProperty == 0xffffffff) { - // return all supported properties - numObjectProperties = MOZ_ARRAY_LENGTH(sSupportedObjectProperties); - objectPropertyList = sSupportedObjectProperties; - } else { - // return property indicated by aProperty - numObjectProperties = 1; - objectProperty = aProperty; - objectPropertyList = &objectProperty; - } - - DbArray::size_type numEntries = result.Length(); - DbArray::index_type entryIdx; - - aPacket.putUInt32(numEntries); - for (entryIdx = 0; entryIdx < numEntries; entryIdx++) { - RefPtr entry = result[entryIdx]; - - for (size_t propertyIdx = 0; propertyIdx < numObjectProperties; propertyIdx++) { - aPacket.putUInt32(entry->mHandle); - MtpObjectProperty prop = objectPropertyList[propertyIdx]; - aPacket.putUInt16(prop); - switch (prop) { - - case MTP_PROPERTY_STORAGE_ID: - aPacket.putUInt16(MTP_TYPE_UINT32); - aPacket.putUInt32(entry->mStorageID); - break; - - case MTP_PROPERTY_PARENT_OBJECT: - aPacket.putUInt16(MTP_TYPE_UINT32); - aPacket.putUInt32(entry->mParent); - break; - - case MTP_PROPERTY_OBJECT_FORMAT: - aPacket.putUInt16(MTP_TYPE_UINT16); - aPacket.putUInt16(entry->mObjectFormat); - break; - - case MTP_PROPERTY_OBJECT_SIZE: - aPacket.putUInt16(MTP_TYPE_UINT64); - aPacket.putUInt64(entry->mObjectSize); - break; - - case MTP_PROPERTY_OBJECT_FILE_NAME: - aPacket.putUInt16(MTP_TYPE_STR); - aPacket.putString(entry->mObjectName.get()); - break; - - case MTP_PROPERTY_PROTECTION_STATUS: - aPacket.putUInt16(MTP_TYPE_UINT16); - aPacket.putUInt16(0); // 0 = No Protection - break; - - case MTP_PROPERTY_DATE_MODIFIED: { - aPacket.putUInt16(MTP_TYPE_STR); - PRExplodedTime explodedTime; - PR_ExplodeTime(entry->mDateModified, PR_LocalTimeParameters, &explodedTime); - char dateStr[20]; - PR_FormatTime(dateStr, sizeof(dateStr), "%Y%m%dT%H%M%S", &explodedTime); - aPacket.putString(dateStr); - break; - } - - case MTP_PROPERTY_DATE_ADDED: { - aPacket.putUInt16(MTP_TYPE_STR); - PRExplodedTime explodedTime; - PR_ExplodeTime(entry->mDateCreated, PR_LocalTimeParameters, &explodedTime); - char dateStr[20]; - PR_FormatTime(dateStr, sizeof(dateStr), "%Y%m%dT%H%M%S", &explodedTime); - aPacket.putString(dateStr); - break; - } - - default: - MTP_ERR("Unrecognized property code: %u", prop); - return MTP_RESPONSE_GENERAL_ERROR; - } - } - } - return MTP_RESPONSE_OK; -} - -//virtual -MtpResponseCode -MozMtpDatabase::getObjectInfo(MtpObjectHandle aHandle, - MtpObjectInfo& aInfo) -{ - RefPtr entry = GetEntry(aHandle); - if (!entry) { - MTP_ERR("Handle 0x%08x is invalid", aHandle); - return MTP_RESPONSE_INVALID_OBJECT_HANDLE; - } - - MTP_LOG("Handle: 0x%08x Display:'%s' Object:'%s'", aHandle, entry->mDisplayName.get(), entry->mObjectName.get()); - - aInfo.mHandle = aHandle; - aInfo.mStorageID = entry->mStorageID; - aInfo.mFormat = entry->mObjectFormat; - aInfo.mProtectionStatus = 0x0; - aInfo.mCompressedSize = 0; - aInfo.mThumbFormat = entry->mObjectFormat; - aInfo.mThumbCompressedSize = 20*20*4; - aInfo.mThumbPixWidth = 20; - aInfo.mThumbPixHeight =20; - aInfo.mImagePixWidth = 20; - aInfo.mImagePixHeight = 20; - aInfo.mImagePixDepth = 4; - aInfo.mParent = entry->mParent; - aInfo.mAssociationType = 0; - aInfo.mAssociationDesc = 0; - aInfo.mSequenceNumber = 0; - aInfo.mName = ::strdup(entry->mObjectName.get()); - aInfo.mDateCreated = 0; - aInfo.mDateModified = 0; - aInfo.mKeywords = ::strdup("fxos,touch"); - - return MTP_RESPONSE_OK; -} - -//virtual -void* -MozMtpDatabase::getThumbnail(MtpObjectHandle aHandle, size_t& aOutThumbSize) -{ - MTP_LOG("Handle: 0x%08x (returning nullptr)", aHandle); - - aOutThumbSize = 0; - - return nullptr; -} - -//virtual -MtpResponseCode -MozMtpDatabase::getObjectFilePath(MtpObjectHandle aHandle, - MtpString& aOutFilePath, - int64_t& aOutFileLength, - MtpObjectFormat& aOutFormat) -{ - RefPtr entry = GetEntry(aHandle); - if (!entry) { - MTP_ERR("Handle 0x%08x is invalid", aHandle); - return MTP_RESPONSE_INVALID_OBJECT_HANDLE; - } - - MTP_LOG("Handle: 0x%08x FilePath: '%s'", aHandle, entry->mPath.get()); - - aOutFilePath = entry->mPath.get(); - aOutFileLength = entry->mObjectSize; - aOutFormat = entry->mObjectFormat; - - return MTP_RESPONSE_OK; -} - -//virtual -MtpResponseCode -MozMtpDatabase::deleteFile(MtpObjectHandle aHandle) -{ - MTP_LOG("Handle: 0x%08x (NOT SUPPORTED)", aHandle); - - //TODO - - return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; -} - -#if 0 -//virtual -MtpResponseCode -MozMtpDatabase::moveFile(MtpObjectHandle aHandle, MtpObjectHandle aNewParent) -{ - MTP_LOG("Handle: 0x%08x NewParent: 0x%08x", aHandle, aNewParent); - - // change parent - - return MTP_RESPONSE_OK -} - -//virtual -MtpResponseCode -MozMtpDatabase::copyFile(MtpObjectHandle aHandle, MtpObjectHandle aNewParent) -{ - MTP_LOG("Handle: 0x%08x NewParent: 0x%08x", aHandle, aNewParent); - - // duplicate DbEntry - // change parent - - return MTP_RESPONSE_OK -} -#endif - -//virtual -MtpObjectHandleList* -MozMtpDatabase::getObjectReferences(MtpObjectHandle aHandle) -{ - MTP_LOG("Handle: 0x%08x (returning nullptr)", aHandle); - return nullptr; -} - -//virtual -MtpResponseCode -MozMtpDatabase::setObjectReferences(MtpObjectHandle aHandle, - MtpObjectHandleList* aReferences) -{ - MTP_LOG("Handle: 0x%08x (NOT SUPPORTED)", aHandle); - return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; -} - -//virtual -MtpProperty* -MozMtpDatabase::getObjectPropertyDesc(MtpObjectProperty aProperty, - MtpObjectFormat aFormat) -{ - MTP_LOG("Property: %s 0x%08x", ObjectPropertyAsStr(aProperty), aProperty); - - // TODO: Perhaps Filesize should be 64-bit? - - MtpProperty* result = nullptr; - switch (aProperty) - { - case MTP_PROPERTY_STORAGE_ID: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_OBJECT_FORMAT: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_OBJECT_SIZE: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_WIDTH: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_HEIGHT: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_IMAGE_BIT_DEPTH: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_DISPLAY_NAME: result = new MtpProperty(aProperty, MTP_TYPE_STR); break; - default: - break; - } - - return result; -} - -//virtual -MtpProperty* -MozMtpDatabase::getDevicePropertyDesc(MtpDeviceProperty aProperty) -{ - MTP_LOG("(returning MTP_DEVICE_PROPERTY_UNDEFINED)"); - return new MtpProperty(MTP_DEVICE_PROPERTY_UNDEFINED, MTP_TYPE_UNDEFINED); -} - -//virtual -void -MozMtpDatabase::sessionStarted() -{ - MTP_LOG(""); -} - -//virtual -void -MozMtpDatabase::sessionEnded() -{ - MTP_LOG(""); -} - -END_MTP_NAMESPACE diff --git a/dom/system/gonk/MozMtpDatabase.h b/dom/system/gonk/MozMtpDatabase.h deleted file mode 100644 index 7edd3ca5c5b..00000000000 --- a/dom/system/gonk/MozMtpDatabase.h +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_system_mozmtpdatabase_h__ -#define mozilla_system_mozmtpdatabase_h__ - -#include "MozMtpCommon.h" - -#include "mozilla/RefPtr.h" -#include "nsCOMPtr.h" -#include "nsISupportsImpl.h" -#include "nsString.h" -#include "nsTArray.h" - -BEGIN_MTP_NAMESPACE // mozilla::system::mtp - -using namespace android; - -class MozMtpDatabase : public MtpDatabase -{ -public: - MozMtpDatabase(const char *aDir); - virtual ~MozMtpDatabase(); - - // called from SendObjectInfo to reserve a database entry for the incoming file - virtual MtpObjectHandle beginSendObject(const char* aPath, - MtpObjectFormat aFormat, - MtpObjectHandle aParent, - MtpStorageID aStorageID, - uint64_t aSize, - time_t aModified); - - // called to report success or failure of the SendObject file transfer - // success should signal a notification of the new object's creation, - // failure should remove the database entry created in beginSendObject - virtual void endSendObject(const char* aPath, - MtpObjectHandle aHandle, - MtpObjectFormat aFormat, - bool aSucceeded); - - virtual MtpObjectHandleList* getObjectList(MtpStorageID aStorageID, - MtpObjectFormat aFormat, - MtpObjectHandle aParent); - - virtual int getNumObjects(MtpStorageID aStorageID, - MtpObjectFormat aFormat, - MtpObjectHandle aParent); - - virtual MtpObjectFormatList* getSupportedPlaybackFormats(); - - virtual MtpObjectFormatList* getSupportedCaptureFormats(); - - virtual MtpObjectPropertyList* getSupportedObjectProperties(MtpObjectFormat aFormat); - - virtual MtpDevicePropertyList* getSupportedDeviceProperties(); - - virtual MtpResponseCode getObjectPropertyValue(MtpObjectHandle aHandle, - MtpObjectProperty aProperty, - MtpDataPacket& aPacket); - - virtual MtpResponseCode setObjectPropertyValue(MtpObjectHandle aHandle, - MtpObjectProperty aProperty, - MtpDataPacket& aPacket); - - virtual MtpResponseCode getDevicePropertyValue(MtpDeviceProperty aProperty, - MtpDataPacket& aPacket); - - virtual MtpResponseCode setDevicePropertyValue(MtpDeviceProperty aProperty, - MtpDataPacket& aPacket); - - virtual MtpResponseCode resetDeviceProperty(MtpDeviceProperty aProperty); - - virtual MtpResponseCode getObjectPropertyList(MtpObjectHandle aHandle, - uint32_t aFormat, - uint32_t aProperty, - int aGroupCode, - int aDepth, - MtpDataPacket& aPacket); - - virtual MtpResponseCode getObjectInfo(MtpObjectHandle aHandle, - MtpObjectInfo& aInfo); - - virtual void* getThumbnail(MtpObjectHandle aHandle, size_t& aOutThumbSize); - - virtual MtpResponseCode getObjectFilePath(MtpObjectHandle aHandle, - MtpString& aOutFilePath, - int64_t& aOutFileLength, - MtpObjectFormat& aOutFormat); - - virtual MtpResponseCode deleteFile(MtpObjectHandle aHandle); - - virtual MtpObjectHandleList* getObjectReferences(MtpObjectHandle aHandle); - - virtual MtpResponseCode setObjectReferences(MtpObjectHandle aHandle, - MtpObjectHandleList* aReferences); - - virtual MtpProperty* getObjectPropertyDesc(MtpObjectProperty aProperty, - MtpObjectFormat aFormat); - - virtual MtpProperty* getDevicePropertyDesc(MtpDeviceProperty aProperty); - - virtual void sessionStarted(); - - virtual void sessionEnded(); - -private: - - struct DbEntry - { - NS_INLINE_DECL_REFCOUNTING(DbEntry) - - MtpObjectHandle mHandle; // uint32_t - MtpStorageID mStorageID; // uint32_t - nsCString mObjectName; - MtpObjectFormat mObjectFormat; // uint16_t - MtpObjectHandle mParent; // uint32_t - uint64_t mObjectSize; - nsCString mDisplayName; - nsCString mPath; - PRTime mDateCreated; - PRTime mDateModified; - }; - typedef nsTArray > DbArray; - - DbArray mDb; - - enum MatchType - { - MatchAll, - MatchHandle, - MatchParent, - MatchFormat, - MatchHandleFormat, - MatchParentFormat, - }; - - - void AddEntry(DbEntry *aEntry); - mozilla::TemporaryRef GetEntry(MtpObjectHandle aHandle); - void RemoveEntry(MtpObjectHandle aHandle); - void QueryEntries(MatchType aMatchType, uint32_t aMatchField1, - uint32_t aMatchField2, DbArray& aResult); - - nsCString BaseName(const nsCString& aPath); - - - MtpObjectHandle GetNextHandle() - { - return mDb.Length(); - } - - void ParseDirectory(const char *aDir, MtpObjectHandle aParent); - void ReadVolume(const char *aVolumeName, const char *aDir); -}; - -END_MTP_NAMESPACE - -#endif // mozilla_system_mozmtpdatabase_h__ diff --git a/dom/system/gonk/MozMtpServer.cpp b/dom/system/gonk/MozMtpServer.cpp deleted file mode 100644 index 43df913dcc9..00000000000 --- a/dom/system/gonk/MozMtpServer.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "MozMtpServer.h" -#include "MozMtpDatabase.h" - -#include -#include -#include - -#include -#include -#include - -#include - -#include "mozilla/FileUtils.h" -#include "mozilla/Scoped.h" -#include "nsThreadUtils.h" - -using namespace android; -using namespace mozilla; -USING_MTP_NAMESPACE - -class MtpServerRunnable : public nsRunnable -{ -public: - nsresult Run() - { - const char *mtpUsbFilename = "/dev/mtp_usb"; - const char *productName = "FirefoxOS"; - const char *storageDir = "/storage/sdcard"; - - mFd = open(mtpUsbFilename, O_RDWR); - if (mFd.get() < 0) { - MTP_LOG("open of '%s' failed", mtpUsbFilename); - return NS_OK; - } - - MTP_LOG("MozMtpServer open done, fd: %d. Start reading.", mFd.get()); - - ScopedDeletePtr database; - ScopedDeletePtr server; - ScopedDeletePtr storage; - - database = new MozMtpDatabase(storageDir); - server = new MtpServer(mFd.get(), database, false, 1023, 0664, 0775); - storage = new MtpStorage(MTP_STORAGE_FIXED_RAM, // id - storageDir, // filePath - productName, // description - 100uLL * 1024uLL * 1024uLL, // reserveSpace - false, // removable - 2uLL * 1024uLL * 1024uLL * 1024uLL); // maxFileSize - - server->addStorage(storage); - - MTP_LOG("MozMtpServer started"); - server->run(); - MTP_LOG("MozMtpServer finished"); - - return NS_OK; - } - -private: - ScopedClose mFd; -}; - -void -MozMtpServer::Run() -{ - nsresult rv = NS_NewNamedThread("MtpServer", getter_AddRefs(mServerThread)); - if (NS_WARN_IF(NS_FAILED(rv))) { - return; - } - MOZ_ASSERT(mServerThread); - mServerThread->Dispatch(new MtpServerRunnable(), 0); -} diff --git a/dom/system/gonk/MozMtpServer.h b/dom/system/gonk/MozMtpServer.h deleted file mode 100644 index c7c6a6f8b2c..00000000000 --- a/dom/system/gonk/MozMtpServer.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_system_mozmtpserver_h__ -#define mozilla_system_mozmtpserver_h__ - -#include "MozMtpCommon.h" - -#include "nsCOMPtr.h" -#include "nsIThread.h" - -BEGIN_MTP_NAMESPACE - -class MozMtpServer -{ -public: - NS_INLINE_DECL_REFCOUNTING(MozMtpServer) - - void Run(); - -private: - nsCOMPtr mServerThread; -}; - -END_MTP_NAMESPACE - -#endif // mozilla_system_mozmtpserver_h__ - - diff --git a/dom/system/gonk/moz.build b/dom/system/gonk/moz.build index 73a36133da2..159cfa32098 100644 --- a/dom/system/gonk/moz.build +++ b/dom/system/gonk/moz.build @@ -41,8 +41,6 @@ SOURCES += [ 'AutoMounter.cpp', 'AutoMounterSetting.cpp', 'GonkGPSGeolocationProvider.cpp', - 'MozMtpDatabase.cpp', - 'MozMtpServer.cpp', 'NetworkUtils.cpp', 'NetworkWorker.cpp', 'nsVolume.cpp', @@ -59,8 +57,6 @@ SOURCES += [ 'VolumeServiceTest.cpp', ] -CXXFLAGS += ['-I%s/frameworks/av/media/mtp' % CONFIG['ANDROID_SOURCE']] - if CONFIG['ENABLE_TESTS']: XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini'] diff --git a/toolkit/library/libxul.mk b/toolkit/library/libxul.mk index d424d64a3cb..4e556df0320 100644 --- a/toolkit/library/libxul.mk +++ b/toolkit/library/libxul.mk @@ -134,7 +134,6 @@ OS_LIBS += \ -lstagefright_omx \ -lbinder \ -lgui \ - -lmtp \ $(NULL) endif From dd058d2b0449386c57eaf881e2661084d948a425 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 11 Jul 2014 16:35:29 -0700 Subject: [PATCH 03/23] Bumping gaia.json for 3 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/b0e241b8ac01 Author: Kevin Grandon Desc: Bug 1037716 - Disable intermittent failing test | TEST-UNEXPECTED-FAIL | /builds/slave/test/gaia/apps/ringtones/test/marionette/manage_test.js | Ringtone management Manage ringtones Create new ringtone ======== https://hg.mozilla.org/integration/gaia-central/rev/b2f43aa49e72 Author: Kevin Grandon Desc: Merge pull request #21639 from KevinGrandon/bug_1033858_update_node_modules Bug 1033858 - Update gaia node modules for dependency updates ======== https://hg.mozilla.org/integration/gaia-central/rev/c93d68ee8ba6 Author: Kevin Grandon Desc: Bug 1033858 - Update gaia node modules for dependency updates --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index e2f5231bbc1..78d835b0e46 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "d7e63029d487bfaba57940d36396d701ddc01655", + "revision": "b0e241b8ac01f1a3e73c43c2b9e1cfa94b0d630f", "repo_path": "/integration/gaia-central" } From 2c21c4dd08a7fc0a7f9302b26b1a2f5a03346361 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 11 Jul 2014 16:41:14 -0700 Subject: [PATCH 04/23] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 5ca57254ad4..96049bd5d6b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index c278d123af9..f5184cdbd80 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 7a7f8179921..abcd20e6ce3 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 5ca57254ad4..96049bd5d6b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 5039a3e892a..d100af41b5d 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index c42d8b3fd6b..8ed8af420a5 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 6f71d98154a..061a9e65778 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 4b2670e4a81..6ed9ec7a98f 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 07bf56d0619..db3f463387e 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 5af411612f2eee035435b825566846eee5c8845a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 11 Jul 2014 18:55:29 -0700 Subject: [PATCH 05/23] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/fbc922929917 Author: Justin D'Arcangelo Desc: Merge pull request #21592 from justindarc/bug1036312 Bug 1036312 - Camera flash flashes when in background ======== https://hg.mozilla.org/integration/gaia-central/rev/628b4491adcd Author: Justin D'Arcangelo Desc: Bug 1036312 - Camera flash flashes when in background --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 78d835b0e46..3505996600b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "b0e241b8ac01f1a3e73c43c2b9e1cfa94b0d630f", + "revision": "fbc922929917d76debb7f91c428f52c22069ac99", "repo_path": "/integration/gaia-central" } From 8278a5c3683f84aa0fedeb5b87e9595d6d27db21 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 11 Jul 2014 19:01:14 -0700 Subject: [PATCH 06/23] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 96049bd5d6b..053a6ad2f5f 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index f5184cdbd80..d4f8dcb2bbe 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index abcd20e6ce3..fc91b7de224 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 96049bd5d6b..053a6ad2f5f 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index d100af41b5d..c7f5f3b7607 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 8ed8af420a5..856e45663ae 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 061a9e65778..6f5446d5b74 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 6ed9ec7a98f..704a973f3e4 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index db3f463387e..372811c0bbd 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From e18b880de7302636e93aac6c37e246d697be22fa Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 11 Jul 2014 20:35:28 -0700 Subject: [PATCH 07/23] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/c0ed46086ca7 Author: Kevin Grandon Desc: Merge pull request #21641 from KevinGrandon/bug_1037720_intermittent_app_pending_update_test Bug 1037720 - Intermittent failing test | TEST-UNEXPECTED-FAIL | /builds/slave/test/gaia/apps/verticalhome/test/marionette/app_pending_update_test.js | Vertical Home - Packaged App Update update an installed app 14:42:39 INFO - TEST-END | Vertical Home - Packaged ======== https://hg.mozilla.org/integration/gaia-central/rev/eb0746c7e9e2 Author: Kevin Grandon Desc: Bug 1037720 - Intermittent failing test | TEST-UNEXPECTED-FAIL | /builds/slave/test/gaia/apps/verticalhome/test/marionette/app_pending_update_test.js | Vertical Home - Packaged App Update update an installed app 14:42:39 INFO - TEST-END | Vertical Home - Packaged r=me --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 3505996600b..50e670b6350 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "fbc922929917d76debb7f91c428f52c22069ac99", + "revision": "c0ed46086ca724e6f1bda6499e8eca849b1ec029", "repo_path": "/integration/gaia-central" } From bd550f8943e877f147e260dfb32f10aafa4f863e Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 11 Jul 2014 20:41:16 -0700 Subject: [PATCH 08/23] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 053a6ad2f5f..8f7e487ba98 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index d4f8dcb2bbe..8101639153d 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index fc91b7de224..c77f6fc83ee 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 053a6ad2f5f..8f7e487ba98 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index c7f5f3b7607..3619b315583 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 856e45663ae..03e69a0c540 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 6f5446d5b74..13049ec48e4 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 704a973f3e4..94c6aa97360 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 372811c0bbd..0ceb0f24ac4 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 98b14a5dcca7437b10a080174ce2426c527ca55f Mon Sep 17 00:00:00 2001 From: Alfredo Yang Date: Mon, 30 Jun 2014 23:59:00 -0400 Subject: [PATCH 09/23] Bug 984274 - Remove WebappsUpdateTimers in B2G mochitests. r=fabrice --- b2g/components/test/mochitest/mochitest.ini | 1 - testing/mochitest/b2g_start_script.js | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/b2g/components/test/mochitest/mochitest.ini b/b2g/components/test/mochitest/mochitest.ini index 88636640344..161358088a4 100644 --- a/b2g/components/test/mochitest/mochitest.ini +++ b/b2g/components/test/mochitest/mochitest.ini @@ -7,7 +7,6 @@ support-files = systemapp_helper.js [test_sandbox_permission.html] -skip-if = true # bug 984274 - frequent timeouts [test_filepicker_path.html] [test_permission_deny.html] [test_permission_gum_remember.html] diff --git a/testing/mochitest/b2g_start_script.js b/testing/mochitest/b2g_start_script.js index 1e48999b021..6bc831af058 100644 --- a/testing/mochitest/b2g_start_script.js +++ b/testing/mochitest/b2g_start_script.js @@ -9,6 +9,8 @@ let wifiSettings = __marionetteParams[3] let prefs = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch) let settings = window.navigator.mozSettings; +let cm = Components.classes["@mozilla.org/categorymanager;1"]. + getService(Components.interfaces.nsICategoryManager); if (wifiSettings) wifiSettings = JSON.parse(wifiSettings); @@ -20,6 +22,12 @@ const CHILD_LOGGER_SCRIPT = "chrome://specialpowers/content/MozillaLogger.js"; let homescreen = document.getElementById('systemapp'); let container = homescreen.contentWindow.document.getElementById('test-container'); +// Disable udpate timers which cause failure in b2g permisson prompt tests. +if (cm) { + cm.deleteCategoryEntry("update-timer", "WebappsUpdateTimer", false); + cm.deleteCategoryEntry("update-timer", "nsUpdateService", false); +} + function openWindow(aEvent) { var popupIframe = aEvent.detail.frameElement; popupIframe.style = 'position: absolute; left: 0; top: 0px; background: white;'; From 60ab73afecc5fb9b73727c68224213027f2deb4c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 11 Jul 2014 22:10:29 -0700 Subject: [PATCH 10/23] Bumping gaia.json for 1 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/68cb800422d0 Author: Kevin Grandon Desc: Bug 1035936 - Disable test, TEST-UNEXPECTED-FAIL | /builds/slave/test/gaia/apps/search/test/marionette/app_search_test.js | Search - App search Search for app with entry point --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 50e670b6350..d39b5fa7c55 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "c0ed46086ca724e6f1bda6499e8eca849b1ec029", + "revision": "68cb800422d07f29d90b2ca2aa47f69998f6fc68", "repo_path": "/integration/gaia-central" } From 3742d68011f15f49f006582b0184a1570a0cb942 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Fri, 11 Jul 2014 22:16:16 -0700 Subject: [PATCH 11/23] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 8f7e487ba98..6ff303c0c28 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 8101639153d..608484a47ae 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index c77f6fc83ee..5c2d491ca67 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 8f7e487ba98..6ff303c0c28 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 3619b315583..312d4daee2b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 03e69a0c540..df650a04df7 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 13049ec48e4..2451a4d0bba 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 94c6aa97360..087cea19278 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 0ceb0f24ac4..5dcdb14a003 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 9bc24f8849ef5324696a82780c3ff11630bb833c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 00:05:28 -0700 Subject: [PATCH 12/23] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/9b0f4215a31b Author: Diego Marcos Desc: Merge pull request #21509 from dmarcos/bug1035383 Bug 1035383 - [B2G][Camera] The user is able to use the camera when batt... ======== https://hg.mozilla.org/integration/gaia-central/rev/a2171750ec89 Author: Diego Marcos Desc: Bug 1035383 - [B2G][Camera] The user is able to use the camera when battery is below 5% --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index d39b5fa7c55..4521d04bb76 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "68cb800422d07f29d90b2ca2aa47f69998f6fc68", + "revision": "9b0f4215a31bdae101401636c09408f1751df6ec", "repo_path": "/integration/gaia-central" } From c8c0d87d9fa9434d32266ea5bf0eb30bf83ca996 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 00:06:51 -0700 Subject: [PATCH 13/23] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 6ff303c0c28..8e9fa973f2b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 608484a47ae..c4dcf7d01ce 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 5c2d491ca67..e52250b9bbb 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 6ff303c0c28..8e9fa973f2b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 312d4daee2b..4202df057ec 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index df650a04df7..b1373a0d8ff 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 2451a4d0bba..c4dee73efea 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 087cea19278..619084d3937 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 5dcdb14a003..db9af84aff4 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 3ecfe8dcc8cca4346edc2233f7659ebd170c4c5c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 05:05:29 -0700 Subject: [PATCH 14/23] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/6e8e72a03d36 Author: vingtetun <21@vingtetun.org> Desc: Merge pull request #21648 from vingtetun/bug1028533 Bug 1028533 - Check hwSupportedTypes exists. r=vingtetun ======== https://hg.mozilla.org/integration/gaia-central/rev/f272a038bc85 Author: Camel Aissani Desc: Bug 1028533 - Check hwSupportedTypes exists. r=vingtetun --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 4521d04bb76..d39539e611e 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "9b0f4215a31bdae101401636c09408f1751df6ec", + "revision": "6e8e72a03d36b24f597e4f299c53db0ae2a0da66", "repo_path": "/integration/gaia-central" } From 2a995016dee92b6d6bc390cea50a1b2623052a88 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 05:12:27 -0700 Subject: [PATCH 15/23] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 8e9fa973f2b..9407349d6e8 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index c4dcf7d01ce..29b22e63558 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index e52250b9bbb..e7f0aa86933 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 8e9fa973f2b..9407349d6e8 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 4202df057ec..807143b9c6a 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index b1373a0d8ff..37b56304dca 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index c4dee73efea..c7ec19a0cae 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 619084d3937..4fa8a16a2e2 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index db9af84aff4..2cdf2b700a6 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From e116151f8abf6c85bc481e2993df4269a3157d2d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 05:20:29 -0700 Subject: [PATCH 16/23] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/fac1fdcfca2a Author: vingtetun <21@vingtetun.org> Desc: Merge pull request #21650 from vingtetun/gallery.settings.permission Bug 1033255 - [Gallery] Remove the settings permission from the manifest... ======== https://hg.mozilla.org/integration/gaia-central/rev/3f50e737cea0 Author: Vivien Nicolas Desc: Bug 1033255 - [Gallery] Remove the settings permission from the manifest. r=pdahiya ======== https://hg.mozilla.org/integration/gaia-central/rev/2b7626e451d9 Author: vingtetun <21@vingtetun.org> Desc: Merge pull request #21649 from vingtetun/video.settings.permission Bug 1033255 - [Video] Remove the settings permission from the manifest. ... ======== https://hg.mozilla.org/integration/gaia-central/rev/b605d4ad10dc Author: Vivien Nicolas Desc: Bug 1033255 - [Video] Remove the settings permission from the manifest. r=johu --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index d39539e611e..bbf1e93b530 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "6e8e72a03d36b24f597e4f299c53db0ae2a0da66", + "revision": "fac1fdcfca2acb8bdc580451a399d401b46dc382", "repo_path": "/integration/gaia-central" } From 8b89331a0a8c1211b8e1ca8e1d2e4741c356968a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 05:23:17 -0700 Subject: [PATCH 17/23] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 9407349d6e8..a389b8b80ee 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 29b22e63558..493f11a6de7 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index e7f0aa86933..df364e0e9db 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 9407349d6e8..a389b8b80ee 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 807143b9c6a..7217161ccf3 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 37b56304dca..4c8815747c1 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index c7ec19a0cae..4a7093b1e41 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 4fa8a16a2e2..5bd9ee897e8 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 2cdf2b700a6..687ee7d708a 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 306ecca2734b2637b08e102604e9b6c1ef8f40dd Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 11:40:29 -0700 Subject: [PATCH 18/23] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/5f1bb0739ef7 Author: Marcus Cavanaugh Desc: Merge pull request #19516 from mcav/async-send Bug 921050 - Send email in the background. r=asuth ======== https://hg.mozilla.org/integration/gaia-central/rev/cdb06337ef0d Author: Marcus Cavanaugh Desc: Bug 921050 - Send email in the background. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index bbf1e93b530..a8bc095773d 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "fac1fdcfca2acb8bdc580451a399d401b46dc382", + "revision": "5f1bb0739ef7bce49864e426c66ff0f57c9d461a", "repo_path": "/integration/gaia-central" } From d94ef89ad41b70cfdcc300e298005f8180fb8f51 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 11:43:09 -0700 Subject: [PATCH 19/23] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index a389b8b80ee..26285775bf4 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 493f11a6de7..d18453daec4 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index df364e0e9db..952c1be922a 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index a389b8b80ee..26285775bf4 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 7217161ccf3..7836411ee3b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 4c8815747c1..a18f16a9d40 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 4a7093b1e41..d55703b9d64 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 5bd9ee897e8..6f34722a249 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 687ee7d708a..63e4eb15359 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From f63143004f29e24e489bbe7b545cfd5937c89531 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 21:30:35 -0700 Subject: [PATCH 20/23] Bumping gaia.json for 1 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/cb957e1ec137 Author: Kevin Grandon Desc: Bug 1017002 - [Homescreen] Disable intermittent Marionette JS failure on Travis: 1) Homescreen navigation > Going to the homescreen and back to a warm app: AssertionError: we got 2 reflows instead of 0 --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index a8bc095773d..e449116f2f1 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "5f1bb0739ef7bce49864e426c66ff0f57c9d461a", + "revision": "cb957e1ec137a8fbfaa30d0059955afd0b7d0c43", "repo_path": "/integration/gaia-central" } From 59b5d8c6251a1ba59db16f317c7049b50bcdad7a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 21:36:19 -0700 Subject: [PATCH 21/23] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 26285775bf4..5a648e9b907 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index d18453daec4..82bf8ead0d3 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 952c1be922a..6e5f28b81a0 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 26285775bf4..5a648e9b907 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 7836411ee3b..e38f788ecd2 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index a18f16a9d40..96823288617 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index d55703b9d64..402faa75b45 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 6f34722a249..b5380a93d7e 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 63e4eb15359..413d7ff4e90 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From ffba232e9cce3c5316fd72b32bc6c88c5722887b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 23:40:29 -0700 Subject: [PATCH 22/23] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/db540afcf32e Author: Kevin Grandon Desc: Merge pull request #21647 from tanay1337/master Update README.md r=kgrandon ======== https://hg.mozilla.org/integration/gaia-central/rev/971678f584c1 Author: Tanay Pant Desc: Update README.md --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index e449116f2f1..19c7cf787fa 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "cb957e1ec137a8fbfaa30d0059955afd0b7d0c43", + "revision": "db540afcf32e30144e33555a5d6ca860ff8cabc3", "repo_path": "/integration/gaia-central" } From 30bee65f1754c998bb03252cac4736f6925bb513 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sat, 12 Jul 2014 23:41:52 -0700 Subject: [PATCH 23/23] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 5a648e9b907..e00b01a781d 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 82bf8ead0d3..669197ca1b9 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 6e5f28b81a0..54ddcfe77b1 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 5a648e9b907..e00b01a781d 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index e38f788ecd2..bd125f4c081 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 96823288617..e4952dbf426 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 402faa75b45..cbc32c1ad2c 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index b5380a93d7e..9abdb4ee833 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 413d7ff4e90..58279ed3a9c 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - +