* #24017 Modified src/Android.mk to include im module

This commit is contained in:
alision
2013-05-09 11:03:07 -04:00
parent b9a242d0b4
commit bb0ab251f9
12 changed files with 50 additions and 9 deletions

View File

@ -45,7 +45,7 @@
#define HAVE_IAX 0
/* Define if you have instant messaging support */
#define HAVE_INSTANT_MESSAGING 0
#define HAVE_INSTANT_MESSAGING 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

View File

@ -21,6 +21,7 @@ MY_DBUS=libdbus-c++-0.9.0-android
MY_SPEEX=speex
MY_OPENSSL=openssl
MY_LIBYAML=libyaml
MY_LIBEXPAT=libexpat
MY_JNI_WRAP := $(LOCAL_PATH)/dbus/callmanager_wrap.cpp
include $(CLEAR_VARS)
@ -80,6 +81,7 @@ LOCAL_SRC_FILES := \
history/history.cpp \
history/historynamecache.cpp \
hooks/urlhook.cpp \
im/instant_messaging.cpp \
sip/sdp.cpp \
sip/sipaccount.cpp \
sip/sipcall.cpp \
@ -102,6 +104,7 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH) \
$(LOCAL_PATH)/dbus \
$(LOCAL_PATH)/history \
$(LOCAL_PATH)/hooks \
$(LOCAL_PATH)/im \
$(LOCAL_PATH)/sip \
$(APP_PROJECT_PATH)/jni/$(MY_SPEEX)/include \
$(APP_PROJECT_PATH)/jni/$(MY_COMMONCPP)/inc \
@ -116,6 +119,7 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH) \
$(APP_PROJECT_PATH)/jni/$(MY_PJPROJECT)/pjmedia/include \
$(APP_PROJECT_PATH)/jni/$(MY_PJPROJECT)/pjnath/include \
$(APP_PROJECT_PATH)/jni/$(MY_LIBYAML)/inc \
$(APP_PROJECT_PATH)/jni/$(MY_LIBEXPAT) \
$(APP_PROJECT_PATH)/jni/$(MY_SPEEX)/include
LOCAL_MODULE := libsflphone

View File

@ -422,8 +422,12 @@ void
CallManagerJNI::sendTextMessage(const std::string& callID, const std::string& message)
{
#if HAVE_INSTANT_MESSAGING
if (!Manager::instance().sendTextMessage(callID, message, "Me"))
throw CallManagerException();
try{
Manager::instance().sendTextMessage(callID, message, "Me");
}catch(...){
ERROR("Could not send \"%s\" text message to %s", message.c_str(), callID.c_str());
}
#else
ERROR("Could not send \"%s\" text message to %s since SFLphone daemon does not support it, please recompile with instant messaging support", message.c_str(), callID.c_str());
#endif

View File

@ -384,6 +384,11 @@ void ConfigurationManagerJNI::setIsAlwaysRecording(const bool& rec)
Manager::instance().setIsAlwaysRecording(rec);
}
void ConfigurationManagerJNI::setRecordingCall(const std::string& id)
{
Manager::instance().setRecordingCall(id);
}
int32_t ConfigurationManagerJNI::getHistoryLimit()
{
return Manager::instance().getHistoryLimit();

View File

@ -98,11 +98,15 @@ class ConfigurationManagerJNI {
void setAudioManager(const std::string& api);
int32_t isIax2Enabled();
/* Recording */
std::string getRecordPath();
void setRecordPath(const std::string& recPath);
bool getIsAlwaysRecording();
void setIsAlwaysRecording(const bool& rec);
void setRecordingCall(const std::string& id);
/* History */
void setHistoryLimit(const int32_t& days);
int32_t getHistoryLimit();
void clearHistory();
@ -110,7 +114,6 @@ class ConfigurationManagerJNI {
int32_t getMailNotify();
void setMailNotify();
std::map<std::string, int32_t> getAddressbookSettings();
void setAddressbookSettings(const std::map<std::string, int32_t>& settings);
std::vector< std::string > getAddressbookList();

View File

@ -1,5 +1,7 @@
LOCAL_PATH:= $(call my-dir)
$(warning Android.mk -> $(LOCAL_PATH))
# FIXME
MY_PREFIX=/sdcard
MY_DATADIR=

View File

@ -99,13 +99,17 @@ public:
int getEchoCancelDelay();
void setEchoCancelDelay(const int32_t& delay);
int32_t isIax2Enabled();
std::string getRecordPath();
void setRecordPath(const std::string& recPath);
bool getIsAlwaysRecording();
void setIsAlwaysRecording(const bool& rec);
void setRecordingCall(const std::string& id);
int32_t getHistoryLimit();
void clearHistory();
void setHistoryLimit(const int32_t& days);
void setAudioManager(const std::string& api);
std::string getAudioManager();
/*void setMailNotify();

18
daemon/src/im/Android.mk Normal file
View File

@ -0,0 +1,18 @@
LOCAL_PATH:= $(call my-dir)
MY_PJPROJECT="pjproject-android/android"
MY_EXPAT="libexpat"
$(warning Android.mk -> $(LOCAL_PATH))
include $(CLEAR_VARS)
LOCAL_SRC_FILES := instant_messaging.cpp
# FIXME
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include-all
LOCAL_MODULE := libim
include $(BUILD_STATIC_LIBRARY)

View File

@ -31,7 +31,7 @@
#include "instant_messaging.h"
#include "logger.h"
#include "expat.h"
#include <expat.h>
namespace {
void XMLCALL

View File

@ -45,8 +45,6 @@
#include <list>
#include <stdexcept>
#include <iax-client.h>
#include "config.h"
#define EMPTY_MESSAGE pj_str((char*)"")

View File

@ -47,9 +47,9 @@
#include "sip/sipaccount.h"
#include "sip/sipcall.h"
#ifndef __ANDROID__
#include "im/instant_messaging.h"
#endif
#if HAVE_IAX
#include "iax/iaxaccount.h"
@ -111,6 +111,7 @@ extern void on_conference_removed_wrapper (const std::string& confID);
extern void on_conference_state_changed_wrapper(const std::string& confID,const std::string& state);
extern struct configurationmanager_callback wrapper_configurationcallback_struct;
extern void on_account_state_changed_wrapper ();
extern void on_registration_state_changed_wrapper(const std::string& accountID, const std::string& state, const int32_t& code);
ManagerImpl::ManagerImpl() :

View File

@ -2060,6 +2060,8 @@ void registration_cb(pjsip_regc_cbparam *param)
std::string state(description->ptr, description->slen);
#if HAVE_DBUS
Manager::instance().getDbusManager()->getCallManager()->registrationStateChanged(accountID, state, param->code);
#else
//Manager::instance().on_registration_state_changed_wrapper(accountID, state, param->code);
#endif
std::pair<int, std::string> details(param->code, state);
// TODO: there id a race condition for this ressource when closing the application