From ed9d7fd24d856463969f98b40652063f17f69760 Mon Sep 17 00:00:00 2001 From: Minjae Kim Date: Thu, 4 Jun 2020 13:59:12 +0900 Subject: [PATCH] webos: refresh patches to apply cleanly on bluez5 version 5.54 :Release Notes: :Detailed Notes: Fix following error occured that when appling patch files to bluez5 version 5.54. ERROR: bluez5-5.54-r0 do_patch: Fuzz detected: Applying patch 0016-Support-enabling-avdtp-delayReport.patch patching file profiles/audio/a2dp.c Hunk #1 succeeded at 2127 (offset 689 lines). patching file profiles/audio/a2dp.h Hunk #1 succeeded at 93 with fuzz 2 (offset 2 lines). patching file profiles/audio/avdtp.c Hunk #1 succeeded at 477 (offset 2 lines). patching file profiles/audio/avdtp.h Hunk #1 succeeded at 310 (offset 10 lines). patching file profiles/audio/media.c Hunk #1 succeeded at 132 (offset 15 lines). Hunk #2 succeeded at 445 (offset 16 lines). Hunk #3 succeeded at 766 (offset 25 lines). Hunk #4 succeeded at 784 (offset 25 lines). Hunk #5 succeeded at 2416 (offset 489 lines). patching file profiles/audio/media.h patching file src/adapter.c Hunk #1 succeeded at 78 (offset 1 line). patching file src/adapter.h patching file src/hcid.h Hunk #1 succeeded at 53 (offset 7 lines). patching file src/main.c Hunk #1 succeeded at 92 with fuzz 2 (offset 3 lines). Hunk #2 succeeded at 442 with fuzz 1 (offset 42 lines). patching file src/main.conf ERROR: bluez5-5.54-r0 do_patch: QA Issue: Patch log indicates that patches do not apply cleanly. [patch-fuzz] :Testing Performed: Only build tested. :QA Notes: None. :Issues Addressed: [PLAT-111903] Create GPVB with Yocto 3.1 dunfell [PLAT-115145] CCC: Upgrade to Yocto 3.1 Dunfell Change-Id: I07e862b3c8ff131eab0e7eb0dfe46790e1d680b9 --- ...-Fix-volume-property-not-able-to-set.patch | 9 +- ...notification-not-appearing-after-127.patch | 16 +- ...6-Support-enabling-avdtp-delayReport.patch | 248 +++++++--------- ...plementation-to-get-connectedUuid-s-.patch | 11 +- ...d-uuids-when-profile-is-disconnected.patch | 10 +- ...-getStatus-not-updated-when-unpaired.patch | 10 +- ...airing-capability-as-NoInputNoOutput.patch | 9 +- ...etting-supported-notification-events.patch | 20 +- ...anceName-MapInstanceProperties-parsi.patch | 278 +++++++++--------- ...IL-support-based-on-MAPInstance-Name.patch | 26 +- 10 files changed, 293 insertions(+), 344 deletions(-) diff --git a/meta-webos/recipes-connectivity/bluez5/bluez5/0014-Fix-volume-property-not-able-to-set.patch b/meta-webos/recipes-connectivity/bluez5/bluez5/0014-Fix-volume-property-not-able-to-set.patch index 3078791c4..7a12eca06 100644 --- a/meta-webos/recipes-connectivity/bluez5/bluez5/0014-Fix-volume-property-not-able-to-set.patch +++ b/meta-webos/recipes-connectivity/bluez5/bluez5/0014-Fix-volume-property-not-able-to-set.patch @@ -1,4 +1,4 @@ -From b534c8c2113eb8dbbeadaa77caaa0064caebd617 Mon Sep 17 00:00:00 2001 +From 8c76e6fd74ae6094f8130f02e3f08d8b3b041243 Mon Sep 17 00:00:00 2001 From: "sameer.mulla" Date: Mon, 21 Jan 2019 12:44:19 +0530 Subject: [PATCH] Fix volume property not able to set @@ -21,15 +21,16 @@ Built and tested Upstream-status: Pending Change-Id: I183357a5de4b95a6e02d39d9d51c4af715bf0a54 + --- profiles/audio/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c -index b9d357e..47747d0 100644 +index 48fabba..0b8f4fd 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c -@@ -802,7 +802,7 @@ static int media_transport_init_source(struct media_transport *transport) +@@ -824,7 +824,7 @@ static int media_transport_init_source(struct media_transport *transport) transport->data = a2dp; transport->destroy = destroy_a2dp; @@ -38,5 +39,3 @@ index b9d357e..47747d0 100644 transport->sink_watch = sink_add_state_cb(service, sink_state_changed, transport); --- -2.7.4 diff --git a/meta-webos/recipes-connectivity/bluez5/bluez5/0015-Fix-volume-level-notification-not-appearing-after-127.patch b/meta-webos/recipes-connectivity/bluez5/bluez5/0015-Fix-volume-level-notification-not-appearing-after-127.patch index 0c466fcb9..f97e227ef 100644 --- a/meta-webos/recipes-connectivity/bluez5/bluez5/0015-Fix-volume-level-notification-not-appearing-after-127.patch +++ b/meta-webos/recipes-connectivity/bluez5/bluez5/0015-Fix-volume-level-notification-not-appearing-after-127.patch @@ -1,4 +1,4 @@ -From f115349ff6634726eaf40e5160a403fc0b60732e Mon Sep 17 00:00:00 2001 +From 1a4cd9bae96ef1bb057b3d98e3cd2562c0ceeef4 Mon Sep 17 00:00:00 2001 From: Sameer Mulla Date: Tue, 10 Dec 2019 16:15:43 +0530 Subject: [PATCH] Fix volume level notification not appearing after 127 @@ -22,16 +22,17 @@ Builded and Tested does not return. Upstream-Status: Inappropriate[webos specific] + --- profiles/audio/media.c | 4 ++-- profiles/audio/transport.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/profiles/audio/media.c b/profiles/audio/media.c -index 1859bc1..90a2719 100644 +index 19d9427..20a1a22 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c -@@ -1177,8 +1177,8 @@ static void set_volume(uint8_t volume, struct btd_device *dev, void *user_data) +@@ -1204,8 +1204,8 @@ static void set_volume(uint8_t volume, struct btd_device *dev, void *user_data) struct media_player *mp = user_data; GSList *l; @@ -43,10 +44,10 @@ index 1859bc1..90a2719 100644 mp->volume = volume; diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c -index 47747d0..5c744ca 100644 +index 0b8f4fd..69fe45b 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c -@@ -673,8 +673,8 @@ static void set_volume(const GDBusPropertyTable *property, +@@ -675,8 +675,8 @@ static void set_volume(const GDBusPropertyTable *property, g_dbus_pending_property_success(id); @@ -57,7 +58,7 @@ index 47747d0..5c744ca 100644 a2dp->volume = volume; -@@ -918,8 +918,8 @@ void media_transport_update_volume(struct media_transport *transport, +@@ -943,8 +943,8 @@ void media_transport_update_volume(struct media_transport *transport, struct a2dp_transport *a2dp = transport->data; /* Check if volume really changed */ @@ -68,6 +69,3 @@ index 47747d0..5c744ca 100644 a2dp->volume = volume; --- -2.17.1 - diff --git a/meta-webos/recipes-connectivity/bluez5/bluez5/0016-Support-enabling-avdtp-delayReport.patch b/meta-webos/recipes-connectivity/bluez5/bluez5/0016-Support-enabling-avdtp-delayReport.patch index e0c4e4c1d..3d249de14 100644 --- a/meta-webos/recipes-connectivity/bluez5/bluez5/0016-Support-enabling-avdtp-delayReport.patch +++ b/meta-webos/recipes-connectivity/bluez5/bluez5/0016-Support-enabling-avdtp-delayReport.patch @@ -1,6 +1,6 @@ -From c652aacc5e7600006adc9095fffc7b49be45d862 Mon Sep 17 00:00:00 2001 +From e69ac5e10fcb94bb3f4e9267504e2d0222ecd77b Mon Sep 17 00:00:00 2001 From: "sameer.mulla" -Date: Tue, 4 Feb 2020 20:28:59 +0530 +Date: Thu, 4 Jun 2020 04:49:48 +0000 Subject: [PATCH] Support enabling avdtp delayReport :Release Notes: @@ -19,135 +19,121 @@ NA [PLAT-98273] Implement AVDTP delay report interface Upstream Status: Pending + --- profiles/audio/a2dp.c | 8 +++++++ profiles/audio/a2dp.h | 1 + - profiles/audio/avdtp.c | 5 +++++ + profiles/audio/avdtp.c | 5 ++++ profiles/audio/avdtp.h | 1 + - profiles/audio/media.c | 21 +++++++++++++++++++ - profiles/audio/media.h | 3 +++ - src/adapter.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ + profiles/audio/media.c | 17 ++++++++++++++ + profiles/audio/media.h | 2 ++ + src/adapter.c | 53 ++++++++++++++++++++++++++++++++++++++++++ src/adapter.h | 3 +++ src/hcid.h | 1 + - src/main.c | 11 ++++++++++ + src/main.c | 11 +++++++++ src/main.conf | 3 +++ - 11 files changed, 114 insertions(+) + 11 files changed, 105 insertions(+) diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c -index fc98bb2..79ee207 100644 +index a5590b2..2eab74f 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c -@@ -1438,6 +1438,14 @@ found: +@@ -2127,6 +2127,14 @@ found: return avdtp_ref(chan->session); } +void a2dp_sep_set_delay_reporting(struct a2dp_sep *sep, bool delay_reporting) +{ -+ DBG(""); -+ DBG("delay_reporting %d",delay_reporting); -+ sep->delay_reporting = delay_reporting; -+ avdtp_local_sep_set_delay_report(sep->lsep, delay_reporting); ++ DBG(""); ++ DBG("delay_reporting %d",delay_reporting); ++ sep->delay_reporting = delay_reporting; ++ avdtp_local_sep_set_delay_report(sep->lsep, delay_reporting); +} + static void connect_cb(GIOChannel *io, GError *err, gpointer user_data) { struct a2dp_channel *chan = user_data; diff --git a/profiles/audio/a2dp.h b/profiles/audio/a2dp.h -index 2c388bb..4b386ce 100644 +index 19466a4..7729884 100644 --- a/profiles/audio/a2dp.h +++ b/profiles/audio/a2dp.h -@@ -91,3 +91,4 @@ gboolean a2dp_sep_unlock(struct a2dp_sep *sep, struct avdtp *session); +@@ -90,6 +90,7 @@ gboolean a2dp_cancel(unsigned int id); + gboolean a2dp_sep_lock(struct a2dp_sep *sep, struct avdtp *session); + gboolean a2dp_sep_unlock(struct a2dp_sep *sep, struct avdtp *session); struct avdtp_stream *a2dp_sep_get_stream(struct a2dp_sep *sep); ++void a2dp_sep_set_delay_reporting(struct a2dp_sep *sep, bool delay_reporting); struct btd_device *a2dp_setup_get_device(struct a2dp_setup *setup); + const char *a2dp_setup_remote_path(struct a2dp_setup *setup); struct avdtp *a2dp_avdtp_get(struct btd_device *device); -+void a2dp_sep_set_delay_reporting(struct a2dp_sep *sep, bool delay_reporting); diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c -index 2cb3c8a..8c262ff 100644 +index 0e075f9..6e38dd1 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c -@@ -475,6 +475,11 @@ static gboolean try_send(int sk, void *data, size_t len) +@@ -477,6 +477,11 @@ static gboolean try_send(int sk, void *data, size_t len) return TRUE; } +void avdtp_local_sep_set_delay_report(struct avdtp_local_sep *lsep, bool delay_reporting) +{ -+ lsep->delay_reporting = delay_reporting; ++ lsep->delay_reporting = delay_reporting; +} + static gboolean avdtp_send(struct avdtp *session, uint8_t transaction, uint8_t message_type, uint8_t signal_id, void *data, size_t len) diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h -index 621a6e3..ba270cd 100644 +index ad2cb9b..1f39d05 100644 --- a/profiles/audio/avdtp.h +++ b/profiles/audio/avdtp.h -@@ -300,3 +300,4 @@ struct avdtp_server *avdtp_get_server(struct avdtp_local_sep *lsep); +@@ -310,3 +310,4 @@ struct avdtp_server *avdtp_get_server(struct avdtp_local_sep *lsep); struct avdtp *avdtp_new(GIOChannel *chan, struct btd_device *device, struct queue *lseps); +void avdtp_local_sep_set_delay_report(struct avdtp_local_sep *lsep, bool delay_reporting); diff --git a/profiles/audio/media.c b/profiles/audio/media.c -index 1859bc1..af476ca 100644 +index 20a1a22..ad1c318 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c -@@ -117,6 +117,19 @@ struct media_player { +@@ -132,6 +132,19 @@ struct media_player { static GSList *adapters = NULL; +void media_set_delay_reporting(struct media_adapter *media_adapter, bool delay_reporting) +{ -+ GSList *l; -+ for (l = media_adapter->endpoints; l; l = l->next) { -+ struct media_endpoint *endpoint = l->data; ++ GSList *l; ++ for (l = media_adapter->endpoints; l; l = l->next) { ++ struct media_endpoint *endpoint = l->data; + -+ if ((strcasecmp(endpoint->uuid, "0000110a-0000-1000-8000-00805f9b34fb") == 0) || (strcasecmp(endpoint->uuid, "0000110b-0000-1000-8000-00805f9b34fb") == 0)) -+ { -+ a2dp_sep_set_delay_reporting(endpoint->sep, delay_reporting); -+ } -+ } ++ if ((strcasecmp(endpoint->uuid, "0000110a-0000-1000-8000-00805f9b34fb") == 0) || (strcasecmp(endpoint->uuid, "0000110b-0000-1000-8000-00805f9b34fb") == 0)) ++ { ++ a2dp_sep_set_delay_reporting(endpoint->sep, delay_reporting); ++ } ++ } +} + static void endpoint_request_free(struct endpoint_request *request) { if (request->call) -@@ -416,6 +429,7 @@ static gboolean set_configuration(struct media_endpoint *endpoint, - void *user_data, - GDestroyNotify destroy) - { -+ DBG(""); - struct a2dp_config_data *data = user_data; - struct btd_device *device = a2dp_setup_get_device(data->setup); - DBusConnection *conn = btd_get_dbus_connection(); -@@ -727,6 +741,7 @@ static struct media_endpoint *media_endpoint_create(struct media_adapter *adapte - int size, - int *err) - { -+ DBG(""); - struct media_endpoint *endpoint; - gboolean succeeded; - -@@ -744,6 +759,10 @@ static struct media_endpoint *media_endpoint_create(struct media_adapter *adapte +@@ -768,6 +781,9 @@ static struct media_endpoint *media_endpoint_create(struct media_adapter *adapte + } endpoint->adapter = adapter; - -+ delay_reporting = btd_adapter_get_delay_reporting(adapter->btd_adapter); -+ -+ DBG("delay_reporting %d", delay_reporting); ++ delay_reporting = btd_adapter_get_delay_reporting(adapter->btd_adapter); + ++ DBG("delay_reporting %d", delay_reporting); + if (strcasecmp(uuid, A2DP_SOURCE_UUID) == 0) succeeded = endpoint_init_a2dp_source(endpoint, - delay_reporting, err); -@@ -1908,6 +1927,8 @@ int media_register(struct btd_adapter *btd_adapter) +@@ -2397,6 +2413,7 @@ int media_register(struct btd_adapter *btd_adapter) return -1; } + set_media_adapter(btd_adapter, adapter); -+ adapters = g_slist_append(adapters, adapter); return 0; diff --git a/profiles/audio/media.h b/profiles/audio/media.h -index dd630d4..48684df 100644 +index dd630d4..d3d9260 100644 --- a/profiles/audio/media.h +++ b/profiles/audio/media.h @@ -23,6 +23,7 @@ @@ -158,17 +144,16 @@ index dd630d4..48684df 100644 typedef void (*media_endpoint_cb_t) (struct media_endpoint *endpoint, void *ret, int size, void *user_data); -@@ -33,3 +34,5 @@ void media_unregister(struct btd_adapter *btd_adapter); +@@ -33,3 +34,4 @@ void media_unregister(struct btd_adapter *btd_adapter); struct a2dp_sep *media_endpoint_get_sep(struct media_endpoint *endpoint); const char *media_endpoint_get_uuid(struct media_endpoint *endpoint); uint8_t media_endpoint_get_codec(struct media_endpoint *endpoint); +void media_set_delay_reporting(struct media_adapter* adapter, bool delay_reporting); -+ diff --git a/src/adapter.c b/src/adapter.c -index 822bd34..79783c5 100644 +index 972d887..9c1c3cf 100644 --- a/src/adapter.c +++ b/src/adapter.c -@@ -77,6 +77,7 @@ +@@ -78,6 +78,7 @@ #include "gatt-database.h" #include "advertising.h" #include "eir.h" @@ -176,132 +161,114 @@ index 822bd34..79783c5 100644 #define ADAPTER_INTERFACE "org.bluez.Adapter1" -@@ -218,6 +219,10 @@ struct btd_adapter { - bool filtered_discoverable; /* we are doing filtered discovery */ +@@ -239,6 +240,9 @@ struct btd_adapter { + bool filtered_discovery; /* we are doing filtered discovery */ bool no_scan_restart_delay; /* when this flag is set, restart scan * without delay */ -+ bool delay_report; -+ -+ struct media_adapter *media_adapter; ++ bool delay_report; + ++ struct media_adapter *media_adapter; uint8_t discovery_type; /* current active discovery type */ uint8_t discovery_enable; /* discovery enabled/disabled */ bool discovery_suspended; /* discovery has been suspended */ -@@ -275,6 +280,11 @@ typedef enum { +@@ -297,6 +301,11 @@ typedef enum { ADAPTER_AUTHORIZE_CHECK_CONNECTED } adapter_authorize_type; +void set_media_adapter(struct btd_adapter *adapter, struct media_adapter *media_adapter) +{ -+ adapter->media_adapter = media_adapter; ++ adapter->media_adapter = media_adapter; +} + static struct btd_adapter *btd_adapter_lookup(uint16_t index) { GList *list; -@@ -456,6 +466,7 @@ uint8_t btd_adapter_get_address_type(struct btd_adapter *adapter) +@@ -498,6 +507,8 @@ static void store_adapter_info(struct btd_adapter *adapter) - static void store_adapter_info(struct btd_adapter *adapter) - { -+ DBG(""); - GKeyFile *key_file; - char filename[PATH_MAX]; - char *str; -@@ -477,6 +488,9 @@ static void store_adapter_info(struct btd_adapter *adapter) g_key_file_set_boolean(key_file, "General", "Discoverable", discoverable); ++ g_key_file_set_boolean(key_file, "General", "DelayReport", ++ adapter->delay_report); -+ g_key_file_set_boolean(key_file, "General", "DelayReport", -+ adapter->delay_report); -+ if (adapter->discoverable_timeout != main_opts.discovto) g_key_file_set_integer(key_file, "General", - "DiscoverableTimeout", -@@ -3136,6 +3150,31 @@ static gboolean property_get_modalias(const GDBusPropertyTable *property, +@@ -3179,6 +3190,31 @@ static gboolean property_get_modalias(const GDBusPropertyTable *property, return TRUE; } +static gboolean property_get_delay_report_feature(const GDBusPropertyTable *property, DBusMessageIter *iter, void *user_data) +{ -+ struct btd_adapter *adapter = user_data; -+ dbus_bool_t delayReportingFeature = adapter->delay_report; ++ struct btd_adapter *adapter = user_data; ++ dbus_bool_t delayReportingFeature = adapter->delay_report; + -+ dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &delayReportingFeature); ++ dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &delayReportingFeature); + -+ return TRUE; ++ return TRUE; +} + +static void property_set_delay_report_feature(const GDBusPropertyTable *property, DBusMessageIter *iter, GDBusPendingPropertySet id, void *user_data) +{ -+ struct btd_adapter *adapter = user_data; -+ dbus_bool_t enable; -+ dbus_message_iter_get_basic(iter, &enable); ++ struct btd_adapter *adapter = user_data; ++ dbus_bool_t enable; ++ dbus_message_iter_get_basic(iter, &enable); + -+ DBG("DelayReport %d", enable); -+ g_dbus_pending_property_success(id); -+ adapter->delay_report = enable; -+ store_adapter_info(adapter); -+ media_set_delay_reporting(adapter->media_adapter, adapter->delay_report); -+ g_dbus_emit_property_changed(dbus_conn, adapter->path, ADAPTER_INTERFACE, "DelayReport"); -+ return; ++ DBG("DelayReport %d", enable); ++ g_dbus_pending_property_success(id); ++ adapter->delay_report = enable; ++ store_adapter_info(adapter); ++ media_set_delay_reporting(adapter->media_adapter, adapter->delay_report); ++ g_dbus_emit_property_changed(dbus_conn, adapter->path, ADAPTER_INTERFACE, "DelayReport"); ++ return; +} + static int device_path_cmp(gconstpointer a, gconstpointer b) { const struct btd_device *device = a; -@@ -3416,6 +3455,7 @@ static const GDBusPropertyTable adapter_properties[] = { +@@ -3459,6 +3495,7 @@ static const GDBusPropertyTable adapter_properties[] = { { "UUIDs", "as", property_get_uuids }, { "Modalias", "s", property_get_modalias, NULL, property_exists_modalias }, -+ { "DelayReport", "b", property_get_delay_report_feature, property_set_delay_report_feature }, ++ { "DelayReport", "b", property_get_delay_report_feature, property_set_delay_report_feature }, { } }; -@@ -4450,6 +4490,11 @@ bool btd_adapter_get_bredr(struct btd_adapter *adapter) +@@ -4550,6 +4587,11 @@ bool btd_adapter_get_bredr(struct btd_adapter *adapter) return false; } +bool btd_adapter_get_delay_reporting(struct btd_adapter *adapter) +{ -+ return adapter->delay_report; ++ return adapter->delay_report; +} + struct btd_gatt_database *btd_adapter_get_database(struct btd_adapter *adapter) { if (!adapter) -@@ -5742,6 +5787,7 @@ static void fix_storage(struct btd_adapter *adapter) - - static void load_config(struct btd_adapter *adapter) - { -+ DBG(""); - GKeyFile *key_file; - char filename[PATH_MAX]; - struct stat st; -@@ -5795,6 +5841,15 @@ static void load_config(struct btd_adapter *adapter) +@@ -5895,6 +5937,15 @@ static void load_config(struct btd_adapter *adapter) gerr = NULL; } -+ /* Get delay report */ -+ adapter->delay_report = g_key_file_get_boolean(key_file, -+ "General", "DelayReport", &gerr); -+ if (gerr) { -+ adapter->delay_report = main_opts.delay_report; -+ g_error_free(gerr); -+ gerr = NULL; -+ } ++ /* Get delay report */ ++ adapter->delay_report = g_key_file_get_boolean(key_file, ++ "General", "DelayReport", &gerr); ++ if (gerr) { ++ adapter->delay_report = main_opts.delay_report; ++ g_error_free(gerr); ++ gerr = NULL; ++ } + g_key_file_free(key_file); } -@@ -5827,6 +5882,7 @@ static struct btd_adapter *btd_adapter_new(uint16_t index) +@@ -5927,6 +5978,7 @@ static struct btd_adapter *btd_adapter_new(uint16_t index) main_opts.did_version); adapter->discoverable_timeout = main_opts.discovto; adapter->pairable_timeout = main_opts.pairto; -+ adapter->delay_report = main_opts.delay_report; ++ adapter->delay_report = main_opts.delay_report; DBG("System name: %s", adapter->system_name); DBG("Major class: %u", adapter->major_class); -@@ -5834,6 +5890,7 @@ static struct btd_adapter *btd_adapter_new(uint16_t index) +@@ -5934,6 +5986,7 @@ static struct btd_adapter *btd_adapter_new(uint16_t index) DBG("Modalias: %s", adapter->modalias); DBG("Discoverable timeout: %u seconds", adapter->discoverable_timeout); DBG("Pairable timeout: %u seconds", adapter->pairable_timeout); @@ -331,51 +298,51 @@ index d0a5253..9aafcd6 100644 struct btd_gatt_database *btd_adapter_get_database(struct btd_adapter *adapter); diff --git a/src/hcid.h b/src/hcid.h -index 2c2b89d..b73d6c7 100644 +index 1bf9378..992d0d1 100644 --- a/src/hcid.h +++ b/src/hcid.h -@@ -46,6 +46,7 @@ struct main_opts { +@@ -53,6 +53,7 @@ struct main_opts { gboolean name_resolv; gboolean debug_keys; gboolean fast_conn; -+ gboolean delay_report; ++ gboolean delay_report; uint16_t did_source; uint16_t did_vendor; diff --git a/src/main.c b/src/main.c -index 7e6af42..8836bf0 100644 +index 7b927ac..618cf53 100644 --- a/src/main.c +++ b/src/main.c -@@ -89,6 +89,7 @@ static const char *supported_options[] = { +@@ -92,6 +92,7 @@ static const char *supported_options[] = { "ControllerMode", "MultiProfile", "FastConnectable", -+ "DelayReport", ++ "DelayReport", "Privacy", + "JustWorksRepairing", NULL - }; -@@ -399,6 +400,16 @@ static void parse_config(GKeyFile *config) +@@ -441,6 +442,16 @@ static void parse_config(GKeyFile *config) else main_opts.fast_conn = boolean; -+ boolean = g_key_file_get_boolean(config, "General", -+ "DelayReport", &err); -+ if (err) -+ g_clear_error(&err); -+ else -+ { -+ DBG("DelayReport=%d", boolean); -+ main_opts.delay_report = boolean; -+ } ++ boolean = g_key_file_get_boolean(config, "General", ++ "DelayReport", &err); ++ if (err) ++ g_clear_error(&err); ++ else ++ { ++ DBG("DelayReport=%d", boolean); ++ main_opts.delay_report = boolean; ++ } + str = g_key_file_get_string(config, "GATT", "Cache", &err); if (err) { - g_clear_error(&err); + DBG("%s", err->message); diff --git a/src/main.conf b/src/main.conf -index cbae32e..7dd16d3 100644 +index 16701eb..83671d3 100644 --- a/src/main.conf +++ b/src/main.conf -@@ -58,6 +58,9 @@ +@@ -65,6 +65,9 @@ # 'false'. #FastConnectable = false @@ -385,6 +352,3 @@ index cbae32e..7dd16d3 100644 # Default privacy setting. # Enables use of private address. # Possible values: "off", "device", "network" --- -2.14.1 - diff --git a/meta-webos/recipes-connectivity/bluez5/bluez5/0017-Subject-PATCH-Implementation-to-get-connectedUuid-s-.patch b/meta-webos/recipes-connectivity/bluez5/bluez5/0017-Subject-PATCH-Implementation-to-get-connectedUuid-s-.patch index 884a7d151..6870c55c2 100644 --- a/meta-webos/recipes-connectivity/bluez5/bluez5/0017-Subject-PATCH-Implementation-to-get-connectedUuid-s-.patch +++ b/meta-webos/recipes-connectivity/bluez5/bluez5/0017-Subject-PATCH-Implementation-to-get-connectedUuid-s-.patch @@ -1,7 +1,7 @@ -From 6fced5abaaa9b8b624f05a20563c4cfe4deabff6 Mon Sep 17 00:00:00 2001 +From 6a1f42fa92a3f72a7eba177891b517429a5174e5 Mon Sep 17 00:00:00 2001 From: Rakes Pani Date: Mon, 6 Apr 2020 12:14:43 +0530 -Subject: [PATCH 2/2] Subject: [PATCH] Implementation to get connectedUuid's in +Subject: [PATCH] Subject: [PATCH] Implementation to get connectedUuid's in case of incoming connection :Release Notes: @@ -19,15 +19,16 @@ Builded and Tested [PLAT-102289] Implement connect for A2DP_SINK Upstream-Status: Inappropriate[webos specific] + --- src/device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/device.c b/src/device.c -index eecef05..5d21bca 100644 +index 3a17f34..a5f5cf5 100644 --- a/src/device.c +++ b/src/device.c -@@ -6662,9 +6662,11 @@ static void service_state_changed(struct btd_service *service, +@@ -6786,9 +6786,11 @@ static void service_state_changed(struct btd_service *service, new_state == BTD_SERVICE_STATE_DISCONNECTING) return; @@ -41,5 +42,3 @@ index eecef05..5d21bca 100644 device_profile_disconnected(device, profile, err); } --- -2.17.1 diff --git a/meta-webos/recipes-connectivity/bluez5/bluez5/0018-Fix-for-updating-connected-uuids-when-profile-is-disconnected.patch b/meta-webos/recipes-connectivity/bluez5/bluez5/0018-Fix-for-updating-connected-uuids-when-profile-is-disconnected.patch index fb7674ad8..cdd409b92 100644 --- a/meta-webos/recipes-connectivity/bluez5/bluez5/0018-Fix-for-updating-connected-uuids-when-profile-is-disconnected.patch +++ b/meta-webos/recipes-connectivity/bluez5/bluez5/0018-Fix-for-updating-connected-uuids-when-profile-is-disconnected.patch @@ -1,4 +1,4 @@ -From 169f37ed37703f3a7bb8f3e569455f4ed8450c9c Mon Sep 17 00:00:00 2001 +From 128e279b936a0443b9bffd8b3969e1e1a7c65048 Mon Sep 17 00:00:00 2001 From: "ramya.hegde" Date: Tue, 14 Apr 2020 15:28:07 +0530 Subject: [PATCH] Fix for updating connected uuids when profile is disconnected @@ -18,15 +18,16 @@ Builded and Tested [PLAT-102923] Implement disconnect to AVRCP target Upstream-Status: Inappropriate[webos specific] + --- src/device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c -index eecef05..7c1d344 100644 +index a5f5cf5..ce0fc0a 100644 --- a/src/device.c +++ b/src/device.c -@@ -2208,7 +2208,10 @@ static void device_profile_disconnected(struct btd_device *dev, +@@ -2210,7 +2210,10 @@ static void device_profile_disconnected(struct btd_device *dev, DBG("%s %s (%d)", profile->name, strerror(-err), -err); if (!err) { if (dev->connected_uuids) @@ -38,6 +39,3 @@ index eecef05..7c1d344 100644 g_dbus_emit_property_changed(dbus_conn, dev->path, DEVICE_INTERFACE, "ConnectedUUIDS"); } --- -2.17.1 - diff --git a/meta-webos/recipes-connectivity/bluez5/bluez5/0019-Fix-device-getStatus-not-updated-when-unpaired.patch b/meta-webos/recipes-connectivity/bluez5/bluez5/0019-Fix-device-getStatus-not-updated-when-unpaired.patch index 65ee6299c..430badff6 100644 --- a/meta-webos/recipes-connectivity/bluez5/bluez5/0019-Fix-device-getStatus-not-updated-when-unpaired.patch +++ b/meta-webos/recipes-connectivity/bluez5/bluez5/0019-Fix-device-getStatus-not-updated-when-unpaired.patch @@ -1,4 +1,4 @@ -From 201e050489cefda52e21e36ca18f173cc1be3560 Mon Sep 17 00:00:00 2001 +From 27e3b7f4fa299dc57695518d09da33d568450673 Mon Sep 17 00:00:00 2001 From: Sameer Mulla Date: Mon, 27 Apr 2020 11:56:21 +0530 Subject: [PATCH] Fix device/getStatus not updated when unpaired @@ -23,15 +23,16 @@ Builded and Tested [PLAT-102335] Test and fix hfp/getStatus for multiple adapter Upstream-Status: Inappropriate[webos specific] + --- src/device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/device.c b/src/device.c -index 8c1ce7f..37e8831 100644 +index ce0fc0a..5293d80 100644 --- a/src/device.c +++ b/src/device.c -@@ -1707,13 +1707,13 @@ static void device_profile_connected(struct btd_device *dev, +@@ -1709,13 +1709,13 @@ static void device_profile_connected(struct btd_device *dev, DBG("%s %s (%d)", profile->name, strerror(-err), -err); @@ -49,6 +50,3 @@ index 8c1ce7f..37e8831 100644 } if (dev->pending == NULL) --- -2.17.1 - diff --git a/meta-webos/recipes-connectivity/bluez5/bluez5/0019-Set-default-pairing-capability-as-NoInputNoOutput.patch b/meta-webos/recipes-connectivity/bluez5/bluez5/0019-Set-default-pairing-capability-as-NoInputNoOutput.patch index df451604c..d6477066b 100644 --- a/meta-webos/recipes-connectivity/bluez5/bluez5/0019-Set-default-pairing-capability-as-NoInputNoOutput.patch +++ b/meta-webos/recipes-connectivity/bluez5/bluez5/0019-Set-default-pairing-capability-as-NoInputNoOutput.patch @@ -1,4 +1,4 @@ -From 34c4bfdbebeddd95726089060084f9626721a491 Mon Sep 17 00:00:00 2001 +From d140d8ef7b795898151a9a343a979e5e62fd5d2a Mon Sep 17 00:00:00 2001 From: "sungmok.shin" Date: Mon, 20 Apr 2020 19:24:45 +0900 Subject: [PATCH] Set default pairing capability as "NoInputNoOutput" @@ -8,10 +8,10 @@ Subject: [PATCH] Set default pairing capability as "NoInputNoOutput" 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent.c b/src/agent.c -index ff44d57..5fddfcb 100644 +index e0ffcd2..17a6482 100644 --- a/src/agent.c +++ b/src/agent.c -@@ -956,7 +956,7 @@ static DBusMessage *register_agent(DBusConnection *conn, +@@ -992,7 +992,7 @@ static DBusMessage *register_agent(DBusConnection *conn, DBUS_TYPE_INVALID) == FALSE) return btd_error_invalid_args(msg); @@ -20,6 +20,3 @@ index ff44d57..5fddfcb 100644 if (cap == IO_CAPABILITY_INVALID) return btd_error_invalid_args(msg); --- -2.17.1 - diff --git a/meta-webos/recipes-connectivity/bluez5/bluez5/0020-AVRCP-getting-supported-notification-events.patch b/meta-webos/recipes-connectivity/bluez5/bluez5/0020-AVRCP-getting-supported-notification-events.patch index fcc59bd25..1f29ad268 100644 --- a/meta-webos/recipes-connectivity/bluez5/bluez5/0020-AVRCP-getting-supported-notification-events.patch +++ b/meta-webos/recipes-connectivity/bluez5/bluez5/0020-AVRCP-getting-supported-notification-events.patch @@ -1,4 +1,4 @@ -From 93ad237885c507f54118ea5716dcf95dd6532c97 Mon Sep 17 00:00:00 2001 +From 8d5f367451bc0fea03cd96501f057e9bf8f99765 Mon Sep 17 00:00:00 2001 From: "ramya.hegde" Date: Mon, 11 May 2020 15:54:12 +0530 Subject: [PATCH] AVRCP getting supported notification events @@ -20,16 +20,17 @@ Built and Tested avrcp/internal/getSupportedNotificationEvents Upstream-Status: Inappropriate[webos specific] + --- profiles/audio/avrcp.c | 1 + src/device.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c -index 21e3366..43a5e53 100644 +index 6bcc99a..885d707 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c -@@ -3811,6 +3811,7 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code, +@@ -3812,6 +3812,7 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code, break; } } @@ -38,10 +39,10 @@ index 21e3366..43a5e53 100644 if (!session->controller || !session->controller->player) return FALSE; diff --git a/src/device.c b/src/device.c -index 37e8831..ce5d322 100644 +index 5293d80..675a7fb 100644 --- a/src/device.c +++ b/src/device.c -@@ -272,6 +272,7 @@ struct btd_device { +@@ -271,6 +271,7 @@ struct btd_device { struct key_code passththough_key; uint8_t avrcp_ct_features; uint8_t avrcp_tg_features; @@ -49,7 +50,7 @@ index 37e8831..ce5d322 100644 }; static const uint16_t uuid_list[] = { -@@ -1348,6 +1349,17 @@ static gboolean dev_property_get_key_code(const GDBusPropertyTable *property, +@@ -1350,6 +1351,17 @@ static gboolean dev_property_get_key_code(const GDBusPropertyTable *property, return TRUE; } @@ -67,7 +68,7 @@ index 37e8831..ce5d322 100644 static gboolean dev_property_get_avrcp_ct_feature(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { -@@ -1867,6 +1879,14 @@ void set_avrcp_feature(struct btd_device *dev, uint8_t feature, bool is_controll +@@ -1869,6 +1881,14 @@ void set_avrcp_feature(struct btd_device *dev, uint8_t feature, bool is_controll } } @@ -82,7 +83,7 @@ index 37e8831..ce5d322 100644 static void add_service_data(void *data, void *user_data) { struct eir_sd *sd = data; -@@ -2952,6 +2972,7 @@ static const GDBusPropertyTable device_properties[] = { +@@ -2992,6 +3012,7 @@ static const GDBusPropertyTable device_properties[] = { NULL, dev_property_avrcp_ct_feature_exist}, { "AvrcpTGFeatures", "y", dev_property_get_avrcp_tg_feature, NULL, dev_property_avrcp_tg_feature_exist}, @@ -90,6 +91,3 @@ index 37e8831..ce5d322 100644 { "ServiceData", "a{sv}", dev_property_get_service_data, NULL, dev_property_service_data_exist }, { "TxPower", "n", dev_property_get_tx_power, NULL, --- -2.17.1 - diff --git a/meta-webos/recipes-connectivity/bluez5/bluez5/0021-Modified-MapInstanceName-MapInstanceProperties-parsi.patch b/meta-webos/recipes-connectivity/bluez5/bluez5/0021-Modified-MapInstanceName-MapInstanceProperties-parsi.patch index 4578922d1..9a3174610 100644 --- a/meta-webos/recipes-connectivity/bluez5/bluez5/0021-Modified-MapInstanceName-MapInstanceProperties-parsi.patch +++ b/meta-webos/recipes-connectivity/bluez5/bluez5/0021-Modified-MapInstanceName-MapInstanceProperties-parsi.patch @@ -1,6 +1,6 @@ -From 04c2776f141c2f17a1604a29634c087e3be60e16 Mon Sep 17 00:00:00 2001 +From 8140f2105e47920446f92c91eae83b88f6624698 Mon Sep 17 00:00:00 2001 From: Rakes Pani -Date: Thu, 9 Jul 2020 13:03:49 +0530 +Date: Tue, 14 Jul 2020 10:37:18 +0900 Subject: [PATCH] Modified MapInstanceName & MapInstanceProperties parsing and type @@ -24,19 +24,19 @@ Upstream-Status: Inappropriate[webos specific] 1 file changed, 167 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c -index ce5d322..5606d95 100644 +index 675a7fb..a6ae27a 100644 --- a/src/device.c +++ b/src/device.c -@@ -211,6 +211,8 @@ struct btd_device { +@@ -210,6 +210,8 @@ struct btd_device { char *modalias; struct btd_adapter *adapter; GSList *uuids; -+ GSList *mapInstances; -+ GSList *mapInstancePropoerties; ++ GSList *mapInstances; ++ GSList *mapInstancePropoerties; GSList *connected_uuids; GSList *primaries; /* List of primary services */ GSList *services; /* List of btd_service */ -@@ -385,6 +387,7 @@ static gboolean store_device_info_cb(gpointer user_data) +@@ -384,6 +386,7 @@ static gboolean store_device_info_cb(gpointer user_data) char *str; char class[9]; char **uuids = NULL; @@ -44,43 +44,43 @@ index ce5d322..5606d95 100644 gsize length = 0; device->store_id = 0; -@@ -440,6 +443,35 @@ static gboolean store_device_info_cb(gpointer user_data) +@@ -439,6 +442,35 @@ static gboolean store_device_info_cb(gpointer user_data) g_key_file_remove_key(key_file, "General", "Services", NULL); } -+ if (device->mapInstances) { -+ GSList *l; -+ int i; ++ if (device->mapInstances) { ++ GSList *l; ++ int i; + -+ mapInstances = g_new0(char *, g_slist_length(device->mapInstances) + 1); -+ for (i = 0, l = device->mapInstances; l; l = g_slist_next(l), i++) -+ mapInstances[i] = l->data; -+ g_key_file_set_string_list(key_file, "General", "MapInstances", -+ (const char **)mapInstances, i); -+ } else { -+ g_key_file_remove_key(key_file, "General", "MapInstances", NULL); -+ } ++ mapInstances = g_new0(char *, g_slist_length(device->mapInstances) + 1); ++ for (i = 0, l = device->mapInstances; l; l = g_slist_next(l), i++) ++ mapInstances[i] = l->data; ++ g_key_file_set_string_list(key_file, "General", "MapInstances", ++ (const char **)mapInstances, i); ++ } else { ++ g_key_file_remove_key(key_file, "General", "MapInstances", NULL); ++ } + -+ if (device->mapInstancePropoerties) { -+ GSList *l = NULL; -+ int i; -+ gint mapProperties[g_slist_length(device->mapInstancePropoerties)]; -+ for (i = 0, l = device->mapInstancePropoerties; l; l = g_slist_next(l), i++) -+ { -+ int *p = (int *)l->data; -+ DBG("Storing %d", *p); -+ mapProperties[i] = *p; -+ } -+ g_key_file_set_integer_list(key_file, "General", "MapProperties", -+ mapProperties, i); -+ } else { -+ g_key_file_remove_key(key_file, "General", "MapProperties", NULL); -+ } ++ if (device->mapInstancePropoerties) { ++ GSList *l = NULL; ++ int i; ++ gint mapProperties[g_slist_length(device->mapInstancePropoerties)]; ++ for (i = 0, l = device->mapInstancePropoerties; l; l = g_slist_next(l), i++) ++ { ++ int *p = (int *)l->data; ++ DBG("Storing %d", *p); ++ mapProperties[i] = *p; ++ } ++ g_key_file_set_integer_list(key_file, "General", "MapProperties", ++ mapProperties, i); ++ } else { ++ g_key_file_remove_key(key_file, "General", "MapProperties", NULL); ++ } + if (device->vendor_src) { g_key_file_set_integer(key_file, "DeviceID", "Source", device->vendor_src); -@@ -467,6 +499,7 @@ static gboolean store_device_info_cb(gpointer user_data) +@@ -466,6 +498,7 @@ static gboolean store_device_info_cb(gpointer user_data) g_key_file_free(key_file); g_free(uuids); @@ -88,108 +88,107 @@ index ce5d322..5606d95 100644 return FALSE; } -@@ -660,6 +693,10 @@ static void device_free(gpointer user_data) +@@ -662,6 +695,10 @@ static void device_free(gpointer user_data) g_slist_free_full(device->uuids, g_free); g_slist_free_full(device->primaries, g_free); g_slist_free_full(device->svc_callbacks, svc_dev_remove); -+ if(device->mapInstances) -+ g_slist_free_full(device->mapInstances, g_free); -+ if(device->mapInstancePropoerties) -+ g_slist_free_full(device->mapInstancePropoerties, g_free); ++ if(device->mapInstances) ++ g_slist_free_full(device->mapInstances, g_free); ++ if(device->mapInstancePropoerties) ++ g_slist_free_full(device->mapInstancePropoerties, g_free); /* Reset callbacks since the device is going to be freed */ gatt_db_unregister(device->db, device->db_id); -@@ -1209,6 +1246,46 @@ static gboolean dev_property_get_uuids(const GDBusPropertyTable *property, +@@ -1211,6 +1248,46 @@ static gboolean dev_property_get_uuids(const GDBusPropertyTable *property, return TRUE; } +static gboolean dev_property_get_mapInstances(const GDBusPropertyTable *property, -+ DBusMessageIter *iter, void *data) ++ DBusMessageIter *iter, void *data) +{ -+ struct btd_device *dev = data; -+ DBusMessageIter entry; -+ GSList *l; ++ struct btd_device *dev = data; ++ DBusMessageIter entry; ++ GSList *l; + -+ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, -+ DBUS_TYPE_STRING_AS_STRING, &entry); ++ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, ++ DBUS_TYPE_STRING_AS_STRING, &entry); + -+ l = dev->mapInstances; -+ for (; l != NULL; l = l->next) -+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, -+ &l->data); ++ l = dev->mapInstances; ++ for (; l != NULL; l = l->next) ++ dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, ++ &l->data); + -+ dbus_message_iter_close_container(iter, &entry); ++ dbus_message_iter_close_container(iter, &entry); + -+ return TRUE; ++ return TRUE; +} + +static gboolean dev_property_get_mapInstanceProperties(const GDBusPropertyTable *property, -+ DBusMessageIter *iter, void *data) ++ DBusMessageIter *iter, void *data) +{ -+ struct btd_device *dev = data; -+ DBusMessageIter entry; -+ GSList *l; ++ struct btd_device *dev = data; ++ DBusMessageIter entry; ++ GSList *l; + -+ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, -+ DBUS_TYPE_INT32_AS_STRING, &entry); ++ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, ++ DBUS_TYPE_INT32_AS_STRING, &entry); + -+ l = dev->mapInstancePropoerties; -+ for (; l != NULL; l = l->next) -+ dbus_message_iter_append_basic(&entry, DBUS_TYPE_INT32, -+ l->data); ++ l = dev->mapInstancePropoerties; ++ for (; l != NULL; l = l->next) ++ dbus_message_iter_append_basic(&entry, DBUS_TYPE_INT32, ++ l->data); + -+ dbus_message_iter_close_container(iter, &entry); ++ dbus_message_iter_close_container(iter, &entry); + -+ return TRUE; ++ return TRUE; +} + static gboolean dev_property_get_modalias(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { -@@ -2984,6 +3061,8 @@ static const GDBusPropertyTable device_properties[] = { +@@ -3024,6 +3101,8 @@ static const GDBusPropertyTable device_properties[] = { { "AdvertisingData", "a{yv}", dev_property_get_advertising_data, NULL, dev_property_advertising_data_exist, G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, -+ { "MapInstances", "as", dev_property_get_mapInstances }, -+ { "MapInstanceProperties", "ai", dev_property_get_mapInstanceProperties }, ++ { "MapInstances", "as", dev_property_get_mapInstances }, ++ { "MapInstanceProperties", "ai", dev_property_get_mapInstanceProperties }, { } }; -@@ -3200,6 +3279,33 @@ static void load_services(struct btd_device *device, char **uuids) +@@ -3240,6 +3319,32 @@ static void load_services(struct btd_device *device, char **uuids) g_strfreev(uuids); } +static void load_map_instances(struct btd_device *device, char **instanceNames) +{ -+ char **instanceName; ++ char **instanceName; + -+ for (instanceName = instanceNames; *instanceName; instanceName++) { -+ if (g_slist_find(device->mapInstances, *instanceName)) -+ continue; ++ for (instanceName = instanceNames; *instanceName; instanceName++) { ++ if (g_slist_find(device->mapInstances, *instanceName)) ++ continue; + -+ device->mapInstances = g_slist_append (device->mapInstances, -+ g_strdup(*instanceName)); -+ } ++ device->mapInstances = g_slist_append (device->mapInstances, ++ g_strdup(*instanceName)); ++ } + -+ g_strfreev(instanceNames); ++ g_strfreev(instanceNames); +} + +static void load_map_properties(struct btd_device *device, int *instanceProperties, gsize len) +{ -+ for (int i = 0; i < len; i++) { -+ DBG("load_map_properties %d ", instanceProperties[i]); -+ int *instanceProperty = (int *)malloc(sizeof(int)); -+ *instanceProperty = instanceProperties[i]; -+ device->mapInstancePropoerties = g_slist_append(device->mapInstancePropoerties, instanceProperty); -+ } -+ g_free(instanceProperties); ++ for (int i = 0; i < len; i++) { ++ DBG("load_map_properties %d ", instanceProperties[i]); ++ int *instanceProperty = (int *)malloc(sizeof(int)); ++ *instanceProperty = instanceProperties[i]; ++ device->mapInstancePropoerties = g_slist_append(device->mapInstancePropoerties, instanceProperty); ++ } ++ g_free(instanceProperties); +} -+ + static void convert_info(struct btd_device *device, GKeyFile *key_file) { char filename[PATH_MAX]; -@@ -3245,7 +3351,7 @@ static void load_info(struct btd_device *device, const char *local, +@@ -3285,7 +3390,7 @@ static void load_info(struct btd_device *device, const char *local, char *str; gboolean store_needed = FALSE; gboolean blocked; @@ -198,91 +197,92 @@ index ce5d322..5606d95 100644 int source, vendor, product, version; char **techno, **t; -@@ -3341,6 +3447,22 @@ next: +@@ -3381,6 +3486,23 @@ next: device->bredr_state.svc_resolved = true; } -+ /* Load MAP instances */ -+ mapInstances = g_key_file_get_string_list(key_file, "General", "MapInstances", -+ NULL, NULL); ++ /* Load MAP instances */ ++ mapInstances = g_key_file_get_string_list(key_file, "General", "MapInstances", ++ NULL, NULL); ++ ++ if (mapInstances) { ++ load_map_instances(device, mapInstances); ++ } + -+ if (mapInstances) { -+ load_map_instances(device, mapInstances); -+ } ++ /* Load MAP instance Properties */ ++ int *mapInstanceProperties; ++ gsize length = 0; ++ mapInstanceProperties = g_key_file_get_integer_list(key_file, "General", "MapProperties", ++ &length, NULL); ++ if (mapInstanceProperties) { ++ load_map_properties(device, mapInstanceProperties, length); ++ } + -+ /* Load MAP instance Properties */ -+ int *mapInstanceProperties; -+ gsize length = 0; -+ mapInstanceProperties = g_key_file_get_integer_list(key_file, "General", "MapProperties", -+ &length, NULL); -+ if (mapInstanceProperties) { -+ load_map_properties(device, mapInstanceProperties, length); -+ } /* Load device id */ source = g_key_file_get_integer(key_file, "DeviceID", "Source", NULL); if (source) { -@@ -4746,6 +4868,29 @@ static int update_record(struct browse_req *req, const char *uuid, +@@ -4816,6 +4938,29 @@ static int update_record(struct browse_req *req, const char *uuid, return 0; } +static int update_mapInstanceName(struct browse_req *req, const char *instanceName) +{ -+ GSList *l; ++ GSList *l; + -+ /* Check if UUID is duplicated */ -+ l = g_slist_find(req->device->mapInstances, instanceName); -+ if (l == NULL) { -+ req->device->mapInstances = g_slist_append(req->device->mapInstances, -+ g_strdup(instanceName)); -+ return 0; -+ } -+ return -EALREADY; ++ /* Check if UUID is duplicated */ ++ l = g_slist_find(req->device->mapInstances, instanceName); ++ if (l == NULL) { ++ req->device->mapInstances = g_slist_append(req->device->mapInstances, ++ g_strdup(instanceName)); ++ return 0; ++ } ++ return -EALREADY; +} + +static int update_mapInstanceProperties(struct browse_req *req, uint8_t supportedMessageType) +{ -+ int *p = (int *)malloc(sizeof(int)); -+ *p = supportedMessageType; -+ req->device->mapInstancePropoerties = g_slist_append(req->device->mapInstancePropoerties, -+ p); -+ return 0; ++ int *p = (int *)malloc(sizeof(int)); ++ *p = supportedMessageType; ++ req->device->mapInstancePropoerties = g_slist_append(req->device->mapInstancePropoerties, ++ p); ++ return 0; +} + static void update_bredr_services(struct browse_req *req, sdp_list_t *recs) { struct btd_device *device = req->device; -@@ -4797,6 +4942,23 @@ static void update_bredr_services(struct browse_req *req, sdp_list_t *recs) +@@ -4858,6 +5003,23 @@ static void update_bredr_services(struct browse_req *req, sdp_list_t *recs) + if (!profile_uuid) continue; - } -+ if (bt_uuid_strcmp(profile_uuid, OBEX_MAS_UUID) == 0) { -+ sdp_data_t *mapInstanceData; -+ DBG("MAS Profile"); -+ mapInstanceData = sdp_data_get(rec, 0x0100); -+ /* PSM must be odd and lsb of upper byte must be 0 */ -+ if (mapInstanceData != NULL) -+ { -+ DBG("instance Name %s " ,mapInstanceData->val.str); -+ if(update_mapInstanceName(req,mapInstanceData->val.str) == 0) -+ { -+ mapInstanceData = sdp_data_get(rec, SDP_ATTR_SUPPORTED_MESSAGE_TYPES); -+ DBG("instance Properties %d " ,mapInstanceData->val.uint8); -+ update_mapInstanceProperties(req,mapInstanceData->val.uint8); -+ } -+ } -+ } ++ if (bt_uuid_strcmp(profile_uuid, OBEX_MAS_UUID) == 0) { ++ sdp_data_t *mapInstanceData; ++ DBG("MAS Profile"); ++ mapInstanceData = sdp_data_get(rec, 0x0100); ++ /* PSM must be odd and lsb of upper byte must be 0 */ ++ if (mapInstanceData != NULL) ++ { ++ DBG("instance Name %s " ,mapInstanceData->val.str); ++ if(update_mapInstanceName(req,mapInstanceData->val.str) == 0) ++ { ++ mapInstanceData = sdp_data_get(rec, SDP_ATTR_SUPPORTED_MESSAGE_TYPES); ++ DBG("instance Properties %d " ,mapInstanceData->val.uint8); ++ update_mapInstanceProperties(req,mapInstanceData->val.uint8); ++ } ++ } ++ } + if (bt_uuid_strcmp(profile_uuid, PNP_UUID) == 0) { uint16_t source, vendor, product, version; sdp_data_t *pdlist; -@@ -4967,6 +5129,10 @@ static void search_cb(sdp_list_t *recs, int err, gpointer user_data) +@@ -5027,6 +5189,10 @@ static void search_cb(sdp_list_t *recs, int err, gpointer user_data) /* Propagate services changes */ g_dbus_emit_property_changed(dbus_conn, req->device->path, DEVICE_INTERFACE, "UUIDs"); -+ g_dbus_emit_property_changed(dbus_conn, req->device->path, -+ DEVICE_INTERFACE, "MapInstances"); -+ g_dbus_emit_property_changed(dbus_conn, req->device->path, -+ DEVICE_INTERFACE, "MapInstanceProperties"); ++ g_dbus_emit_property_changed(dbus_conn, req->device->path, ++ DEVICE_INTERFACE, "MapInstances"); ++ g_dbus_emit_property_changed(dbus_conn, req->device->path, ++ DEVICE_INTERFACE, "MapInstanceProperties"); send_reply: device_svc_resolved(device, BROWSE_SDP, BDADDR_BREDR, err); diff --git a/meta-webos/recipes-connectivity/bluez5/bluez5/0022-Enabled-EMAIL-support-based-on-MAPInstance-Name.patch b/meta-webos/recipes-connectivity/bluez5/bluez5/0022-Enabled-EMAIL-support-based-on-MAPInstance-Name.patch index 9e54ed7f6..7b580070c 100644 --- a/meta-webos/recipes-connectivity/bluez5/bluez5/0022-Enabled-EMAIL-support-based-on-MAPInstance-Name.patch +++ b/meta-webos/recipes-connectivity/bluez5/bluez5/0022-Enabled-EMAIL-support-based-on-MAPInstance-Name.patch @@ -1,4 +1,4 @@ -From 86b5cd1e34750481b0dcaae8c18bcb6f5b33f247 Mon Sep 17 00:00:00 2001 +From df11e4d281552d28aa51f4df2a576a79beae47cd Mon Sep 17 00:00:00 2001 From: Rakes Pani Date: Wed, 3 Jun 2020 18:08:39 +0530 Subject: [PATCH] Enabled EMAIL support based on MAPInstance Name Modified @@ -18,6 +18,7 @@ Subject: [PATCH] Enabled EMAIL support based on MAPInstance Name Modified [PLAT-107882] Implement BlueZ API support for MAP connection support Upstream-Status: Inappropriate[webos specific] + --- obexd/client/bluetooth.c | 21 ++++++++++++++++++--- obexd/client/manager.c | 10 ++++++---- @@ -149,10 +150,10 @@ index fbcad6d..c24f009 100644 create_callback, data); if (session != NULL) { diff --git a/obexd/client/map.c b/obexd/client/map.c -index 386ae8b..4f20d48 100644 +index 28e60fe..94e9d64 100644 --- a/obexd/client/map.c +++ b/obexd/client/map.c -@@ -1594,6 +1594,19 @@ static DBusMessage *map_list_filter_fields(DBusConnection *connection, +@@ -1595,6 +1595,19 @@ static DBusMessage *map_list_filter_fields(DBusConnection *connection, return reply; } @@ -172,7 +173,7 @@ index 386ae8b..4f20d48 100644 static void update_inbox_cb(struct obc_session *session, struct obc_transfer *transfer, GError *err, void *user_data) -@@ -1830,6 +1843,10 @@ static const GDBusMethodTable map_methods[] = { +@@ -1831,6 +1844,10 @@ static const GDBusMethodTable map_methods[] = { GDBUS_ARGS({ "transfer", "o" }, { "properties", "a{sv}" }), map_push_message) }, @@ -264,10 +265,10 @@ index b035cfc..ff17edf 100644 int (*getpacketopt) (GIOChannel *io, int *tx_mtu, int *rx_mtu); void (*disconnect) (guint id); diff --git a/tools/obexctl.c b/tools/obexctl.c -index a190834..76565c9 100644 +index 9ed336a..275950a 100644 --- a/tools/obexctl.c +++ b/tools/obexctl.c -@@ -126,6 +126,7 @@ static void connect_reply(DBusMessage *message, void *user_data) +@@ -127,6 +127,7 @@ static void connect_reply(DBusMessage *message, void *user_data) struct connect_args { char *dev; char *target; @@ -275,7 +276,7 @@ index a190834..76565c9 100644 }; static void connect_args_free(void *data) -@@ -156,6 +157,8 @@ static void connect_setup(DBusMessageIter *iter, void *user_data) +@@ -157,6 +158,8 @@ static void connect_setup(DBusMessageIter *iter, void *user_data) g_dbus_dict_append_entry(&dict, "Target", DBUS_TYPE_STRING, &args->target); @@ -284,7 +285,7 @@ index a190834..76565c9 100644 done: dbus_message_iter_close_container(iter, &dict); -@@ -165,6 +168,7 @@ static void cmd_connect(int argc, char *argv[]) +@@ -166,6 +169,7 @@ static void cmd_connect(int argc, char *argv[]) { struct connect_args *args; const char *target = "opp"; @@ -292,7 +293,7 @@ index a190834..76565c9 100644 if (!client) { bt_shell_printf("Client proxy not available\n"); -@@ -174,9 +178,13 @@ static void cmd_connect(int argc, char *argv[]) +@@ -175,9 +179,13 @@ static void cmd_connect(int argc, char *argv[]) if (argc > 2) target = argv[2]; @@ -306,7 +307,7 @@ index a190834..76565c9 100644 if (g_dbus_proxy_method_call(client, "CreateSession", connect_setup, connect_reply, args, connect_args_free) == FALSE) { -@@ -1844,7 +1852,7 @@ static void cmd_mkdir(int argc, char *argv[]) +@@ -1845,7 +1853,7 @@ static void cmd_mkdir(int argc, char *argv[]) static const struct bt_shell_menu main_menu = { .name = "main", .entries = { @@ -315,7 +316,7 @@ index a190834..76565c9 100644 { "disconnect", "[session]", cmd_disconnect, "Disconnect session", session_generator }, { "list", NULL, cmd_list, "List available sessions" }, -@@ -1864,7 +1872,8 @@ static const struct bt_shell_menu main_menu = { +@@ -1865,7 +1873,8 @@ static const struct bt_shell_menu main_menu = { { "pull", "", cmd_pull, "Pull Vobject & stores in file" }, { "cd", "", cmd_cd, "Change current folder" }, @@ -325,6 +326,3 @@ index a190834..76565c9 100644 { "cp", " ", cmd_cp, "Copy source file to destination file" }, { "mv", " ", cmd_mv, --- -2.17.1 -