mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 20:17:37 +00:00
merge b2g-inbound to mozilla-central a=merge
This commit is contained in:
commit
7ab156d0b6
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="1c9eb3d16167c2e5a9f7789eb46ee17830e6054e"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0114839afc44aa98ae87db91004835f16a49dcab"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c9eb3d16167c2e5a9f7789eb46ee17830e6054e"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="0114839afc44aa98ae87db91004835f16a49dcab"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c9eb3d16167c2e5a9f7789eb46ee17830e6054e"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="0114839afc44aa98ae87db91004835f16a49dcab"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="1c9eb3d16167c2e5a9f7789eb46ee17830e6054e"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0114839afc44aa98ae87db91004835f16a49dcab"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c9eb3d16167c2e5a9f7789eb46ee17830e6054e"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="0114839afc44aa98ae87db91004835f16a49dcab"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "cea1598e51f188fe8c48196cbb2c73aacbf3b1dc",
|
||||
"revision": "3112418e17e7f0b56dddb38316f6a448ec9c1e2a",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="1c9eb3d16167c2e5a9f7789eb46ee17830e6054e"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0114839afc44aa98ae87db91004835f16a49dcab"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="1c9eb3d16167c2e5a9f7789eb46ee17830e6054e"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0114839afc44aa98ae87db91004835f16a49dcab"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="1c9eb3d16167c2e5a9f7789eb46ee17830e6054e"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="0114839afc44aa98ae87db91004835f16a49dcab"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="1c9eb3d16167c2e5a9f7789eb46ee17830e6054e"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0114839afc44aa98ae87db91004835f16a49dcab"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -819,11 +819,7 @@ BluetoothAdapter::EnableDisable(bool aEnable, ErrorResult& aRv)
|
||||
}
|
||||
|
||||
// Notify applications of adapter state change to Enabling/Disabling
|
||||
nsTArray<nsString> types;
|
||||
BT_APPEND_ENUM_STRING(types,
|
||||
BluetoothAdapterAttribute,
|
||||
BluetoothAdapterAttribute::State);
|
||||
DispatchAttributeEvent(types);
|
||||
HandleAdapterStateChanged();
|
||||
|
||||
// Wrap runnable to handle result
|
||||
nsRefPtr<BluetoothReplyRunnable> result =
|
||||
@ -832,8 +828,11 @@ BluetoothAdapter::EnableDisable(bool aEnable, ErrorResult& aRv)
|
||||
methodName);
|
||||
|
||||
if(NS_FAILED(bs->EnableDisable(aEnable, result))) {
|
||||
// Restore mState and notify applications of adapter state change
|
||||
mState = aEnable ? BluetoothAdapterState::Disabled
|
||||
: BluetoothAdapterState::Enabled;
|
||||
HandleAdapterStateChanged();
|
||||
|
||||
promise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
|
||||
}
|
||||
|
||||
@ -894,6 +893,16 @@ BluetoothAdapter::IsAdapterAttributeChanged(BluetoothAdapterAttribute aType,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothAdapter::HandleAdapterStateChanged()
|
||||
{
|
||||
nsTArray<nsString> types;
|
||||
BT_APPEND_ENUM_STRING(types,
|
||||
BluetoothAdapterAttribute,
|
||||
BluetoothAdapterAttribute::State);
|
||||
DispatchAttributeEvent(types);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothAdapter::HandlePropertyChanged(const BluetoothValue& aValue)
|
||||
{
|
||||
|
@ -193,6 +193,7 @@ private:
|
||||
|
||||
bool IsAdapterAttributeChanged(BluetoothAdapterAttribute aType,
|
||||
const BluetoothValue& aValue);
|
||||
void HandleAdapterStateChanged();
|
||||
void HandlePropertyChanged(const BluetoothValue& aValue);
|
||||
void DispatchAttributeEvent(const nsTArray<nsString>& aTypes);
|
||||
BluetoothAdapterAttribute
|
||||
|
@ -28,6 +28,7 @@
|
||||
namespace android {
|
||||
class MOZ_EXPORT MtpServer;
|
||||
class MOZ_EXPORT MtpStorage;
|
||||
class MOZ_EXPORT MtpStringBuffer;
|
||||
class MOZ_EXPORT MtpDatabase;
|
||||
class MOZ_EXPORT MtpDataPacket;
|
||||
class MOZ_EXPORT MtpProperty;
|
||||
@ -39,6 +40,7 @@ namespace android {
|
||||
#include <MtpProperty.h>
|
||||
#include <MtpServer.h>
|
||||
#include <MtpStorage.h>
|
||||
#include <MtpStringBuffer.h>
|
||||
#include <MtpTypes.h>
|
||||
|
||||
#endif // mozilla_system_mtpcommon_h__
|
||||
|
@ -29,6 +29,7 @@ ObjectPropertyAsStr(MtpObjectProperty aProperty)
|
||||
{
|
||||
switch (aProperty) {
|
||||
case MTP_PROPERTY_STORAGE_ID: return "MTP_PROPERTY_STORAGE_ID";
|
||||
case MTP_PROPERTY_OBJECT_FILE_NAME: return "MTP_PROPERTY_OBJECT_FILE_NAME";
|
||||
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";
|
||||
@ -102,6 +103,22 @@ MozMtpDatabase::BaseName(const nsCString& path)
|
||||
return path;
|
||||
}
|
||||
|
||||
static nsCString
|
||||
GetPathWithoutFileName(const nsCString& aFullPath)
|
||||
{
|
||||
nsCString path;
|
||||
|
||||
int32_t offset = aFullPath.RFindChar('/');
|
||||
if (offset != kNotFound) {
|
||||
// The trailing slash will be as part of 'path'
|
||||
path = StringHead(aFullPath, offset + 1);
|
||||
}
|
||||
|
||||
MTP_LOG("returning '%s'", path.get());
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
void
|
||||
MozMtpDatabase::ParseDirectory(const char *aDir, MtpObjectHandle aParent)
|
||||
{
|
||||
@ -353,14 +370,84 @@ MozMtpDatabase::getObjectPropertyValue(MtpObjectHandle aHandle,
|
||||
return MTP_RESPONSE_OK;
|
||||
}
|
||||
|
||||
static int
|
||||
GetTypeOfObjectProp(MtpObjectProperty aProperty)
|
||||
{
|
||||
struct PropertyTableEntry {
|
||||
MtpObjectProperty property;
|
||||
int type;
|
||||
};
|
||||
|
||||
static const PropertyTableEntry kObjectPropertyTable[] = {
|
||||
{MTP_PROPERTY_STORAGE_ID, MTP_TYPE_UINT32 },
|
||||
{MTP_PROPERTY_OBJECT_FORMAT, MTP_TYPE_UINT16 },
|
||||
{MTP_PROPERTY_PROTECTION_STATUS, MTP_TYPE_UINT16 },
|
||||
{MTP_PROPERTY_OBJECT_SIZE, MTP_TYPE_UINT64 },
|
||||
{MTP_PROPERTY_OBJECT_FILE_NAME, MTP_TYPE_STR },
|
||||
{MTP_PROPERTY_DATE_MODIFIED, MTP_TYPE_STR },
|
||||
{MTP_PROPERTY_PARENT_OBJECT, MTP_TYPE_UINT32 },
|
||||
{MTP_PROPERTY_DISPLAY_NAME, MTP_TYPE_STR },
|
||||
{MTP_PROPERTY_DATE_ADDED, MTP_TYPE_STR },
|
||||
};
|
||||
|
||||
int count = sizeof(kObjectPropertyTable) / sizeof(kObjectPropertyTable[0]);
|
||||
const PropertyTableEntry* entryProp = kObjectPropertyTable;
|
||||
int type = 0;
|
||||
|
||||
for (int i = 0; i < count; ++i, ++entryProp) {
|
||||
if (entryProp->property == aProperty) {
|
||||
type = entryProp->type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
//virtual
|
||||
MtpResponseCode
|
||||
MozMtpDatabase::setObjectPropertyValue(MtpObjectHandle aHandle,
|
||||
MtpObjectProperty aProperty,
|
||||
MtpDataPacket& aPacket)
|
||||
{
|
||||
MTP_LOG("Handle: 0x%08x (NOT SUPPORTED)", aHandle);
|
||||
return MTP_RESPONSE_OPERATION_NOT_SUPPORTED;
|
||||
MTP_LOG("Handle: 0x%08x Property: 0x%08x", aHandle, aProperty);
|
||||
|
||||
// Only support file name change
|
||||
if (aProperty != MTP_PROPERTY_OBJECT_FILE_NAME) {
|
||||
MTP_ERR("property 0x%x not supported", aProperty);
|
||||
return MTP_RESPONSE_OBJECT_PROP_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (GetTypeOfObjectProp(aProperty) != MTP_TYPE_STR) {
|
||||
MTP_ERR("property type 0x%x not supported", GetTypeOfObjectProp(aProperty));
|
||||
return MTP_RESPONSE_GENERAL_ERROR;
|
||||
}
|
||||
|
||||
RefPtr<DbEntry> entry = GetEntry(aHandle);
|
||||
if (!entry) {
|
||||
MTP_ERR("Invalid Handle: 0x%08x", aHandle);
|
||||
return MTP_RESPONSE_INVALID_OBJECT_HANDLE;
|
||||
}
|
||||
|
||||
MtpStringBuffer buf;
|
||||
aPacket.getString(buf);
|
||||
|
||||
nsDependentCString newFileName(buf);
|
||||
nsCString newFileFullPath(GetPathWithoutFileName(entry->mPath) + newFileName);
|
||||
|
||||
if (PR_Rename(entry->mPath.get(), newFileFullPath.get()) != PR_SUCCESS) {
|
||||
MTP_ERR("Failed to rename '%s' to '%s'",
|
||||
entry->mPath.get(), newFileFullPath.get());
|
||||
return MTP_RESPONSE_GENERAL_ERROR;
|
||||
}
|
||||
|
||||
MTP_LOG("renamed '%s' to '%s'", entry->mPath.get(), newFileFullPath.get());
|
||||
|
||||
entry->mPath = newFileFullPath;
|
||||
entry->mObjectName = BaseName(entry->mPath);
|
||||
entry->mDisplayName = entry->mObjectName;
|
||||
|
||||
return MTP_RESPONSE_OK;
|
||||
}
|
||||
|
||||
//virtual
|
||||
@ -635,7 +722,13 @@ MozMtpDatabase::getObjectInfo(MtpObjectHandle aHandle,
|
||||
aInfo.mStorageID = entry->mStorageID;
|
||||
aInfo.mFormat = entry->mObjectFormat;
|
||||
aInfo.mProtectionStatus = 0x0;
|
||||
aInfo.mCompressedSize = 0;
|
||||
|
||||
if (entry->mObjectSize > 0xFFFFFFFFuLL) {
|
||||
aInfo.mCompressedSize = 0xFFFFFFFFuLL;
|
||||
} else {
|
||||
aInfo.mCompressedSize = entry->mObjectSize;
|
||||
}
|
||||
|
||||
aInfo.mThumbFormat = entry->mObjectFormat;
|
||||
aInfo.mThumbCompressedSize = 20*20*4;
|
||||
aInfo.mThumbPixWidth = 20;
|
||||
@ -748,18 +841,36 @@ MozMtpDatabase::getObjectPropertyDesc(MtpObjectProperty aProperty,
|
||||
{
|
||||
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;
|
||||
case MTP_PROPERTY_PROTECTION_STATUS:
|
||||
result = new MtpProperty(aProperty, MTP_TYPE_UINT16);
|
||||
break;
|
||||
case MTP_PROPERTY_OBJECT_FORMAT:
|
||||
result = new MtpProperty(aProperty, MTP_TYPE_UINT16, false, aFormat);
|
||||
break;
|
||||
case MTP_PROPERTY_STORAGE_ID:
|
||||
case MTP_PROPERTY_PARENT_OBJECT:
|
||||
case MTP_PROPERTY_WIDTH:
|
||||
case MTP_PROPERTY_HEIGHT:
|
||||
case MTP_PROPERTY_IMAGE_BIT_DEPTH:
|
||||
result = new MtpProperty(aProperty, MTP_TYPE_UINT32);
|
||||
break;
|
||||
case MTP_PROPERTY_OBJECT_SIZE:
|
||||
result = new MtpProperty(aProperty, MTP_TYPE_UINT64);
|
||||
break;
|
||||
case MTP_PROPERTY_DISPLAY_NAME:
|
||||
result = new MtpProperty(aProperty, MTP_TYPE_STR);
|
||||
break;
|
||||
case MTP_PROPERTY_OBJECT_FILE_NAME:
|
||||
result = new MtpProperty(aProperty, MTP_TYPE_STR, true);
|
||||
break;
|
||||
case MTP_PROPERTY_DATE_MODIFIED:
|
||||
case MTP_PROPERTY_DATE_ADDED:
|
||||
result = new MtpProperty(aProperty, MTP_TYPE_STR);
|
||||
result->setFormDateTime();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user