Compare commits

...

7 Commits

Author SHA1 Message Date
Slava Monich
c8e3b0389f Version 1.1.23 2025-08-11 02:25:31 +03:00
Slava Monich
b0f2cebcb5 Merge pull request #45 from LaakkonenJussi/fix_build_warnings
Proper handling of the NR extension enum
2025-08-11 02:15:49 +03:00
Jussi Laakkonen
42f60e6709 [util] Proper handling of the NR extension enum. JB#62994
It is not ideal to try to handle two separate enums within one switch.
Handle those separately to avoid:

src/binder_util.c:282:5: warning: case value ‘23’ not in enumerated type ‘RADIO_PREF_NET_TYPE’ {aka ‘enum radio_pref_net_type’} [-Wswitch]
  282 |     case RADIO_PREF_NET_NR_ONLY:
      |     ^~~~
src/binder_util.c:285:5: warning: case value ‘24’ not in enumerated type ‘RADIO_PREF_NET_TYPE’ {aka ‘enum radio_pref_net_type’} [-Wswitch]
  285 |     case RADIO_PREF_NET_NR_LTE:
2025-08-07 18:37:29 +03:00
Slava Monich
be1f94671d Version 1.1.22 2025-03-27 06:13:23 +02:00
Slava Monich
4c071845e8 [ofono-binder] Fix implicit-function-declaration warnings
src/binder_cbs.c: In function 'binder_cbs_set_config':
src/binder_cbs.c:229:41: warning: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
  229 |                 config->fromServiceId = atoi(range[0]);

src/binder_gprs_context.c: In function 'binder_gprs_context_set_address':
src/binder_gprs_context.c:218:40: warning: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
  218 |                     const int prefix = atoi(s + 1);
      |                                        ^~~~

src/binder_netreg.c: In function 'binder_netreg_nitz_notify':
src/binder_netreg.c:2015:23: warning: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
 2015 |         time.utcoff = atoi(tz) * 15 * 60;
      |                       ^~~~
2025-03-27 06:04:16 +02:00
Slava Monich
3b247d58b7 Merge pull request #44 from mer-hybris/jb58545
Add support for external ringback tone
2025-03-27 05:53:15 +02:00
Matti Lehtimäki
7804af7dfd [ofono-binder-plugin] Add support for external ringback tone. JB#58545
Needed when external IMS plugin implements ringback tone.
2025-03-24 17:28:28 +02:00
12 changed files with 119 additions and 24 deletions

View File

@@ -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
View File

@@ -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

View File

@@ -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

View File

@@ -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,

View File

@@ -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,\

View File

@@ -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,

View File

@@ -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

View File

@@ -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;

View File

@@ -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))

View File

@@ -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 */

View File

@@ -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);

View File

@@ -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);
}
}