[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/ofono-ril-binder-plugin.git</param>
<param name="branch">master</param>
- <param name="revision">1.0.6</param>
+ <param name="revision"></param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin-1.0.13.tar.bz2/Makefile
^
|
@@ -32,7 +32,7 @@
VERSION_MAJOR = 1
VERSION_MINOR = 0
-VERSION_RELEASE = 6
+VERSION_RELEASE = 13
# Version for pkg-config
PCVERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
@@ -65,6 +65,7 @@
ril_binder_plugin.c
LIB_SRC = \
+ ril_binder_oemhook.c \
ril_binder_radio.c
#
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin-1.0.13.tar.bz2/libgrilio-binder.pc.in
^
|
@@ -5,6 +5,6 @@
Name: libgrilio-binder
Description: Binder based transport for libgrilio
Version: [version]
-Requires: glib-2.0 libgrilio libglibutil libgbinder-radio libgbinder
+Requires.private: glib-2.0 libgrilio libglibutil libgbinder-radio libgbinder
Libs: -L${libdir} -l${name}
Cflags: -I${includedir} -I${includedir}/${name}
|
[-]
[+]
|
Added |
_service:tar_git:ofono-ril-binder-plugin-1.0.13.tar.bz2/src/ril_binder_log.h
^
|
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2018 Jolla Ltd.
+ * Copyright (C) 2018 Slava Monich <slava.monich@jolla.com>
+ *
+ * You may use this file under the terms of 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.
+ */
+
+#ifndef RIL_BINDER_LOG_H
+#define RIL_BINDER_LOG_H
+
+#define GLOG_MODULE_NAME ril_binder_radio_log
+#include <gutil_log.h>
+
+#endif /* RIL_BINDER_LOG_H */
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
|
[-]
[+]
|
Added |
_service:tar_git:ofono-ril-binder-plugin-1.0.13.tar.bz2/src/ril_binder_oemhook.c
^
|
@@ -0,0 +1,436 @@
+/*
+ * Copyright (C) 2020 Jolla Ltd.
+ * Copyright (C) 2020 Slava Monich <slava.monich@jolla.com>
+ *
+ * You may use this file under the terms of 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.
+ */
+
+#include "ril_binder_oemhook.h"
+#include "ril_binder_log.h"
+
+#include <radio_instance.h>
+#include <grilio_request.h>
+
+#include <gbinder.h>
+#include <gutil_log.h>
+#include <gutil_misc.h>
+
+typedef GObjectClass RilBinderOemHookClass;
+struct ril_binder_oemhook {
+ GObject parent;
+ const char* name;
+ RadioInstance* radio;
+ GBinderClient* client;
+ GBinderRemoteObject* remote;
+ GBinderLocalObject* response;
+ GBinderLocalObject* indication;
+ gulong death_id;
+};
+
+G_DEFINE_TYPE(RilBinderOemHook, ril_binder_oemhook, G_TYPE_OBJECT)
+#define RIL_BINDER_TYPE_OEMHOOK (ril_binder_oemhook_get_type())
+#define RIL_BINDER_OEMHOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+ RIL_BINDER_TYPE_OEMHOOK, RilBinderOemHook))
+
+enum ril_binder_oemhook_signal {
+ SIGNAL_RESP_SEND_REQUEST_RAW,
+ SIGNAL_COUNT
+};
+
+#define SIGNAL_RESP_SEND_REQUEST_RAW_NAME "oemhook-resp-send-request-raw"
+
+static guint ril_binder_oemhook_signals[SIGNAL_COUNT] = { 0 };
+
+/* Logging */
+#define OEMHOOK_LOG ril_binder_oemhook_log
+static const GLOG_MODULE_DEFINE2_(OEMHOOK_LOG, "oemhook", GLOG_MODULE_NAME);
+#undef GLOG_MODULE_NAME
+#define GLOG_MODULE_NAME OEMHOOK_LOG
+#define DBG_(self,fmt,args...) GDEBUG("%s " fmt, (self)->name, ##args)
+
+/* android.hardware.radio.deprecated@1.0::IOemHook */
+enum ril_binder_oemhook_req {
+ /* setResponseFunctions(IOemHookResponse, IOemHookIndication); */
+ OEMHOOK_REQ_SET_RESPONSE_FUNCTIONS = GBINDER_FIRST_CALL_TRANSACTION,
+ /* oneway sendRequestRaw(int32_t serial, vec<uint8_t> data); */
+ OEMHOOK_REQ_SEND_REQUEST_RAW,
+ /* oneway sendRequestStrings(int32_t serial, vec<string> data); */
+ OEMHOOK_REQ_SEND_REQUEST_STRINGS
+};
+
+/* android.hardware.radio.deprecated@1.0::IOemHookResponse */
+enum ril_binder_oemhook_resp {
+ /* oneway sendRequestRawResponse(RadioResponseInfo, vec<uint8_t>); */
+ OEMHOOK_RESP_SEND_REQUEST_RAW = GBINDER_FIRST_CALL_TRANSACTION,
+ /* oneway sendRequestStringsResponse(RadioResponseInfo, vec<string>); */
+ OEMHOOK_RESP_SEND_REQUEST_STRINGS
+};
+
+/* android.hardware.radio.deprecated@1.0::IOemHookIndication */
+enum ril_binder_oemhook_ind {
+ /* oneway oemHookRaw(RadioIndicationType, vec<uint8_t> data); */
+ OEMHOOK_IND_OEM_HOOK_RAW = GBINDER_FIRST_CALL_TRANSACTION
+};
+
+#define OEMHOOK_IFACE(x) "android.hardware.radio.deprecated@1.0::" x
+#define OEMHOOK_REMOTE OEMHOOK_IFACE("IOemHook")
+#define OEMHOOK_RESPONSE OEMHOOK_IFACE("IOemHookResponse")
+#define OEMHOOK_INDICATION OEMHOOK_IFACE("IOemHookIndication")
+
+static
+void
+ril_binder_oemhook_drop_objects(
+ RilBinderOemHook* self)
+{
+ if (self->indication) {
+ gbinder_local_object_drop(self->indication);
+ self->indication = NULL;
+ }
+ if (self->response) {
+ gbinder_local_object_drop(self->response);
+ self->response = NULL;
+ }
+ if (self->remote) {
+ gbinder_remote_object_remove_handler(self->remote, self->death_id);
+ gbinder_remote_object_unref(self->remote);
+ self->death_id = 0;
+ self->remote = NULL;
+ }
+ if (self->radio) {
+ radio_instance_unref(self->radio);
+ self->radio = NULL;
+ }
+ if (self->client) {
+ gbinder_client_unref(self->client);
+ self->client = NULL;
+ }
+}
+
+static
+void
+ril_binder_oemhook_died(
+ GBinderRemoteObject* obj,
+ void* user_data)
+{
+ RilBinderOemHook* self = user_data;
+
+ GERR("%s oemhook died", self->name);
+ ril_binder_oemhook_drop_objects(self);
+}
+
+/* oneway sendRequestRawResponse(RadioResponseInfo, vec<uint8_t>); */
+static
+void
+ril_binder_oemhook_handle_send_request_raw_response(
+ RilBinderOemHook* self,
+ const RadioResponseInfo* info,
+ GBinderReader* in)
+{
+ GUtilData data;
+
+ data.bytes = gbinder_reader_read_hidl_byte_vec(in, &data.size);
+ GASSERT(data.bytes);
+ if (data.bytes) {
+ g_signal_emit(self, ril_binder_oemhook_signals
+ [SIGNAL_RESP_SEND_REQUEST_RAW], 0, info, &data);
+ }
+}
+
+static
+GBinderLocalReply*
+ril_binder_oemhook_response(
+ GBinderLocalObject* obj,
+ GBinderRemoteRequest* req,
+ guint code,
+ guint flags,
+ int* status,
+ void* user_data)
+{
+ RilBinderOemHook* self = user_data;
+ const char* iface = gbinder_remote_request_interface(req);
+
+ if (!g_strcmp0(iface, OEMHOOK_RESPONSE)) {
+ GBinderReader reader;
+ const RadioResponseInfo* info;
+
+ /* All these should be one-way transactions */
+ GASSERT(flags & GBINDER_TX_FLAG_ONEWAY);
+
+ /* And have RadioResponseInfo as the first parameter */
+ gbinder_remote_request_init_reader(req, &reader);
+ info = gbinder_reader_read_hidl_struct(&reader, RadioResponseInfo);
+ GASSERT(info);
+ if (info) {
+ switch (code) {
+ case OEMHOOK_RESP_SEND_REQUEST_RAW:
+ DBG_(self, OEMHOOK_RESPONSE " %u sendRequestRawResponse", code);
+ ril_binder_oemhook_handle_send_request_raw_response(self,
+ info, &reader);
+ break;
+ case OEMHOOK_RESP_SEND_REQUEST_STRINGS:
+ /*
+ * No need to handle sendRequestStringsResponse() just yet
+ * because we never call sendRequestStrings()
+ *
|
[-]
[+]
|
Added |
_service:tar_git:ofono-ril-binder-plugin-1.0.13.tar.bz2/src/ril_binder_oemhook.h
^
|
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2020 Jolla Ltd.
+ * Copyright (C) 2020 Slava Monich <slava.monich@jolla.com>
+ *
+ * You may use this file under the terms of 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.
+ */
+
+#ifndef RIL_BINDER_OEMHOOK_H
+#define RIL_BINDER_OEMHOOK_H
+
+#include <radio_types.h>
+#include <gbinder_types.h>
+#include <grilio_types.h>
+
+typedef struct ril_binder_oemhook RilBinderOemHook;
+
+typedef
+void
+(*RilBinderOemHookRawResponseFunc)(
+ RilBinderOemHook* hook,
+ const RadioResponseInfo* info,
+ const GUtilData* data,
+ gpointer user_data);
+
+typedef
+gboolean
+(*RilBinderOemHookRawFunc)(
+ RilBinderOemHook* hook,
+ const GUtilData* data,
+ gpointer user_data);
+
+RilBinderOemHook*
+ril_binder_oemhook_new(
+ GBinderServiceManager* sm,
+ RadioInstance* radio)
+ G_GNUC_INTERNAL;
+
+void
+ril_binder_oemhook_free(
+ RilBinderOemHook* hook)
+ G_GNUC_INTERNAL;
+
+gboolean
+ril_binder_oemhook_send_request_raw(
+ RilBinderOemHook* hook,
+ GRilIoRequest* req)
+ G_GNUC_INTERNAL;
+
+gulong
+ril_binder_oemhook_add_raw_response_handler(
+ RilBinderOemHook* hook,
+ RilBinderOemHookRawResponseFunc func,
+ gpointer user_data)
+ G_GNUC_INTERNAL;
+
+void
+ril_binder_oemhook_remove_handler(
+ RilBinderOemHook* hook,
+ gulong id)
+ G_GNUC_INTERNAL;
+
+#endif /* RIL_BINDER_OEMHOOK_H */
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin-1.0.13.tar.bz2/src/ril_binder_radio.c
^
|
@@ -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 BSD license as follows:
*
@@ -30,12 +30,16 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define GLIB_DISABLE_DEPRECATION_WARNINGS
+
#include "ril_binder_radio.h"
#include "ril_binder_radio_impl.h"
+#include "ril_binder_oemhook.h"
+#include "ril_binder_log.h"
#include <ofono/ril-constants.h>
-#include <ofono/log.h>
+#include "grilio_channel.h"
#include "grilio_encode.h"
#include "grilio_parser.h"
#include "grilio_request.h"
@@ -49,8 +53,6 @@
#include <gutil_misc.h>
/* Logging */
-#define GLOG_MODULE_NAME ril_binder_radio_log
-#include <gutil_log.h>
GLOG_MODULE_DEFINE("grilio-binder");
#define RIL_BINDER_KEY_MODEM "modem"
@@ -91,7 +93,8 @@
} RilBinderRadioFailureData;
struct ril_binder_radio_priv {
- char* modem;
+ RilBinderOemHook* oemhook;
+ gulong oemhook_raw_response_id;
GUtilIdleQueue* idle;
GHashTable* req_map; /* code -> RilBinderRadioCall */
GHashTable* resp_map; /* resp_tx -> RilBinderRadioCall */
@@ -112,8 +115,10 @@
*==========================================================================*/
#define ril_binder_radio_write_hidl_string_data(writer,ptr,field,index) \
- ril_binder_radio_write_string_with_parent(writer, &ptr->field, index, \
- (guint8*)(&ptr->field) - (guint8*)ptr)
+ ril_binder_radio_write_hidl_string_data2(writer,ptr,field,index,0)
+#define ril_binder_radio_write_hidl_string_data2(writer,ptr,field,index,off) \
+ ril_binder_radio_write_string_with_parent(writer, &ptr->field, index, \
+ (off) + ((guint8*)(&ptr->field) - (guint8*)ptr))
static
inline
@@ -137,17 +142,31 @@
static
void
ril_binder_radio_write_data_profile_strings(
- GBinderWriter* writer,
+ GBinderWriter* w,
const RadioDataProfile* dp,
- guint pi)
+ guint idx,
+ guint i)
{
- /* Write the string data in the right order*/
- ril_binder_radio_write_hidl_string_data(writer, dp, apn, pi);
- ril_binder_radio_write_hidl_string_data(writer, dp, protocol, pi);
- ril_binder_radio_write_hidl_string_data(writer, dp, roamingProtocol, pi);
- ril_binder_radio_write_hidl_string_data(writer, dp, user, pi);
- ril_binder_radio_write_hidl_string_data(writer, dp, password, pi);
- ril_binder_radio_write_hidl_string_data(writer, dp, mvnoMatchData, pi);
+ const guint off = sizeof(*dp) * i;
+
+ /* Write the string data in the right order */
+ ril_binder_radio_write_hidl_string_data2(w, dp, apn, idx, off);
+ ril_binder_radio_write_hidl_string_data2(w, dp, protocol, idx, off);
+ ril_binder_radio_write_hidl_string_data2(w, dp, roamingProtocol, idx, off);
+ ril_binder_radio_write_hidl_string_data2(w, dp, user, idx, off);
+ ril_binder_radio_write_hidl_string_data2(w, dp, password, idx, off);
+ ril_binder_radio_write_hidl_string_data2(w, dp, mvnoMatchData, idx, off);
+}
+
+inline
+static
+void
+ril_binder_radio_write_single_data_profile(
+ GBinderWriter* writer,
+ const RadioDataProfile* dp)
+{
+ ril_binder_radio_write_data_profile_strings(writer, dp,
+ gbinder_writer_append_buffer_object(writer, dp, sizeof(*dp)), 0);
}
static
@@ -504,7 +523,8 @@
{
gboolean ok = FALSE;
GRilIoParser parser;
- gint32 count, tech, auth;
+ gint32 count, tech, auth, profile_id;
+ char* profile_str = NULL;
char* tech_str = NULL;
char* apn = NULL;
char* user = NULL;
@@ -516,7 +536,8 @@
if (grilio_parser_get_int32(&parser, &count) && count == 7 &&
(tech_str = grilio_parser_get_utf8(&parser)) != NULL &&
gutil_parse_int(tech_str, 10, &tech) &&
- grilio_parser_skip_string(&parser) &&
+ (profile_str = grilio_parser_get_utf8(&parser)) != NULL &&
+ gutil_parse_int(profile_str, 10, &profile_id) &&
(apn = grilio_parser_get_utf8(&parser)) != NULL &&
(user = grilio_parser_get_utf8(&parser)) != NULL &&
(password = grilio_parser_get_utf8(&parser)) != NULL &&
@@ -524,7 +545,6 @@
gutil_parse_int(auth_str, 10, &auth) &&
(proto = grilio_parser_get_utf8(&parser)) != NULL) {
GBinderWriter writer;
- guint parent;
RadioDataProfile* profile;
/* ril.h has this to say about the radio tech parameter:
@@ -548,14 +568,17 @@
ril_binder_radio_take_string(out, &profile->password, password);
ril_binder_radio_take_string(out, &profile->mvnoMatchData, NULL);
profile->roamingProtocol = profile->protocol;
+ profile->profileId = profile_id;
profile->authType = auth;
+ profile->enabled = TRUE;
+ profile->supportedApnTypesBitmap =
+ (profile_id == RADIO_DATA_PROFILE_DEFAULT) ?
+ RADIO_APN_TYPE_DEFAULT : RADIO_APN_TYPE_MMS;
/* Write the parcel */
gbinder_writer_append_int32(&writer, grilio_request_serial(in));
gbinder_writer_append_int32(&writer, tech); /* radioTechnology */
- parent = gbinder_writer_append_buffer_object(&writer,
- profile, sizeof(*profile)); /* dataProfileInfo */
- ril_binder_radio_write_data_profile_strings(&writer, profile, parent);
+ ril_binder_radio_write_single_data_profile(&writer, profile);
gbinder_writer_append_bool(&writer, FALSE); /* modemCognitive */
/* TODO: provide the actual roaming status? */
gbinder_writer_append_bool(&writer, TRUE); /* roamingAllowed */
@@ -568,6 +591,7 @@
g_free(proto);
}
+ g_free(profile_str);
g_free(tech_str);
g_free(auth_str);
return ok;
@@ -870,6 +894,66 @@
/**
* @param int32_t Serial number of request.
+ * @param DeviceStateType The updated device state type.
+ * @param bool The updated state.
+ */
+static
+void
+ril_binder_radio_device_state_req(
+ GBinderLocalRequest* req,
+ guint32 serial,
+ RADIO_DEVICE_STATE type,
+ gboolean state)
+{
+ GBinderWriter writer;
+
+ gbinder_local_request_init_writer(req, &writer);
+ gbinder_writer_append_int32(&writer, serial);
+ gbinder_writer_append_int32(&writer, type);
+ gbinder_writer_append_bool(&writer, state);
+}
+
+static
+gboolean
+ril_binder_radio_map_screen_state_to_device_state(
+ GRilIoRequest* in,
+ GBinderLocalRequest* out)
+{
+ GRilIoParser parser;
+ gint32 count, value;
+
+ ril_binder_radio_init_parser(&parser, in);
+ if (grilio_parser_get_int32(&parser, &count) && count == 1 &&
+ grilio_parser_get_int32(&parser, &value)) {
+ ril_binder_radio_device_state_req(out, grilio_request_serial(in),
+ RADIO_DEVICE_STATE_POWER_SAVE_MODE, !value);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static
|