mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge b2g-inbound to m-c. a=merge
This commit is contained in:
commit
b7d111e6dd
@ -20,6 +20,14 @@ INSTALL_TARGETS += UA_UPDATE
|
||||
# Make sure the standalone glue doesn't try to get libxpcom.so from b2g/app.
|
||||
NSDISTMODE = copy
|
||||
|
||||
# Copy the Firefox OS fonts if available
|
||||
ifdef MOZTTDIR
|
||||
include $(MOZTTDIR)/fonts.mk
|
||||
MOZTT_DEST = $(FINAL_TARGET)/fonts
|
||||
MOZTT_FILES = $(patsubst external/moztt/%,$(MOZTTDIR)/%,$(filter external/moztt/%,$(subst :, ,$(PRODUCT_COPY_FILES))))
|
||||
INSTALL_TARGETS += MOZTT
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
APP_ICON = b2g
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<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="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<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="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<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="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -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="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "d3b2bb39fd5873ff8d537a3267d21d20491c3d1d",
|
||||
"revision": "8d483aad9a257678544e70bdfadee0e576cc3239",
|
||||
"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="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<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="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -34,4 +34,7 @@ export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
|
||||
|
||||
GAIADIR=$topsrcdir/gaia
|
||||
|
||||
# Include Firefox OS fonts.
|
||||
MOZTTDIR=$topsrcdir/moztt
|
||||
|
||||
. "$topsrcdir/b2g/config/mozconfigs/common.override"
|
||||
|
@ -32,6 +32,9 @@ export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
|
||||
|
||||
GAIADIR=$topsrcdir/gaia
|
||||
|
||||
# Include Firefox OS fonts.
|
||||
MOZTTDIR=$topsrcdir/moztt
|
||||
|
||||
# Build simulator xpi and phone tweaks for b2g-desktop
|
||||
FXOS_SIMULATOR=1
|
||||
|
||||
|
@ -34,4 +34,7 @@ export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
|
||||
|
||||
GAIADIR=$topsrcdir/gaia
|
||||
|
||||
# Include Firefox OS fonts.
|
||||
MOZTTDIR=$topsrcdir/moztt
|
||||
|
||||
. "$topsrcdir/b2g/config/mozconfigs/common.override"
|
||||
|
@ -32,6 +32,9 @@ export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
|
||||
|
||||
GAIADIR=$topsrcdir/gaia
|
||||
|
||||
# Include Firefox OS fonts.
|
||||
MOZTTDIR=$topsrcdir/moztt
|
||||
|
||||
# Build simulator xpi and phone tweaks for b2g-desktop
|
||||
FXOS_SIMULATOR=1
|
||||
|
||||
|
@ -32,4 +32,7 @@ export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
|
||||
|
||||
GAIADIR=$topsrcdir/gaia
|
||||
|
||||
# Include Firefox OS fonts.
|
||||
MOZTTDIR=$topsrcdir/moztt
|
||||
|
||||
. "$topsrcdir/b2g/config/mozconfigs/common.override"
|
||||
|
@ -29,6 +29,9 @@ export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
|
||||
|
||||
GAIADIR=$topsrcdir/gaia
|
||||
|
||||
# Include Firefox OS fonts.
|
||||
MOZTTDIR=$topsrcdir/moztt
|
||||
|
||||
# Build simulator xpi and phone tweaks for b2g-desktop
|
||||
FXOS_SIMULATOR=1
|
||||
|
||||
|
@ -28,4 +28,7 @@ export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
|
||||
|
||||
GAIADIR=$topsrcdir/gaia
|
||||
|
||||
# Include Firefox OS fonts.
|
||||
MOZTTDIR=$topsrcdir/moztt
|
||||
|
||||
. "$topsrcdir/b2g/config/mozconfigs/common.override"
|
||||
|
@ -25,6 +25,9 @@ export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP
|
||||
|
||||
GAIADIR=$topsrcdir/gaia
|
||||
|
||||
# Include Firefox OS fonts.
|
||||
MOZTTDIR=$topsrcdir/moztt
|
||||
|
||||
# Build simulator xpi and phone tweaks for b2g-desktop
|
||||
FXOS_SIMULATOR=1
|
||||
|
||||
|
@ -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="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||
|
@ -10,5 +10,12 @@
|
||||
"digest": "5520f53fc10fcb569f235aff5c78ea5b69c878a8439b95aa758de2b83fc9f09bd4758c5fd701d84c58776386e210f3f30e5c9da6fdd8358d7dd371c764179339",
|
||||
"algorithm": "sha512",
|
||||
"filename": "sccache.tar.bz2"
|
||||
},
|
||||
{
|
||||
"size": 31057326,
|
||||
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
|
||||
"algorithm": "sha512",
|
||||
"filename": "moztt.tar.bz2",
|
||||
"unpack": "True"
|
||||
}
|
||||
]
|
||||
|
@ -10,5 +10,12 @@
|
||||
"digest": "5520f53fc10fcb569f235aff5c78ea5b69c878a8439b95aa758de2b83fc9f09bd4758c5fd701d84c58776386e210f3f30e5c9da6fdd8358d7dd371c764179339",
|
||||
"algorithm": "sha512",
|
||||
"filename": "sccache.tar.bz2"
|
||||
},
|
||||
{
|
||||
"size": 31057326,
|
||||
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
|
||||
"algorithm": "sha512",
|
||||
"filename": "moztt.tar.bz2",
|
||||
"unpack": "True"
|
||||
}
|
||||
]
|
||||
|
@ -19,5 +19,12 @@
|
||||
"digest": "5520f53fc10fcb569f235aff5c78ea5b69c878a8439b95aa758de2b83fc9f09bd4758c5fd701d84c58776386e210f3f30e5c9da6fdd8358d7dd371c764179339",
|
||||
"algorithm": "sha512",
|
||||
"filename": "sccache.tar.bz2"
|
||||
},
|
||||
{
|
||||
"size": 31057326,
|
||||
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
|
||||
"algorithm": "sha512",
|
||||
"filename": "moztt.tar.bz2",
|
||||
"unpack": "True"
|
||||
}
|
||||
]
|
||||
|
@ -4,5 +4,12 @@
|
||||
"digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869",
|
||||
"algorithm": "sha512",
|
||||
"filename": "mozmake.exe"
|
||||
},
|
||||
{
|
||||
"size": 31057326,
|
||||
"digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51",
|
||||
"algorithm": "sha512",
|
||||
"filename": "moztt.tar.bz2",
|
||||
"unpack": "True"
|
||||
}
|
||||
]
|
||||
|
@ -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="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="27a1d1baaa8e375b70e043efee67d5f2206c330b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -886,3 +886,7 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
|
||||
@BINPATH@/gaia/*
|
||||
@BINPATH@/b2g-bin@BIN_SUFFIX@
|
||||
#endif
|
||||
|
||||
#ifdef PACKAGE_MOZTT
|
||||
@BINPATH@/fonts/*
|
||||
#endif
|
||||
|
@ -183,6 +183,15 @@ if test -n "$FXOS_SIMULATOR" ; then
|
||||
AC_SUBST(FXOS_SIMULATOR)
|
||||
fi
|
||||
|
||||
if test -n "$MOZTTDIR" -a ! -d "$MOZTTDIR" ; then
|
||||
AC_MSG_ERROR([MOZTTDIR '$MOZTTDIR' isn't a valid directory])
|
||||
fi
|
||||
|
||||
AC_SUBST(MOZTTDIR)
|
||||
if test -n "$MOZTTDIR" ; then
|
||||
AC_DEFINE(PACKAGE_MOZTT)
|
||||
fi
|
||||
|
||||
MOZ_ARG_WITH_STRING(gonk,
|
||||
[ --with-gonk=DIR
|
||||
location of gonk dir],
|
||||
|
@ -92,10 +92,11 @@ public:
|
||||
sSetPropertyRunnableArray.Clear();
|
||||
sUnbondingRunnableArray.Clear();
|
||||
|
||||
// Bluetooth scan mode is NONE by default
|
||||
// Bluetooth scan mode is SCAN_MODE_CONNECTABLE by default, i.e., It should
|
||||
// be connectable and non-discoverable.
|
||||
NS_ENSURE_TRUE(sBtInterface, NS_ERROR_FAILURE);
|
||||
sBtInterface->SetAdapterProperty(
|
||||
BluetoothNamedValue(NS_ConvertUTF8toUTF16("Discoverable"), true),
|
||||
BluetoothNamedValue(NS_ConvertUTF8toUTF16("Discoverable"), false),
|
||||
new SetAdapterPropertyResultHandler());
|
||||
|
||||
// Try to fire event 'AdapterAdded' to fit the original behaviour when
|
||||
|
@ -107,10 +107,11 @@ public:
|
||||
sBondingRunnableArray.Clear();
|
||||
sUnbondingRunnableArray.Clear();
|
||||
|
||||
// Bluetooth scan mode is NONE by default
|
||||
// Bluetooth scan mode is SCAN_MODE_CONNECTABLE by default, i.e., It should
|
||||
// be connectable and non-discoverable.
|
||||
NS_ENSURE_TRUE(sBtInterface, NS_ERROR_FAILURE);
|
||||
sBtInterface->SetAdapterProperty(
|
||||
BluetoothNamedValue(NS_ConvertUTF8toUTF16("Discoverable"), true),
|
||||
BluetoothNamedValue(NS_ConvertUTF8toUTF16("Discoverable"), false),
|
||||
new SetAdapterPropertyResultHandler());
|
||||
|
||||
// Trigger BluetoothOppManager to listen
|
||||
|
@ -352,7 +352,7 @@ GonkCameraParameters::SetTranslated(uint32_t aKey, const ICameraControl::Size& a
|
||||
if (aSize.width > INT_MAX || aSize.height > INT_MAX) {
|
||||
// AOSP can only handle signed ints.
|
||||
DOM_CAMERA_LOGE("Camera parameter aKey=%d out of bounds (width=%u, height=%u)\n",
|
||||
aSize.width, aSize.height);
|
||||
aKey, aSize.width, aSize.height);
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,13 @@ protected:
|
||||
void get(const char* aKey, double& aRet) { aRet = getFloat(aKey); }
|
||||
void get(const char* aKey, const char*& aRet) { aRet = get(aKey); }
|
||||
void get(const char* aKey, int& aRet) { aRet = getInt(aKey); }
|
||||
void get(const char* aKey, bool& aRet) { aRet = strcmp(get(aKey), FALSE); }
|
||||
|
||||
void
|
||||
get(const char* aKey, bool& aRet)
|
||||
{
|
||||
const char* value = get(aKey);
|
||||
aRet = value ? strcmp(value, TRUE) == 0 : false;
|
||||
}
|
||||
|
||||
void remove(const char* aKey) { android::CameraParameters::remove(aKey); }
|
||||
|
||||
|
@ -29,6 +29,17 @@ const MOBILECALLFORWARDINGOPTIONS_CID =
|
||||
Components.ID("{e0cf4463-ee63-4b05-ab2e-d94bf764836c}");
|
||||
const TELEPHONYDIALCALLBACK_CID =
|
||||
Components.ID("{c2af1a5d-3649-44ef-a1ff-18e9ac1dec51}");
|
||||
const NEIGHBORINGCELLINFO_CID =
|
||||
Components.ID("{6078cbf1-f34c-44fa-96f8-11a88d4bfdd3}");
|
||||
const GSMCELLINFO_CID =
|
||||
Components.ID("{e3cf3aa0-f992-48fe-967b-ec98a28c8535}");
|
||||
const WCDMACELLINFO_CID =
|
||||
Components.ID("{62e2c83c-b535-4068-9762-8039fac48106}");
|
||||
const CDMACELLINFO_CID =
|
||||
Components.ID("{40f491f0-dd8b-42fd-af32-aef5b002749a}");
|
||||
const LTECELLINFO_CID =
|
||||
Components.ID("{715e2c76-3b08-41e4-8ea5-e60c5ce6393e}");
|
||||
|
||||
|
||||
const NS_XPCOM_SHUTDOWN_OBSERVER_ID = "xpcom-shutdown";
|
||||
const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";
|
||||
@ -36,6 +47,9 @@ const NS_NETWORK_ACTIVE_CHANGED_TOPIC_ID = "network-active-changed";
|
||||
|
||||
const kPrefRilDebuggingEnabled = "ril.debugging.enabled";
|
||||
|
||||
const INT32_MAX = 2147483647;
|
||||
const UNKNOWN_RSSI = 99;
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gSystemMessenger",
|
||||
"@mozilla.org/system-message-internal;1",
|
||||
"nsISystemMessagesInternal");
|
||||
@ -138,6 +152,134 @@ MobileCallForwardingOptions.prototype = {
|
||||
serviceClass: Ci.nsIMobileConnection.ICC_SERVICE_CLASS_NONE
|
||||
}
|
||||
|
||||
function NeighboringCellInfo() {}
|
||||
NeighboringCellInfo.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsINeighboringCellInfo]),
|
||||
classID: NEIGHBORINGCELLINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: NEIGHBORINGCELLINFO_CID,
|
||||
classDescription: "NeighboringCellInfo",
|
||||
interfaces: [Ci.nsINeighboringCellInfo]
|
||||
}),
|
||||
|
||||
// nsINeighboringCellInfo
|
||||
|
||||
networkType: null,
|
||||
gsmLocationAreaCode: -1,
|
||||
gsmCellId: -1,
|
||||
wcdmaPsc: -1,
|
||||
signalStrength: UNKNOWN_RSSI
|
||||
};
|
||||
|
||||
function CellInfo() {}
|
||||
CellInfo.prototype = {
|
||||
|
||||
// nsICellInfo
|
||||
|
||||
type: null,
|
||||
registered: false,
|
||||
timestampType: Ci.nsICellInfo.TIMESTAMP_TYPE_UNKNOWN,
|
||||
timestamp: 0
|
||||
};
|
||||
|
||||
function GsmCellInfo() {}
|
||||
GsmCellInfo.prototype = {
|
||||
__proto__: CellInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsICellInfo,
|
||||
Ci.nsIGsmCellInfo]),
|
||||
classID: GSMCELLINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: GSMCELLINFO_CID,
|
||||
classDescription: "GsmCellInfo",
|
||||
interfaces: [Ci.nsIGsmCellInfo]
|
||||
}),
|
||||
|
||||
// nsIGsmCellInfo
|
||||
|
||||
mcc: INT32_MAX,
|
||||
mnc: INT32_MAX,
|
||||
lac: INT32_MAX,
|
||||
cid: INT32_MAX,
|
||||
signalStrength: UNKNOWN_RSSI,
|
||||
bitErrorRate: UNKNOWN_RSSI
|
||||
};
|
||||
|
||||
function WcdmaCellInfo() {}
|
||||
WcdmaCellInfo.prototype = {
|
||||
__proto__: CellInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsICellInfo,
|
||||
Ci.nsIWcdmaCellInfo]),
|
||||
classID: WCDMACELLINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: WCDMACELLINFO_CID,
|
||||
classDescription: "WcdmaCellInfo",
|
||||
interfaces: [Ci.nsIWcdmaCellInfo]
|
||||
}),
|
||||
|
||||
// nsIWcdmaCellInfo
|
||||
|
||||
mcc: INT32_MAX,
|
||||
mnc: INT32_MAX,
|
||||
lac: INT32_MAX,
|
||||
cid: INT32_MAX,
|
||||
psc: INT32_MAX,
|
||||
signalStrength: UNKNOWN_RSSI,
|
||||
bitErrorRate: UNKNOWN_RSSI
|
||||
};
|
||||
|
||||
function LteCellInfo() {}
|
||||
LteCellInfo.prototype = {
|
||||
__proto__: CellInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsICellInfo,
|
||||
Ci.nsILteCellInfo]),
|
||||
classID: LTECELLINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: LTECELLINFO_CID,
|
||||
classDescription: "LteCellInfo",
|
||||
interfaces: [Ci.nsILteCellInfo]
|
||||
}),
|
||||
|
||||
// nsILteCellInfo
|
||||
|
||||
mcc: INT32_MAX,
|
||||
mnc: INT32_MAX,
|
||||
cid: INT32_MAX,
|
||||
pcid: INT32_MAX,
|
||||
tac: INT32_MAX,
|
||||
signalStrength: UNKNOWN_RSSI,
|
||||
rsrp: INT32_MAX,
|
||||
rsrq: INT32_MAX,
|
||||
rssnr: INT32_MAX,
|
||||
cqi: INT32_MAX,
|
||||
timingAdvance: INT32_MAX
|
||||
};
|
||||
|
||||
function CdmaCellInfo() {}
|
||||
CdmaCellInfo.prototype = {
|
||||
__proto__: CellInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsICellInfo,
|
||||
Ci.nsICdmaCellInfo]),
|
||||
classID: CDMACELLINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: CDMACELLINFO_CID,
|
||||
classDescription: "CdmaCellInfo",
|
||||
interfaces: [Ci.nsICdmaCellInfo]
|
||||
}),
|
||||
|
||||
// nsICdmaCellInfo
|
||||
|
||||
networkId: INT32_MAX,
|
||||
systemId: INT32_MAX,
|
||||
baseStationId: INT32_MAX,
|
||||
longitude: INT32_MAX,
|
||||
latitude: INT32_MAX,
|
||||
cdmaDbm: INT32_MAX,
|
||||
cdmaEcio: INT32_MAX,
|
||||
evdoDbm: INT32_MAX,
|
||||
evdoEcio: INT32_MAX,
|
||||
evdoSnr: INT32_MAX
|
||||
};
|
||||
|
||||
/**
|
||||
* Wrap a MobileConnectionCallback to a TelephonyDialCallback.
|
||||
*/
|
||||
@ -904,6 +1046,67 @@ MobileConnectionProvider.prototype = {
|
||||
return true;
|
||||
}).bind(this));
|
||||
},
|
||||
|
||||
getCellInfoList: function(aCallback) {
|
||||
this._radioInterface.sendWorkerMessage("getCellInfoList",
|
||||
null,
|
||||
function(aResponse) {
|
||||
if (aResponse.errorMsg) {
|
||||
aCallback.notifyGetCellInfoListFailed(aResponse.errorMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
let cellInfoList = [];
|
||||
let count = aResponse.result.length;
|
||||
for (let i = 0; i < count; i++) {
|
||||
let srcCellInfo = aResponse.result[i];
|
||||
let cellInfo;
|
||||
switch (srcCellInfo.type) {
|
||||
case RIL.CELL_INFO_TYPE_GSM:
|
||||
cellInfo = new GsmCellInfo();
|
||||
break;
|
||||
case RIL.CELL_INFO_TYPE_WCDMA:
|
||||
cellInfo = new WcdmaCellInfo();
|
||||
break;
|
||||
case RIL.CELL_INFO_TYPE_LTE:
|
||||
cellInfo = new LteCellInfo();
|
||||
break;
|
||||
case RIL.CELL_INFO_TYPE_CDMA:
|
||||
cellInfo = new CdmaCellInfo();
|
||||
break;
|
||||
}
|
||||
|
||||
if (!cellInfo) {
|
||||
continue;
|
||||
}
|
||||
this._updateInfo(cellInfo, srcCellInfo);
|
||||
cellInfoList.push(cellInfo);
|
||||
}
|
||||
aCallback.notifyGetCellInfoList(count, cellInfoList);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
getNeighboringCellIds: function(aCallback) {
|
||||
this._radioInterface.sendWorkerMessage("getNeighboringCellIds",
|
||||
null,
|
||||
function(aResponse) {
|
||||
if (aResponse.errorMsg) {
|
||||
aCallback.notifyGetNeighboringCellIdsFailed(aResponse.errorMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
let neighboringCellIds = [];
|
||||
let count = aResponse.result.length;
|
||||
for (let i = 0; i < count; i++) {
|
||||
let srcCellInfo = aResponse.result[i];
|
||||
let cellInfo = new NeighboringCellInfo();
|
||||
this._updateInfo(cellInfo, srcCellInfo);
|
||||
neighboringCellIds.push(cellInfo);
|
||||
}
|
||||
aCallback.notifyGetNeighboringCellIds(count, neighboringCellIds);
|
||||
|
||||
}.bind(this));
|
||||
},
|
||||
};
|
||||
|
||||
function MobileConnectionService() {
|
||||
|
@ -4,13 +4,17 @@
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(1aed4c36-979e-4d20-9fa0-55139da8301e)]
|
||||
interface nsICellInfo;
|
||||
|
||||
[scriptable, uuid(d8fae631-7ade-4024-b288-7efe75e6b091)]
|
||||
interface nsICellInfoListCallback : nsISupports
|
||||
{
|
||||
/**
|
||||
* result is an array of nsICellInfo.
|
||||
* result is an array of nsICellInfo, which could be instances of
|
||||
* nsIGsmCellInfo, nsIWcdmaCellInfo, nsICdmaCellInfo or nsILteCellInfo.
|
||||
*/
|
||||
void notifyGetCellInfoList(in jsval result);
|
||||
void notifyGetCellInfoList(in uint32_t count,
|
||||
[array, size_is(count)] in nsICellInfo result);
|
||||
|
||||
/**
|
||||
* Callback function with error message.
|
||||
|
@ -4,10 +4,12 @@
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsICellInfoListCallback;
|
||||
interface nsIMobileCallForwardingOptions;
|
||||
interface nsIMobileConnection;
|
||||
interface nsIMobileConnectionInfo;
|
||||
interface nsIMobileNetworkInfo;
|
||||
interface nsINeighboringCellIdsCallback;
|
||||
interface nsIVariant;
|
||||
|
||||
[scriptable, uuid(823d935e-8262-47ed-8429-8203096b2ff4)]
|
||||
@ -234,7 +236,7 @@ already_AddRefed<nsIMobileConnectionService>
|
||||
NS_CreateMobileConnectionService();
|
||||
%}
|
||||
|
||||
[scriptable, uuid(bde83c1d-1335-43b6-8268-ec7e320167f0)]
|
||||
[scriptable, uuid(cfc7d15b-d2c2-4f28-ad9f-b250030c3073)]
|
||||
interface nsIMobileConnection : nsISupports
|
||||
{
|
||||
/*
|
||||
@ -764,4 +766,23 @@ interface nsIMobileConnection : nsISupports
|
||||
*/
|
||||
void setRadioEnabled(in bool enabled,
|
||||
in nsIMobileConnectionCallback requestCallback);
|
||||
|
||||
/**
|
||||
* Request neighboring cell ids in GSM/UMTS network.
|
||||
*
|
||||
* @param callback
|
||||
* Called when request is finished. See nsINeighboringCellIdsCallback
|
||||
* for details.
|
||||
*/
|
||||
void getNeighboringCellIds(in nsINeighboringCellIdsCallback callback);
|
||||
|
||||
/**
|
||||
* Request all of the current cell information known to the radio, including
|
||||
* neighboring cells.
|
||||
*
|
||||
* @param callback
|
||||
* Called when request is finished. See nsICellInfoListCallback
|
||||
* for details.
|
||||
*/
|
||||
void getCellInfoList(in nsICellInfoListCallback callback);
|
||||
};
|
||||
|
@ -4,13 +4,16 @@
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(909f5972-c74e-44dd-b72a-7ddb62aae617)]
|
||||
interface nsINeighboringCellInfo;
|
||||
|
||||
[scriptable, uuid(0941cb79-36e5-41e0-b05f-cdb854c53f03)]
|
||||
interface nsINeighboringCellIdsCallback : nsISupports
|
||||
{
|
||||
/**
|
||||
* result is an array of nsINeighboringCellInfo.
|
||||
*/
|
||||
void notifyGetNeighboringCellIds(in jsval result);
|
||||
void notifyGetNeighboringCellIds(in uint32_t count,
|
||||
[array, size_is(count)] in nsINeighboringCellInfo result);
|
||||
|
||||
/**
|
||||
* Callback function with error message.
|
||||
|
@ -340,6 +340,20 @@ MobileConnectionChild::SetRadioEnabled(bool aEnabled,
|
||||
? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MobileConnectionChild::GetNeighboringCellIds(nsINeighboringCellIdsCallback* aCallback)
|
||||
{
|
||||
// This function is supported in chrome context only.
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MobileConnectionChild::GetCellInfoList(nsICellInfoListCallback* aCallback)
|
||||
{
|
||||
// This function is supported in chrome context only.
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
bool
|
||||
MobileConnectionChild::SendRequest(const MobileConnectionRequest& aRequest,
|
||||
nsIMobileConnectionCallback* aCallback)
|
||||
|
@ -36,3 +36,4 @@ disabled = Bug 979137
|
||||
[test_dsds_mobile_data_connection.js]
|
||||
[test_mobile_clir.js]
|
||||
[test_mobile_clir_radio_off.js]
|
||||
[test_mobile_neighboring_cell_ids.js]
|
||||
|
@ -0,0 +1,38 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 30000;
|
||||
// This test must run in chrome context.
|
||||
MARIONETTE_CONTEXT = "chrome";
|
||||
|
||||
let Promise = Cu.import("resource://gre/modules/Promise.jsm").Promise;
|
||||
|
||||
let service = Cc["@mozilla.org/mobileconnection/mobileconnectionservice;1"]
|
||||
.getService(Ci.nsIMobileConnectionService);
|
||||
ok(service, "service.constructor is " + service.constructor);
|
||||
|
||||
let mobileConnection = service.getItemByServiceId(0);
|
||||
ok(mobileConnection, "mobileConnection.constructor is " + mobileConnection.constrctor);
|
||||
|
||||
function testGetNeighboringCellIds() {
|
||||
log("Test getting mobile neighboring cell ids");
|
||||
let deferred = Promise.defer();
|
||||
|
||||
mobileConnection.getNeighboringCellIds({
|
||||
notifyGetNeighboringCellIds: function(aResult) {
|
||||
deferred.resolve(aResult);
|
||||
},
|
||||
notifyGetNeighboringCellIdsFailed: function(aError) {
|
||||
deferred.reject(aError);
|
||||
}
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
// Start tests
|
||||
testGetNeighboringCellIds()
|
||||
.then(function resolve(aResult) {
|
||||
ok(false, "getNeighboringCellIds should not success");
|
||||
}, function reject(aError) {
|
||||
is(aError, "RequestNotSupported", "failed to getNeighboringCellIds");
|
||||
}).then(finish);
|
@ -80,10 +80,13 @@ USING_MTP_NAMESPACE
|
||||
#define USE_DEBUG 0
|
||||
|
||||
#undef LOG
|
||||
#undef LOGW
|
||||
#undef ERR
|
||||
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "AutoMounter", ## args)
|
||||
#define LOGW(args...) __android_log_print(ANDROID_LOG_WARN, "AutoMounter", ## args)
|
||||
#define ERR(args...) __android_log_print(ANDROID_LOG_ERROR, "AutoMounter", ## args)
|
||||
|
||||
#undef DBG
|
||||
#if USE_DEBUG
|
||||
#define DBG(args...) __android_log_print(ANDROID_LOG_DEBUG, "AutoMounter" , ## args)
|
||||
#else
|
||||
@ -270,7 +273,7 @@ public:
|
||||
|
||||
void ConfigureUsbFunction(const char* aUsbFunc);
|
||||
|
||||
void StartMtpServer();
|
||||
bool StartMtpServer();
|
||||
void StopMtpServer();
|
||||
|
||||
void StartUmsSharing();
|
||||
@ -582,16 +585,33 @@ SetUsbFunction(const char* aUsbFunc)
|
||||
property_set(SYS_USB_CONFIG, newSysUsbConfig);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
AutoMounter::StartMtpServer()
|
||||
{
|
||||
if (sMozMtpServer) {
|
||||
// Mtp Server is already running - nothing to do
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
LOG("Starting MtpServer");
|
||||
|
||||
// For debugging, Change the #if 0 to #if 1, and then attach gdb during
|
||||
// the 5 second interval below. Otherwise, configuring MTP will cause adb
|
||||
// (and thus gdb) to get bounced.
|
||||
#if 0
|
||||
LOG("Sleeping");
|
||||
PRTime now = PR_Now();
|
||||
PRTime stopTime = now + 5000000;
|
||||
while (PR_Now() < stopTime) {
|
||||
LOG("Sleeping...");
|
||||
sleep(1);
|
||||
}
|
||||
LOG("Sleep done");
|
||||
#endif
|
||||
|
||||
sMozMtpServer = new MozMtpServer();
|
||||
sMozMtpServer->Run();
|
||||
if (!sMozMtpServer->Init()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
VolumeArray::index_type volIndex;
|
||||
VolumeArray::size_type numVolumes = VolumeManager::NumVolumes();
|
||||
@ -600,6 +620,9 @@ AutoMounter::StartMtpServer()
|
||||
nsRefPtr<MozMtpStorage> storage = new MozMtpStorage(vol, sMozMtpServer);
|
||||
mMozMtpStorage.AppendElement(storage);
|
||||
}
|
||||
|
||||
sMozMtpServer->Run();
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
@ -736,8 +759,13 @@ AutoMounter::UpdateState()
|
||||
// and start the MTP server. This particular codepath will not
|
||||
// normally be taken, but it could happen if you stop and restart
|
||||
// b2g while sys.usb.config is set to enable mtp.
|
||||
StartMtpServer();
|
||||
SetState(STATE_MTP_STARTED);
|
||||
if (StartMtpServer()) {
|
||||
SetState(STATE_MTP_STARTED);
|
||||
} else {
|
||||
// Unable to start MTP. Go back to UMS.
|
||||
SetUsbFunction(USB_FUNC_UMS);
|
||||
SetState(STATE_UMS_CONFIGURING);
|
||||
}
|
||||
} else {
|
||||
// We need to configure USB to use mtp. Wait for it to be configured
|
||||
// before we start the MTP server.
|
||||
@ -763,8 +791,13 @@ AutoMounter::UpdateState()
|
||||
if (mtpEnabled && mtpConfigured) {
|
||||
// The USB layer has been configured. Now we can go ahead and start
|
||||
// the MTP server.
|
||||
StartMtpServer();
|
||||
SetState(STATE_MTP_STARTED);
|
||||
if (StartMtpServer()) {
|
||||
SetState(STATE_MTP_STARTED);
|
||||
} else {
|
||||
// Unable to start MTP. Go back to UMS.
|
||||
SetUsbFunction(USB_FUNC_UMS);
|
||||
SetState(STATE_UMS_CONFIGURING);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (rndisConfigured) {
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "mozilla/dom/SettingChangeNotificationBinding.h"
|
||||
|
||||
#undef LOG
|
||||
#undef ERR
|
||||
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "AutoMounterSetting" , ## args)
|
||||
#define ERR(args...) __android_log_print(ANDROID_LOG_ERROR, "AutoMounterSetting" , ## args)
|
||||
|
||||
|
@ -171,9 +171,29 @@ void
|
||||
MozMtpDatabase::RemoveEntry(MtpObjectHandle aHandle)
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
if (!IsValidHandle(aHandle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (aHandle > 0 && aHandle < mDb.Length()) {
|
||||
mDb[aHandle] = nullptr;
|
||||
RefPtr<DbEntry> removedEntry = mDb[aHandle];
|
||||
mDb[aHandle] = nullptr;
|
||||
MTP_DBG("0x%08x removed", aHandle);
|
||||
// if the entry is not a folder, just return.
|
||||
if (removedEntry->mObjectFormat != MTP_FORMAT_ASSOCIATION) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find out and remove the children of aHandle.
|
||||
// Since the index for a directory will always be less than the index of any of its children,
|
||||
// we can remove the entire subtree in one pass.
|
||||
ProtectedDbArray::size_type numEntries = mDb.Length();
|
||||
ProtectedDbArray::index_type entryIndex;
|
||||
for (entryIndex = aHandle+1; entryIndex < numEntries; entryIndex++) {
|
||||
RefPtr<DbEntry> entry = mDb[entryIndex];
|
||||
if (entry && IsValidHandle(entry->mParent) && !mDb[entry->mParent]) {
|
||||
mDb[entryIndex] = nullptr;
|
||||
MTP_DBG("0x%08x removed", aHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,6 +226,11 @@ private:
|
||||
MatchParentFormat,
|
||||
};
|
||||
|
||||
bool IsValidHandle(MtpObjectHandle aHandle)
|
||||
{
|
||||
return aHandle > 0 && aHandle < mDb.Length();
|
||||
}
|
||||
|
||||
void AddEntry(DbEntry* aEntry);
|
||||
void AddEntryAndNotify(DbEntry* aEntr, RefCountedMtpServer* aMtpServer);
|
||||
void DumpEntries(const char* aLabel);
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include "base/message_loop.h"
|
||||
#include "DeviceStorage.h"
|
||||
#include "mozilla/FileUtils.h"
|
||||
#include "mozilla/LazyIdleThread.h"
|
||||
#include "mozilla/Scoped.h"
|
||||
#include "mozilla/Services.h"
|
||||
@ -225,33 +224,38 @@ MozMtpServer::GetMozMtpDatabase()
|
||||
return db.forget();
|
||||
}
|
||||
|
||||
void
|
||||
MozMtpServer::Run()
|
||||
bool
|
||||
MozMtpServer::Init()
|
||||
{
|
||||
MOZ_ASSERT(MessageLoop::current() == XRE_GetIOMessageLoop());
|
||||
|
||||
const char *mtpUsbFilename = "/dev/mtp_usb";
|
||||
ScopedClose mtpUsbFd(open(mtpUsbFilename, O_RDWR));
|
||||
if (mtpUsbFd.get() < 0) {
|
||||
mMtpUsbFd = open(mtpUsbFilename, O_RDWR);
|
||||
if (mMtpUsbFd.get() < 0) {
|
||||
MTP_ERR("open of '%s' failed", mtpUsbFilename);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
MTP_LOG("Opened '%s' fd %d", mtpUsbFilename, mtpUsbFd.get());
|
||||
MTP_LOG("Opened '%s' fd %d", mtpUsbFilename, mMtpUsbFd.get());
|
||||
|
||||
mMozMtpDatabase = new MozMtpDatabase();
|
||||
mMtpServer = new RefCountedMtpServer(mtpUsbFd.get(), // fd
|
||||
mMtpServer = new RefCountedMtpServer(mMtpUsbFd.get(), // fd
|
||||
mMozMtpDatabase.get(), // MtpDatabase
|
||||
false, // ptp?
|
||||
AID_MEDIA_RW, // file group
|
||||
0664, // file permissions
|
||||
0775); // dir permissions
|
||||
return true;
|
||||
}
|
||||
|
||||
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(mtpUsbFd.forget(), this), NS_DISPATCH_NORMAL);
|
||||
mServerThread->Dispatch(new MtpServerRunnable(mMtpUsbFd.forget(), this), NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
END_MTP_NAMESPACE
|
||||
|
@ -10,6 +10,8 @@
|
||||
#include "MozMtpCommon.h"
|
||||
#include "MozMtpDatabase.h"
|
||||
|
||||
#include "mozilla/FileUtils.h"
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIThread.h"
|
||||
@ -40,10 +42,9 @@ class MozMtpServer
|
||||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MozMtpServer)
|
||||
|
||||
bool Init();
|
||||
void Run();
|
||||
|
||||
// void UpdateStorage(android::MtpStorageID id, Volume *vol);
|
||||
|
||||
already_AddRefed<RefCountedMtpServer> GetMtpServer();
|
||||
already_AddRefed<MozMtpDatabase> GetMozMtpDatabase();
|
||||
|
||||
@ -51,6 +52,7 @@ private:
|
||||
nsRefPtr<RefCountedMtpServer> mMtpServer;
|
||||
nsRefPtr<MozMtpDatabase> mMozMtpDatabase;
|
||||
nsCOMPtr<nsIThread> mServerThread;
|
||||
ScopedClose mMtpUsbFd;
|
||||
};
|
||||
|
||||
END_MTP_NAMESPACE
|
||||
|
@ -13,10 +13,13 @@
|
||||
#define USE_DEBUG 0
|
||||
|
||||
#undef LOG
|
||||
#undef LOGW
|
||||
#undef ERR
|
||||
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "OpenFileFinder", ## args)
|
||||
#define LOGW(args...) __android_log_print(ANDROID_LOG_WARN, "OpenFileFinder", ## args)
|
||||
#define ERR(args...) __android_log_print(ANDROID_LOG_ERROR, "OpenFileFinder", ## args)
|
||||
|
||||
#undef DBG
|
||||
#if USE_DEBUG
|
||||
#define DBG(args...) __android_log_print(ANDROID_LOG_DEBUG, "OpenFileFinder" , ## args)
|
||||
#else
|
||||
|
@ -53,16 +53,6 @@ const RADIOINTERFACE_CID =
|
||||
Components.ID("{6a7c91f0-a2b3-4193-8562-8969296c0b54}");
|
||||
const RILNETWORKINTERFACE_CID =
|
||||
Components.ID("{3bdd52a9-3965-4130-b569-0ac5afed045e}");
|
||||
const NEIGHBORINGCELLINFO_CID =
|
||||
Components.ID("{f9dfe26a-851e-4a8b-a769-cbb1baae7ded}");
|
||||
const GSMCELLINFO_CID =
|
||||
Components.ID("{41f6201e-7263-42e3-b31f-38a9dc8a280a}");
|
||||
const WCDMACELLINFO_CID =
|
||||
Components.ID("{eeaaf307-df6e-4c98-b121-e3302b1fc468}");
|
||||
const CDMACELLINFO_CID =
|
||||
Components.ID("{b497d6e4-4cb8-4d6e-b673-840c7d5ddf25}");
|
||||
const LTECELLINFO_CID =
|
||||
Components.ID("{c7e0a78a-4e99-42f5-9251-e6172c5ed8d8}");
|
||||
|
||||
const NS_XPCOM_SHUTDOWN_OBSERVER_ID = "xpcom-shutdown";
|
||||
const kNetworkConnStateChangedTopic = "network-connection-state-changed";
|
||||
@ -97,9 +87,6 @@ const RADIO_POWER_OFF_TIMEOUT = 30000;
|
||||
const SMS_HANDLED_WAKELOCK_TIMEOUT = 5000;
|
||||
const HW_DEFAULT_CLIENT_ID = 0;
|
||||
|
||||
const INT32_MAX = 2147483647;
|
||||
const UNKNOWN_RSSI = 99;
|
||||
|
||||
const RIL_IPC_ICCMANAGER_MSG_NAMES = [
|
||||
"RIL:GetRilContext",
|
||||
"RIL:SendStkResponse",
|
||||
@ -962,127 +949,6 @@ CdmaIccInfo.prototype = {
|
||||
prlVersion: 0
|
||||
};
|
||||
|
||||
function NeighboringCellInfo() {}
|
||||
NeighboringCellInfo.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsINeighboringCellInfo]),
|
||||
classID: NEIGHBORINGCELLINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: NEIGHBORINGCELLINFO_CID,
|
||||
classDescription: "NeighboringCellInfo",
|
||||
interfaces: [Ci.nsINeighboringCellInfo]
|
||||
}),
|
||||
|
||||
// nsINeighboringCellInfo
|
||||
|
||||
networkType: null,
|
||||
gsmLocationAreaCode: -1,
|
||||
gsmCellId: -1,
|
||||
wcdmaPsc: -1,
|
||||
signalStrength: UNKNOWN_RSSI
|
||||
};
|
||||
|
||||
function CellInfo() {}
|
||||
CellInfo.prototype = {
|
||||
type: null,
|
||||
registered: false,
|
||||
timestampType: Ci.nsICellInfo.TIMESTAMP_TYPE_UNKNOWN,
|
||||
timestamp: 0
|
||||
};
|
||||
|
||||
function GsmCellInfo() {}
|
||||
GsmCellInfo.prototype = {
|
||||
__proto__: CellInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIGsmCellInfo]),
|
||||
classID: GSMCELLINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: GSMCELLINFO_CID,
|
||||
classDescription: "GsmCellInfo",
|
||||
interfaces: [Ci.nsIGsmCellInfo]
|
||||
}),
|
||||
|
||||
// nsIGsmCellInfo
|
||||
|
||||
mcc: INT32_MAX,
|
||||
mnc: INT32_MAX,
|
||||
lac: INT32_MAX,
|
||||
cid: INT32_MAX,
|
||||
signalStrength: UNKNOWN_RSSI,
|
||||
bitErrorRate: UNKNOWN_RSSI
|
||||
};
|
||||
|
||||
function WcdmaCellInfo() {}
|
||||
WcdmaCellInfo.prototype = {
|
||||
__proto__: CellInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIWcdmaCellInfo]),
|
||||
classID: WCDMACELLINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: WCDMACELLINFO_CID,
|
||||
classDescription: "WcdmaCellInfo",
|
||||
interfaces: [Ci.nsIWcdmaCellInfo]
|
||||
}),
|
||||
|
||||
// nsIWcdmaCellInfo
|
||||
|
||||
mcc: INT32_MAX,
|
||||
mnc: INT32_MAX,
|
||||
lac: INT32_MAX,
|
||||
cid: INT32_MAX,
|
||||
psc: INT32_MAX,
|
||||
signalStrength: UNKNOWN_RSSI,
|
||||
bitErrorRate: UNKNOWN_RSSI
|
||||
};
|
||||
|
||||
function LteCellInfo() {}
|
||||
LteCellInfo.prototype = {
|
||||
__proto__: CellInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsILteCellInfo]),
|
||||
classID: LTECELLINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: LTECELLINFO_CID,
|
||||
classDescription: "LteCellInfo",
|
||||
interfaces: [Ci.nsILteCellInfo]
|
||||
}),
|
||||
|
||||
// nsILteCellInfo
|
||||
|
||||
mcc: INT32_MAX,
|
||||
mnc: INT32_MAX,
|
||||
cid: INT32_MAX,
|
||||
pcid: INT32_MAX,
|
||||
tac: INT32_MAX,
|
||||
signalStrength: UNKNOWN_RSSI,
|
||||
rsrp: INT32_MAX,
|
||||
rsrq: INT32_MAX,
|
||||
rssnr: INT32_MAX,
|
||||
cqi: INT32_MAX,
|
||||
timingAdvance: INT32_MAX
|
||||
};
|
||||
|
||||
function CdmaCellInfo() {}
|
||||
CdmaCellInfo.prototype = {
|
||||
__proto__: CellInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsICdmaCellInfo]),
|
||||
classID: CDMACELLINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: CDMACELLINFO_CID,
|
||||
classDescription: "CdmaCellInfo",
|
||||
interfaces: [Ci.nsICdmaCellInfo]
|
||||
}),
|
||||
|
||||
// nsICdmaCellInfo
|
||||
|
||||
networkId: INT32_MAX,
|
||||
systemId: INT32_MAX,
|
||||
baseStationId: INT32_MAX,
|
||||
longitude: INT32_MAX,
|
||||
latitude: INT32_MAX,
|
||||
cdmaDbm: INT32_MAX,
|
||||
cdmaEcio: INT32_MAX,
|
||||
evdoDbm: INT32_MAX,
|
||||
evdoEcio: INT32_MAX,
|
||||
evdoSnr: INT32_MAX
|
||||
};
|
||||
|
||||
function DataConnectionHandler(clientId, radioInterface) {
|
||||
// Initial owning attributes.
|
||||
this.clientId = clientId;
|
||||
@ -3895,67 +3761,6 @@ RadioInterface.prototype = {
|
||||
this.workerMessenger.send(rilMessageType, message);
|
||||
}
|
||||
},
|
||||
|
||||
getCellInfoList: function(callback) {
|
||||
this.workerMessenger.send("getCellInfoList",
|
||||
null,
|
||||
function(response) {
|
||||
if (response.errorMsg) {
|
||||
callback.notifyGetCellInfoListFailed(response.errorMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
let cellInfoList = [];
|
||||
let count = response.result.length;
|
||||
for (let i = 0; i < count; i++) {
|
||||
let srcCellInfo = response.result[i];
|
||||
let cellInfo;
|
||||
switch (srcCellInfo.type) {
|
||||
case RIL.CELL_INFO_TYPE_GSM:
|
||||
cellInfo = new GsmCellInfo();
|
||||
break;
|
||||
case RIL.CELL_INFO_TYPE_WCDMA:
|
||||
cellInfo = new WcdmaCellInfo();
|
||||
break;
|
||||
case RIL.CELL_INFO_TYPE_LTE:
|
||||
cellInfo = new LteCellInfo();
|
||||
break;
|
||||
case RIL.CELL_INFO_TYPE_CDMA:
|
||||
cellInfo = new CdmaCellInfo();
|
||||
break;
|
||||
}
|
||||
|
||||
if (!cellInfo) {
|
||||
continue;
|
||||
}
|
||||
this.updateInfo(srcCellInfo, cellInfo);
|
||||
cellInfoList.push(cellInfo);
|
||||
}
|
||||
callback.notifyGetCellInfoList(cellInfoList);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
getNeighboringCellIds: function(callback) {
|
||||
this.workerMessenger.send("getNeighboringCellIds",
|
||||
null,
|
||||
function(response) {
|
||||
if (response.errorMsg) {
|
||||
callback.notifyGetNeighboringCellIdsFailed(response.errorMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
let neighboringCellIds = [];
|
||||
let count = response.result.length;
|
||||
for (let i = 0; i < count; i++) {
|
||||
let srcCellInfo = response.result[i];
|
||||
let cellInfo = new NeighboringCellInfo();
|
||||
this.updateInfo(srcCellInfo, cellInfo);
|
||||
neighboringCellIds.push(cellInfo);
|
||||
}
|
||||
callback.notifyGetNeighboringCellIds(neighboringCellIds);
|
||||
|
||||
}.bind(this));
|
||||
}
|
||||
};
|
||||
|
||||
function DataCall(clientId, apnSetting) {
|
||||
|
@ -12,9 +12,11 @@
|
||||
#endif
|
||||
|
||||
#undef LOG
|
||||
#undef ERR
|
||||
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, VOLUME_MANAGER_LOG_TAG, ## args)
|
||||
#define ERR(args...) __android_log_print(ANDROID_LOG_ERROR, VOLUME_MANAGER_LOG_TAG, ## args)
|
||||
|
||||
#undef DBG
|
||||
#if USE_DEBUG
|
||||
#define DBG(args...) __android_log_print(ANDROID_LOG_DEBUG, VOLUME_MANAGER_LOG_TAG, ## args)
|
||||
#else
|
||||
|
@ -5,11 +5,9 @@
|
||||
#include "nsISupports.idl"
|
||||
#include "nsINetworkManager.idl"
|
||||
|
||||
interface nsICellInfoListCallback;
|
||||
interface nsIIccInfo;
|
||||
interface nsIMobileConnectionInfo;
|
||||
interface nsIMobileMessageCallback;
|
||||
interface nsINeighboringCellIdsCallback;
|
||||
|
||||
[scriptable, uuid(6e0f45b8-410e-11e3-8c8e-b715b2cd0128)]
|
||||
interface nsIRilNetworkInterface : nsINetworkInterface
|
||||
@ -42,7 +40,7 @@ interface nsIRilSendWorkerMessageCallback : nsISupports
|
||||
boolean handleResponse(in jsval response);
|
||||
};
|
||||
|
||||
[scriptable, uuid(c13a8890-797b-4557-b92f-6b959f56c1d8)]
|
||||
[scriptable, uuid(622e8809-1a89-45f7-9b35-7e49b5aaa69f)]
|
||||
interface nsIRadioInterface : nsISupports
|
||||
{
|
||||
readonly attribute nsIRilContext rilContext;
|
||||
@ -72,17 +70,6 @@ interface nsIRadioInterface : nsISupports
|
||||
[optional] in nsIRilSendWorkerMessageCallback callback);
|
||||
|
||||
void getSmscAddress(in nsIMobileMessageCallback request);
|
||||
|
||||
/**
|
||||
* Request neighboring cell ids in GSM/UMTS network.
|
||||
*/
|
||||
void getNeighboringCellIds(in nsINeighboringCellIdsCallback callback);
|
||||
|
||||
/**
|
||||
* Request all of the current cell information known to the radio, including
|
||||
* neighboring cells.
|
||||
*/
|
||||
void getCellInfoList(in nsICellInfoListCallback callback);
|
||||
};
|
||||
|
||||
[scriptable, uuid(78b65e8c-68e7-4510-9a05-65bba12b283e)]
|
||||
|
@ -215,6 +215,7 @@ const TELEPHONY_REQUESTS = [
|
||||
REQUEST_DIAL,
|
||||
REQUEST_DIAL_EMERGENCY_CALL,
|
||||
REQUEST_HANGUP,
|
||||
REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND,
|
||||
REQUEST_HANGUP_WAITING_OR_BACKGROUND,
|
||||
REQUEST_SEPARATE_CONNECTION,
|
||||
REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE,
|
||||
@ -1779,13 +1780,25 @@ RilObject.prototype = {
|
||||
Buf.sendParcel();
|
||||
},
|
||||
|
||||
sendHangUpBackgroundRequest: function() {
|
||||
this.telephonyRequestQueue.push(REQUEST_HANGUP_WAITING_OR_BACKGROUND,
|
||||
this.sendRilRequestHangUpWaiting, null);
|
||||
sendHangUpForegroundRequest: function(options) {
|
||||
this.telephonyRequestQueue.push(REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND,
|
||||
this.sendRilRequestHangUpForeground,
|
||||
options);
|
||||
},
|
||||
|
||||
sendRilRequestHangUpWaiting: function() {
|
||||
this.context.Buf.simpleRequest(REQUEST_HANGUP_WAITING_OR_BACKGROUND);
|
||||
sendRilRequestHangUpForeground: function(options) {
|
||||
this.context.Buf.simpleRequest(REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND,
|
||||
options);
|
||||
},
|
||||
|
||||
sendHangUpBackgroundRequest: function(options) {
|
||||
this.telephonyRequestQueue.push(REQUEST_HANGUP_WAITING_OR_BACKGROUND,
|
||||
this.sendRilRequestHangUpWaiting, options);
|
||||
},
|
||||
|
||||
sendRilRequestHangUpWaiting: function(options) {
|
||||
this.context.Buf.simpleRequest(REQUEST_HANGUP_WAITING_OR_BACKGROUND,
|
||||
options);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -1961,6 +1974,27 @@ RilObject.prototype = {
|
||||
Buf.sendParcel();
|
||||
},
|
||||
|
||||
hangUpConference: function(options) {
|
||||
if (this._isCdma) {
|
||||
// In cdma, ril only maintains one call index.
|
||||
let call = this.currentCalls[1];
|
||||
if (!call) {
|
||||
options.success = false;
|
||||
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
call.hangUpLocal = true;
|
||||
this.sendHangUpRequest(1);
|
||||
} else {
|
||||
if (this.currentConference.state === CALL_STATE_ACTIVE) {
|
||||
this.sendHangUpForegroundRequest(options);
|
||||
} else {
|
||||
this.sendHangUpBackgroundRequest(options);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
holdConference: function() {
|
||||
if (this._isCdma) {
|
||||
return;
|
||||
@ -5430,26 +5464,19 @@ RilObject.prototype[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, option
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_HANGUP] = function REQUEST_HANGUP(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
return;
|
||||
}
|
||||
options.success = options.rilRequestError === 0;
|
||||
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
|
||||
this.sendChromeMessage(options);
|
||||
|
||||
this.getCurrentCalls();
|
||||
if (options.success) {
|
||||
this.getCurrentCalls();
|
||||
}
|
||||
};
|
||||
RilObject.prototype[REQUEST_HANGUP_WAITING_OR_BACKGROUND] = function REQUEST_HANGUP_WAITING_OR_BACKGROUND(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.getCurrentCalls();
|
||||
RilObject.prototype[REQUEST_HANGUP].call(this, length, options);
|
||||
};
|
||||
// TODO Bug 1012599: This one is not used.
|
||||
RilObject.prototype[REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND] = function REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.getCurrentCalls();
|
||||
RilObject.prototype[REQUEST_HANGUP].call(this, length, options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE] = function REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
@ -7844,6 +7871,12 @@ GsmPDUHelperObject.prototype = {
|
||||
|
||||
msg.body = null;
|
||||
msg.data = null;
|
||||
|
||||
if (length <= 0) {
|
||||
// No data to read.
|
||||
return;
|
||||
}
|
||||
|
||||
switch (msg.encoding) {
|
||||
case PDU_DCS_MSG_CODING_7BITS_ALPHABET:
|
||||
// 7 bit encoding allows 140 octets, which means 160 characters
|
||||
|
@ -12,4 +12,3 @@ disabled = Bug 808783
|
||||
[test_data_connection.js]
|
||||
[test_network_active_changed.js]
|
||||
[test_multiple_data_connection.js]
|
||||
[test_neighboring_cell_ids.js]
|
||||
|
@ -1,33 +0,0 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 30000;
|
||||
MARIONETTE_HEAD_JS = "head.js";
|
||||
|
||||
function testGetNeighboringCellIds() {
|
||||
log("Test getting neighboring cell ids");
|
||||
let deferred = Promise.defer();
|
||||
|
||||
radioInterface.getNeighboringCellIds({
|
||||
notifyGetNeighboringCellIds: function(aResult) {
|
||||
deferred.resolve(aResult);
|
||||
},
|
||||
notifyGetNeighboringCellIdsFailed: function(aError) {
|
||||
deferred.reject(aError);
|
||||
}
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
// Start tests
|
||||
startTestBase(function() {
|
||||
// TODO: Bug 1028837 - B2G Emulator: support neighboring cell ids.
|
||||
// Currently, emulator does not support RIL_REQUEST_NEIGHBORING_CELL_IDS,
|
||||
// so we expect to get a 'RequestNotSupported' error here.
|
||||
return testGetNeighboringCellIds()
|
||||
.then(function resolve(aResult) {
|
||||
ok(false, "getNeighboringCellIds should not success");
|
||||
}, function reject(aError) {
|
||||
is(aError, "RequestNotSupported", "failed to getNeighboringCellIds");
|
||||
});
|
||||
});
|
@ -5,14 +5,16 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "TelephonyCallGroup.h"
|
||||
#include "mozilla/dom/TelephonyCallGroupBinding.h"
|
||||
|
||||
#include "CallsList.h"
|
||||
#include "Telephony.h"
|
||||
#include "mozilla/dom/CallEvent.h"
|
||||
#include "mozilla/dom/CallGroupErrorEvent.h"
|
||||
#include "Telephony.h"
|
||||
#include "mozilla/dom/TelephonyCallGroupBinding.h"
|
||||
#include "mozilla/dom/telephony/TelephonyCallback.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::dom::telephony;
|
||||
using mozilla::ErrorResult;
|
||||
|
||||
TelephonyCallGroup::TelephonyCallGroup(nsPIDOMWindow* aOwner)
|
||||
@ -277,6 +279,28 @@ TelephonyCallGroup::Remove(TelephonyCall& aCall, ErrorResult& aRv)
|
||||
}
|
||||
}
|
||||
|
||||
already_AddRefed<Promise>
|
||||
TelephonyCallGroup::HangUp(ErrorResult& aRv)
|
||||
{
|
||||
MOZ_ASSERT(!mCalls.IsEmpty());
|
||||
|
||||
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
|
||||
if (!global) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<Promise> promise = Promise::Create(global, aRv);
|
||||
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
|
||||
|
||||
nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
|
||||
aRv = mTelephony->Service()->HangUpConference(mCalls[0]->ServiceId(),
|
||||
callback);
|
||||
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
|
||||
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
void
|
||||
TelephonyCallGroup::Hold(ErrorResult& aRv)
|
||||
{
|
||||
|
@ -7,6 +7,7 @@
|
||||
#ifndef mozilla_dom_telephony_telephonycallgroup_h__
|
||||
#define mozilla_dom_telephony_telephonycallgroup_h__
|
||||
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/dom/telephony/TelephonyCommon.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -52,6 +53,9 @@ public:
|
||||
void
|
||||
Remove(TelephonyCall& aCall, ErrorResult& aRv);
|
||||
|
||||
already_AddRefed<Promise>
|
||||
HangUp(ErrorResult& aRv);
|
||||
|
||||
void
|
||||
Hold(ErrorResult& aRv);
|
||||
|
||||
|
@ -1038,6 +1038,16 @@ TelephonyService.prototype = {
|
||||
});
|
||||
},
|
||||
|
||||
hangUpConference: function(aClientId, aCallback) {
|
||||
this._sendToRilWorker(aClientId, "hangUpConference", null, response => {
|
||||
if (!response.success) {
|
||||
aCallback.notifyError(response.errorMsg);
|
||||
} else {
|
||||
aCallback.notifySuccess();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
holdConference: function(aClientId) {
|
||||
this._sendToRilWorker(aClientId, "holdConference");
|
||||
},
|
||||
|
@ -30,11 +30,17 @@ struct USSDRequest
|
||||
nsString ussd;
|
||||
};
|
||||
|
||||
struct HangUpConferenceRequest
|
||||
{
|
||||
uint32_t clientId;
|
||||
};
|
||||
|
||||
union IPCTelephonyRequest
|
||||
{
|
||||
EnumerateCallsRequest;
|
||||
DialRequest;
|
||||
USSDRequest;
|
||||
HangUpConferenceRequest;
|
||||
};
|
||||
|
||||
sync protocol PTelephony {
|
||||
|
@ -253,6 +253,13 @@ TelephonyIPCService::SeparateCall(uint32_t aClientId, uint32_t aCallIndex)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TelephonyIPCService::HangUpConference(uint32_t aClientId,
|
||||
nsITelephonyCallback *aCallback)
|
||||
{
|
||||
return SendRequest(nullptr, aCallback, HangUpConferenceRequest(aClientId));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TelephonyIPCService::HoldConference(uint32_t aClientId)
|
||||
{
|
||||
|
@ -45,6 +45,8 @@ TelephonyParent::RecvPTelephonyRequestConstructor(PTelephonyRequestParent* aActo
|
||||
return actor->DoRequest(aRequest.get_DialRequest());
|
||||
case IPCTelephonyRequest::TUSSDRequest:
|
||||
return actor->DoRequest(aRequest.get_USSDRequest());
|
||||
case IPCTelephonyRequest::THangUpConferenceRequest:
|
||||
return actor->DoRequest(aRequest.get_HangUpConferenceRequest());
|
||||
default:
|
||||
MOZ_CRASH("Unknown type!");
|
||||
}
|
||||
@ -451,6 +453,20 @@ TelephonyRequestParent::DoRequest(const USSDRequest& aRequest)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TelephonyRequestParent::DoRequest(const HangUpConferenceRequest& aRequest)
|
||||
{
|
||||
nsCOMPtr<nsITelephonyService> service =
|
||||
do_GetService(TELEPHONY_SERVICE_CONTRACTID);
|
||||
if (service) {
|
||||
service->HangUpConference(aRequest.clientId(), this);
|
||||
} else {
|
||||
return NS_SUCCEEDED(NotifyError(NS_LITERAL_STRING("InvalidStateError")));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
TelephonyRequestParent::SendResponse(const IPCTelephonyResponse& aResponse)
|
||||
{
|
||||
|
@ -129,6 +129,9 @@ private:
|
||||
|
||||
bool
|
||||
DoRequest(const USSDRequest& aRequest);
|
||||
|
||||
bool
|
||||
DoRequest(const HangUpConferenceRequest& aRequest);
|
||||
};
|
||||
|
||||
END_TELEPHONY_NAMESPACE
|
||||
|
@ -240,7 +240,7 @@ interface nsITelephonyDialCallback : nsITelephonyCallback
|
||||
* XPCOM component (in the content process) that provides the telephony
|
||||
* information.
|
||||
*/
|
||||
[scriptable, uuid(79188caa-046a-48e1-b9c5-2e891504dc7a)]
|
||||
[scriptable, uuid(6fa2d94b-80ee-4085-b6a0-535811ba9bb6)]
|
||||
interface nsITelephonyService : nsISupports
|
||||
{
|
||||
const unsigned short CALL_STATE_UNKNOWN = 0;
|
||||
@ -296,6 +296,8 @@ interface nsITelephonyService : nsISupports
|
||||
|
||||
void conferenceCall(in unsigned long clientId);
|
||||
void separateCall(in unsigned long clientId, in unsigned long callIndex);
|
||||
void hangUpConference(in unsigned long clientId,
|
||||
in nsITelephonyCallback callback);
|
||||
void holdConference(in unsigned long clientId);
|
||||
void resumeConference(in unsigned long clientId);
|
||||
|
||||
|
@ -1110,6 +1110,44 @@ let emulator = (function() {
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hangup conference.
|
||||
*
|
||||
* @return A deferred promise.
|
||||
*/
|
||||
function hangUpConference() {
|
||||
log("Hangup conference.");
|
||||
|
||||
let deferred = Promise.defer();
|
||||
let done = function() {
|
||||
deferred.resolve();
|
||||
};
|
||||
|
||||
let pending = ["conference.hangUp", "conference.onstatechange"];
|
||||
let receive = function(name) {
|
||||
receivedPending(name, pending, done);
|
||||
};
|
||||
|
||||
for (let call of conference.calls) {
|
||||
let callName = "Call (" + call.id.number + ')';
|
||||
|
||||
let onstatechange = callName + ".onstatechange";
|
||||
pending.push(onstatechange);
|
||||
check_onstatechange(call, callName, 'disconnected',
|
||||
receive.bind(null, onstatechange));
|
||||
}
|
||||
|
||||
check_onstatechange(conference, 'conference', '', function() {
|
||||
receive("conference.onstatechange");
|
||||
});
|
||||
|
||||
conference.hangUp().then(() => {
|
||||
receive("conference.hangUp");
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a conference with an outgoing call and an incoming call.
|
||||
*
|
||||
@ -1254,6 +1292,7 @@ let emulator = (function() {
|
||||
this.gResumeConference = resumeConference;
|
||||
this.gRemoveCallInConference = removeCallInConference;
|
||||
this.gHangUpCallInConference = hangUpCallInConference;
|
||||
this.gHangUpConference = hangUpConference;
|
||||
this.gSetupConference = setupConference;
|
||||
this.gReceivedPending = receivedPending;
|
||||
}());
|
||||
|
@ -52,6 +52,7 @@ disabled = Bug 821958
|
||||
[test_conference_two_calls.js]
|
||||
[test_conference_add_error.js]
|
||||
[test_conference_remove_error.js]
|
||||
[test_conference_two_hangup_all.js]
|
||||
[test_conference_two_hangup_one.js]
|
||||
[test_conference_two_hold_resume.js]
|
||||
[test_conference_two_remove_one.js]
|
||||
|
@ -0,0 +1,56 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
function testConferenceHangUpForeground() {
|
||||
log('= testConferenceHangUpForeground =');
|
||||
|
||||
let outCall;
|
||||
let inCall;
|
||||
let outNumber = "5555550101";
|
||||
let inNumber = "5555550201";
|
||||
|
||||
return Promise.resolve()
|
||||
.then(() => gSetupConference([outNumber, inNumber]))
|
||||
.then(calls => {
|
||||
[outCall, inCall] = calls;
|
||||
})
|
||||
.then(() => gHangUpConference())
|
||||
.then(() => gCheckAll(null, [], '', [], []));
|
||||
}
|
||||
|
||||
function testConferenceHangUpBackground() {
|
||||
log('= testConferenceHangUpBackground =');
|
||||
|
||||
let outCall;
|
||||
let inCall;
|
||||
let outNumber = "5555550101";
|
||||
let inNumber = "5555550201";
|
||||
let outInfo = gOutCallStrPool(outNumber);
|
||||
let inInfo = gInCallStrPool(inNumber);
|
||||
|
||||
return Promise.resolve()
|
||||
.then(() => gSetupConference([outNumber, inNumber]))
|
||||
.then(calls => {
|
||||
[outCall, inCall] = calls;
|
||||
})
|
||||
.then(() => gHoldConference([outCall, inCall], function() {
|
||||
gCheckState(null, [], 'held', [outCall, inCall]);
|
||||
}))
|
||||
.then(() => gCheckAll(null, [], 'held', [outCall, inCall],
|
||||
[outInfo.held, inInfo.held]))
|
||||
.then(() => gHangUpConference())
|
||||
.then(() => gCheckAll(null, [], '', [], []));
|
||||
}
|
||||
|
||||
// Start the test
|
||||
startTest(function() {
|
||||
testConferenceHangUpForeground()
|
||||
.then(() => testConferenceHangUpBackground())
|
||||
.then(null, error => {
|
||||
ok(false, 'promise rejects during test.');
|
||||
})
|
||||
.then(finish);
|
||||
});
|
@ -136,7 +136,7 @@ let PDUBuilder = {
|
||||
};
|
||||
}
|
||||
|
||||
let encodedBodyLength = options.body.length;
|
||||
let encodedBodyLength = (options.body) ? options.body.length : 0;
|
||||
let headerOctets = (headerLength ? headerLength + 1 : 0);
|
||||
|
||||
let paddingBits;
|
||||
@ -161,9 +161,11 @@ let PDUBuilder = {
|
||||
}
|
||||
}
|
||||
|
||||
this.writeStringAsSeptets(options.body, paddingBits,
|
||||
RIL.PDU_NL_IDENTIFIER_DEFAULT,
|
||||
RIL.PDU_NL_IDENTIFIER_DEFAULT);
|
||||
if (encodedBodyLength > 0) {
|
||||
this.writeStringAsSeptets(options.body, paddingBits,
|
||||
RIL.PDU_NL_IDENTIFIER_DEFAULT,
|
||||
RIL.PDU_NL_IDENTIFIER_DEFAULT);
|
||||
}
|
||||
return this.buf;
|
||||
},
|
||||
|
||||
|
@ -20,7 +20,7 @@ function checkEventStatus(aEvent, aServiceId, aHasMessages, aMessageCount,
|
||||
compareVoicemailStatus(voicemail.getStatus(), status);
|
||||
}
|
||||
|
||||
function testLevel2DiscardActive(aActive) {
|
||||
function testLevel2Discard(aActive) {
|
||||
log(" Active: " + aActive);
|
||||
|
||||
let sender = "+15125551235";
|
||||
@ -32,15 +32,14 @@ function testLevel2DiscardActive(aActive) {
|
||||
}
|
||||
|
||||
// Tests for Level 3 MWI with a message count in the User Data Header
|
||||
function testLevel3DiscardActive(aMessageCount) {
|
||||
log(" Message Count: " + aMessageCount);
|
||||
function testLevel3Discard(aMessageCount, aBody) {
|
||||
log(" Message Count: " + aMessageCount + ", Body: " + aBody);
|
||||
|
||||
let sender = "+15125551236";
|
||||
let body = aMessageCount + " voicemails";
|
||||
let pdu = PDUBuilder.buildLevel3DiscardMwi(aMessageCount, sender, body);
|
||||
let pdu = PDUBuilder.buildLevel3DiscardMwi(aMessageCount, sender, aBody);
|
||||
return sendIndicatorPDUAndWait(pdu)
|
||||
.then((aResults) => checkEventStatus(aResults[0], 0, !!aMessageCount,
|
||||
aMessageCount, sender, body));
|
||||
aMessageCount, sender, aBody));
|
||||
}
|
||||
|
||||
startTestCommon(function() {
|
||||
@ -49,12 +48,14 @@ startTestCommon(function() {
|
||||
.then(() => log("Testing Message Waiting Indication Group"))
|
||||
// Level 2 discarded active/inactive MWI.
|
||||
.then(() => log(" Discard Message"))
|
||||
.then(() => testLevel2DiscardActive(true))
|
||||
.then(() => testLevel2DiscardActive(false))
|
||||
.then(() => testLevel2Discard(true))
|
||||
.then(() => testLevel2Discard(false))
|
||||
|
||||
.then(() => log("Testing Special SMS Message Indication"))
|
||||
.then(() => log(" Discard Message"))
|
||||
// Level 3 discarded active/inactive MWI.
|
||||
.then(() => testLevel3DiscardActive(3))
|
||||
.then(() => testLevel3DiscardActive(0));
|
||||
.then(() => testLevel3Discard(3, "3 voicemails"))
|
||||
.then(() => testLevel3Discard(0, "0 voicemail"))
|
||||
.then(() => testLevel3Discard(3, null))
|
||||
.then(() => testLevel3Discard(0, null));
|
||||
});
|
||||
|
@ -17,6 +17,9 @@ interface TelephonyCallGroup : EventTarget {
|
||||
[Throws]
|
||||
void remove(TelephonyCall call);
|
||||
|
||||
[NewObject, Throws]
|
||||
Promise<void> hangUp();
|
||||
|
||||
[Throws]
|
||||
void hold();
|
||||
|
||||
|
@ -359,9 +359,6 @@ public:
|
||||
// Whether or not this frame may have touch listeners.
|
||||
bool mMayHaveTouchListeners;
|
||||
|
||||
// Whether or not this frame may have touch caret.
|
||||
bool mMayHaveTouchCaret;
|
||||
|
||||
public:
|
||||
void SetIsRoot(bool aIsRoot)
|
||||
{
|
||||
@ -530,10 +527,23 @@ public:
|
||||
mContentDescription = aContentDescription;
|
||||
}
|
||||
|
||||
bool GetMayHaveTouchCaret() const
|
||||
{
|
||||
return mMayHaveTouchCaret;
|
||||
}
|
||||
|
||||
void SetMayHaveTouchCaret(bool aMayHaveTouchCaret)
|
||||
{
|
||||
mMayHaveTouchCaret = aMayHaveTouchCaret;
|
||||
}
|
||||
|
||||
private:
|
||||
// New fields from now on should be made private and old fields should
|
||||
// be refactored to be private.
|
||||
|
||||
// Whether or not this frame may have a touch caret.
|
||||
bool mMayHaveTouchCaret;
|
||||
|
||||
// Whether or not this is the root scroll frame for the root content document.
|
||||
bool mIsRoot;
|
||||
|
||||
|
@ -1036,7 +1036,7 @@ nsEventStatus AsyncPanZoomController::ReceiveInputEvent(const InputData& aEvent)
|
||||
block->GetOverscrollHandoffChain()->CancelAnimations();
|
||||
}
|
||||
|
||||
if (mFrameMetrics.mMayHaveTouchListeners || mFrameMetrics.mMayHaveTouchCaret) {
|
||||
if (mFrameMetrics.mMayHaveTouchListeners || mFrameMetrics.GetMayHaveTouchCaret()) {
|
||||
// Content may intercept the touch events and prevent-default them. So we schedule
|
||||
// a timeout to give content time to do that.
|
||||
ScheduleContentResponseTimeout();
|
||||
@ -2677,7 +2677,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
|
||||
UpdateTransformScale();
|
||||
|
||||
mFrameMetrics.mMayHaveTouchListeners = aLayerMetrics.mMayHaveTouchListeners;
|
||||
mFrameMetrics.mMayHaveTouchCaret = aLayerMetrics.mMayHaveTouchCaret;
|
||||
mFrameMetrics.SetMayHaveTouchCaret(aLayerMetrics.GetMayHaveTouchCaret());
|
||||
mFrameMetrics.SetScrollParentId(aLayerMetrics.GetScrollParentId());
|
||||
APZC_LOG_FM(aLayerMetrics, "%p got a NotifyLayersUpdated with aIsFirstPaint=%d", this, aIsFirstPaint);
|
||||
|
||||
|
@ -63,6 +63,7 @@
|
||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||
#include "ProfilerMarkers.h"
|
||||
#endif
|
||||
#include "mozilla/VsyncDispatcher.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
@ -190,6 +191,117 @@ static void SetThreadPriority()
|
||||
hal::SetCurrentThreadPriority(hal::THREAD_PRIORITY_COMPOSITOR);
|
||||
}
|
||||
|
||||
CompositorVsyncObserver::CompositorVsyncObserver(CompositorParent* aCompositorParent)
|
||||
: mNeedsComposite(false)
|
||||
, mIsObservingVsync(false)
|
||||
, mCompositorParent(aCompositorParent)
|
||||
, mCurrentCompositeTaskMonitor("CurrentCompositeTaskMonitor")
|
||||
, mCurrentCompositeTask(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CompositorVsyncObserver::~CompositorVsyncObserver()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
UnobserveVsync();
|
||||
mCompositorParent = nullptr;
|
||||
mNeedsComposite = false;
|
||||
CancelCurrentCompositeTask();
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO Potential performance heuristics:
|
||||
* If a composite takes 17 ms, do we composite ASAP or wait until next vsync?
|
||||
* If a layer transaction comes after vsync, do we composite ASAP or wait until
|
||||
* next vsync?
|
||||
* How many skipped vsync events until we stop listening to vsync events?
|
||||
*/
|
||||
void
|
||||
CompositorVsyncObserver::SetNeedsComposite(bool aNeedsComposite)
|
||||
{
|
||||
MOZ_ASSERT(CompositorParent::IsInCompositorThread());
|
||||
mNeedsComposite = aNeedsComposite;
|
||||
|
||||
if (!mIsObservingVsync && mNeedsComposite) {
|
||||
ObserveVsync();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CompositorVsyncObserver::NotifyVsync(TimeStamp aVsyncTimestamp)
|
||||
{
|
||||
// Called from the vsync dispatch thread
|
||||
MOZ_ASSERT(!CompositorParent::IsInCompositorThread());
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
MonitorAutoLock lock(mCurrentCompositeTaskMonitor);
|
||||
if (mCurrentCompositeTask == nullptr) {
|
||||
mCurrentCompositeTask = NewRunnableMethod(this,
|
||||
&CompositorVsyncObserver::Composite,
|
||||
aVsyncTimestamp);
|
||||
CompositorParent::CompositorLoop()->PostTask(FROM_HERE, mCurrentCompositeTask);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
CompositorVsyncObserver::CancelCurrentCompositeTask()
|
||||
{
|
||||
MOZ_ASSERT(CompositorParent::IsInCompositorThread() || NS_IsMainThread());
|
||||
MonitorAutoLock lock(mCurrentCompositeTaskMonitor);
|
||||
if (mCurrentCompositeTask) {
|
||||
mCurrentCompositeTask->Cancel();
|
||||
mCurrentCompositeTask = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CompositorVsyncObserver::Composite(TimeStamp aVsyncTimestamp)
|
||||
{
|
||||
MOZ_ASSERT(CompositorParent::IsInCompositorThread());
|
||||
{
|
||||
MonitorAutoLock lock(mCurrentCompositeTaskMonitor);
|
||||
mCurrentCompositeTask = nullptr;
|
||||
}
|
||||
|
||||
if (mNeedsComposite && mCompositorParent) {
|
||||
mNeedsComposite = false;
|
||||
mCompositorParent->CompositeCallback(aVsyncTimestamp);
|
||||
} else {
|
||||
// We're getting vsync notifications but we don't need to composite so
|
||||
// unregister the vsync.
|
||||
UnobserveVsync();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CompositorVsyncObserver::NeedsComposite()
|
||||
{
|
||||
MOZ_ASSERT(CompositorParent::IsInCompositorThread());
|
||||
return mNeedsComposite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Since the vsync thread has its own locks before notifying us of vsync
|
||||
* we can't register/unregister from the vsync thread. Any other thread is fine
|
||||
*/
|
||||
void
|
||||
CompositorVsyncObserver::ObserveVsync()
|
||||
{
|
||||
MOZ_ASSERT(CompositorParent::IsInCompositorThread());
|
||||
VsyncDispatcher::GetInstance()->AddCompositorVsyncObserver(this);
|
||||
mIsObservingVsync = true;
|
||||
}
|
||||
|
||||
void
|
||||
CompositorVsyncObserver::UnobserveVsync()
|
||||
{
|
||||
MOZ_ASSERT(CompositorParent::IsInCompositorThread() || NS_IsMainThread());
|
||||
VsyncDispatcher::GetInstance()->RemoveCompositorVsyncObserver(this);
|
||||
mIsObservingVsync = false;
|
||||
}
|
||||
|
||||
void CompositorParent::StartUp()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread(), "Should be on the main Thread!");
|
||||
@ -254,6 +366,10 @@ CompositorParent::CompositorParent(nsIWidget* aWidget,
|
||||
if (gfxPrefs::AsyncPanZoomEnabled()) {
|
||||
mApzcTreeManager = new APZCTreeManager();
|
||||
}
|
||||
|
||||
if (gfxPrefs::VsyncAlignedCompositor()) {
|
||||
mCompositorVsyncObserver = new CompositorVsyncObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
@ -293,6 +409,7 @@ CompositorParent::Destroy()
|
||||
mApzcTreeManager = nullptr;
|
||||
}
|
||||
sIndirectLayerTrees.erase(mRootLayerTreeID);
|
||||
mCompositorVsyncObserver = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
@ -374,12 +491,17 @@ CompositorParent::RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
|
||||
bool
|
||||
CompositorParent::RecvFlushRendering()
|
||||
{
|
||||
// If we're waiting to do a composite, then cancel it
|
||||
// and do it immediately instead.
|
||||
if (mCurrentCompositeTask) {
|
||||
if (gfxPrefs::VsyncAlignedCompositor() && mCompositorVsyncObserver->NeedsComposite()) {
|
||||
mCompositorVsyncObserver->SetNeedsComposite(false);
|
||||
CancelCurrentCompositeTask();
|
||||
ForceComposeToTarget(nullptr);
|
||||
} else if (mCurrentCompositeTask) {
|
||||
// If we're waiting to do a composite, then cancel it
|
||||
// and do it immediately instead.
|
||||
CancelCurrentCompositeTask();
|
||||
ForceComposeToTarget(nullptr);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -497,7 +619,9 @@ CompositorParent::ForceComposition()
|
||||
void
|
||||
CompositorParent::CancelCurrentCompositeTask()
|
||||
{
|
||||
if (mCurrentCompositeTask) {
|
||||
if (gfxPrefs::VsyncAlignedCompositor()) {
|
||||
mCompositorVsyncObserver->CancelCurrentCompositeTask();
|
||||
} else if (mCurrentCompositeTask) {
|
||||
mCurrentCompositeTask->Cancel();
|
||||
mCurrentCompositeTask = nullptr;
|
||||
}
|
||||
@ -604,8 +728,10 @@ CalculateCompositionFrameRate()
|
||||
}
|
||||
|
||||
void
|
||||
CompositorParent::ScheduleComposition()
|
||||
CompositorParent::ScheduleSoftwareTimerComposition()
|
||||
{
|
||||
MOZ_ASSERT(!gfxPrefs::VsyncAlignedCompositor());
|
||||
|
||||
if (mCurrentCompositeTask || mPaused) {
|
||||
return;
|
||||
}
|
||||
@ -621,8 +747,9 @@ CompositorParent::ScheduleComposition()
|
||||
TimeDuration minFrameDelta = TimeDuration::FromMilliseconds(
|
||||
rate == 0 ? 0.0 : std::max(0.0, 1000.0 / rate));
|
||||
|
||||
|
||||
mCurrentCompositeTask = NewRunnableMethod(this, &CompositorParent::CompositeCallback);
|
||||
mCurrentCompositeTask = NewRunnableMethod(this,
|
||||
&CompositorParent::CompositeCallback,
|
||||
TimeStamp::Now());
|
||||
|
||||
if (!initialComposition && delta < minFrameDelta) {
|
||||
TimeDuration delay = minFrameDelta - delta;
|
||||
@ -639,8 +766,28 @@ CompositorParent::ScheduleComposition()
|
||||
}
|
||||
|
||||
void
|
||||
CompositorParent::CompositeCallback()
|
||||
CompositorParent::ScheduleComposition()
|
||||
{
|
||||
MOZ_ASSERT(IsInCompositorThread());
|
||||
if (gfxPrefs::VsyncAlignedCompositor()) {
|
||||
mCompositorVsyncObserver->SetNeedsComposite(true);
|
||||
} else {
|
||||
ScheduleSoftwareTimerComposition();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CompositorParent::CompositeCallback(TimeStamp aScheduleTime)
|
||||
{
|
||||
if (gfxPrefs::VsyncAlignedCompositor()) {
|
||||
// Align OMTA to vsync time.
|
||||
// TODO: ensure it aligns with the refresh / start time of
|
||||
// animations
|
||||
mLastCompose = aScheduleTime;
|
||||
} else {
|
||||
mLastCompose = TimeStamp::Now();
|
||||
}
|
||||
|
||||
mCurrentCompositeTask = nullptr;
|
||||
CompositeToTarget(nullptr);
|
||||
}
|
||||
@ -684,8 +831,6 @@ CompositorParent::CompositeToTarget(DrawTarget* aTarget, const nsIntRect* aRect)
|
||||
}
|
||||
#endif
|
||||
|
||||
mLastCompose = TimeStamp::Now();
|
||||
|
||||
if (!CanComposite()) {
|
||||
DidComposite();
|
||||
return;
|
||||
@ -838,14 +983,18 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
// However, we only do this update when a composite operation is already
|
||||
// scheduled in order to better match the behavior under regular sampling
|
||||
// conditions.
|
||||
if (mIsTesting && root && mCurrentCompositeTask) {
|
||||
bool needTestComposite = mIsTesting && root &&
|
||||
(mCurrentCompositeTask ||
|
||||
(gfxPrefs::VsyncAlignedCompositor() &&
|
||||
mCompositorVsyncObserver->NeedsComposite()));
|
||||
if (needTestComposite) {
|
||||
AutoResolveRefLayers resolve(mCompositionManager);
|
||||
SetShadowProperties(mLayerManager->GetRoot());
|
||||
bool requestNextFrame =
|
||||
mCompositionManager->TransformShadowTree(mTestTime);
|
||||
if (!requestNextFrame) {
|
||||
CancelCurrentCompositeTask();
|
||||
// Pretend we composited in case someone is wating for this event.
|
||||
// Pretend we composited in case someone is waiting for this event.
|
||||
DidComposite();
|
||||
}
|
||||
}
|
||||
@ -870,8 +1019,12 @@ CompositorParent::SetTestSampleTime(LayerTransactionParent* aLayerTree,
|
||||
mIsTesting = true;
|
||||
mTestTime = aTime;
|
||||
|
||||
bool testComposite = mCompositionManager && (mCurrentCompositeTask ||
|
||||
(gfxPrefs::VsyncAlignedCompositor()
|
||||
&& mCompositorVsyncObserver->NeedsComposite()));
|
||||
|
||||
// Update but only if we were already scheduled to animate
|
||||
if (mCompositionManager && mCurrentCompositeTask) {
|
||||
if (testComposite) {
|
||||
AutoResolveRefLayers resolve(mCompositionManager);
|
||||
SetShadowProperties(mLayerManager->GetRoot());
|
||||
bool requestNextFrame = mCompositionManager->TransformShadowTree(aTime);
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsSize.h" // for nsIntSize
|
||||
#include "ThreadSafeRefcountingWithMainThreadDestruction.h"
|
||||
#include "mozilla/VsyncDispatcher.h"
|
||||
|
||||
class CancelableTask;
|
||||
class MessageLoop;
|
||||
@ -51,6 +52,7 @@ namespace layers {
|
||||
class APZCTreeManager;
|
||||
class AsyncCompositionManager;
|
||||
class Compositor;
|
||||
class CompositorParent;
|
||||
class LayerManagerComposite;
|
||||
class LayerTransactionParent;
|
||||
|
||||
@ -87,10 +89,45 @@ private:
|
||||
friend class CompositorParent;
|
||||
};
|
||||
|
||||
/**
|
||||
* Manages the vsync (de)registration and tracking on behalf of the
|
||||
* compositor when it need to paint.
|
||||
* Turns vsync notifications into scheduled composites.
|
||||
**/
|
||||
|
||||
class CompositorVsyncObserver MOZ_FINAL : public VsyncObserver
|
||||
{
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(CompositorVsyncObserver)
|
||||
friend class CompositorParent;
|
||||
|
||||
public:
|
||||
CompositorVsyncObserver(CompositorParent* aCompositorParent);
|
||||
virtual bool NotifyVsync(TimeStamp aVsyncTimestamp) MOZ_OVERRIDE;
|
||||
void SetNeedsComposite(bool aSchedule);
|
||||
bool NeedsComposite();
|
||||
void CancelCurrentCompositeTask();
|
||||
|
||||
private:
|
||||
virtual ~CompositorVsyncObserver();
|
||||
|
||||
void Composite(TimeStamp aVsyncTimestamp);
|
||||
void NotifyCompositeTaskExecuted();
|
||||
void ObserveVsync();
|
||||
void UnobserveVsync();
|
||||
|
||||
bool mNeedsComposite;
|
||||
bool mIsObservingVsync;
|
||||
nsRefPtr<CompositorParent> mCompositorParent;
|
||||
|
||||
mozilla::Monitor mCurrentCompositeTaskMonitor;
|
||||
CancelableTask* mCurrentCompositeTask;
|
||||
};
|
||||
|
||||
class CompositorParent MOZ_FINAL : public PCompositorParent,
|
||||
public ShadowLayersManager
|
||||
{
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(CompositorParent)
|
||||
friend class CompositorVsyncObserver;
|
||||
|
||||
public:
|
||||
explicit CompositorParent(nsIWidget* aWidget,
|
||||
@ -287,7 +324,7 @@ protected:
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) MOZ_OVERRIDE;
|
||||
virtual void ScheduleTask(CancelableTask*, int);
|
||||
void CompositeCallback();
|
||||
void CompositeCallback(TimeStamp aScheduleTime);
|
||||
void CompositeToTarget(gfx::DrawTarget* aTarget, const nsIntRect* aRect = nullptr);
|
||||
void ForceComposeToTarget(gfx::DrawTarget* aTarget, const nsIntRect* aRect = nullptr);
|
||||
|
||||
@ -299,6 +336,7 @@ protected:
|
||||
void ResumeCompositionAndResize(int width, int height);
|
||||
void ForceComposition();
|
||||
void CancelCurrentCompositeTask();
|
||||
void ScheduleSoftwareTimerComposition();
|
||||
|
||||
/**
|
||||
* Add a compositor to the global compositor map.
|
||||
@ -348,6 +386,7 @@ protected:
|
||||
nsRefPtr<APZCTreeManager> mApzcTreeManager;
|
||||
|
||||
nsRefPtr<CompositorThreadHolder> mCompositorThreadHolder;
|
||||
nsRefPtr<CompositorVsyncObserver> mCompositorVsyncObserver;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(CompositorParent);
|
||||
};
|
||||
|
@ -203,7 +203,8 @@ private:
|
||||
DECL_GFX_PREF(Live, "gfx.draw-color-bars", CompositorDrawColorBars, bool, false);
|
||||
|
||||
// Use vsync events generated by hardware
|
||||
DECL_GFX_PREF(Once, "gfx.frameuniformity.hw-vsync", FrameUniformityHWVsyncEnabled, bool, false);
|
||||
DECL_GFX_PREF(Once, "gfx.vsync.hw-vsync.enabled", HardwareVsyncEnabled, bool, false);
|
||||
DECL_GFX_PREF(Once, "gfx.vsync.compositor", VsyncAlignedCompositor, bool, false);
|
||||
DECL_GFX_PREF(Once, "gfx.touch.resample", TouchResampling, bool, false);
|
||||
// These times should be in nanoseconds
|
||||
DECL_GFX_PREF(Once, "gfx.touch.resample.max-predict", TouchResampleMaxPredict, int32_t, 8000000);
|
||||
|
@ -761,7 +761,7 @@ nsDisplayScrollLayer::ComputeFrameMetrics(nsIFrame* aForFrame,
|
||||
metrics.mMayHaveTouchListeners = innerWin->HasTouchEventListeners();
|
||||
}
|
||||
}
|
||||
metrics.mMayHaveTouchCaret = presShell->MayHaveTouchCaret();
|
||||
metrics.SetMayHaveTouchCaret(presShell->MayHaveTouchCaret());
|
||||
}
|
||||
|
||||
LayoutDeviceToParentLayerScale layoutToParentLayerScale =
|
||||
|
@ -67,7 +67,7 @@ GeckoTouchDispatcher::GeckoTouchDispatcher()
|
||||
|
||||
mEnabledUniformityInfo = gfxPrefs::UniformityInfo();
|
||||
mResamplingEnabled = gfxPrefs::TouchResampling() &&
|
||||
gfxPrefs::FrameUniformityHWVsyncEnabled();
|
||||
gfxPrefs::HardwareVsyncEnabled();
|
||||
mVsyncAdjust = gfxPrefs::TouchVsyncSampleAdjust();
|
||||
mMaxPredict = gfxPrefs::TouchResampleMaxPredict();
|
||||
mMinResampleTime = gfxPrefs::TouchResampleMinTime();
|
||||
|
@ -218,7 +218,7 @@ HwcComposer2D::RegisterHwcEventCallback()
|
||||
device->registerProcs(device, &sHWCProcs);
|
||||
mHasHWVsync = true;
|
||||
|
||||
if (!gfxPrefs::FrameUniformityHWVsyncEnabled()) {
|
||||
if (!gfxPrefs::HardwareVsyncEnabled()) {
|
||||
device->eventControl(device, HWC_DISPLAY_PRIMARY, HWC_EVENT_VSYNC, false);
|
||||
mHasHWVsync = false;
|
||||
}
|
||||
|
48
widget/shared/VsyncDispatcher.cpp
Normal file
48
widget/shared/VsyncDispatcher.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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 "VsyncDispatcher.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "CompositorParent.h"
|
||||
|
||||
using namespace mozilla::layers;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
StaticRefPtr<VsyncDispatcher> sVsyncDispatcher;
|
||||
|
||||
/*static*/ VsyncDispatcher*
|
||||
VsyncDispatcher::GetInstance()
|
||||
{
|
||||
if (!sVsyncDispatcher) {
|
||||
sVsyncDispatcher = new VsyncDispatcher();
|
||||
ClearOnShutdown(&sVsyncDispatcher);
|
||||
}
|
||||
|
||||
return sVsyncDispatcher;
|
||||
}
|
||||
|
||||
VsyncDispatcher::VsyncDispatcher()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VsyncDispatcher::~VsyncDispatcher()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
VsyncDispatcher::AddCompositorVsyncObserver(VsyncObserver* aVsyncObserver)
|
||||
{
|
||||
MOZ_ASSERT(CompositorParent::IsInCompositorThread());
|
||||
}
|
||||
|
||||
void
|
||||
VsyncDispatcher::RemoveCompositorVsyncObserver(VsyncObserver* aVsyncObserver)
|
||||
{
|
||||
MOZ_ASSERT(CompositorParent::IsInCompositorThread());
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
44
widget/shared/VsyncDispatcher.h
Normal file
44
widget/shared/VsyncDispatcher.h
Normal file
@ -0,0 +1,44 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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_widget_VsyncDispatcher_h
|
||||
#define mozilla_widget_VsyncDispatcher_h
|
||||
|
||||
#include "nsISupportsImpl.h"
|
||||
|
||||
namespace mozilla {
|
||||
class TimeStamp;
|
||||
|
||||
class VsyncObserver
|
||||
{
|
||||
public:
|
||||
// The method called when a vsync occurs. Return true if some work was done.
|
||||
// Vsync notifications will occur on the hardware vsync thread
|
||||
virtual bool NotifyVsync(TimeStamp aVsyncTimestamp) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~VsyncObserver() { }
|
||||
};
|
||||
|
||||
// VsyncDispatcher is used to dispatch vsync events to the registered observers.
|
||||
class VsyncDispatcher
|
||||
{
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VsyncDispatcher)
|
||||
|
||||
public:
|
||||
static VsyncDispatcher* GetInstance();
|
||||
|
||||
// Compositor vsync observers must be added/removed on the compositor thread
|
||||
void AddCompositorVsyncObserver(VsyncObserver* aVsyncObserver);
|
||||
void RemoveCompositorVsyncObserver(VsyncObserver* aVsyncObserver);
|
||||
|
||||
private:
|
||||
VsyncDispatcher();
|
||||
virtual ~VsyncDispatcher();
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // __mozilla_widget_VsyncDispatcher_h
|
@ -7,9 +7,14 @@
|
||||
if CONFIG['MOZ_X11']:
|
||||
DIRS += ['x11']
|
||||
|
||||
EXPORTS.mozilla += [
|
||||
'VsyncDispatcher.h',
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'nsShmImage.cpp',
|
||||
'SharedWidgetUtils.cpp',
|
||||
'VsyncDispatcher.cpp',
|
||||
'WidgetEventImpl.cpp',
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user