Compare commits

..

5 Commits

Author SHA1 Message Date
Slava Monich
9e267487f4 Merge branch 'devel' into 'master'
Add more stuff to ofono devel package

See merge request !157
2017-11-27 20:15:16 +00:00
Slava Monich
c8a774dfee [ofono] Add gdbus.h to the devel package. JB#37478
External (dynamically loadable) plugins need it.
2017-11-27 21:53:25 +02:00
Slava Monich
b88518d0f3 [ofono] Adapt Sailfish OS plugins to newly introduced <ofono/storage.h> 2017-11-27 21:53:25 +02:00
Slava Monich
b223ccc675 storage: Implement ofono_config_dir and ofono_storage_dir 2017-11-27 21:53:25 +02:00
Slava Monich
947a41a5fc include: Add storage.h
To expose ofono directories to dynamically loadable plugins.

Conflicts:
	ofono/Makefile.am
2017-11-27 21:53:25 +02:00
6 changed files with 58 additions and 9 deletions

View File

@@ -24,7 +24,9 @@ pkginclude_HEADERS = include/log.h include/plugin.h include/history.h \
include/sim-mnclength.h \
include/handsfree-audio.h include/siri.h \
include/sms-filter.h \
include/netmon.h include/lte.h
include/netmon.h include/lte.h \
include/storage.h \
gdbus/gdbus.h
nodist_pkginclude_HEADERS = include/version.h
@@ -1163,6 +1165,10 @@ include/ofono/version.h: include/version.h
$(AM_V_at)$(MKDIR_P) include/ofono
$(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
include/ofono/gdbus.h: $(abs_top_srcdir)/gdbus/gdbus.h
$(AM_V_at)$(MKDIR_P) include/ofono
$(AM_V_GEN)$(LN_S) $< $@
include/ofono/%.h: $(abs_top_srcdir)/include/%.h
$(AM_V_at)$(MKDIR_P) include/ofono
$(AM_V_GEN)$(LN_S) $< $@

View File

@@ -46,7 +46,7 @@
#define OFONO_API_SUBJECT_TO_CHANGE
#include <ofono/plugin.h>
#include "storage.h"
#include <ofono/storage.h>
#define OFONO_RADIO_ACCESS_MODE_ALL (OFONO_RADIO_ACCESS_MODE_GSM |\
OFONO_RADIO_ACCESS_MODE_UMTS |\
@@ -1664,7 +1664,7 @@ static void ril_plugin_set_storage_perm(const char *path,
static void ril_plugin_switch_identity(const struct ril_plugin_identity *id)
{
ril_plugin_set_storage_perm(STORAGEDIR, id);
ril_plugin_set_storage_perm(ofono_storage_dir(), id);
if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) < 0) {
ofono_error("prctl(PR_SET_KEEPCAPS) failed: %s",
strerror(errno));

32
ofono/include/storage.h Normal file
View File

@@ -0,0 +1,32 @@
/*
*
* oFono - Open Telephony stack for Linux
*
* Copyright (C) 2017 Jolla Ltd. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __OFONO_STORAGE_H
#define __OFONO_STORAGE_H
#ifdef __cplusplus
extern "C" {
#endif
const char *ofono_config_dir(void);
const char *ofono_storage_dir(void);
#ifdef __cplusplus
}
#endif
#endif /* __OFONO_STORAGE_H */

View File

@@ -22,9 +22,8 @@
#include <gutil_macros.h>
#include <string.h>
#define OFONO_API_SUBJECT_TO_CHANGE
#include "ofono.h"
#include "storage.h"
#include "src/ofono.h"
#include "src/storage.h"
#include <sailfish_manager.h>
#include <sailfish_cell_info.h>

View File

@@ -23,9 +23,9 @@
#include <gutil_misc.h>
#include <gutil_log.h>
#include "ofono.h"
#include "common.h"
#include "storage.h"
#include "src/ofono.h"
#include "src/common.h"
#include "src/storage.h"
#define SAILFISH_SIM_INFO_STORE "cache"
#define SAILFISH_SIM_INFO_STORE_GROUP "sim"

View File

@@ -23,6 +23,8 @@
#include <config.h>
#endif
#include <ofono/storage.h>
#define _GNU_SOURCE
#include <string.h>
#include <stdarg.h>
@@ -35,6 +37,16 @@
#include "storage.h"
const char *ofono_config_dir(void)
{
return CONFIGDIR;
}
const char *ofono_storage_dir(void)
{
return STORAGEDIR;
}
int create_dirs(const char *filename, const mode_t mode)
{
struct stat st;