Compare commits
7 Commits
ubports/fo
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8e3b0389f | ||
|
|
b0f2cebcb5 | ||
|
|
42f60e6709 | ||
|
|
be1f94671d | ||
|
|
4c071845e8 | ||
|
|
3b247d58b7 | ||
|
|
7804af7dfd |
2
Makefile
2
Makefile
@@ -93,6 +93,8 @@ STRIP ?= strip
|
||||
WARNINGS = -Wall
|
||||
BASE_FLAGS = -fPIC -fvisibility=hidden
|
||||
FULL_CFLAGS = $(BASE_FLAGS) $(CFLAGS) $(DEFINES) $(WARNINGS) -MMD -MP \
|
||||
-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 \
|
||||
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_MAX_ALLOWED \
|
||||
$(shell pkg-config --cflags $(PKGS)) -I$(EXTLIB_DIR)/include
|
||||
FULL_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS) -shared \
|
||||
$(shell pkg-config --libs $(LDPKGS))
|
||||
|
||||
12
debian/changelog
vendored
12
debian/changelog
vendored
@@ -1,3 +1,15 @@
|
||||
libofonobinderpluginext (1.1.23) unstable; urgency=low
|
||||
|
||||
* Fixed compilation warning
|
||||
|
||||
-- Slava Monich <slava@monich.com> Mon, 11 Aug 2025 02:21:15 +0300
|
||||
|
||||
libofonobinderpluginext (1.1.22) unstable; urgency=low
|
||||
|
||||
* Add support for external ringback tone
|
||||
|
||||
-- Slava Monich <slava@monich.com> Thu, 27 Mar 2025 05:56:56 +0200
|
||||
|
||||
libofonobinderpluginext (1.1.0) unstable; urgency=low
|
||||
|
||||
* Stable release of the extension API
|
||||
|
||||
@@ -25,7 +25,7 @@ all: debug release pkgconfig
|
||||
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 1
|
||||
VERSION_RELEASE = 21
|
||||
VERSION_RELEASE = 23
|
||||
|
||||
# Version for pkg-config
|
||||
PCVERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
|
||||
@@ -76,6 +76,8 @@ WARNINGS = -Wall -Wstrict-aliasing -Wunused-result
|
||||
INCLUDES = -I$(INCLUDE_DIR)
|
||||
BASE_FLAGS = -fPIC
|
||||
FULL_CFLAGS = $(BASE_FLAGS) $(CFLAGS) $(DEFINES) $(WARNINGS) $(INCLUDES) \
|
||||
-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 \
|
||||
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_MAX_ALLOWED \
|
||||
-MMD -MP $(shell pkg-config --cflags $(PKGS))
|
||||
FULL_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS) -shared -Wl,-soname,$(LIB_SONAME) \
|
||||
$(shell pkg-config --libs $(PKGS)) -lpthread
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* oFono - Open Source Telephony - binder based adaptation
|
||||
*
|
||||
* Copyright (C) 2022 Jolla Ltd.
|
||||
* Copyright (C) 2025 Slava Monich <slava@monich.com>
|
||||
*
|
||||
* 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
|
||||
@@ -160,6 +161,13 @@ void
|
||||
BINDER_EXT_CALL_DISCONNECT_REASON reason,
|
||||
void* user_data);
|
||||
|
||||
typedef
|
||||
void
|
||||
(*BinderExtCallRingbackToneFunc)(
|
||||
BinderExtCall* ext,
|
||||
gboolean start,
|
||||
void* user_data);
|
||||
|
||||
GType binder_ext_call_get_type(void);
|
||||
#define BINDER_EXT_TYPE_CALL (binder_ext_call_get_type())
|
||||
#define BINDER_EXT_CALL(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, \
|
||||
@@ -287,6 +295,12 @@ binder_ext_call_remove_handler(
|
||||
BinderExtCall* ext,
|
||||
gulong id);
|
||||
|
||||
gulong
|
||||
binder_ext_call_add_ringback_tone_handler(
|
||||
BinderExtCall* ext,
|
||||
BinderExtCallRingbackToneFunc handler,
|
||||
void* user_data); /* Since 1.1.22 */
|
||||
|
||||
void
|
||||
binder_ext_call_remove_handlers(
|
||||
BinderExtCall* ext,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* oFono - Open Source Telephony - binder based adaptation
|
||||
*
|
||||
* Copyright (C) 2022 Jolla Ltd.
|
||||
* Copyright (C) 2025 Slava Monich <slava@monich.com>
|
||||
*
|
||||
* 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
|
||||
@@ -80,6 +81,8 @@ typedef struct binder_ext_call_interface {
|
||||
gulong (*add_ssn_handler)(BinderExtCall* ext,
|
||||
BinderExtCallSuppSvcNotifyFunc handler, void* user_data);
|
||||
void (*remove_handler)(BinderExtCall* ext, gulong id);
|
||||
gulong (*add_ringback_tone_handler)(BinderExtCall* ext,
|
||||
BinderExtCallRingbackToneFunc handler, void* user_data); /* Since 1.1.22 */
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_reserved1)(void);
|
||||
@@ -91,7 +94,6 @@ typedef struct binder_ext_call_interface {
|
||||
void (*_reserved7)(void);
|
||||
void (*_reserved8)(void);
|
||||
void (*_reserved9)(void);
|
||||
void (*_reserved10)(void);
|
||||
} BinderExtCallInterface;
|
||||
|
||||
#define BINDER_EXT_CALL_GET_IFACE(obj) G_TYPE_INSTANCE_GET_INTERFACE(obj,\
|
||||
|
||||
@@ -319,6 +319,22 @@ binder_ext_call_remove_handler(
|
||||
}
|
||||
}
|
||||
|
||||
gulong
|
||||
binder_ext_call_add_ringback_tone_handler(
|
||||
BinderExtCall* self,
|
||||
BinderExtCallRingbackToneFunc handler,
|
||||
void* user_data)
|
||||
{
|
||||
if (G_LIKELY(self)) {
|
||||
BinderExtCallInterface* iface = GET_IFACE(self);
|
||||
|
||||
if (iface->add_ringback_tone_handler) {
|
||||
iface->add_ringback_tone_handler(self, handler, user_data);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
binder_ext_call_remove_handlers(
|
||||
BinderExtCall* self,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Name: ofono-binder-plugin
|
||||
|
||||
Version: 1.1.21
|
||||
Version: 1.1.23
|
||||
Release: 1
|
||||
Summary: Binder based ofono plugin
|
||||
License: GPLv2
|
||||
@@ -11,7 +11,8 @@ Source: %{name}-%{version}.tar.bz2
|
||||
%define libgbinder_version 1.1.29
|
||||
%define libgbinder_radio_version 1.6.0
|
||||
%define libmce_version 1.0.6
|
||||
%define libofonobinderpluginext_version 1.1.0
|
||||
%define libofonobinderpluginext_version 1.1.22
|
||||
%define glib_version 2.32
|
||||
%define ofono_version 1.29+git8
|
||||
|
||||
BuildRequires: pkgconfig
|
||||
@@ -20,7 +21,7 @@ BuildRequires: pkgconfig(libgbinder) >= %{libgbinder_version}
|
||||
BuildRequires: pkgconfig(libgbinder-radio) >= %{libgbinder_radio_version}
|
||||
BuildRequires: pkgconfig(libglibutil) >= %{libglibutil_version}
|
||||
BuildRequires: pkgconfig(libmce-glib) >= %{libmce_version}
|
||||
BuildRequires: pkgconfig(glib-2.0)
|
||||
BuildRequires: pkgconfig(glib-2.0) >= %{glib_version}
|
||||
|
||||
# license macro requires rpm >= 4.11
|
||||
BuildRequires: pkgconfig(rpm)
|
||||
@@ -35,6 +36,7 @@ Requires: libgbinder >= %{libgbinder_version}
|
||||
Requires: libgbinder-radio >= %{libgbinder_radio_version}
|
||||
Requires: libglibutil >= %{libglibutil_version}
|
||||
Requires: libmce-glib >= %{libmce_version}
|
||||
Requires: glib2 >= %{glib_version}
|
||||
|
||||
Conflicts: ofono-ril-plugin
|
||||
Obsoletes: ofono-ril-plugin
|
||||
@@ -88,6 +90,7 @@ Requires: pkgconfig(glib-2.0)
|
||||
Requires: pkgconfig(libgbinder-radio) >= %{libgbinder_radio_version}
|
||||
Requires: pkgconfig(libglibutil) >= %{libglibutil_version}
|
||||
Requires: libofonobinderpluginext = %{version}
|
||||
Requires: glib2 >= %{glib_version}
|
||||
|
||||
%post -n libofonobinderpluginext -p /sbin/ldconfig
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* oFono - Open Source Telephony - binder based adaptation
|
||||
*
|
||||
* Copyright (C) 2021-2022 Jolla Ltd.
|
||||
* Copyright (C) 2025 Slava Monich <slava@monich.com>
|
||||
*
|
||||
* 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
|
||||
@@ -32,6 +33,8 @@
|
||||
#include <gutil_macros.h>
|
||||
#include <gutil_strv.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct binder_cbs {
|
||||
struct ofono_cbs* cbs;
|
||||
RadioRequestGroup* g;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* oFono - Open Source Telephony - binder based adaptation
|
||||
*
|
||||
* Copyright (C) 2021-2022 Jolla Ltd.
|
||||
* Copyright (C) 2025 Slava Monich <slava@monich.com>
|
||||
*
|
||||
* 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
|
||||
@@ -29,6 +30,7 @@
|
||||
#include <gutil_misc.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define CTX_ID_NONE ((unsigned int)(-1))
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* oFono - Open Source Telephony - binder based adaptation
|
||||
*
|
||||
* Copyright (C) 2021-2022 Jolla Ltd.
|
||||
* Copyright (C) 2025 Slava Monich <slava@monich.com>
|
||||
*
|
||||
* 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
|
||||
@@ -36,6 +37,8 @@
|
||||
|
||||
#include <gutil_macros.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define REGISTRATION_MAX_RETRIES (2)
|
||||
#define NETWORK_SCAN_TIMEOUT_SEC (60) /* 1 min */
|
||||
#define OPERATOR_LIST_TIMEOUT_SEC (300) /* 5 min */
|
||||
|
||||
@@ -256,6 +256,40 @@ binder_pref_from_raf(
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
binder_pref_mask_internal(
|
||||
RADIO_PREF_NET_TYPE_INTERNAL pref,
|
||||
int none,
|
||||
int gsm_mask,
|
||||
int umts_mask,
|
||||
int lte_mask,
|
||||
int nr_mask)
|
||||
{
|
||||
switch (pref) {
|
||||
case RADIO_PREF_NET_NR_ONLY:
|
||||
return nr_mask;
|
||||
|
||||
case RADIO_PREF_NET_NR_LTE:
|
||||
return lte_mask | nr_mask;
|
||||
|
||||
case RADIO_PREF_NET_NR_LTE_CDMA_EVDO:
|
||||
case RADIO_PREF_NET_NR_LTE_WCDMA:
|
||||
case RADIO_PREF_NET_NR_LTE_TD_SCDMA:
|
||||
case RADIO_PREF_NET_NR_LTE_TD_SCDMA_WCDMA:
|
||||
return umts_mask | lte_mask | nr_mask;
|
||||
|
||||
case RADIO_PREF_NET_NR_LTE_GSM_WCDMA:
|
||||
case RADIO_PREF_NET_NR_LTE_TD_SCDMA_GSM:
|
||||
case RADIO_PREF_NET_NR_LTE_CDMA_EVDO_GSM_WCDMA:
|
||||
case RADIO_PREF_NET_NR_LTE_TD_SCDMA_GSM_WCDMA:
|
||||
case RADIO_PREF_NET_NR_LTE_TD_SCDMA_CDMA_EVDO_GSM_WCDMA:
|
||||
return gsm_mask | umts_mask | lte_mask | nr_mask;
|
||||
}
|
||||
|
||||
return none;
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
binder_pref_mask(
|
||||
@@ -279,12 +313,6 @@ binder_pref_mask(
|
||||
case RADIO_PREF_NET_LTE_CDMA_EVDO:
|
||||
return lte_mask;
|
||||
|
||||
case RADIO_PREF_NET_NR_ONLY:
|
||||
return nr_mask;
|
||||
|
||||
case RADIO_PREF_NET_NR_LTE:
|
||||
return lte_mask | nr_mask;
|
||||
|
||||
case RADIO_PREF_NET_TD_SCDMA_GSM:
|
||||
case RADIO_PREF_NET_GSM_WCDMA:
|
||||
case RADIO_PREF_NET_GSM_WCDMA_AUTO:
|
||||
@@ -305,24 +333,15 @@ binder_pref_mask(
|
||||
case RADIO_PREF_NET_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA:
|
||||
return gsm_mask | umts_mask | lte_mask;
|
||||
|
||||
case RADIO_PREF_NET_NR_LTE_CDMA_EVDO:
|
||||
case RADIO_PREF_NET_NR_LTE_WCDMA:
|
||||
case RADIO_PREF_NET_NR_LTE_TD_SCDMA:
|
||||
case RADIO_PREF_NET_NR_LTE_TD_SCDMA_WCDMA:
|
||||
return umts_mask | lte_mask | nr_mask;
|
||||
|
||||
case RADIO_PREF_NET_NR_LTE_GSM_WCDMA:
|
||||
case RADIO_PREF_NET_NR_LTE_TD_SCDMA_GSM:
|
||||
case RADIO_PREF_NET_NR_LTE_CDMA_EVDO_GSM_WCDMA:
|
||||
case RADIO_PREF_NET_NR_LTE_TD_SCDMA_GSM_WCDMA:
|
||||
case RADIO_PREF_NET_NR_LTE_TD_SCDMA_CDMA_EVDO_GSM_WCDMA:
|
||||
return gsm_mask | umts_mask | lte_mask | nr_mask;
|
||||
|
||||
case RADIO_PREF_NET_CDMA_ONLY:
|
||||
case RADIO_PREF_NET_EVDO_ONLY:
|
||||
case RADIO_PREF_NET_CDMA_EVDO_AUTO:
|
||||
case RADIO_PREF_NET_INVALID:
|
||||
return none;
|
||||
|
||||
default:
|
||||
return binder_pref_mask_internal((RADIO_PREF_NET_TYPE_INTERNAL)pref,
|
||||
none, gsm_mask, umts_mask, lte_mask, nr_mask);
|
||||
}
|
||||
|
||||
DBG("unexpected pref mode %d", pref);
|
||||
|
||||
@@ -57,6 +57,7 @@ enum binder_voicecall_ext_events {
|
||||
VOICECALL_EXT_CALL_STATE_CHANGED,
|
||||
VOICECALL_EXT_CALL_DISCONNECTED,
|
||||
VOICECALL_EXT_CALL_SUPP_SVC_NOTIFICATION,
|
||||
VOICECALL_EXT_CALL_RINGBACK_TONE,
|
||||
VOICECALL_EXT_EVENT_COUNT
|
||||
};
|
||||
|
||||
@@ -2118,6 +2119,19 @@ binder_voicecall_ext_call_disconnected(
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
binder_voicecall_ext_call_ringback_tone(
|
||||
BinderExtCall* ext,
|
||||
gboolean start,
|
||||
void* user_data)
|
||||
{
|
||||
BinderVoiceCall* self = user_data;
|
||||
|
||||
DBG_(self, "play ringback tone: %d", start);
|
||||
ofono_voicecall_ringback_tone_notify(self->vc, start);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
binder_voicecall_register(
|
||||
@@ -2199,6 +2213,9 @@ binder_voicecall_register(
|
||||
self->ext_event[VOICECALL_EXT_CALL_SUPP_SVC_NOTIFICATION] =
|
||||
binder_ext_call_add_ssn_handler(self->ext,
|
||||
binder_voicecall_ext_supp_svc_notification, self);
|
||||
self->ext_event[VOICECALL_EXT_CALL_RINGBACK_TONE] =
|
||||
binder_ext_call_add_ringback_tone_handler(self->ext,
|
||||
binder_voicecall_ext_call_ringback_tone, self);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user