Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Merge b2g-inbound to m-c on a CLOSED TREE.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvandermeulen committed Oct 31, 2013
2 parents d7738cf + e996d56 commit 0fda0c1
Show file tree
Hide file tree
Showing 110 changed files with 1,912 additions and 2,142 deletions.
15 changes: 1 addition & 14 deletions b2g/app/b2g.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ pref("services.push.requestTimeout", 10000);
pref("services.push.udp.wakeupEnabled", true);

// NetworkStats
#ifdef MOZ_B2G_RIL
#ifdef MOZ_WIDGET_GONK
pref("dom.mozNetworkStats.enabled", true);
pref("dom.webapps.firstRunWithSIM", true);
#endif
Expand Down Expand Up @@ -825,22 +825,9 @@ pref("gfx.canvas.skiagl.dynamic-cache", true);
// enable fence with readpixels for SurfaceStream
pref("gfx.gralloc.fence-with-readpixels", true);

// Enable Telephony API
pref("dom.telephony.enabled", true);

// Cell Broadcast API
pref("dom.cellbroadcast.enabled", true);
pref("ril.cellbroadcast.disabled", false);

// ICC API
pref("dom.icc.enabled", true);

// Mobile Connection API
pref("dom.mobileconnection.enabled", true);

// Voice Mail API
pref("dom.voicemail.enabled", true);

// The url of the page used to display network error details.
pref("b2g.neterror.url", "app://system.gaiamobile.org/net_error.html");

Expand Down
2 changes: 1 addition & 1 deletion b2g/chrome/content/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ let FormAssistant = {
},

showKeyboard: function fa_showKeyboard(target) {
if (this.isKeyboardOpened)
if (this.focusedElement === target)
return;

if (target instanceof HTMLOptionElement)
Expand Down
5 changes: 5 additions & 0 deletions b2g/chrome/content/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ SettingsListener.observe('language.current', 'en-US', function(value) {
Services.prefs.setBoolPref('dom.mms.requestStatusReport', value);
});

SettingsListener.observe('ril.mms.requestReadReport.enabled', true,
function(value) {
Services.prefs.setBoolPref('dom.mms.requestReadReport', value);
});

SettingsListener.observe('ril.cellbroadcast.disabled', false,
function(value) {
Services.prefs.setBoolPref('ril.cellbroadcast.disabled', value);
Expand Down
4 changes: 2 additions & 2 deletions b2g/chrome/content/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Cu.import("resource://gre/modules/AppsUtils.jsm");
Cu.import('resource://gre/modules/UserAgentOverrides.jsm');
Cu.import('resource://gre/modules/Keyboard.jsm');
Cu.import('resource://gre/modules/ErrorPage.jsm');
#ifdef MOZ_B2G_RIL
#ifdef MOZ_WIDGET_GONK
Cu.import('resource://gre/modules/NetworkStatsService.jsm');
#endif

Expand Down Expand Up @@ -611,7 +611,7 @@ var shell = {

this.sendEvent(window, 'ContentStart');

#ifdef MOZ_B2G_RIL
#ifdef MOZ_WIDGET_GONK
Cu.import('resource://gre/modules/OperatorApps.jsm');
#endif

Expand Down
2 changes: 1 addition & 1 deletion b2g/config/gaia.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"revision": "d2dbad943faf566fe36dbe79086127da837af6a3",
"revision": "aa1ebd9c011628a4e1a9802fd552ec853610b2f5",
"repo_path": "/integration/gaia-central"
}
59 changes: 34 additions & 25 deletions b2g/installer/package-manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@
@BINPATH@/components/dom_audiochannel.xpt
@BINPATH@/components/dom_base.xpt
@BINPATH@/components/dom_system.xpt
#ifdef MOZ_B2G_RIL
@BINPATH@/components/dom_voicemail.xpt
#ifdef MOZ_WIDGET_GONK
@BINPATH@/components/dom_wifi.xpt
@BINPATH@/components/dom_system_gonk.xpt
#endif
#ifdef MOZ_B2G_RIL
@BINPATH@/components/dom_voicemail.xpt
@BINPATH@/components/dom_icc.xpt
@BINPATH@/components/dom_cellbroadcast.xpt
@BINPATH@/components/dom_wappush.xpt
Expand Down Expand Up @@ -399,6 +401,36 @@
@BINPATH@/components/nsDownloadManagerUI.js
@BINPATH@/components/nsSidebar.manifest
@BINPATH@/components/nsSidebar.js

; WiFi, NetworkManager, NetworkStats
#ifdef MOZ_WIDGET_GONK
@BINPATH@/components/DOMWifiManager.js
@BINPATH@/components/DOMWifiManager.manifest
@BINPATH@/components/NetworkInterfaceListService.js
@BINPATH@/components/NetworkInterfaceListService.manifest
@BINPATH@/components/NetworkManager.js
@BINPATH@/components/NetworkManager.manifest
@BINPATH@/components/NetworkStatsManager.js
@BINPATH@/components/NetworkStatsManager.manifest
@BINPATH@/components/NetworkStatsServiceProxy.js
@BINPATH@/components/NetworkStatsServiceProxy.manifest
@BINPATH@/components/WifiWorker.js
@BINPATH@/components/WifiWorker.manifest
#endif // MOZ_WIDGET_GONK

; RIL
#if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL)
@BINPATH@/components/MmsService.js
@BINPATH@/components/MmsService.manifest
@BINPATH@/components/MobileMessageDatabaseService.js
@BINPATH@/components/MobileMessageDatabaseService.manifest
@BINPATH@/components/RadioInterfaceLayer.js
@BINPATH@/components/RadioInterfaceLayer.manifest
@BINPATH@/components/RILContentHelper.js
@BINPATH@/components/TelephonyProvider.js
@BINPATH@/components/TelephonyProvider.manifest
#endif // MOZ_WIDGET_GONK && MOZ_B2G_RIL

#ifndef MOZ_WIDGET_GONK
@BINPATH@/components/extensions.manifest
@BINPATH@/components/addonManager.js
Expand Down Expand Up @@ -464,29 +496,6 @@
@BINPATH@/components/webvtt.xpt
@BINPATH@/components/WebVTT.manifest
@BINPATH@/components/WebVTTParserWrapper.js
#ifdef MOZ_B2G_RIL
@BINPATH@/components/NetworkManager.manifest
@BINPATH@/components/NetworkManager.js
@BINPATH@/components/RadioInterfaceLayer.manifest
@BINPATH@/components/RadioInterfaceLayer.js
@BINPATH@/components/MmsService.manifest
@BINPATH@/components/MmsService.js
@BINPATH@/components/RILContentHelper.js
@BINPATH@/components/MobileMessageDatabaseService.manifest
@BINPATH@/components/MobileMessageDatabaseService.js
@BINPATH@/components/WifiWorker.js
@BINPATH@/components/WifiWorker.manifest
@BINPATH@/components/DOMWifiManager.js
@BINPATH@/components/DOMWifiManager.manifest
@BINPATH@/components/NetworkStatsManager.js
@BINPATH@/components/NetworkStatsManager.manifest
@BINPATH@/components/NetworkInterfaceListService.manifest
@BINPATH@/components/NetworkInterfaceListService.js
@BINPATH@/components/TelephonyProvider.manifest
@BINPATH@/components/TelephonyProvider.js
@BINPATH@/components/NetworkStatsServiceProxy.manifest
@BINPATH@/components/NetworkStatsServiceProxy.js
#endif
#ifdef MOZ_ENABLE_DBUS
@BINPATH@/components/@DLL_PREFIX@dbusservice@DLL_SUFFIX@
#endif
Expand Down
11 changes: 8 additions & 3 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1941,7 +1941,7 @@ ia64*-hpux*)
no_x=yes
if test -n "$gonkdir"; then
_PLATFORM_DEFAULT_TOOLKIT=cairo-gonk
MOZ_B2G_RIL=1
_PLATFORM_HAVE_RIL=1
MOZ_B2G_FM=1
MOZ_SYNTH_PICO=1
else
Expand Down Expand Up @@ -7274,9 +7274,14 @@ dnl ========================================================
MOZ_ARG_ENABLE_BOOL(b2g-ril,
[ --enable-b2g-ril Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ],
MOZ_B2G_RIL=1,
MOZ_B2G_RIL= )
MOZ_B2G_RIL=,
MOZ_B2G_RIL=$_PLATFORM_HAVE_RIL )
if test -n "$MOZ_B2G_RIL"; then
AC_DEFINE(MOZ_B2G_RIL)
if test -n "$_PLATFORM_HAVE_RIL"; then
AC_DEFINE(MOZ_B2G_RIL)
else
AC_MSG_ERROR([b2g-ril cannot be enabled because target platform doesn't support it.])
fi
fi
AC_SUBST(MOZ_B2G_RIL)

Expand Down
2 changes: 1 addition & 1 deletion content/events/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LOCAL_INCLUDES += \
-I$(srcdir)/../../../layout/xul/tree/ \
$(NULL)

ifdef MOZ_B2G_RIL
ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
LOCAL_INCLUDES += \
-I$(srcdir)/../../../dom/wifi \
$(NULL)
Expand Down
4 changes: 3 additions & 1 deletion content/media/omx/MediaOmxReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ nsresult MediaOmxReader::InitOmxDecoder()
dataSource->initCheck();

sp<MediaExtractor> extractor = MediaExtractor::Create(dataSource);

if (!extractor.get()) {
return NS_ERROR_FAILURE;
}
mOmxDecoder = new OmxDecoder(mDecoder->GetResource(), mDecoder);
if (!mOmxDecoder->Init(extractor)) {
return NS_ERROR_FAILURE;
Expand Down
56 changes: 28 additions & 28 deletions dom/base/Navigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "nsIDOMWakeLock.h"
#include "nsIPowerManagerService.h"
#include "mozilla/dom/MobileMessageManager.h"
#include "mozilla/dom/Telephony.h"
#include "mozilla/Hal.h"
#include "nsISiteSpecificUserAgent.h"
#include "mozilla/ClearOnShutdown.h"
Expand All @@ -38,9 +39,8 @@
#include "nsGlobalWindow.h"
#ifdef MOZ_B2G_RIL
#include "mozilla/dom/IccManager.h"
#include "MobileConnection.h"
#include "mozilla/dom/CellBroadcast.h"
#include "mozilla/dom/Telephony.h"
#include "mozilla/dom/network/MobileConnection.h"
#include "mozilla/dom/Voicemail.h"
#endif
#include "nsIIdleObserver.h"
Expand Down Expand Up @@ -138,12 +138,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPowerManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMobileMessageManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTelephony)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnection)
#ifdef MOZ_B2G_RIL
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMobileConnection)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCellBroadcast)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIccManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTelephony)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVoicemail)
#endif
#ifdef MOZ_B2G_BT
Expand Down Expand Up @@ -209,6 +209,10 @@ Navigator::Invalidate()
mMobileMessageManager = nullptr;
}

if (mTelephony) {
mTelephony = nullptr;
}

if (mConnection) {
mConnection->Shutdown();
mConnection = nullptr;
Expand All @@ -229,10 +233,6 @@ Navigator::Invalidate()
mIccManager = nullptr;
}

if (mTelephony) {
mTelephony = nullptr;
}

if (mVoicemail) {
mVoicemail = nullptr;
}
Expand Down Expand Up @@ -1165,34 +1165,34 @@ Navigator::GetMozMobileMessage()
return mMobileMessageManager;
}

#ifdef MOZ_B2G_RIL

CellBroadcast*
Navigator::GetMozCellBroadcast(ErrorResult& aRv)
Telephony*
Navigator::GetMozTelephony(ErrorResult& aRv)
{
if (!mCellBroadcast) {
if (!mTelephony) {
if (!mWindow) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
mCellBroadcast = CellBroadcast::Create(mWindow, aRv);
mTelephony = Telephony::Create(mWindow, aRv);
}

return mCellBroadcast;
return mTelephony;
}

Telephony*
Navigator::GetMozTelephony(ErrorResult& aRv)
#ifdef MOZ_B2G_RIL

CellBroadcast*
Navigator::GetMozCellBroadcast(ErrorResult& aRv)
{
if (!mTelephony) {
if (!mCellBroadcast) {
if (!mWindow) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
mTelephony = Telephony::Create(mWindow, aRv);
mCellBroadcast = CellBroadcast::Create(mWindow, aRv);
}

return mTelephony;
return mCellBroadcast;
}

Voicemail*
Expand Down Expand Up @@ -1697,15 +1697,6 @@ Navigator::HasMobileMessageSupport(JSContext* /* unused */, JSObject* aGlobal)
return true;
}

/* static */
bool
Navigator::HasCameraSupport(JSContext* /* unused */, JSObject* aGlobal)
{
nsCOMPtr<nsPIDOMWindow> win = GetWindowFromGlobal(aGlobal);
return win && nsDOMCameraManager::CheckPermission(win);
}

#ifdef MOZ_B2G_RIL
/* static */
bool
Navigator::HasTelephonySupport(JSContext* /* unused */, JSObject* aGlobal)
Expand All @@ -1719,6 +1710,15 @@ Navigator::HasTelephonySupport(JSContext* /* unused */, JSObject* aGlobal)
return win && CheckPermission(win, "telephony");
}

/* static */
bool
Navigator::HasCameraSupport(JSContext* /* unused */, JSObject* aGlobal)
{
nsCOMPtr<nsPIDOMWindow> win = GetWindowFromGlobal(aGlobal);
return win && nsDOMCameraManager::CheckPermission(win);
}

#ifdef MOZ_B2G_RIL
/* static */
bool
Navigator::HasMobileConnectionSupport(JSContext* /* unused */,
Expand Down
10 changes: 5 additions & 5 deletions dom/base/Navigator.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ class BluetoothManager;
#ifdef MOZ_B2G_RIL
class CellBroadcast;
class IccManager;
class Telephony;
class Voicemail;
#endif

class PowerManager;
class Telephony;

namespace time {
class TimeManager;
Expand Down Expand Up @@ -211,14 +211,14 @@ class Navigator : public nsIDOMNavigator
bool MozIsLocallyAvailable(const nsAString& aURI, bool aWhenOffline,
ErrorResult& aRv);
nsIDOMMozMobileMessageManager* GetMozMobileMessage();
Telephony* GetMozTelephony(ErrorResult& aRv);
nsIDOMMozConnection* GetMozConnection();
nsDOMCameraManager* GetMozCameras(ErrorResult& aRv);
void MozSetMessageHandler(const nsAString& aType,
systemMessageCallback* aCallback,
ErrorResult& aRv);
bool MozHasPendingMessage(const nsAString& aType, ErrorResult& aRv);
#ifdef MOZ_B2G_RIL
Telephony* GetMozTelephony(ErrorResult& aRv);
nsIDOMMozMobileConnection* GetMozMobileConnection(ErrorResult& aRv);
CellBroadcast* GetMozCellBroadcast(ErrorResult& aRv);
Voicemail* GetMozVoicemail(ErrorResult& aRv);
Expand Down Expand Up @@ -268,11 +268,11 @@ class Navigator : public nsIDOMNavigator
}
static bool HasMobileMessageSupport(JSContext* /* unused */,
JSObject* aGlobal);
static bool HasTelephonySupport(JSContext* /* unused */,
JSObject* aGlobal);
static bool HasCameraSupport(JSContext* /* unused */,
JSObject* aGlobal);
#ifdef MOZ_B2G_RIL
static bool HasTelephonySupport(JSContext* /* unused */,
JSObject* aGlobal);
static bool HasMobileConnectionSupport(JSContext* /* unused */,
JSObject* aGlobal);
static bool HasCellBroadcastSupport(JSContext* /* unused */,
Expand Down Expand Up @@ -326,12 +326,12 @@ class Navigator : public nsIDOMNavigator
#endif
nsRefPtr<PowerManager> mPowerManager;
nsRefPtr<MobileMessageManager> mMobileMessageManager;
nsRefPtr<Telephony> mTelephony;
nsRefPtr<network::Connection> mConnection;
#ifdef MOZ_B2G_RIL
nsRefPtr<network::MobileConnection> mMobileConnection;
nsRefPtr<CellBroadcast> mCellBroadcast;
nsRefPtr<IccManager> mIccManager;
nsRefPtr<Telephony> mTelephony;
nsRefPtr<Voicemail> mVoicemail;
#endif
#ifdef MOZ_B2G_BT
Expand Down

0 comments on commit 0fda0c1

Please sign in to comment.