forked from sailfishos/ofono
Compare commits
2 Commits
mer/1.23+g
...
mer/1.22+g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ed6bf1d51 | ||
|
|
7c07139439 |
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019 Jolla Ltd.
|
* Copyright (C) 2019-2020 Jolla Ltd.
|
||||||
|
* Copyright (C) 2020 Open Mobile Platform LLC.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -25,7 +26,7 @@ extern "C" {
|
|||||||
enum ofono_dbus_access {
|
enum ofono_dbus_access {
|
||||||
OFONO_DBUS_ACCESS_DENY, /* Deny access */
|
OFONO_DBUS_ACCESS_DENY, /* Deny access */
|
||||||
OFONO_DBUS_ACCESS_ALLOW, /* Allow access */
|
OFONO_DBUS_ACCESS_ALLOW, /* Allow access */
|
||||||
OFONO_DBUS_ACCESS_DONT_CARE, /* No decision */
|
OFONO_DBUS_ACCESS_DONT_CARE /* No decision */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ofono_dbus_access_intf {
|
enum ofono_dbus_access_intf {
|
||||||
@@ -38,6 +39,7 @@ enum ofono_dbus_access_intf {
|
|||||||
OFONO_DBUS_ACCESS_INTF_SIMMGR, /* org.ofono.SimManager */
|
OFONO_DBUS_ACCESS_INTF_SIMMGR, /* org.ofono.SimManager */
|
||||||
OFONO_DBUS_ACCESS_INTF_MODEM, /* org.ofono.Modem */
|
OFONO_DBUS_ACCESS_INTF_MODEM, /* org.ofono.Modem */
|
||||||
OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS, /* org.ofono.RadioSettings */
|
OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS, /* org.ofono.RadioSettings */
|
||||||
|
OFONO_DBUS_ACCESS_INTF_STK, /* org.ofono.SimToolkit */
|
||||||
OFONO_DBUS_ACCESS_INTF_COUNT
|
OFONO_DBUS_ACCESS_INTF_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,6 +118,12 @@ enum ofono_dbus_access_radiosettings_method {
|
|||||||
OFONO_DBUS_ACCESS_RADIOSETTINGS_METHOD_COUNT
|
OFONO_DBUS_ACCESS_RADIOSETTINGS_METHOD_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* OFONO_DBUS_ACCESS_INTF_STK */
|
||||||
|
enum ofono_dbus_access_stk_method {
|
||||||
|
OFONO_DBUS_ACCESS_STK_REGISTER_AGENT,
|
||||||
|
OFONO_DBUS_ACCESS_STK_METHOD_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
#define OFONO_DBUS_ACCESS_PRIORITY_LOW (-100)
|
#define OFONO_DBUS_ACCESS_PRIORITY_LOW (-100)
|
||||||
#define OFONO_DBUS_ACCESS_PRIORITY_DEFAULT (0)
|
#define OFONO_DBUS_ACCESS_PRIORITY_DEFAULT (0)
|
||||||
#define OFONO_DBUS_ACCESS_PRIORITY_HIGH (100)
|
#define OFONO_DBUS_ACCESS_PRIORITY_HIGH (100)
|
||||||
|
|||||||
@@ -743,18 +743,32 @@ static int sailfish_manager_update_modem_paths(struct sailfish_manager_priv *p)
|
|||||||
*/
|
*/
|
||||||
if (sailfish_manager_all_sims_are_initialized(p)) {
|
if (sailfish_manager_all_sims_are_initialized(p)) {
|
||||||
slot = sailfish_manager_find_slot_imsi(p, NULL);
|
slot = sailfish_manager_find_slot_imsi(p, NULL);
|
||||||
if (slot && slot->watch->online &&
|
if (slot && slot->watch->imsi && slot->watch->online &&
|
||||||
p->auto_data_sim == SIM_AUTO_SELECT_ONCE) {
|
p->auto_data_sim == SIM_AUTO_SELECT_ONCE) {
|
||||||
|
const char *imsi = slot->watch->imsi;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Data SIM only needs to be auto-selected
|
* Data SIM only needs to be auto-selected
|
||||||
* once and it's done. Write that down.
|
* once and it's done. Write that down.
|
||||||
*/
|
*/
|
||||||
|
DBG("Default data sim set to %s once", imsi);
|
||||||
p->auto_data_sim_done = TRUE;
|
p->auto_data_sim_done = TRUE;
|
||||||
g_key_file_set_boolean(p->storage,
|
g_key_file_set_boolean(p->storage,
|
||||||
SF_STORE_GROUP,
|
SF_STORE_GROUP,
|
||||||
SF_STORE_AUTO_DATA_SIM_DONE,
|
SF_STORE_AUTO_DATA_SIM_DONE,
|
||||||
p->auto_data_sim_done);
|
p->auto_data_sim_done);
|
||||||
|
|
||||||
|
g_free(p->default_data_imsi);
|
||||||
|
p->pub.default_data_imsi =
|
||||||
|
p->default_data_imsi = g_strdup(imsi);
|
||||||
|
g_key_file_set_string(p->storage,
|
||||||
|
SF_STORE_GROUP,
|
||||||
|
SF_STORE_DEFAULT_DATA_SIM,
|
||||||
|
imsi);
|
||||||
|
|
||||||
storage_sync(NULL, SF_STORE, p->storage);
|
storage_sync(NULL, SF_STORE, p->storage);
|
||||||
|
sailfish_manager_dbus_signal(p->dbus,
|
||||||
|
SAILFISH_MANAGER_SIGNAL_DATA_IMSI);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DBG("Skipping auto-selection of data SIM");
|
DBG("Skipping auto-selection of data SIM");
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019 Jolla Ltd.
|
* Copyright (C) 2019-2020 Jolla Ltd.
|
||||||
|
* Copyright (C) 2020 Open Mobile Platform LLC.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -41,6 +42,8 @@ const char *ofono_dbus_access_intf_name(enum ofono_dbus_access_intf intf)
|
|||||||
return OFONO_MODEM_INTERFACE;
|
return OFONO_MODEM_INTERFACE;
|
||||||
case OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS:
|
case OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS:
|
||||||
return OFONO_RADIO_SETTINGS_INTERFACE;
|
return OFONO_RADIO_SETTINGS_INTERFACE;
|
||||||
|
case OFONO_DBUS_ACCESS_INTF_STK:
|
||||||
|
return OFONO_STK_INTERFACE;
|
||||||
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -165,6 +168,14 @@ const char *ofono_dbus_access_method_name(enum ofono_dbus_access_intf intf,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case OFONO_DBUS_ACCESS_INTF_STK:
|
||||||
|
switch ((enum ofono_dbus_access_stk_method)method) {
|
||||||
|
case OFONO_DBUS_ACCESS_STK_REGISTER_AGENT:
|
||||||
|
return "RegisterAgent";
|
||||||
|
case OFONO_DBUS_ACCESS_STK_METHOD_COUNT:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
case OFONO_DBUS_ACCESS_INTF_COUNT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||||
|
* Copyright (C) 2020 Jolla Ltd.
|
||||||
|
* Copyright (C) 2020 Open Mobile Platform LLC.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -725,6 +727,12 @@ static DBusMessage *stk_register_agent(DBusConnection *conn,
|
|||||||
if (!dbus_validate_path(agent_path, NULL))
|
if (!dbus_validate_path(agent_path, NULL))
|
||||||
return __ofono_error_invalid_format(msg);
|
return __ofono_error_invalid_format(msg);
|
||||||
|
|
||||||
|
if (!__ofono_dbus_access_method_allowed(dbus_message_get_sender(msg),
|
||||||
|
OFONO_DBUS_ACCESS_INTF_STK,
|
||||||
|
OFONO_DBUS_ACCESS_STK_REGISTER_AGENT,
|
||||||
|
agent_path))
|
||||||
|
return __ofono_error_access_denied(msg);
|
||||||
|
|
||||||
stk->default_agent = stk_agent_new(agent_path,
|
stk->default_agent = stk_agent_new(agent_path,
|
||||||
dbus_message_get_sender(msg),
|
dbus_message_get_sender(msg),
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony
|
* oFono - Open Source Telephony
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019 Jolla Ltd.
|
* Copyright (C) 2019-2020 Jolla Ltd.
|
||||||
|
* Copyright (C) 2020 Open Mobile Platform LLC.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -103,6 +104,9 @@ static const struct test_method_name_data method_name_tests[] = {
|
|||||||
},{
|
},{
|
||||||
OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS,
|
OFONO_DBUS_ACCESS_INTF_RADIOSETTINGS,
|
||||||
OFONO_DBUS_ACCESS_RADIOSETTINGS_METHOD_COUNT
|
OFONO_DBUS_ACCESS_RADIOSETTINGS_METHOD_COUNT
|
||||||
|
},{
|
||||||
|
OFONO_DBUS_ACCESS_INTF_STK,
|
||||||
|
OFONO_DBUS_ACCESS_STK_METHOD_COUNT
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user