Backed out changeset 089f015f15bb and e907ab075ec8 (bug 880610) for hitting MOZ_ASSERT

This commit is contained in:
Eric Chou 2013-10-19 16:01:25 +08:00
parent c3fb0aed0d
commit c886826721
9 changed files with 15 additions and 46 deletions

View File

@ -222,7 +222,6 @@ if test -n "$gonkdir" ; then
15)
GONK_INCLUDES="-I$gonkdir/frameworks/base/opengl/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/frameworks/base/include -I$gonkdir/frameworks/base/services/camera -I$gonkdir/frameworks/base/include/media/stagefright -I$gonkdir/frameworks/base/include/media/stagefright/openmax -I$gonkdir/frameworks/base/media/libstagefright/rtsp -I$gonkdir/frameworks/base/media/libstagefright/include -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib -I$gonkdir/dalvik/libnativehelper/include/nativehelper"
MOZ_B2G_BT=1
MOZ_B2G_BT_BLUEZ=1
MOZ_B2G_CAMERA=1
MOZ_OMX_DECODER=1
AC_SUBST(MOZ_OMX_DECODER)
@ -231,15 +230,9 @@ if test -n "$gonkdir" ; then
17|18)
GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include"
if test -d "$gonkdir/external/bluetooth/bluez"; then
GONK_INCLUDES="$GONK_INCLUDES -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib"
GONK_INCLUDES+=" -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib"
MOZ_B2G_BT=1
MOZ_B2G_BT_BLUEZ=1
fi
if test -d "$gonkdir/external/bluetooth/bluedroid"; then
MOZ_B2G_BT=1
MOZ_B2G_BT_BLUEDROID=1
fi
MOZ_B2G_CAMERA=1
MOZ_OMX_DECODER=1
AC_SUBST(MOZ_OMX_DECODER)
@ -7295,8 +7288,6 @@ if test -n "$MOZ_B2G_BT"; then
AC_DEFINE(MOZ_B2G_BT)
fi
AC_SUBST(MOZ_B2G_BT)
AC_SUBST(MOZ_B2G_BT_BLUEZ)
AC_SUBST(MOZ_B2G_BT_BLUEDROID)
dnl ========================================================
dnl = Enable Pico Speech Synthesis (Gonk usually)

View File

@ -44,9 +44,7 @@
#if defined(MOZ_B2G_BT)
# if defined(MOZ_BLUETOOTH_GONK)
#ifndef MOZ_B2G_BT_BLUEDROID
#include "BluetoothGonkService.h"
#endif
# include "BluetoothGonkService.h"
# elif defined(MOZ_BLUETOOTH_DBUS)
# include "BluetoothDBusService.h"
# else
@ -306,13 +304,9 @@ BluetoothService::Create()
#endif
#if defined(MOZ_BLUETOOTH_GONK)
#ifndef MOZ_B2G_BT_BLUEDROID
return new BluetoothGonkService();
#endif
#elif defined(MOZ_BLUETOOTH_DBUS)
#ifdef MOZ_B2G_BT_BLUEZ
return new BluetoothDBusService();
#endif
#endif
BT_WARNING("No platform support for bluetooth!");
return nullptr;

View File

@ -27,12 +27,11 @@
#include <errno.h>
#include <sys/socket.h>
#ifdef MOZ_B2G_BT_BLUEZ
#include <bluetooth/bluetooth.h>
#include <bluetooth/l2cap.h>
#include <bluetooth/rfcomm.h>
#include <bluetooth/sco.h>
#endif
#include "BluetoothUnixSocketConnector.h"
#include "nsThreadUtils.h"
@ -44,7 +43,6 @@ static const int L2CAP_SO_SNDBUF = 400 * 1024; // 400 KB send buffer
static const int L2CAP_SO_RCVBUF = 400 * 1024; // 400 KB receive buffer
static const int L2CAP_MAX_MTU = 65000;
#ifdef MOZ_B2G_BT_BLUEZ
static
int get_bdaddr(const char *str, bdaddr_t *ba)
{
@ -64,8 +62,6 @@ void get_bdaddr_as_string(const bdaddr_t *ba, char *str) {
b[5], b[4], b[3], b[2], b[1], b[0]);
}
#endif
BluetoothUnixSocketConnector::BluetoothUnixSocketConnector(
BluetoothSocketType aType,
int aChannel,
@ -80,7 +76,6 @@ BluetoothUnixSocketConnector::BluetoothUnixSocketConnector(
bool
BluetoothUnixSocketConnector::SetUp(int aFd)
{
#ifdef MOZ_B2G_BT_BLUEZ
int lm = 0;
int sndbuf, rcvbuf;
@ -162,7 +157,7 @@ BluetoothUnixSocketConnector::SetUp(int aFd)
}
}
}
#endif
return true;
}
@ -172,7 +167,6 @@ BluetoothUnixSocketConnector::Create()
MOZ_ASSERT(!NS_IsMainThread());
int fd = -1;
#ifdef MOZ_B2G_BT_BLUEZ
switch (mType) {
case BluetoothSocketType::RFCOMM:
fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
@ -199,7 +193,7 @@ BluetoothUnixSocketConnector::Create()
BT_WARNING("Could not set up socket!");
return -1;
}
#endif
return fd;
}
@ -209,7 +203,6 @@ BluetoothUnixSocketConnector::CreateAddr(bool aIsServer,
sockaddr_any& aAddr,
const char* aAddress)
{
#ifdef MOZ_B2G_BT_BLUEZ
// Set to BDADDR_ANY, if it's not a server, we'll reset.
bdaddr_t bd_address_obj = {{0, 0, 0, 0, 0, 0}};
@ -249,7 +242,6 @@ BluetoothUnixSocketConnector::CreateAddr(bool aIsServer,
BT_WARNING("Socket type unknown!");
return false;
}
#endif
return true;
}
@ -257,7 +249,6 @@ void
BluetoothUnixSocketConnector::GetSocketAddr(const sockaddr_any& aAddr,
nsAString& aAddrStr)
{
#ifdef MOZ_B2G_BT_BLUEZ
char addr[18];
switch (mType) {
case BluetoothSocketType::RFCOMM:
@ -274,5 +265,4 @@ BluetoothUnixSocketConnector::GetSocketAddr(const sockaddr_any& aAddr,
MOZ_CRASH("Socket should be either RFCOMM or SCO!");
}
aAddrStr.AssignASCII(addr);
#endif
}

View File

@ -36,14 +36,6 @@ DEFINES += -DMOZ_BLUETOOTH_DBUS
endif
endif
ifdef MOZ_B2G_BT_BLUEZ
DEFINES += -DMOZ_B2G_BT_BLUEZ
endif
ifdef MOZ_B2G_BT_BLUEDROID
DEFINES += -DMOZ_B2G_BT_BLUEDROID
endif
# Add VPATH to LOCAL_INCLUDES so we are going to include the correct backend
# subdirectory.
LOCAL_INCLUDES += $(VPATH:%=-I%)

View File

@ -24,9 +24,6 @@ BEGIN_BLUETOOTH_NAMESPACE
class BluetoothDBusService : public BluetoothService
{
public:
BluetoothDBusService();
~BluetoothDBusService();
bool IsReady();
virtual nsresult StartInternal() MOZ_OVERRIDE;
@ -171,6 +168,11 @@ public:
virtual nsresult
SendInputMessage(const nsAString& aDeviceAddresses,
const nsAString& aMessage) MOZ_OVERRIDE;
protected:
BluetoothDBusService();
~BluetoothDBusService();
private:
/**
* For DBus Control method of "UpdateNotification", event id should be

View File

@ -52,7 +52,7 @@ if CONFIG['MOZ_B2G_BT']:
'BluetoothRilListener.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_BT_BLUEZ']:
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
CPP_SOURCES += [
'linux/BluetoothDBusService.cpp',
'gonk/BluetoothGonkService.cpp',

View File

@ -14,7 +14,7 @@ DIRS += [
if CONFIG['MOZ_B2G_RIL']:
DIRS += ['ril']
if CONFIG['MOZ_B2G_BT_BLUEZ']:
if CONFIG['MOZ_B2G_BT']:
DIRS += ['dbus']
if CONFIG['MOZ_B2G_RIL'] or CONFIG['MOZ_B2G_BT']:

View File

@ -12,7 +12,7 @@
#include <sys/types.h>
#include <sys/un.h>
#include <netinet/in.h>
#ifdef MOZ_B2G_BT_BLUEZ
#ifdef MOZ_B2G_BT
#include <bluetooth/bluetooth.h>
#include <bluetooth/sco.h>
#include <bluetooth/l2cap.h>
@ -31,7 +31,7 @@ union sockaddr_any {
sockaddr_un un;
sockaddr_in in;
sockaddr_in6 in6;
#ifdef MOZ_B2G_BT_BLUEZ
#ifdef MOZ_B2G_BT
sockaddr_sco sco;
sockaddr_rc rc;
sockaddr_l2 l2;

View File

@ -89,7 +89,7 @@ ifdef MOZ_B2G_RIL #{
STATIC_LIBS += mozril_s
endif #}
ifdef MOZ_B2G_BT_BLUEZ #{
ifdef MOZ_B2G_BT #{
STATIC_LIBS += mozdbus_s
ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
OS_LIBS += -ldbus