Skip to content
Snippets Groups Projects
Commit 27d77de2 authored by Romain Bertozzi's avatar Romain Bertozzi Committed by Guillaume Roguez
Browse files

ios: open signals for iOS platform


This patch opens signals for the iOS platform.
The signals that are opened are:
    - GetAppDataPath
    - GetHardwareAudioFormat

Issue: #1540
Change-Id: Ia0a5d999aaf358a562fa8af58bc1c630fb1388f5
Reviewed-by: default avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
parent 1451a220
No related branches found
No related tags found
No related merge requests found
...@@ -73,10 +73,10 @@ getSignalHandlers() ...@@ -73,10 +73,10 @@ getSignalHandlers()
exported_callback<DRing::ConfigurationSignal::MigrationEnded>(), exported_callback<DRing::ConfigurationSignal::MigrationEnded>(),
exported_callback<DRing::ConfigurationSignal::DeviceRevocationEnded>(), exported_callback<DRing::ConfigurationSignal::DeviceRevocationEnded>(),
exported_callback<DRing::ConfigurationSignal::Error>(), exported_callback<DRing::ConfigurationSignal::Error>(),
#ifdef __ANDROID__ #if defined(__ANDROID__) || TARGET_OS_IOS
exported_callback<DRing::ConfigurationSignal::GetHardwareAudioFormat>(), exported_callback<DRing::ConfigurationSignal::GetHardwareAudioFormat>(),
#endif #endif
#if defined(__ANDROID__) || defined(RING_UWP) #if defined(__ANDROID__) || TARGET_OS_IOS || defined(RING_UWP)
exported_callback<DRing::ConfigurationSignal::GetAppDataPath>(), exported_callback<DRing::ConfigurationSignal::GetAppDataPath>(),
#endif #endif
......
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
#include "dring.h" #include "dring.h"
#include "logger.h" #include "logger.h"
#ifdef __APPLE__
#include <TargetConditionals.h>
#endif
#include <exception> #include <exception>
#include <memory> #include <memory>
#include <map> #include <map>
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
#include "dring.h" #include "dring.h"
#include "security_const.h" #include "security_const.h"
#ifdef __APPLE__
#include <TargetConditionals.h>
#endif
namespace DRing { namespace DRing {
void registerConfHandlers(const std::map<std::string, std::shared_ptr<CallbackWrapperBase>>&); void registerConfHandlers(const std::map<std::string, std::shared_ptr<CallbackWrapperBase>>&);
...@@ -278,13 +282,13 @@ struct ConfigurationSignal { ...@@ -278,13 +282,13 @@ struct ConfigurationSignal {
* These are special getters for Android and UWP, so the daemon can retreive * These are special getters for Android and UWP, so the daemon can retreive
* information only accessible through their respective platform APIs * information only accessible through their respective platform APIs
*/ */
#ifdef __ANDROID__ #if defined(__ANDROID__) || TARGET_OS_IOS
struct GetHardwareAudioFormat { struct GetHardwareAudioFormat {
constexpr static const char* name = "GetHardwareAudioFormat"; constexpr static const char* name = "GetHardwareAudioFormat";
using cb_type = void(std::vector<int32_t>* /* params_ret */); using cb_type = void(std::vector<int32_t>* /* params_ret */);
}; };
#endif #endif
#if defined(__ANDROID__) || defined(RING_UWP) #if defined(__ANDROID__) || defined(RING_UWP) || TARGET_OS_IOS
struct GetAppDataPath { struct GetAppDataPath {
constexpr static const char* name = "GetAppDataPath"; constexpr static const char* name = "GetAppDataPath";
using cb_type = void(const std::string& name, std::vector<std::string>* /* path_ret */); using cb_type = void(const std::string& name, std::vector<std::string>* /* path_ret */);
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <TargetConditionals.h> #include <TargetConditionals.h>
#endif #endif
#ifdef __ANDROID__ #if defined(__ANDROID__) || TARGET_OS_IOS
#include "client/ring_signal.h" #include "client/ring_signal.h"
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
...@@ -175,7 +175,7 @@ create_pidfile() ...@@ -175,7 +175,7 @@ create_pidfile()
std::string std::string
expand_path(const std::string &path) expand_path(const std::string &path)
{ {
#if defined __ANDROID__ || defined RING_UWP || defined WIN32 || TARGET_OS_IPHONE #if defined __ANDROID__ || defined RING_UWP || defined WIN32 || TARGET_OS_IOS
RING_ERR("Path expansion not implemented, returning original"); RING_ERR("Path expansion not implemented, returning original");
return path; return path;
#else #else
...@@ -417,7 +417,7 @@ FileHandle::~FileHandle() ...@@ -417,7 +417,7 @@ FileHandle::~FileHandle()
} }
} }
#if defined(__ANDROID__) || defined(RING_UWP) #if defined(__ANDROID__) || defined(RING_UWP) || TARGET_OS_IOS
static std::string files_path; static std::string files_path;
static std::string cache_path; static std::string cache_path;
static std::string config_path; static std::string config_path;
...@@ -451,7 +451,7 @@ get_cache_dir() ...@@ -451,7 +451,7 @@ get_cache_dir()
return cache_home; return cache_home;
} else { } else {
#endif #endif
#ifdef __ANDROID__ #if defined(__ANDROID__) || TARGET_OS_IOS
std::vector<std::string> paths; std::vector<std::string> paths;
emitSignal<DRing::ConfigurationSignal::GetAppDataPath>("cache", &paths); emitSignal<DRing::ConfigurationSignal::GetAppDataPath>("cache", &paths);
if (not paths.empty()) if (not paths.empty())
...@@ -473,7 +473,7 @@ get_cache_dir() ...@@ -473,7 +473,7 @@ get_cache_dir()
std::string std::string
get_home_dir() get_home_dir()
{ {
#if defined __ANDROID__ #if defined(__ANDROID__) || TARGET_OS_IOS
std::vector<std::string> paths; std::vector<std::string> paths;
emitSignal<DRing::ConfigurationSignal::GetAppDataPath>("files", &paths); emitSignal<DRing::ConfigurationSignal::GetAppDataPath>("files", &paths);
if (not paths.empty()) if (not paths.empty())
...@@ -517,7 +517,7 @@ get_home_dir() ...@@ -517,7 +517,7 @@ get_home_dir()
std::string std::string
get_data_dir() get_data_dir()
{ {
#ifdef __ANDROID__ #if defined(__ANDROID__) || TARGET_OS_IOS
std::vector<std::string> paths; std::vector<std::string> paths;
emitSignal<DRing::ConfigurationSignal::GetAppDataPath>("files", &paths); emitSignal<DRing::ConfigurationSignal::GetAppDataPath>("files", &paths);
if (not paths.empty()) if (not paths.empty())
...@@ -553,7 +553,7 @@ get_data_dir() ...@@ -553,7 +553,7 @@ get_data_dir()
std::string std::string
get_config_dir() get_config_dir()
{ {
#ifdef __ANDROID__ #if defined(__ANDROID__) || TARGET_OS_IOS
std::vector<std::string> paths; std::vector<std::string> paths;
emitSignal<DRing::ConfigurationSignal::GetAppDataPath>("config", &paths); emitSignal<DRing::ConfigurationSignal::GetAppDataPath>("config", &paths);
if (not paths.empty()) if (not paths.empty())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment