Compare commits

..

40 Commits
1.0.2 ... 1.2.2

Author SHA1 Message Date
Slava Monich
7b5656d2a8 Version 1.2.2 2021-03-05 14:01:30 +02:00
Slava Monich
788d472839 [gbinder-radio] Added radio_instance_get_with_version(). JB#50597
That's consistent with other API calls.

radio_instance_get_with_interface() has been removed from the header
and shouldn't be used.
2021-03-05 13:58:59 +02:00
Slava Monich
7f4446b3fd Version 1.2.1 2021-03-05 12:35:10 +02:00
Slava Monich
e08ef1bdae Merge pull request #9 from monich/backcompat
Backward compatibility with radio@1.0
2021-03-05 12:30:13 +02:00
Slava Monich
8039bfe66e [gbinder-radio] Backward compatibility with radio@1.0. JB#50597
Once you say you support radio@1.2 responses, getIccCardStatus@1.0
responds with getIccCardStatusResponse@1.2. That breaks clients
which only handle radio@1.0 responses.

Intention to support higher interface levels must be explicitly
expressed.
2021-03-05 12:23:10 +02:00
Slava Monich
7e23a74fbf Version 1.2.0
Version bump marks radio@1.2 support
2021-03-04 13:39:04 +02:00
Slava Monich
a9463baaaf Freshened up license 2021-03-04 13:38:42 +02:00
Slava Monich
ddee97fc93 Acknowledge Matti's contribution 2021-03-04 13:34:24 +02:00
Slava Monich
f562149d18 Merge pull request #8 from monich/radio-1.2
Support for android.hardware.radio@1.2 interfaces
2021-03-04 13:26:42 +02:00
Matti Lehtimäki
21d659a5c5 [gbinder-radio] Attach to the highest supported interface. JB#50597 2021-03-04 02:28:52 +02:00
Matti Lehtimäki
71f5632e2d [gbinder-radio] Added android.hardware.radio@1.2 types. JB#50597
Add missing android.hardware.radio@1.1 entry to radio_req_resp.
2021-03-03 18:15:45 +02:00
Slava Monich
30e7563d94 Version 1.0.11 2020-10-01 21:05:56 +03:00
Slava Monich
26a321bc36 [gbinder-radio] Added req => resp mapping for radio@1.1 calls 2020-10-01 21:03:42 +03:00
Slava Monich
f141bd1615 Merge pull request #7 from nemomobile-ux/permissions
Install the library with exe permissions.
2020-10-01 20:58:26 +03:00
Rinigus
d3a63909c7 [gbinder-radio] Install the library with exe permissions. JB#51013
Signed-off-by: Rinigus <rinigus.git@gmail.com>
2020-09-30 23:02:43 +03:00
Slava Monich
aaa1c0c9a0 Version 1.0.10 2020-06-03 15:35:18 +03:00
Slava Monich
e0ffc4d60c Merge pull request #6 from monich/lib64
Respect arch specific lib dir
2020-06-03 15:22:39 +03:00
Slava Monich
94d469380e [gbinder-radio] Respect arch specific lib dir. JB#49681 2020-06-03 04:04:01 +03:00
Slava Monich
7e4b839fc6 [gbinder-radio] Hide internal symbols 2020-06-03 04:04:01 +03:00
Slava Monich
0708177e94 [gbinder-radio] Constants for android.hardware.radio@1.1 interfaces 2020-06-03 04:03:54 +03:00
Slava Monich
9047ef9a56 [gbinder-radio] Ignore GLib deprecation warnings 2020-06-02 20:14:05 +03:00
Slava Monich
bb61f00d57 Version 1.0.9 2020-03-24 12:37:01 +02:00
Slava Monich
601ef084ee Added AUTHORS file 2020-03-24 12:33:40 +02:00
Slava Monich
3cd41646b4 Merge pull request #5 from Danct12/1.0.8-deb
[debian] Packaging for Debian-based distros. JB#42254
2020-03-24 12:29:17 +02:00
Danct12
d1fb490f9b Initial packaging for Debian
Signed-off-by: Danct12 <danct12@disroot.org>
2020-03-24 09:16:30 +07:00
Slava Monich
7e0c222f1d Version 1.0.8 2019-08-14 18:03:57 +03:00
Slava Monich
f5b2cc062c [gbinder-radio] Added RADIO_DEVICE_STATE enum. JB#46836 2019-08-14 18:00:57 +03:00
Slava Monich
9e246ebb55 Version 1.0.7 2019-07-02 14:23:45 +03:00
Slava Monich
5f5afc3d76 Fixed syntax error in a last-minute change 2019-07-02 14:23:32 +03:00
Slava Monich
eab404c46b Merge pull request #4 from monich/enabled
Add enabled attribute to RadioInstance
2019-07-02 14:11:40 +03:00
Slava Monich
395a50ba3d [gbinder-radio] Added enabled attribute to RadioInstance. JB#46324
And these new functions:

  radio_instance_new_with_modem_and_slot()
  radio_instance_set_enabled()
  radio_instance_add_enabled_handler()
2019-06-28 19:00:26 +03:00
Slava Monich
79379ea3d1 Version 1.0.6 2019-04-30 12:04:25 +03:00
Slava Monich
197e84e71a [gbinder-radio] Added RadioDataProfile enums. JB#45342
RADIO_DATA_PROFILE_ID and RADIO_APN_TYPES
2019-04-30 12:02:32 +03:00
Slava Monich
30ea57a3cb Version 1.0.5 2019-03-19 12:45:16 +02:00
Slava Monich
49fcc2a599 Merge pull request #2 from krnlyng/jb44067
Add HardwareConfig types
2019-03-19 12:43:01 +02:00
Frajo Haider
6d9f87f7ea [gbinder-radio] add HardwareConfig types. JB#44067 2019-03-19 12:39:42 +02:00
Slava Monich
efc30cd06d Version 1.0.4 2019-03-06 00:41:13 +02:00
Slava Monich
6959979384 [gbinder-radio] Fixed death handling. JB#44551
Listeners were being registered for the wrong signal.
2019-03-06 00:38:32 +02:00
Slava Monich
1ebf32bc73 Version 1.0.3 2019-03-05 02:59:50 +02:00
Slava Monich
a119a68374 [gbinder-radio] Added RADIO_APN_AUTH_TYPE enum. JB#44551 2019-03-05 02:56:47 +02:00
19 changed files with 831 additions and 107 deletions

10
.gitignore vendored
View File

@@ -1,13 +1,11 @@
*~
debian/files
debian/libgbinder-radio-dev.debhelper.log
debian/libgbinder-radio-dev.substvars
debian/libgbinder-radio-dev
debian/libgbinder-radio.debhelper.log
debian/libgbinder-radio.postinst.debhelper
debian/libgbinder-radio.postrm.debhelper
debian/libgbinder-radio.substvars
debian/libgbinder-radio
debian/*.debhelper.log
debian/*.debhelper
debian/*.substvars
debian/*.install
debian/tmp
documentation.list
installroot

4
AUTHORS Normal file
View File

@@ -0,0 +1,4 @@
Danct12 <danct12@disroot.org>
Frajo Haider <f_haider@gmx.at>
Matti Lehtimäki <matti.lehtimaki@jolla.com>
Slava Monich <slava@monich.com>

33
LICENSE Normal file
View File

@@ -0,0 +1,33 @@
Copyright (C) 2018-2021 Jolla Ltd.
Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
You may use this file under the terms of the BSD license as follows:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the names of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation
are those of the authors and should not be interpreted as representing
any official policies, either expressed or implied.

View File

@@ -22,7 +22,7 @@ all: debug release pkgconfig
#
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_MINOR = 2
VERSION_RELEASE = 2
# Version for pkg-config
@@ -78,10 +78,7 @@ DEBUG_FLAGS = -g
RELEASE_FLAGS =
COVERAGE_FLAGS = -g
ifndef KEEP_SYMBOLS
KEEP_SYMBOLS = 0
endif
KEEP_SYMBOLS ?= 0
ifneq ($(KEEP_SYMBOLS),0)
RELEASE_FLAGS += -g
endif
@@ -144,9 +141,10 @@ pkgconfig: $(PKGCONFIG)
clean:
rm -f *~ $(SRC_DIR)/*~ $(INCLUDE_DIR)/*~
rm -fr $(BUILD_DIR) RPMS installroot
rm -fr debian/tmp debian/libgbinder debian/libgbinder-dev
rm -fr debian/tmp debian/libgbinder-radio debian/libgbinder-radio-dev
rm -f documentation.list debian/files debian/*.substvars
rm -f debian/*.debhelper.log debian/*.debhelper debian/*~
rm -f debian/*.install
$(BUILD_DIR):
mkdir -p $@
@@ -192,25 +190,34 @@ $(COVERAGE_LIB): $(COVERAGE_OBJS)
$(AR) rc $@ $?
ranlib $@
#
# LIBDIR usually gets substituted with arch specific dir.
# It's relative in deb build and can be whatever in rpm build.
#
LIBDIR ?= usr/lib
ABS_LIBDIR := $(shell echo /$(LIBDIR) | sed -r 's|/+|/|g')
$(PKGCONFIG): $(LIB_NAME).pc.in Makefile
sed -e 's/\[version\]/'$(PCVERSION)/g $< > $@
sed -e 's|@version@|$(PCVERSION)|g' -e 's|@libdir@|$(ABS_LIBDIR)|g' $< > $@
debian/%.install: debian/%.install.in
sed 's|@LIBDIR@|$(LIBDIR)|g' $< > $@
#
# Install
#
INSTALL_PERM = 644
INSTALL = install
INSTALL_DIRS = $(INSTALL) -d
INSTALL_FILES = $(INSTALL) -m $(INSTALL_PERM)
INSTALL_FILES = $(INSTALL) -m 644
INSTALL_LIB_DIR = $(DESTDIR)/usr/lib
INSTALL_LIB_DIR = $(DESTDIR)$(ABS_LIBDIR)
INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/$(NAME)
INSTALL_PKGCONFIG_DIR = $(DESTDIR)/usr/lib/pkgconfig
INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(ABS_LIBDIR)/pkgconfig
install: $(INSTALL_LIB_DIR)
$(INSTALL_FILES) $(RELEASE_SO) $(INSTALL_LIB_DIR)
$(INSTALL) -m 755 $(RELEASE_SO) $(INSTALL_LIB_DIR)
ln -sf $(LIB_SO) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK2)
ln -sf $(LIB_SYMLINK2) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK1)

39
debian/changelog vendored Normal file
View File

@@ -0,0 +1,39 @@
libgbinder-radio (1.2.2) unstable; urgency=medium
* Added radio_instance_get_with_version()
-- Slava Monich <slava.monich@jolla.com> Fri, 05 Mar 2021 14:00:20 +0200
libgbinder-radio (1.2.1) unstable; urgency=medium
* Fixed backward compatibility with radio@1.0
-- Slava Monich <slava.monich@jolla.com> Fri, 05 Mar 2021 12:33:50 +0200
libgbinder-radio (1.2.0) unstable; urgency=medium
* Support for radio@1.2 interfaces
-- Slava Monich <slava.monich@jolla.com> Thu, 04 Mar 2021 13:36:51 +0200
libgbinder-radio (1.0.11) unstable; urgency=medium
* Make library executable on RPM based systems
* Added req => resp mapping for radio@1.1 calls
-- Slava Monich <slava.monich@jolla.com> Thu, 01 Oct 2020 21:04:59 +0300
libgbinder-radio (1.0.10) unstable; urgency=medium
* Hide internal symbols
* Respect arch specific lib dir
* Ignore GLib deprecation warnings
* Added constants for android.hardware.radio@1.1 interfaces
-- Slava Monich <slava.monich@jolla.com> Wed, 03 Jun 2020 15:24:17 +0300
libgbinder-radio (1.0.9) unstable; urgency=medium
* Added packaging for Debian-based distros.
-- Danct12 <danct12@disroot.org> Tue, 24 Mar 2020 02:55:50 +0700

1
debian/compat vendored Normal file
View File

@@ -0,0 +1 @@
9

17
debian/control vendored Normal file
View File

@@ -0,0 +1,17 @@
Source: libgbinder-radio
Priority: optional
Maintainer: Danct12 <danct12@disroot.org>
Build-Depends: debhelper (>=9), libgbinder-dev (>= 1.0.9)
Standards-Version: 3.9.6
Package: libgbinder-radio-dev
Section: libdevel
Architecture: any
Depends: libgbinder-radio (= ${binary:Version}), ${misc:Depends}
Description: Development files for libgbinder-radio
Package: libgbinder-radio
Section: libs
Architecture: any
Depends: libgbinder (>= 1.0.9), ${shlibs:Depends}, ${misc:Depends}
Description: Binder client library for Android radio interfaces

33
debian/copyright vendored Normal file
View File

@@ -0,0 +1,33 @@
Copyright (C) 2018-2021 Jolla Ltd.
Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
You may use this file under the terms of the BSD license as follows:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the names of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation
are those of the authors and should not be interpreted as representing
any official policies, either expressed or implied.

View File

@@ -0,0 +1,3 @@
debian/tmp/@LIBDIR@/libgbinder-radio.so @LIBDIR@
debian/tmp/@LIBDIR@/pkgconfig/libgbinder-radio.pc @LIBDIR@/pkgconfig
debian/tmp/usr/include/* usr/include

1
debian/libgbinder-radio.install.in vendored Normal file
View File

@@ -0,0 +1 @@
debian/tmp/@LIBDIR@/libgbinder-radio.so.* @LIBDIR@

14
debian/rules vendored Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/make -f
# Uncomment to enable verbose build
#export DH_VERBOSE = 1
LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
override_dh_auto_build:
dh_auto_build -- LIBDIR=$(LIBDIR) release pkgconfig debian/libgbinder-radio.install debian/libgbinder-radio-dev.install
override_dh_auto_install:
dh_auto_install -- LIBDIR=$(LIBDIR) install-dev
%:
dh $@

1
debian/source/format vendored Normal file
View File

@@ -0,0 +1 @@
3.0 (native)

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018-2019 Jolla Ltd.
* Copyright (C) 2018-2019 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2018-2021 Jolla Ltd.
* Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -45,6 +45,13 @@ G_BEGIN_DECLS
typedef struct radio_instance_priv RadioInstancePriv;
typedef enum radio_interface {
RADIO_INTERFACE_1_0,
RADIO_INTERFACE_1_1,
RADIO_INTERFACE_1_2,
RADIO_INTERFACE_COUNT
} RADIO_INTERFACE; /* Since 1.2.0 */
struct radio_instance {
GObject parent;
RadioInstancePriv* priv;
@@ -52,6 +59,12 @@ struct radio_instance {
const char* dev;
const char* slot;
const char* key;
/* Since 1.0.7 */
const char* modem; /* D-Bus path */
int slot_index; /* 0 for SIM1, 1 for SIM2 and so on */
gboolean enabled;
/* Since 1.2.0 */
RADIO_INTERFACE version;
};
typedef
@@ -113,11 +126,38 @@ radio_instance_new(
const char* dev,
const char* name);
RadioInstance*
radio_instance_new_with_modem_and_slot(
const char* dev,
const char* name,
const char* modem,
int slot_index); /* Since 1.0.7 */
RadioInstance*
radio_instance_new_with_version(
const char* dev,
const char* name,
RADIO_INTERFACE version); /* Since 1.2.1 */
RadioInstance*
radio_instance_new_with_modem_slot_and_version(
const char* dev,
const char* name,
const char* modem,
int slot_index,
RADIO_INTERFACE version); /* Since 1.2.1 */
RadioInstance*
radio_instance_get(
const char* dev,
const char* name);
RadioInstance*
radio_instance_get_with_version(
const char* dev,
const char* name,
RADIO_INTERFACE version); /* Since 1.2.2 */
RadioInstance* const*
radio_instance_get_all(
void);
@@ -160,6 +200,11 @@ radio_instance_send_request_sync(
RADIO_REQ code,
GBinderLocalRequest* args);
void
radio_instance_set_enabled(
RadioInstance* radio,
gboolean enabled); /* Since 1.0.7 */
gulong
radio_instance_add_indication_handler(
RadioInstance* radio,
@@ -200,6 +245,12 @@ radio_instance_add_death_handler(
RadioInstanceFunc func,
gpointer user_data);
gulong
radio_instance_add_enabled_handler(
RadioInstance* radio,
RadioInstanceFunc func,
gpointer user_data); /* Since 1.0.7 */
void
radio_instance_remove_handler(
RadioInstance* radio,

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018-2019 Jolla Ltd.
* Copyright (C) 2018-2019 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2018-2021 Jolla Ltd.
* Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -46,9 +46,17 @@ typedef struct radio_registry RadioRegistry;
#define RADIO_IFACE_PREFIX "android.hardware.radio@"
#define RADIO_IFACE_1_0(x) RADIO_IFACE_PREFIX "1.0::" x
#define RADIO_IFACE_1_1(x) RADIO_IFACE_PREFIX "1.1::" x
#define RADIO_IFACE_1_2(x) RADIO_IFACE_PREFIX "1.2::" x
#define RADIO_1_0 RADIO_IFACE_1_0("IRadio")
#define RADIO_1_1 RADIO_IFACE_1_1("IRadio")
#define RADIO_1_2 RADIO_IFACE_1_2("IRadio")
#define RADIO_RESPONSE_1_0 RADIO_IFACE_1_0("IRadioResponse")
#define RADIO_RESPONSE_1_1 RADIO_IFACE_1_1("IRadioResponse")
#define RADIO_RESPONSE_1_2 RADIO_IFACE_1_2("IRadioResponse")
#define RADIO_INDICATION_1_0 RADIO_IFACE_1_0("IRadioIndication")
#define RADIO_INDICATION_1_1 RADIO_IFACE_1_1("IRadioIndication")
#define RADIO_INDICATION_1_2 RADIO_IFACE_1_2("IRadioIndication")
/* Types defined in types.hal */
@@ -175,6 +183,44 @@ typedef enum radio_access_family {
} RADIO_ACCESS_FAMILY;
G_STATIC_ASSERT(sizeof(RADIO_ACCESS_FAMILY) == 4);
typedef enum radio_apn_auth_type {
RADIO_APN_AUTH_NONE,
RADIO_APN_AUTH_PAP,
RADIO_APN_AUTH_CHAP,
RADIO_APN_AUTH_PAP_CHAP
} RADIO_APN_AUTH_TYPE;
G_STATIC_ASSERT(sizeof(RADIO_APN_AUTH_TYPE) == 4);
typedef enum radio_apn_types {
RADIO_APN_TYPE_NONE = 0,
RADIO_APN_TYPE_DEFAULT = 1 << 0,
RADIO_APN_TYPE_MMS = 1 << 1,
RADIO_APN_TYPE_SUPL = 1 << 2,
RADIO_APN_TYPE_DUN = 1 << 3,
RADIO_APN_TYPE_HIPRI = 1 << 4,
RADIO_APN_TYPE_FOTA = 1 << 5,
RADIO_APN_TYPE_IMS = 1 << 6,
RADIO_APN_TYPE_CBS = 1 << 7,
RADIO_APN_TYPE_IA = 1 << 8,
RADIO_APN_TYPE_EMERGENCY = 1 << 9,
RADIO_APN_TYPE_ALL = RADIO_APN_TYPE_DEFAULT | RADIO_APN_TYPE_MMS |
RADIO_APN_TYPE_SUPL | RADIO_APN_TYPE_DUN | RADIO_APN_TYPE_HIPRI |
RADIO_APN_TYPE_FOTA | RADIO_APN_TYPE_IMS | RADIO_APN_TYPE_CBS |
RADIO_APN_TYPE_IA | RADIO_APN_TYPE_EMERGENCY
} RADIO_APN_TYPES;
G_STATIC_ASSERT(sizeof(RADIO_APN_TYPES) == 4);
typedef enum radio_data_profile_id {
RADIO_DATA_PROFILE_INVALID = -1,
RADIO_DATA_PROFILE_DEFAULT = 0,
RADIO_DATA_PROFILE_TETHERED = 1,
RADIO_DATA_PROFILE_IMS = 2,
RADIO_DATA_PROFILE_FOTA = 3,
RADIO_DATA_PROFILE_CBS = 4,
RADIO_DATA_PROFILE_OEM_BASE = 1000
} RADIO_DATA_PROFILE_ID;
G_STATIC_ASSERT(sizeof(RADIO_DATA_PROFILE_ID) == 4);
typedef enum radio_card_state {
RADIO_CARD_STATE_ABSENT,
RADIO_CARD_STATE_PRESENT,
@@ -258,6 +304,30 @@ typedef enum radio_capability_status {
} RADIO_CAPABILITY_STATUS;
G_STATIC_ASSERT(sizeof(RADIO_CAPABILITY_STATUS) == 4);
typedef enum radio_device_state {
RADIO_DEVICE_STATE_POWER_SAVE_MODE,
RADIO_DEVICE_STATE_CHARGING_STATE,
RADIO_DEVICE_STATE_LOW_DATA_EXPECTED
} RADIO_DEVICE_STATE;
G_STATIC_ASSERT(sizeof(RADIO_DEVICE_STATE) == 4);
typedef enum radio_data_request_reason {
RADIO_DATA_REQUEST_REASON_NORMAL = 1,
RADIO_DATA_REQUEST_REASON_SHUTDOWN,
RADIO_DATA_REQUEST_REASON_HANDOVER
} RADIO_DATA_REQUEST_REASON; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RADIO_DATA_REQUEST_REASON) == 4);
typedef enum radio_access_network {
RADIO_ACCESS_NETWORK_UNKNOWN,
RADIO_ACCESS_NETWORK_GERAN,
RADIO_ACCESS_NETWORK_UTRAN,
RADIO_ACCESS_NETWORK_EUTRAN,
RADIO_ACCESS_NETWORK_CDMA2000,
RADIO_ACCESS_NETWORK_IWLAN
} RADIO_ACCESS_NETWORK; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RADIO_ACCESS_NETWORK) == 4);
typedef struct radio_response_info {
RADIO_RESP_TYPE type RADIO_ALIGNED(4);
guint32 serial RADIO_ALIGNED(4);
@@ -275,6 +345,19 @@ typedef struct radio_card_status {
} RADIO_ALIGNED(8) RadioCardStatus;
G_STATIC_ASSERT(sizeof(RadioCardStatus) == 40);
typedef struct radio_card_status_1_2 {
RADIO_CARD_STATE cardState RADIO_ALIGNED(4);
RADIO_PIN_STATE universalPinState RADIO_ALIGNED(4);
gint32 gsmUmtsSubscriptionAppIndex RADIO_ALIGNED(4);
gint32 cdmaSubscriptionAppIndex RADIO_ALIGNED(4);
gint32 imsSubscriptionAppIndex RADIO_ALIGNED(4);
GBinderHidlVec apps RADIO_ALIGNED(8); /* vec<RadioAppStatus> */
gint32 physicalSlotId RADIO_ALIGNED(4);
GBinderHidlString atr RADIO_ALIGNED(8);
GBinderHidlString iccid RADIO_ALIGNED(8);
} RADIO_ALIGNED(8) RadioCardStatus_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCardStatus_1_2) == 80);
typedef struct radio_app_status {
RADIO_APP_TYPE appType RADIO_ALIGNED(4);
RADIO_APP_STATE appState RADIO_ALIGNED(4);
@@ -311,6 +394,24 @@ typedef struct radio_call {
} RADIO_ALIGNED(8) RadioCall;
G_STATIC_ASSERT(sizeof(RadioCall) == 88);
typedef struct radio_call_1_2 {
RADIO_CALL_STATE state RADIO_ALIGNED(4);
gint32 index RADIO_ALIGNED(4);
gint32 toa RADIO_ALIGNED(4);
guint8 isMpty RADIO_ALIGNED(1);
guint8 isMT RADIO_ALIGNED(1);
guint8 als RADIO_ALIGNED(1);
guint8 isVoice RADIO_ALIGNED(1);
guint8 isVoicePrivacy RADIO_ALIGNED(1);
GBinderHidlString number RADIO_ALIGNED(8);
gint32 numberPresentation RADIO_ALIGNED(4);
GBinderHidlString name RADIO_ALIGNED(8);
gint32 namePresentation RADIO_ALIGNED(4);
GBinderHidlVec uusInfo RADIO_ALIGNED(8); /* vec<RadioUusInfo> */
gint32 audioQuality RADIO_ALIGNED(4);
} RADIO_ALIGNED(8) RadioCall_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCall_1_2) == 96);
typedef struct radio_dial {
GBinderHidlString address RADIO_ALIGNED(8);
gint32 clir RADIO_ALIGNED(4);
@@ -333,11 +434,11 @@ typedef struct radio_operator_info {
G_STATIC_ASSERT(sizeof(RadioOperatorInfo) == 56);
typedef struct radio_data_profile {
gint32 profileId RADIO_ALIGNED(4);
RADIO_DATA_PROFILE_ID profileId RADIO_ALIGNED(4);
GBinderHidlString apn RADIO_ALIGNED(8);
GBinderHidlString protocol RADIO_ALIGNED(8);
GBinderHidlString roamingProtocol RADIO_ALIGNED(8);
gint32 authType RADIO_ALIGNED(4);
RADIO_APN_AUTH_TYPE authType RADIO_ALIGNED(4);
GBinderHidlString user RADIO_ALIGNED(8);
GBinderHidlString password RADIO_ALIGNED(8);
gint32 type RADIO_ALIGNED(4);
@@ -345,8 +446,8 @@ typedef struct radio_data_profile {
gint32 maxConns RADIO_ALIGNED(4);
gint32 waitTime RADIO_ALIGNED(4);
guint8 enabled RADIO_ALIGNED(1);
gint32 supportedApnTypesBitmap RADIO_ALIGNED(4);
gint32 bearerBitmap RADIO_ALIGNED(4);
RADIO_APN_TYPES supportedApnTypesBitmap RADIO_ALIGNED(4);
RADIO_ACCESS_FAMILY bearerBitmap RADIO_ALIGNED(4);
gint32 mtu RADIO_ALIGNED(4);
gint32 mvnoType RADIO_ALIGNED(4);
GBinderHidlString mvnoMatchData RADIO_ALIGNED(8);
@@ -445,6 +546,20 @@ typedef struct radio_cell_info {
} RADIO_ALIGNED(8) RadioCellInfo;
G_STATIC_ASSERT(sizeof(RadioCellInfo) == 104);
typedef struct radio_cell_info_1_2 {
RADIO_CELL_INFO_TYPE cellInfoType RADIO_ALIGNED(4);
guint8 registered RADIO_ALIGNED(1);
gint32 timeStampType RADIO_ALIGNED(4);
guint64 timeStamp RADIO_ALIGNED(8);
GBinderHidlVec gsm RADIO_ALIGNED(8); /* vec<RadioCellInfoGsm> */
GBinderHidlVec cdma RADIO_ALIGNED(8); /* vec<RadioCellInfoCdma> */
GBinderHidlVec lte RADIO_ALIGNED(8); /* vec<RadioCellInfoLte> */
GBinderHidlVec wcdma RADIO_ALIGNED(8); /* vec<RadioCellInfoWcdma> */
GBinderHidlVec tdscdma RADIO_ALIGNED(8); /* vec<RadioCellInfoTdscdma> */
gint32 connectionStatus RADIO_ALIGNED(4);
} RADIO_ALIGNED(8) RadioCellInfo_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellInfo_1_2) == 112);
typedef struct radio_cell_identity_gsm {
GBinderHidlString mcc RADIO_ALIGNED(8);
GBinderHidlString mnc RADIO_ALIGNED(8);
@@ -493,6 +608,67 @@ typedef struct radio_cell_identity_tdscdma {
} RADIO_ALIGNED(8) RadioCellIdentityTdscdma;
G_STATIC_ASSERT(sizeof(RadioCellIdentityTdscdma) == 48);
typedef struct radio_cell_identity_operator_names {
GBinderHidlString alphaLong RADIO_ALIGNED(8);
GBinderHidlString alphaShort RADIO_ALIGNED(8);
} RADIO_ALIGNED(8) RadioCellIdentityOperatorNames; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellIdentityOperatorNames) == 32);
typedef struct radio_cell_identity_gsm_1_2 {
GBinderHidlString mcc RADIO_ALIGNED(8);
GBinderHidlString mnc RADIO_ALIGNED(8);
gint32 lac RADIO_ALIGNED(4);
gint32 cid RADIO_ALIGNED(4);
gint32 arfcn RADIO_ALIGNED(4);
guint8 bsic RADIO_ALIGNED(1);
RadioCellIdentityOperatorNames operatorNames RADIO_ALIGNED(8);
} RADIO_ALIGNED(8) RadioCellIdentityGsm_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellIdentityGsm_1_2) == 80);
typedef struct radio_cell_identity_wcdma_1_2 {
GBinderHidlString mcc RADIO_ALIGNED(8);
GBinderHidlString mnc RADIO_ALIGNED(8);
gint32 lac RADIO_ALIGNED(4);
gint32 cid RADIO_ALIGNED(4);
gint32 psc RADIO_ALIGNED(4);
gint32 uarfcn RADIO_ALIGNED(4);
RadioCellIdentityOperatorNames operatorNames RADIO_ALIGNED(8);
} RADIO_ALIGNED(8) RadioCellIdentityWcdma_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellIdentityWcdma_1_2) == 80);
typedef struct radio_cell_identity_cdma_1_2 {
gint32 networkId RADIO_ALIGNED(4);
gint32 systemId RADIO_ALIGNED(4);
gint32 baseStationId RADIO_ALIGNED(4);
gint32 longitude RADIO_ALIGNED(4);
gint32 latitude RADIO_ALIGNED(4);
RadioCellIdentityOperatorNames operatorNames RADIO_ALIGNED(8);
} RADIO_ALIGNED(4) RadioCellIdentityCdma_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellIdentityCdma_1_2) == 56);
typedef struct radio_cell_identity_lte_1_2 {
GBinderHidlString mcc RADIO_ALIGNED(8);
GBinderHidlString mnc RADIO_ALIGNED(8);
gint32 ci RADIO_ALIGNED(4);
gint32 pci RADIO_ALIGNED(4);
gint32 tac RADIO_ALIGNED(4);
gint32 earfcn RADIO_ALIGNED(4);
RadioCellIdentityOperatorNames operatorNames RADIO_ALIGNED(8);
gint32 bandwidth RADIO_ALIGNED(4);
} RADIO_ALIGNED(8) RadioCellIdentityLte_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellIdentityLte_1_2) == 88);
typedef struct radio_cell_identity_tdscdma_1_2 {
GBinderHidlString mcc RADIO_ALIGNED(8);
GBinderHidlString mnc RADIO_ALIGNED(8);
gint32 lac RADIO_ALIGNED(4);
gint32 cid RADIO_ALIGNED(4);
gint32 cpid RADIO_ALIGNED(4);
gint32 uarfcn RADIO_ALIGNED(8);
RadioCellIdentityOperatorNames operatorNames RADIO_ALIGNED(8);
} RADIO_ALIGNED(8) RadioCellIdentityTdscdma_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellIdentityTdscdma_1_2) == 88);
typedef struct radio_voice_reg_state_result {
RADIO_REG_STATE regState RADIO_ALIGNED(4);
RADIO_TECH rat RADIO_ALIGNED(4);
@@ -527,6 +703,14 @@ typedef struct radio_signal_strength_wcdma {
} RADIO_ALIGNED(4) RadioSignalStrengthWcdma;
G_STATIC_ASSERT(sizeof(RadioSignalStrengthWcdma) == 8);
typedef struct radio_signal_strength_wcdma_1_2 {
gint32 signalStrength RADIO_ALIGNED(4);
gint32 bitErrorRate RADIO_ALIGNED(4);
gint32 rscp RADIO_ALIGNED(4);
gint32 ecno RADIO_ALIGNED(4);
} RADIO_ALIGNED(4) RadioSignalStrengthWcdma_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioSignalStrengthWcdma_1_2) == 16);
typedef struct radio_signal_strength_cdma {
guint32 dbm RADIO_ALIGNED(4);
guint32 ecio RADIO_ALIGNED(4);
@@ -555,6 +739,13 @@ typedef struct radio_signal_strength_tdscdma {
} RADIO_ALIGNED(4) RadioSignalStrengthTdScdma;
G_STATIC_ASSERT(sizeof(RadioSignalStrengthTdScdma) == 4);
typedef struct radio_signal_strength_tdscdma_1_2 {
guint32 signalStrength RADIO_ALIGNED(4);
guint32 bitErrorRate RADIO_ALIGNED(4);
guint32 rscp RADIO_ALIGNED(4);
} RADIO_ALIGNED(4) RadioSignalStrengthTdScdma_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioSignalStrengthTdScdma_1_2) == 12);
typedef struct radio_signal_strength {
RadioSignalStrengthGsm gw RADIO_ALIGNED(4);
RadioSignalStrengthCdma cdma RADIO_ALIGNED(4);
@@ -564,6 +755,16 @@ typedef struct radio_signal_strength {
} RADIO_ALIGNED(4) RadioSignalStrength;
G_STATIC_ASSERT(sizeof(RadioSignalStrength) == 60);
typedef struct radio_signal_strength_1_2 {
RadioSignalStrengthGsm gw RADIO_ALIGNED(4);
RadioSignalStrengthCdma cdma RADIO_ALIGNED(4);
RadioSignalStrengthEvdo evdo RADIO_ALIGNED(4);
RadioSignalStrengthLte lte RADIO_ALIGNED(4);
RadioSignalStrengthTdScdma tdScdma RADIO_ALIGNED(4);
RadioSignalStrengthWcdma_1_2 wcdma RADIO_ALIGNED(4);
} RADIO_ALIGNED(4) RadioSignalStrength_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioSignalStrength_1_2) == 76);
typedef struct radio_cell_info_gsm {
RadioCellIdentityGsm cellIdentityGsm RADIO_ALIGNED(8);
RadioSignalStrengthGsm signalStrengthGsm RADIO_ALIGNED(4);
@@ -595,6 +796,37 @@ typedef struct radio_cell_info_tdscdma {
} RADIO_ALIGNED(8) RadioCellInfoTdscdma;
G_STATIC_ASSERT(sizeof(RadioCellInfoTdscdma) == 56);
typedef struct radio_cell_info_gsm_1_2 {
RadioCellIdentityGsm_1_2 cellIdentityGsm RADIO_ALIGNED(8);
RadioSignalStrengthGsm signalStrengthGsm RADIO_ALIGNED(4);
} RADIO_ALIGNED(8) RadioCellInfoGsm_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellInfoGsm_1_2) == 96);
typedef struct radio_cell_info_wcdma_1_2 {
RadioCellIdentityWcdma_1_2 cellIdentityWcdma RADIO_ALIGNED(8);
RadioSignalStrengthWcdma_1_2 signalStrengthWcdma RADIO_ALIGNED(4);
} RADIO_ALIGNED(8) RadioCellInfoWcdma_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellInfoWcdma_1_2) == 96);
typedef struct radio_cell_info_cdma_1_2 {
RadioCellIdentityCdma_1_2 cellIdentityCdma RADIO_ALIGNED(4);
RadioSignalStrengthCdma signalStrengthCdma RADIO_ALIGNED(4);
RadioSignalStrengthEvdo signalStrengthEvdo RADIO_ALIGNED(4);
} RADIO_ALIGNED(4) RadioCellInfoCdma_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellInfoCdma_1_2) == 80);
typedef struct radio_cell_info_lte_1_2 {
RadioCellIdentityLte_1_2 cellIdentityLte RADIO_ALIGNED(8);
RadioSignalStrengthLte signalStrengthLte RADIO_ALIGNED(4);
} RADIO_ALIGNED(8) RadioCellInfoLte_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellInfoLte_1_2) == 112);
typedef struct radio_cell_info_tdscdma_1_2 {
RadioCellIdentityTdscdma_1_2 cellIdentityTdscdma RADIO_ALIGNED(8);
RadioSignalStrengthTdScdma_1_2 signalStrengthTdscdma RADIO_ALIGNED(4);
} RADIO_ALIGNED(8) RadioCellInfoTdscdma_1_2; /* Since 1.2.0 */
G_STATIC_ASSERT(sizeof(RadioCellInfoTdscdma_1_2) == 104);
typedef struct radio_gsm_broadcast_sms_config {
gint32 fromServiceId RADIO_ALIGNED(4);
gint32 toServiceId RADIO_ALIGNED(4);
@@ -651,6 +883,29 @@ typedef struct radio_activity_stats_info {
} RADIO_ALIGNED(4) RadioActivityStatsInfo;
G_STATIC_ASSERT(sizeof(RadioActivityStatsInfo) == 32);
typedef struct radio_hardware_config {
gint32 type RADIO_ALIGNED(4);
GBinderHidlString uuid RADIO_ALIGNED(8);
gint32 state RADIO_ALIGNED(4);
GBinderHidlVec modem RADIO_ALIGNED(8); /* vec<RadioHardwareConfigModem> */
GBinderHidlVec sim RADIO_ALIGNED(8); /* vec<RadioHardwareConfigSim> */
} RADIO_ALIGNED(8) RadioHardwareConfig;
G_STATIC_ASSERT(sizeof(RadioHardwareConfig) == 64);
typedef struct radio_hardware_config_modem {
gint32 rilModel RADIO_ALIGNED(4);
guint32 rat RADIO_ALIGNED(4);
gint32 maxVoice RADIO_ALIGNED(4);
gint32 maxData RADIO_ALIGNED(4);
gint32 maxStandby RADIO_ALIGNED(4);
} RADIO_ALIGNED(4) RadioHardwareConfigModem;
G_STATIC_ASSERT(sizeof(RadioHardwareConfigModem) == 20);
typedef struct radio_hardware_config_sim {
GBinderHidlString modemUuid RADIO_ALIGNED(8);
} RADIO_ALIGNED(8) RadioHardwareConfigSim;
G_STATIC_ASSERT(sizeof(RadioHardwareConfigSim) == 16);
/* c(req,resp,callName,CALL_NAME) */
#define RADIO_CALL_1_0(c) \
c(2,1,getIccCardStatus,GET_ICC_CARD_STATUS) \
@@ -782,6 +1037,18 @@ G_STATIC_ASSERT(sizeof(RadioActivityStatsInfo) == 32);
c(128,127,setIndicationFilter,SET_INDICATION_FILTER) \
c(129,128,setSimCardPower,SET_SIM_CARD_POWER)
#define RADIO_CALL_1_1(c) \
c(131,130,setCarrierInfoForImsiEncryption,SET_CARRIER_INFO_FOR_IMSI_ENCRYPTION) \
c(132,131,setSimCardPower_1_1,SET_SIM_CARD_POWER_1_1) \
c(133,132,startNetworkScan,START_NETWORK_SCAN) \
c(134,133,stopNetworkScan,STOP_NETWORK_SCAN) \
c(135,134,startKeepalive,START_KEEPALIVE) \
c(136,135,stopKeepalive,STOP_KEEPALIVE)
#define RADIO_CALL_1_2(c) /* Since 1.2.0 */ \
c(139,138,setSignalStrengthReportingCriteria,SET_SIGNAL_STRENGTH_REPORTING_CRITERIA) \
c(140,139,setLinkCapacityReportingCriteria,SET_LINK_CAPACITY_REPORTING_CRITERIA)
/* e(code,eventName,EVENT_NAME) */
#define RADIO_EVENT_1_0(e) \
e(1,radioStateChanged,RADIO_STATE_CHANGED) \
@@ -830,23 +1097,64 @@ G_STATIC_ASSERT(sizeof(RadioActivityStatsInfo) == 32);
e(44,pcoData,PCO_DATA) \
e(45,modemReset,MODEM_RESET)
#define RADIO_EVENT_1_1(e) \
e(46,carrierInfoForImsiEncryption,CARRIER_INFO_FOR_IMSI_ENCRYPTION) \
e(47,networkScanResult,NETWORK_SCAN_RESULT) \
e(48,keepaliveStatus,KEEPALIVE_STATUS)
#define RADIO_EVENT_1_2(e) /* Since 1.2.0 */ \
e(49,networkScanResult_1_2,NETWORK_SCAN_RESULT_1_2) \
e(50,cellInfoList_1_2,CELL_INFO_LIST_1_2) \
e(51,currentLinkCapacityEstimate,CURRENT_LINK_CAPACITY_ESTIMATE) \
e(52,currentPhysicalChannelConfigs,CURRENT_PHYSICAL_CHANNEL_CONFIGS) \
e(53,currentSignalStrength_1_2,CURRENT_SIGNAL_STRENGTH_1_2)
typedef enum radio_req {
RADIO_REQ_ANY = 0,
RADIO_REQ_NONE = 0,
RADIO_REQ_SET_RESPONSE_FUNCTIONS = 1, /* setResponseFunctions */
#define RADIO_REQ_(req,resp,Name,NAME) RADIO_REQ_##NAME = req,
/* android.hardware.radio@1.0::IRadio */
RADIO_REQ_SET_RESPONSE_FUNCTIONS = 1, /* setResponseFunctions */
RADIO_CALL_1_0(RADIO_REQ_)
RADIO_REQ_RESPONSE_ACKNOWLEDGEMENT = 130, /* responseAcknowledgement */
RADIO_1_0_REQ_LAST = RADIO_REQ_RESPONSE_ACKNOWLEDGEMENT,
/* android.hardware.radio@1.1::IRadio */
RADIO_CALL_1_1(RADIO_REQ_)
RADIO_1_1_REQ_LAST = RADIO_REQ_STOP_KEEPALIVE,
/* android.hardware.radio@1.2::IRadio */
RADIO_CALL_1_2(RADIO_REQ_)
RADIO_REQ_START_NETWORK_SCAN_1_2 = 137,
RADIO_REQ_SET_INDICATION_FILTER_1_2 = 138,
RADIO_REQ_SETUP_DATA_CALL_1_2 = 141,
RADIO_REQ_DEACTIVATE_DATA_CALL_1_2 = 142,
RADIO_1_2_REQ_LAST = RADIO_REQ_DEACTIVATE_DATA_CALL_1_2
#undef RADIO_REQ_
RADIO_REQ_RESPONSE_ACKNOWLEDGEMENT = 130 /* responseAcknowledgement */
} RADIO_REQ;
typedef enum radio_resp {
RADIO_RESP_ANY = 0,
RADIO_RESP_NONE = 0,
#define RADIO_RESP_(req,resp,Name,NAME) RADIO_RESP_##NAME = resp,
/* android.hardware.radio@1.0::IRadioResponse */
RADIO_CALL_1_0(RADIO_RESP_)
RADIO_RESP_ACKNOWLEDGE_REQUEST = 129, /* acknowledgeRequest */
/* android.hardware.radio@1.1::IRadioResponse */
RADIO_CALL_1_1(RADIO_RESP_)
/* android.hardware.radio@1.2::IRadioResponse */
RADIO_CALL_1_2(RADIO_RESP_)
RADIO_RESP_GET_CELL_INFO_LIST_1_2 = 136,
RADIO_RESP_GET_ICC_CARD_STATUS_1_2 = 137,
RADIO_RESP_GET_CURRENT_CALLS_1_2 = 140,
RADIO_RESP_GET_SIGNAL_STRENGTH_1_2 = 141,
RADIO_RESP_GET_VOICE_REGISTRATION_STATE_1_2 = 142,
RADIO_RESP_GET_DATA_REGISTRATION_STATE_1_2 = 143
#undef RADIO_RESP_
RADIO_RESP_ACKNOWLEDGE_REQUEST = 129
} RADIO_RESP;
typedef enum radio_ind {
@@ -854,6 +1162,8 @@ typedef enum radio_ind {
RADIO_IND_NONE = 0,
#define RADIO_IND_(code,Name,NAME) RADIO_IND_##NAME = code,
RADIO_EVENT_1_0(RADIO_IND_)
RADIO_EVENT_1_1(RADIO_IND_)
RADIO_EVENT_1_2(RADIO_IND_)
#undef RADIO_IND_
} RADIO_IND;

View File

@@ -1,10 +1,10 @@
name=gbinder-radio
libdir=/usr/lib
libdir=@libdir@
includedir=/usr/include
Name: libgbinder-radio
Description: Binder client library for Android radio interfaces
Version: [version]
Requires: glib-2.0 libglibutil libgbinder
Version: @version@
Requires.private: glib-2.0 libglibutil libgbinder
Libs: -L${libdir} -l${name}
Cflags: -I${includedir} -I${includedir}/${name}

View File

@@ -1,15 +1,18 @@
Name: libgbinder-radio
Version: 1.0.2
Version: 1.2.2
Release: 0
Summary: Binder client library for Android radio interfaces
Group: Development/Libraries
License: BSD
URL: https://github.com/mer-hybris/libgbinder-radio
Source: %{name}-%{version}.tar.bz2
%define libgbinder_version 1.0.9
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(libglibutil)
BuildRequires: pkgconfig(libgbinder) >= 1.0.9
Requires: libgbinder >= 1.0.9
BuildRequires: pkgconfig(libgbinder) >= %{libgbinder_version}
Requires: libgbinder >= %{libgbinder_version}
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@@ -28,11 +31,11 @@ This package contains the development library for %{name}.
%setup -q
%build
make KEEP_SYMBOLS=1 release pkgconfig
make LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release pkgconfig
%install
rm -rf %{buildroot}
make install-dev DESTDIR=%{buildroot}
make LIBDIR=%{_libdir} DESTDIR=%{buildroot} install-dev
%post -p /sbin/ldconfig

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018-2019 Jolla Ltd.
* Copyright (C) 2018-2019 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2018-2021 Jolla Ltd.
* Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -34,6 +34,8 @@
* any official policies, either expressed or implied.
*/
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include "radio_instance.h"
#include "radio_registry_p.h"
#include "radio_util.h"
@@ -43,6 +45,7 @@
#include <gutil_idlepool.h>
#include <gutil_misc.h>
#include <gutil_strv.h>
#include <glib-object.h>
@@ -59,6 +62,7 @@ struct radio_instance_priv {
char* dev;
char* slot;
char* key;
char* modem;
};
G_DEFINE_TYPE(RadioInstance, radio_instance, G_TYPE_OBJECT)
@@ -70,6 +74,7 @@ enum radio_instance_signal {
SIGNAL_OBSERVE_RESPONSE,
SIGNAL_ACK,
SIGNAL_DEATH,
SIGNAL_ENABLED,
SIGNAL_COUNT
};
@@ -79,11 +84,60 @@ enum radio_instance_signal {
#define SIGNAL_OBSERVE_RESPONSE_NAME "radio-instance-observe-response"
#define SIGNAL_ACK_NAME "radio-instance-ack"
#define SIGNAL_DEATH_NAME "radio-instance-death"
#define SIGNAL_ENABLED_NAME "radio-instance-enabled"
static guint radio_instance_signals[SIGNAL_COUNT] = { 0 };
static GHashTable* radio_instance_table = NULL;
#define DEFAULT_INTERFACE RADIO_INTERFACE_1_0
static const GBinderClientIfaceInfo radio_iface_info[] = {
{RADIO_1_2, RADIO_1_2_REQ_LAST },
{RADIO_1_1, RADIO_1_1_REQ_LAST },
{RADIO_1_0, RADIO_1_0_REQ_LAST }
};
static const char* const radio_indication_ifaces[] = {
RADIO_INDICATION_1_2,
RADIO_INDICATION_1_1,
RADIO_INDICATION_1_0,
NULL
};
static const char* const radio_response_ifaces[] = {
RADIO_RESPONSE_1_2,
RADIO_RESPONSE_1_1,
RADIO_RESPONSE_1_0,
NULL
};
typedef struct radio_interface_desc {
RADIO_INTERFACE version;
const char* radio_iface;
const char* const* ind_ifaces;
const char* const* resp_ifaces;
} RadioInterfaceDesc;
static const RadioInterfaceDesc radio_interfaces[] = {
{
RADIO_INTERFACE_1_2,
RADIO_1_2,
radio_indication_ifaces + 0,
radio_response_ifaces + 0,
},{
RADIO_INTERFACE_1_1,
RADIO_1_1,
radio_indication_ifaces + 1,
radio_response_ifaces + 1
},{
RADIO_INTERFACE_1_0,
RADIO_1_0,
radio_indication_ifaces + 2,
radio_response_ifaces + 2
}
};
/*==========================================================================*
* Implementation
*==========================================================================*/
@@ -155,7 +209,9 @@ radio_instance_indication(
RadioInstance* self = RADIO_INSTANCE(user_data);
const char* iface = gbinder_remote_request_interface(req);
if (!g_strcmp0(iface, RADIO_INDICATION_1_0)) {
if (!g_strcmp0(iface, RADIO_INDICATION_1_0) ||
!g_strcmp0(iface, RADIO_INDICATION_1_1) ||
!g_strcmp0(iface, RADIO_INDICATION_1_2)) {
GBinderReader reader;
guint type;
@@ -202,14 +258,14 @@ radio_instance_response(
RadioInstance* self = RADIO_INSTANCE(user_data);
const char* iface = gbinder_remote_request_interface(req);
if (!g_strcmp0(iface, RADIO_RESPONSE_1_0)) {
if (gutil_strv_contains((const GStrV*)radio_response_ifaces, iface)) {
/* All these should be one-way transactions */
GASSERT(flags & GBINDER_TX_FLAG_ONEWAY);
if (code == RADIO_RESP_ACKNOWLEDGE_REQUEST) {
/* oneway acknowledgeRequest(int32_t serial) */
gint32 serial;
GDEBUG(RADIO_RESPONSE_1_0 " %u acknowledgeRequest", code);
GDEBUG("%s %u acknowledgeRequest", iface, code);
if (gbinder_remote_request_read_int32(req, &serial)) {
g_signal_emit(self, radio_instance_signals[SIGNAL_ACK], 0,
serial);
@@ -315,70 +371,95 @@ radio_instance_gone(
g_free(key);
}
static
RadioInstance*
radio_instance_create_version(
GBinderServiceManager* sm,
GBinderRemoteObject* remote,
const char* dev,
const char* slot,
const char* key,
const char* modem,
int slot_index,
const RadioInterfaceDesc* desc)
{
RadioInstance* self = g_object_new(RADIO_TYPE_INSTANCE, NULL);
RadioInstancePriv* priv = self->priv;
GBinderLocalRequest* req;
GBinderWriter writer;
int status;
self->slot = priv->slot = g_strdup(slot);
self->dev = priv->dev = g_strdup(dev);
self->key = priv->key = g_strdup(key);
self->modem = priv->modem = g_strdup(modem);
self->slot_index = slot_index;
self->version = desc->version;
priv->remote = gbinder_remote_object_ref(remote);
priv->client = gbinder_client_new2(remote,
radio_iface_info, G_N_ELEMENTS(radio_iface_info));
priv->indication = gbinder_servicemanager_new_local_object2(sm,
desc->ind_ifaces, radio_instance_indication, self);
priv->response = gbinder_servicemanager_new_local_object2(sm,
desc->resp_ifaces, radio_instance_response, self);
priv->death_id = gbinder_remote_object_add_death_handler(remote,
radio_instance_died, self);
/* IRadio::setResponseFunctions */
req = gbinder_client_new_request2(priv->client,
RADIO_REQ_SET_RESPONSE_FUNCTIONS);
gbinder_local_request_init_writer(req, &writer);
gbinder_writer_append_local_object(&writer, priv->response);
gbinder_writer_append_local_object(&writer, priv->indication);
gbinder_remote_reply_unref(gbinder_client_transact_sync_reply(priv->client,
RADIO_REQ_SET_RESPONSE_FUNCTIONS, req, &status));
GVERBOSE_("setResponseFunctions %s status %d", slot, status);
gbinder_local_request_unref(req);
GDEBUG("Instance '%s'", slot);
/*
* Don't destroy GBinderServiceManager right away in case if we
* have another slot to initialize.
*/
gutil_idle_pool_add_object(priv->idle, g_object_ref(sm));
return self;
}
static
RadioInstance*
radio_instance_create(
const char* dev,
const char* slot,
const char* key)
const char* key,
const char* modem,
int slot_index,
RADIO_INTERFACE max_version)
{
RadioInstance* self = NULL;
GBinderServiceManager* sm = gbinder_servicemanager_new(dev);
if (sm) {
int status = 0;
const char* iface = RADIO_1_0;
char* fqname = g_strconcat(iface, "/", slot, NULL);
GBinderRemoteObject* remote = gbinder_servicemanager_get_service_sync
(sm, fqname, &status);
guint i;
if (remote) {
RadioInstancePriv* priv;
GBinderLocalRequest* req;
GBinderRemoteReply* reply;
GBinderWriter writer;
for (i = 0; i < G_N_ELEMENTS(radio_interfaces) && !self; i++) {
const RadioInterfaceDesc* desc = radio_interfaces + i;
GINFO("Connected to %s", fqname);
/* get_service returns auto-released reference,
* we need to add a reference of our own */
gbinder_remote_object_ref(remote);
if (desc->version <= max_version) {
char* fqname = g_strconcat(desc->radio_iface, "/", slot, NULL);
GBinderRemoteObject* obj = /* autoreleased */
gbinder_servicemanager_get_service_sync(sm, fqname, NULL);
self = g_object_new(RADIO_TYPE_INSTANCE, NULL);
priv = self->priv;
self->slot = priv->slot = g_strdup(slot);
self->dev = priv->dev = g_strdup(dev);
self->key = priv->key = g_strdup(key);
priv->remote = remote;
priv->client = gbinder_client_new(remote, iface);
priv->indication = gbinder_servicemanager_new_local_object
(sm, RADIO_INDICATION_1_0, radio_instance_indication, self);
priv->response = gbinder_servicemanager_new_local_object
(sm, RADIO_RESPONSE_1_0, radio_instance_response, self);
priv->death_id = gbinder_remote_object_add_death_handler
(remote, radio_instance_died, self);
/* IRadio::setResponseFunctions */
req = gbinder_client_new_request(priv->client);
gbinder_local_request_init_writer(req, &writer);
gbinder_writer_append_local_object(&writer, priv->response);
gbinder_writer_append_local_object(&writer, priv->indication);
reply = gbinder_client_transact_sync_reply(priv->client,
RADIO_REQ_SET_RESPONSE_FUNCTIONS, req, &status);
GVERBOSE_("setResponseFunctions %s status %d", slot, status);
gbinder_local_request_unref(req);
gbinder_remote_reply_unref(reply);
GDEBUG("Instance '%s'", slot);
/*
* Don't destroy GBinderServiceManager right away in case if we
* have another slot to initialize.
*/
gutil_idle_pool_add_object(priv->idle, g_object_ref(sm));
if (obj) {
GINFO("Connected to %s", fqname);
self = radio_instance_create_version(sm, obj, dev, slot, key,
modem, slot_index, desc);
}
g_free(fqname);
}
}
gbinder_servicemanager_unref(sm);
g_free(fqname);
}
return self;
}
@@ -387,9 +468,10 @@ static
char*
radio_instance_make_key(
const char* dev,
const char* name)
const char* name,
RADIO_INTERFACE version)
{
return g_strconcat(dev, ":", name, NULL);
return g_strdup_printf("%s:%s:%d", dev, name, version);
}
/*==========================================================================*
@@ -400,9 +482,58 @@ RadioInstance*
radio_instance_new(
const char* dev,
const char* name)
{
return radio_instance_new_with_version(dev, name, DEFAULT_INTERFACE);
}
RadioInstance*
radio_instance_new_with_modem_and_slot(
const char* dev,
const char* name,
const char* modem,
int slot) /* Since 1.0.7 */
{
return radio_instance_new_with_modem_slot_and_version(dev, name, modem,
slot, DEFAULT_INTERFACE);
}
RadioInstance*
radio_instance_new_with_version(
const char* dev,
const char* name,
RADIO_INTERFACE version) /* Since 1.2.1 */
{
if (name && name[0]) {
const char* modem;
int slot;
if (!g_strcmp0(name, "slot1")) {
modem = "/ril_0";
slot = 0;
} else if (!g_strcmp0(name, "slot2")) {
modem = "/ril_1";
slot = 1;
} else {
GWARN("Unexpected slot '%s'", name);
modem = NULL;
slot = 0;
}
return radio_instance_new_with_modem_slot_and_version(dev, name, modem,
slot, version);
}
return NULL;
}
RadioInstance*
radio_instance_new_with_modem_slot_and_version(
const char* dev,
const char* name,
const char* modem,
int slot,
RADIO_INTERFACE version) /* Since 1.2.1 */
{
if (dev && dev[0] && name && name[0]) {
char* key = radio_instance_make_key(dev, name);
char* key = radio_instance_make_key(dev, name, version);
RadioInstance* self = NULL;
if (radio_instance_table) {
@@ -412,7 +543,7 @@ radio_instance_new(
g_free(key);
return radio_instance_ref(self);
} else {
self = radio_instance_create(dev, name, key);
self = radio_instance_create(dev, name, key, modem, slot, version);
if (self) {
if (!radio_instance_table) {
radio_instance_table = g_hash_table_new_full
@@ -433,11 +564,29 @@ RadioInstance*
radio_instance_get(
const char* dev,
const char* name)
{
return radio_instance_get_with_version(dev, name, DEFAULT_INTERFACE);
}
RadioInstance*
radio_instance_get_with_interface(
const char* dev,
const char* name,
RADIO_INTERFACE version) /* 1.2.1, deprecated */
{
return radio_instance_get_with_version(dev, name, version);
}
RadioInstance*
radio_instance_get_with_version(
const char* dev,
const char* name,
RADIO_INTERFACE version) /* Since 1.2.2 */
{
RadioInstance* self = NULL;
if (dev && dev[0] && name && name[0]) {
char* key = radio_instance_make_key(dev, name);
char* key = radio_instance_make_key(dev, name, version);
if (radio_instance_table) {
self = g_hash_table_lookup(radio_instance_table, key);
@@ -575,7 +724,7 @@ radio_instance_new_request(
RADIO_REQ code)
{
if (G_LIKELY(self)) {
return gbinder_client_new_request(self->priv->client);
return gbinder_client_new_request2(self->priv->client, code);
}
return NULL;
}
@@ -593,6 +742,18 @@ radio_instance_send_request_sync(
return FALSE;
}
void
radio_instance_set_enabled(
RadioInstance* self,
gboolean enabled) /* Since 1.0.7 */
{
if (G_LIKELY(self) && self->enabled != enabled) {
self->enabled = enabled;
GDEBUG("%s %sabled", self->slot, enabled ? "en" : "dis");
g_signal_emit(self, radio_instance_signals[SIGNAL_ENABLED], 0);
}
}
gulong
radio_instance_add_indication_handler(
RadioInstance* self,
@@ -665,7 +826,17 @@ radio_instance_add_death_handler(
gpointer user_data)
{
return (G_LIKELY(self) && G_LIKELY(func)) ? g_signal_connect(self,
SIGNAL_ACK_NAME, G_CALLBACK(func), user_data) : 0;
SIGNAL_DEATH_NAME, G_CALLBACK(func), user_data) : 0;
}
gulong
radio_instance_add_enabled_handler(
RadioInstance* self,
RadioInstanceFunc func,
gpointer user_data) /* Since 1.0.7 */
{
return (G_LIKELY(self) && G_LIKELY(func)) ? g_signal_connect(self,
SIGNAL_ENABLED_NAME, G_CALLBACK(func), user_data) : 0;
}
void
@@ -721,6 +892,7 @@ radio_instance_finalize(
g_free(priv->slot);
g_free(priv->dev);
g_free(priv->key);
g_free(priv->modem);
G_OBJECT_CLASS(radio_instance_parent_class)->finalize(object);
}
@@ -761,6 +933,10 @@ radio_instance_class_init(
g_signal_new(SIGNAL_DEATH_NAME, type,
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
radio_instance_signals[SIGNAL_ENABLED] =
g_signal_new(SIGNAL_ENABLED_NAME, type,
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
}
/*

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018-2019 Jolla Ltd.
* Copyright (C) 2018-2019 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2018-2020 Jolla Ltd.
* Copyright (C) 2018-2020 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -41,11 +41,13 @@
void
radio_registry_instance_added(
RadioInstance* instance);
RadioInstance* instance)
G_GNUC_INTERNAL;
void
radio_registry_instance_removed(
const char* key);
const char* key)
G_GNUC_INTERNAL;
#endif /* RADIO_REGISTRY_PRIVATE_H */

View File

@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018-2019 Jolla Ltd.
* Copyright (C) 2018-2019 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2018-2021 Jolla Ltd.
* Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -49,7 +49,13 @@ radio_req_name(
#define RADIO_REQ_(req,resp,Name,NAME) \
case RADIO_REQ_##NAME: return #Name;
RADIO_CALL_1_0(RADIO_REQ_)
RADIO_CALL_1_1(RADIO_REQ_)
RADIO_CALL_1_2(RADIO_REQ_)
#undef RADIO_REQ_
case RADIO_REQ_START_NETWORK_SCAN_1_2: return "startNetworkScan_1_2";
case RADIO_REQ_SET_INDICATION_FILTER_1_2: return "setIndicationFilter_1_2";
case RADIO_REQ_SETUP_DATA_CALL_1_2: return "setupDataCall_1_2";
case RADIO_REQ_DEACTIVATE_DATA_CALL_1_2: return "deactivateDataCall_1_2";
case RADIO_REQ_ANY:
break;
}
@@ -65,7 +71,21 @@ radio_resp_name(
#define RADIO_RESP_(req,resp,Name,NAME) \
case RADIO_RESP_##NAME: return #Name "Response";
RADIO_CALL_1_0(RADIO_RESP_)
RADIO_CALL_1_1(RADIO_RESP_)
RADIO_CALL_1_2(RADIO_RESP_)
#undef RADIO_RESP_
case RADIO_RESP_GET_CELL_INFO_LIST_1_2:
return "getCellInfoListResponse_1_2";
case RADIO_RESP_GET_ICC_CARD_STATUS_1_2:
return "getIccCardStatusResponse_1_2";
case RADIO_RESP_GET_CURRENT_CALLS_1_2:
return "getCurrentCallsResponse_1_2";
case RADIO_RESP_GET_SIGNAL_STRENGTH_1_2:
return "getSignalStrengthResponse_1_2";
case RADIO_RESP_GET_VOICE_REGISTRATION_STATE_1_2:
return "getVoiceRegistrationStateResponse_1_2";
case RADIO_RESP_GET_DATA_REGISTRATION_STATE_1_2:
return "getDataRegistrationStateResponse_1_2";
case RADIO_RESP_ANY:
break;
}
@@ -80,6 +100,8 @@ radio_ind_name(
#define RADIO_IND_(code,Name,NAME) \
case RADIO_IND_##NAME: return #Name;
RADIO_EVENT_1_0(RADIO_IND_)
RADIO_EVENT_1_1(RADIO_IND_)
RADIO_EVENT_1_2(RADIO_IND_)
#undef RADIO_IND_
case RADIO_IND_ANY:
break;
@@ -95,10 +117,19 @@ radio_req_resp(
#define RADIO_REQ_(req,resp,Name,NAME) \
case RADIO_REQ_##NAME: return RADIO_RESP_##NAME;
RADIO_CALL_1_0(RADIO_REQ_)
RADIO_CALL_1_1(RADIO_REQ_)
RADIO_CALL_1_2(RADIO_REQ_)
#undef RADIO_REQ_
default:
return RADIO_RESP_NONE;
case RADIO_REQ_SET_RESPONSE_FUNCTIONS:
case RADIO_REQ_RESPONSE_ACKNOWLEDGEMENT:
case RADIO_REQ_START_NETWORK_SCAN_1_2:
case RADIO_REQ_SET_INDICATION_FILTER_1_2:
case RADIO_REQ_SETUP_DATA_CALL_1_2:
case RADIO_REQ_DEACTIVATE_DATA_CALL_1_2:
case RADIO_REQ_ANY:
break;
}
return RADIO_RESP_NONE;
}
/*