commit e0048b690cfd93da4fa47be110008bac260462a8
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Wed Apr 21 11:21:08 2021 +0200

    release: bump version to 1.16.4

 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 0325cd530c35e0854b3f2a6624c7fdc4cad69995
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Wed Apr 21 11:20:53 2021 +0200

    NEWS: update for 1.16.4

 NEWS | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

commit 1cd612aab46e442075defeab7f0ce8ba97ba11d1
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Wed Apr 21 11:33:53 2021 +0200

    build: disable gtkdocize in autoreconf

    We have a custom modified gtk-doc.make file in our sources, which
    disables the gtkdoc-rebase on local install step, so we don't want
    autoreconf to copy a different one when we're bootstrapping.

    (cherry picked from commit 4ae623c37b5eb395c79b49a044958c09fd6d23a7)

 autogen.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 5a3dd6d4da2afa4df83781465cd5975ba337d6f5
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Apr 12 23:37:19 2021 +0200

    cli: avoid attempting to setup timeout on NULL proxy

    mm_manager_get_proxy() may actually return NULL if creating the
    internal GDBusProxy for the Manager interface fails.

    (cherry picked from commit 5a735317f7c0c42b2ddce52dbf1fa1edfc1c41f4)

 cli/mmcli.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

commit 2ed8ee5257e6479f12008b84cf93a196a75ba273
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Apr 12 23:06:22 2021 +0200

    kerneldevice: fix segfault when processing event for non-existing port

        ModemManager[6954]: <warn>  [1618260091.319919] [br0] invalid
        sysfs path read for net/br0
        **
        ERROR:kerneldevice/mm-kernel-device-generic.c:235:ptr_array_add_sysfs_attribute_link_basename:
        assertion failed: (array && sysfs_path && attribute)
        Bail out!
        ERROR:kerneldevice/mm-kernel-device-generic.c:235:ptr_array_add_sysfs_attribute_link_basename:
        assertion failed: (array && sysfs_path && attribute)

        Thread 1 "ModemManager" received signal SIGABRT, Aborted.
        (gdb) bt
        #0  0x00007ffff7438ef5 in raise () at /usr/lib/libc.so.6
        #1  0x00007ffff7422862 in abort () at /usr/lib/libc.so.6
        #2  0x00007ffff76c2084 in  () at /usr/lib/libglib-2.0.so.0
        #3  0x00007ffff771d85d in g_assertion_message_expr () at
        /usr/lib/libglib-2.0.so.0
        #4  0x00005555556a5337 in
        ptr_array_add_sysfs_attribute_link_basename (array=0x5555557de520,
        sysfs_path=0x0, attribute=0x555555703bd8 "driver", out_value=0x0)
            at kerneldevice/mm-kernel-device-generic.c:235
        #5  0x00005555556a542b in
        preload_contents_other (self=0x5555557a6c60) at
        kerneldevice/mm-kernel-device-generic.c:255
        #6  0x00005555556a6485 in preload_contents (self=0x5555557a6c60)
        at kerneldevice/mm-kernel-device-generic.c:517
        #7  0x00005555556a7fb6 in check_preload (self=0x5555557a6c60)
        at kerneldevice/mm-kernel-device-generic.c:980
        #8  0x00005555556a855f in initable_init (initable=0x5555557a6c60,
        cancellable=0x0, error=0x7fffffffe5c8) at
        kerneldevice/mm-kernel-device-generic.c:1127
        #9  0x00007ffff78a2f41 in g_initable_new_valist () at
        /usr/lib/libgio-2.0.so.0
        #10 0x00007ffff78a2ffa in g_initable_new () at
        /usr/lib/libgio-2.0.so.0
        #11 0x00005555556a8205 in mm_kernel_device_generic_new_with_rules
        (props=0x5555557a5fa0, rules=0x7fffec001e30, error=0x7fffffffe5c8)
        at kerneldevice/mm-kernel-device-generic.c:1042
        #12 0x00005555556a827d in mm_kernel_device_generic_new
        (props=0x5555557a5fa0, error=0x7fffffffe5c8) at
        kerneldevice/mm-kernel-device-generic.c:1063
        #13 0x00005555555aba9c in handle_kernel_event
        (self=0x555555793220, properties=0x5555557a5fa0,
        error=0x7fffffffe5c8) at mm-base-manager.c:414

    (cherry picked from commit 3d5a994ca8d8e766fd87a85d346c5b21f5e6c53e)

 src/kerneldevice/mm-kernel-device-generic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

commit b793fdc1c7a8a57a8e229f12861de0375174b152
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Thu Apr 8 22:24:04 2021 +0200

    iface-modem-time: fix invalid read when loading network timezone fails

      ==226546== Invalid read of size 4
      ==226546==    at 0x5068CB7: g_error_matches (in
      /usr/lib/libglib-2.0.so.0.6600.7)
      ==226546==    by 0x1BAC86: load_network_timezone_ready
      (mm-iface-modem-time.c:218)
      ==226546==    by 0x4EA827E: g_simple_async_result_complete (in
      /usr/lib/libgio-2.0.so.0.6600.7)
      ==226546==    by 0x17AE2C: at_command_ready (mm-base-modem-at.c:538)
      ==226546==    by 0x4EA827E: g_simple_async_result_complete (in
      /usr/lib/libgio-2.0.so.0.6600.7)
      ==226546==    by 0x24B475: serial_command_ready
      (mm-port-serial-at.c:378)
      ==226546==    by 0x4EA827E: g_simple_async_result_complete (in
      /usr/lib/libgio-2.0.so.0.6600.7)
      ==226546==    by 0x244F94: command_context_complete_and_free
      (mm-port-serial.c:141)
      ==226546==    by 0x246861: port_serial_got_response
      (mm-port-serial.c:755)
      ==226546==    by 0x246923: port_serial_timed_out
      (mm-port-serial.c:785)
      ==226546==    by 0x50863C3: ??? (in
      /usr/lib/libglib-2.0.so.0.6600.7)
      ==226546==    by 0x5085B83: g_main_context_dispatch (in
      /usr/lib/libglib-2.0.so.0.6600.7)

    (cherry picked from commit b766ded3ca58cee202bd4567dd5530f04dc2290d)

 src/mm-iface-modem-time.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

commit ab6033e9582ec79a8e0c0a7735a4dbad0e3f8a6b
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Thu Apr 8 22:40:20 2021 +0200

    libmm-glib,bearer-properties: fix usage of CMP_FLAGS_NO_RM_PROTOCOL

    (cherry picked from commit 3d665d22093b985f6860170bca8d33a5562056d1)

 libmm-glib/mm-bearer-properties.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

commit 124c2c672b773a366decec223aa8bec33f8bbd80
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Wed Mar 24 21:50:42 2021 +0100

    iface-modem: avoid check for SIM swap if no interface skeleton
    available

    (cherry picked from commit 9f7bbf28d210a4986f2d0d353e4e37024bc91c4a)

 src/mm-iface-modem.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

commit b0021c3e8c02ed595e651dd4a7561cdeaef647c0
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Wed Mar 24 21:47:54 2021 +0100

    iface-modem: avoid lock info update if no interface skeleton available

    Fixes
    https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/351

    (cherry picked from commit 96d83392a850b84888661f68cb170dd87fcd3c85)

 src/mm-iface-modem.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

commit 15cd1d7003c6a4942e31c57a658029ba36c27c2f
Author: Dylan Van Assche <me@dylanvanassche.be>
Date:   Tue Mar 16 19:28:09 2021 +0100

    quectel: ignore QGPSURC

    QGPSURCs are not ignored and causes calls to be rejected in some cases

    (cherry picked from commit 192e067f97153125fe9d3362c750146a5a7215cf)

 plugins/quectel/mm-broadband-modem-qmi-quectel.c | 10 +++++
 plugins/quectel/mm-broadband-modem-quectel.c     | 10 +++++
 plugins/quectel/mm-shared-quectel.c              | 48
 +++++++++++++++++++++++-
 plugins/quectel/mm-shared-quectel.h              |  7 +++-
 4 files changed, 72 insertions(+), 3 deletions(-)

commit 99bffc03cff060a752c0c9a4af0e7d06847c0c00
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Wed Mar 24 11:00:22 2021 +0100

    libmm-glib,bearer-properties: fix 'allowed-auth' comparison

    (cherry picked from commit 4b19b9693f03ab48c6707508d27b24e38294e022)

 libmm-glib/mm-bearer-properties.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit eed71a6048de040816f81dcf2031ece6fd7eb679
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Fri Mar 12 17:44:44 2021 +0100

    base-bearer: ignore forced disconnections

    If using PPP, ModemManager is never in charge of deciding when the
    connection is finished, because that would end up making ModemManager
    try to use the TTY port while pppd is still using it.

    When the modem goes unregistered for some time, we should not force
    the disconnection of the bearer object, we still need to wait for pppd
    to tell us the modem is disconnected.

    Fixes
    https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/331

    (cherry picked from commit 3e58fbe547115bd875754806340b3bb39cc7b053)

 src/mm-base-bearer.c | 5 +++++
 1 file changed, 5 insertions(+)

commit c5a86261cc1352d040313efa47247821a8d792cf
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Mar 21 13:44:16 2021 +0100

    cinterion: make sure FALSE sets GError in parse_smong_response()

    The g_regex_match_full() method may return FALSE without setting the
    GError, so that case needs to be considered.

    In addition to that, the following g_assert() was not doing what it
    should have been, as it was comparing the address of the variable and
    not the variable itself; rework the code to avoid that as well:
      g_assert (access_tech != MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN);

    (cherry picked from commit 634682b602dd51efbda42a8b2e8764b9bb0024e2)

 plugins/cinterion/mm-modem-helpers-cinterion.c     | 48
 +++++++++++-----------
 .../cinterion/tests/test-modem-helpers-cinterion.c | 29 ++++++++++---
 2 files changed, 48 insertions(+), 29 deletions(-)

commit efef1132101345f48bfe9102ddebed194b3c6cd6
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Mar 21 13:05:27 2021 +0100

    cinterion: make sure FALSE sets GError in provcfg_response_to_cid()

    The g_regex_match_full() method may return FALSE without setting the
    GError, so that case needs to be considered.

    Reported by Jan Mazura.

    Fixes
    https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/347

    (cherry picked from commit d01bca493dad933b9df51bec1254c79089ffa1c7)

 plugins/cinterion/mm-modem-helpers-cinterion.c     | 14 ++++++++++-
 .../cinterion/tests/test-modem-helpers-cinterion.c | 27
 ++++++++++++++++++----
 2 files changed, 35 insertions(+), 6 deletions(-)

commit 70f4677c211ccbb278eff65dc56a5ea9b0b34085
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Mar 21 11:24:18 2021 +0100

    cinterion: allow '*' in Prov/Cfg response

    E.g. in a Cinterion PLS8-E (REVISION 04.004) to match the following
    line:

      ^SCFG: "MEopMode/Prov/Cfg","fallback*"

    Fix suggested by Jan Mazura.

    See
    https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/347

    (cherry picked from commit 5285e958abcd734de73a13011b5243bcfdf4d20c)

 plugins/cinterion/mm-modem-helpers-cinterion.c         | 2 +-
 plugins/cinterion/tests/test-modem-helpers-cinterion.c | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

commit 6c0d96129702e4babdd98255dacaa278633ecd0a
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Tue Mar 23 15:36:58 2021 +0100

    kerneldevice,udev: don't use autoptr in GUdev types

    The autoptr support in all GUdev types was introduced in
    commit 272533131c6ed38479a88805, included in libgudev 232.

    In the MM 1.16 branch we depend on libgudev 147, so avoid
    implicitly bumping the required version.

    Fixes
    https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/349

 src/kerneldevice/mm-kernel-device-udev.c | 30
 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

commit b69da9d037d4857ad22a5efdb3bb9d1f494e4f21
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Thu Mar 18 11:20:02 2021 +0100

    base-modem: plug leaks when organizing ports

    The GLists maintained in the logic need to be explicitly freed (just
    the lists, not the list contents) if we exit early on error or if we
    end up deciding that the specific ports are available but unsupported
    by the plugin (e.g. if a plugin that doesn't support net ports finds
    net ports in the modem).

      ==225333== 24 bytes in 1 blocks are definitely lost in loss record
      2,024 of 5,525
      ==225333==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
      ==225333==    by 0x506C539: g_malloc (in
      /usr/lib/libglib-2.0.so.0.6600.7)
      ==225333==    by 0x508DC8F: g_slice_alloc (in
      /usr/lib/libglib-2.0.so.0.6600.7)
      ==225333==    by 0x50636B4: g_list_append (in
      /usr/lib/libglib-2.0.so.0.6600.7)
      ==225333==    by 0x17E671: mm_base_modem_organize_ports
      (mm-base-modem.c:1298)
      ==225333==    by 0x1E4409: mm_plugin_create_modem (mm-plugin.c:1094)
      ==225333==    by 0x162C81: mm_device_create_modem (mm-device.c:481)
      ==225333==    by 0x15DE60: device_support_check_ready
      (mm-base-manager.c:218)
      ==225333==    by 0x4EA8173: ??? (in /usr/lib/libgio-2.0.so.0.6600.7)
      ==225333==    by 0x4EAC6E8: ??? (in /usr/lib/libgio-2.0.so.0.6600.7)
      ==225333==    by 0x16730F: device_context_run_ready
      (mm-plugin-manager.c:1533)
      ==225333==    by 0x4EA8173: ??? (in /usr/lib/libgio-2.0.so.0.6600.7)

    (cherry picked from commit ab007a449638eeacaf6f626b707842af5274db95)

 src/mm-base-modem.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

commit 8a1f79bd5d5e2e0f1aa1b00901cbd84aa8e8729f
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 22:23:07 2021 +0100

    charsets: define common translit fallback character

    (cherry picked from commit 8a8e00168b02c5064f01d5da20a97c7268ba1e2b)

 src/mm-charsets.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

commit 2e51229c6fb0e235ea0bc41997abb3220d54f974
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 09:14:21 2021 +0100

    charsets: remove charset_hex_to_utf8()

    No longer used, replaced by the new common conversion methods.

    (cherry picked from commit c84454c1b00da7d33cc4fd917be4be6756317488)

 src/mm-charsets.c | 41 -----------------------------------------
 src/mm-charsets.h |  6 ------
 2 files changed, 47 deletions(-)

commit abd41673a2f3ed9178c08975d223ba744970ac40
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 09:09:45 2021 +0100

    charsets: remove take_and_convert methods

    These methods worked in a very strict way for some encodings, and in a
    very very loose way for others. E.g. when converting from hex-encoded
    UCS-2, we would attempt to convert as much text as we could even if
    the input string was truly not even close to UCS-2. This kind of "do
    our best" could make sense when processing e.g. the operator name
    reported by the modem, as that is some string to show to the user and
    there may be no strict requirement to have it perfectly fine. But the
    kind of loose comparison done for UCS-2 doesn't make sense e.g. when
    converting USSD responses or SMS messages.

    (cherry picked from commit 0ff3eb7ee0106423519152a68de1621cedf567c8)

 src/mm-charsets.c | 208
 ------------------------------------------------------
 src/mm-charsets.h |   5 --
 2 files changed, 213 deletions(-)

commit a030ea61498e736b3ba8405ce8d6e5ea37045fa7
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 09:07:21 2021 +0100

    cinterion: rework mno decoding to use str_to_utf8()

    (cherry picked from commit ab4c31ec0b2c79285e24b9a117ff5e5c21f8fd71)

 plugins/cinterion/mm-modem-helpers-cinterion.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

commit b42a60e4803916352143a0fc14032fd7bd50a379
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 09:01:49 2021 +0100

    cinterion: rework band encoding to use str_to_utf8()

    Also providing support to report errors when attempting to decode the
    strings.

    (cherry picked from commit 6bc07b4b1487cfc6e171ec1f2c34958f17202a8b)

 plugins/cinterion/mm-modem-helpers-cinterion.c | 88
 ++++++++++++++++++++------
 1 file changed, 67 insertions(+), 21 deletions(-)

commit 251d2096f6a8748b031e8434ccea9a17ea7bcd59
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sat Feb 13 16:04:56 2021 +0100

    helpers: rework normalize_operator() to use str_to_utf8()

    Instead of blindly assuming that we can take whatever string given as
    valid UTF-8, we'll always attempt to convert from the current modem
    charset into UTF-8. Before we were doing this for hex-encoded UCS2,
    but not for example for GSM-7.

    And due to the now applied GSM-7 conversion, the mf627a/mf627b +COPS
    parsing unit tests are updated accordingly, because when converting
    from an input string that contains byte 0x40 ('@' in UTF-8) as if it
    were GSM-7, the 0x40 is taken as character '¡', encoded as 0xc2,0xa1
    in UTF-8).

    (cherry picked from commit 16df1e17e6e96f8dd0ba67003c6abb7083b9d7ec)

 plugins/altair/mm-broadband-modem-altair-lte.c |  2 +-
 src/mm-broadband-modem.c                       |  4 +--
 src/mm-modem-helpers.c                         | 42
 ++++++++++++++++----------
 src/mm-modem-helpers.h                         |  3 +-
 src/tests/test-modem-helpers.c                 |  8 +++--
 5 files changed, 36 insertions(+), 23 deletions(-)

commit bba502c4be260e46c97f266957b3cb1bc67af7eb
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sat Feb 13 15:45:52 2021 +0100

    charsets,tests: update take_and_convert tests to str_from/to

    (cherry picked from commit 63fa9eee462de9270e3ab44eab43050877982cf1)

 src/tests/test-charsets.c | 98
 ++++++++++++++++++++++++++---------------------
 1 file changed, 55 insertions(+), 43 deletions(-)

commit ada8ec6786cc9aff9b1c93caa62c16292681bdf6
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sat Feb 13 14:54:54 2021 +0100

    cinterion: move sequence to set bands to private ctx

    The sequence of commands is exclusively used during the set current
    bands operation, so there is no point in storing it in the private
    object data.

    (cherry picked from commit 3ac248a7a6a4ad03d10dc691905e43be8722ab31)

 plugins/cinterion/mm-broadband-modem-cinterion.c | 65
 ++++++++++++++----------
 1 file changed, 39 insertions(+), 26 deletions(-)

commit e7a949de935dc09e7012d9bedbf6bd6f0b80f3d4
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sat Feb 13 14:44:27 2021 +0100

    charsets: use new str_from_utf8() instead of
    take_and_convert_to_current_charset()

    (cherry picked from commit e5363b546b72403451f14f24502f6c9a90728616)

 plugins/cinterion/mm-broadband-modem-cinterion.c |  77 ++++++++++----
 plugins/mbm/mm-broadband-bearer-mbm.c            |  40 ++++---
 src/mm-broadband-modem.c                         | 126
 +++++++++++------------
 src/mm-broadband-modem.h                         |  12 ---
 4 files changed, 142 insertions(+), 113 deletions(-)

commit ee08721984b93303fac2e00ba456b79826a83f4a
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Tue Dec 22 15:10:55 2020 +0100

    charsets: use new bytearray_to_utf8() instead of hex_to_utf8()

    (cherry picked from commit 395ab06c03086bf127970d14a97102e21222126f)

 src/mm-broadband-modem.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

commit c87f85d4709284e2059da9214df1cb9e36cfdb62
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Dec 21 14:28:08 2020 +0100

    charsets: use new bytearray_to_utf8() instead of byte_array_to_utf8()

    (cherry picked from commit 5ea4a591a40748c5be5f9f4b14ac4f7a09fe2857)

 src/mm-broadband-modem-mbim.c |  6 ++----
 src/mm-broadband-modem-qmi.c  |  6 ++----
 src/mm-charsets.c             | 23 -----------------------
 src/mm-charsets.h             |  5 -----
 src/mm-sms-part-3gpp.c        |  9 +++------
 5 files changed, 7 insertions(+), 42 deletions(-)

commit aa67dd24c3853362d385686b6f1acbbc7f94cccf
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Dec 21 14:20:13 2020 +0100

    charsets: make charset_gsm_unpacked_to_utf8() private

    Use the generic mm_modem_charset_bytearray_to_utf8() instead.

    (cherry picked from commit 033e174e445ff7606ea43191a4a5c141413e10e2)

 plugins/huawei/mm-broadband-modem-huawei.c | 15 ++++++++++-----
 src/mm-base-sim.c                          | 23 ++++++++++++++++-------
 src/mm-broadband-modem-mbim.c              |  9 ++++++---
 src/mm-charsets.c                          | 21 +++++++++++----------
 src/mm-charsets.h                          |  5 -----
 src/mm-sms-part-3gpp.c                     | 18 +++++++++++-------
 src/tests/test-charsets.c                  |  6 ++++--
 7 files changed, 58 insertions(+), 39 deletions(-)

commit 2b05740820c63d4b977b148eda3e1ca2198669b7
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Dec 21 13:37:13 2020 +0100

    charsets: use new bytearray_from_utf8() instead of byte_array_append()

    (cherry picked from commit 8bfdfb187b9c911366376f1574dc7e45fe4f0767)

 src/mm-broadband-modem-mbim.c |  9 ++---
 src/mm-broadband-modem-qmi.c  |  4 +--
 src/mm-broadband-modem.c      | 34 +++++++++----------
 src/mm-charsets.c             | 34 -------------------
 src/mm-charsets.h             |  9 -----
 src/mm-sms-part-3gpp.c        |  5 ++-
 src/mm-sms-part-cdma.c        | 76
 ++++++++++++++++++++-----------------------
 7 files changed, 59 insertions(+), 112 deletions(-)

commit cafdcb1311bbe4afbce56f97148b1794cf59621f
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 15:23:43 2021 +0100

    charsets: make charset_utf8_to_unpacked_gsm() private

    Use the generic mm_modem_charset_bytearray_from_utf8() instead.

    (cherry picked from commit 75b37e16b12ca3807852804fed668ba2fd7ca317)

 plugins/huawei/mm-broadband-modem-huawei.c | 24 ++++++---------
 src/mm-broadband-modem-mbim.c              | 13 +++-----
 src/mm-charsets.c                          | 49
 +++++++++++++++---------------
 src/mm-charsets.h                          |  4 ---
 src/mm-sms-part-3gpp.c                     | 17 +++++------
 src/tests/test-charsets.c                  | 15 +++++----
 6 files changed, 55 insertions(+), 67 deletions(-)

commit 061da8e4921862b5de514f4ca82d142debe28be1
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Fri Nov 27 00:41:40 2020 +0100

    charsets: new common APIs to convert from/to charsets and UTF-8

    (cherry picked from commit 9c613d33e1f60501cc8406f6429097d8bda87c59)

 src/mm-charsets.c | 298
 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 src/mm-charsets.h |  61 +++++++++++
 2 files changed, 352 insertions(+), 7 deletions(-)

commit 6e0a686228ac5a2da1b5a97d57c8d60082f24ffa
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 13:47:21 2021 +0100

    charsets: avoid //TRANSLIT when converting to/from charsets

    The //TRANSLIT extension is not always supported by the different
    iconv() implementations that we may find out there, so let's
    completely avoid using it.

    For some of the charsets it actually didn't make much sense anyway,
    e.g. as converting to UTF-16 or UTF-8 would always be possible without
    requiring //TRANSLIT to take effect.

    The //TRANSLIT extension was also being used sometimes in the source
    charset identification, which was also not fully correct, as we would
    only expect it in the target charset identification.

    (cherry picked from commit 6f32c8d38f2c7ad269c4ccf84190ad6e917293a9)

 src/mm-charsets.c | 81
 +++++++++++++++++++++++++++----------------------------
 1 file changed, 40 insertions(+), 41 deletions(-)

commit c23b4cd78a38e860130b6673a926272e8f3930a1
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Thu Nov 26 23:22:57 2020 +0100

    charsets: make translit optional in utf8_to_unpacked_gsm()

    If the conversion is not fully compatible, the user of the method
    needs to request transliteration enabled explicitly in order to avoid
    returning errors in this method.

    (cherry picked from commit bc449cbe87ccebccbe35f926e88a2dd110832ddf)

 plugins/huawei/mm-broadband-modem-huawei.c |  5 +++-
 src/mm-broadband-modem-mbim.c              |  5 ++--
 src/mm-charsets.c                          | 39
 ++++++++++++++++++++----------
 src/mm-charsets.h                          |  4 ++-
 src/mm-sms-part-3gpp.c                     |  7 ++++--
 src/tests/test-charsets.c                  |  3 ++-
 6 files changed, 42 insertions(+), 21 deletions(-)

commit 5aa572d7f8604e68d08dc678dcc7f9ccc5240530
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Thu Nov 26 23:07:11 2020 +0100

    charsets: make translit optional in gsm_unpacked_to_utf8()

    Until now, this method would automatically apply transliteration;
    i.e. replacing characters with '?' when no direct translation was
    available.

    We can attempt to do that transliteration on strings that are not
    critical, e.g. the operator name reported by the network. But we
    should not do that on other types of strings, e.g. on SMS contents
    that may really have additional purposes than just being
    human-readable.

    This commit makes the transliteration option to be explicitly
    requested by the caller.

    (cherry picked from commit 5ce97abd73da12b64393be798f2c294d29be2705)

 plugins/huawei/mm-broadband-modem-huawei.c |   2 +-
 src/mm-base-sim.c                          |   2 +-
 src/mm-broadband-modem-mbim.c              |   6 +-
 src/mm-charsets.c                          |  21 ++++--
 src/mm-charsets.h                          |  10 ++-
 src/mm-sms-part-3gpp.c                     | 116
 +++++++++++++++++------------
 src/tests/test-charsets.c                  |   4 +-
 7 files changed, 96 insertions(+), 65 deletions(-)

commit 64296ce39744c959aca690d0ab9b2b69820240b4
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 10:20:44 2021 +0100

    libmm-glib,tests: add ishexstr/hexstr2bin/bin2hexstr unit tests

    (cherry picked from commit 5480cb67b283c078770b02766c37768cb0930d7b)

 libmm-glib/tests/test-common-helpers.c | 104
 +++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)

commit da57feee719f234f619567eb7df2a9c69817a7bd
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 11:06:50 2021 +0100

    libmm-glib,common-helpers: make hexstr2bin() return a guint8 array

    It makes much more sense than returning a gchar array, as gchar is
    signed.

    (cherry picked from commit 34de613deab1c8728118fce389963ecb29ca51e7)

 libmm-glib/mm-common-helpers.c               | 10 +++++-----
 libmm-glib/mm-common-helpers.h               |  2 +-
 plugins/altair/mm-modem-helpers-altair-lte.c | 18 ++++++++---------
 plugins/huawei/mm-broadband-modem-huawei.c   |  4 ++--
 plugins/huawei/mm-modem-helpers-huawei.c     | 30
 ++++++++++++----------------
 src/mm-base-sim.c                            | 16 +++++++--------
 src/mm-charsets.c                            | 12 +++++------
 src/mm-modem-helpers-qmi.c                   |  2 +-
 src/mm-modem-helpers.c                       |  2 +-
 src/mm-sms-part-3gpp.c                       |  2 +-
 src/mm-sms-part-cdma.c                       |  2 +-
 11 files changed, 48 insertions(+), 52 deletions(-)

commit 7f272cc84e89137b3dcf1a225882a6d5906dc3f6
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 10:46:49 2021 +0100

    libmm-glib,common-helpers: ishexstr() fails on empty input string

    (cherry picked from commit 6d8610d63ecb8e53e14486533a580ea4f37c644c)

 libmm-glib/mm-common-helpers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

commit c1c0319f3e9110155ab19c4838b3372faaa64c53
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Feb 14 10:43:35 2021 +0100

    libmm-glib,common-helpers: hexstr2bin fails on empty input string

    Also, remove the trailing NUL byte that was appended to the output
    binary stream, as it's not needed in any case.

    (cherry picked from commit 8c30a6b6f813114d0cdc6b8a04ae4336c8393d48)

 libmm-glib/mm-common-helpers.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

commit ce36979813cdc31692e5ffddd57136aa3165e740
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Dec 21 13:52:54 2020 +0100

    libmm-glib,common-helpers: make hexstr2bin() accept input string
    length

    Optionally given explicitly, and -1 can be used to assume it's
    NUL-terminated.

    (cherry picked from commit a211981d4a12b0ef6cab48b7a04ae9e5674cac01)

 libmm-glib/mm-common-helpers.c               | 9 +++++----
 libmm-glib/mm-common-helpers.h               | 2 +-
 plugins/altair/mm-modem-helpers-altair-lte.c | 2 +-
 plugins/huawei/mm-broadband-modem-huawei.c   | 2 +-
 plugins/huawei/mm-modem-helpers-huawei.c     | 2 +-
 src/mm-base-sim.c                            | 4 ++--
 src/mm-charsets.c                            | 2 +-
 src/mm-modem-helpers-qmi.c                   | 2 +-
 src/mm-modem-helpers.c                       | 2 +-
 src/mm-sms-part-3gpp.c                       | 2 +-
 src/mm-sms-part-cdma.c                       | 2 +-
 11 files changed, 16 insertions(+), 15 deletions(-)

commit d126fa58069e794fe59b9e48d1b86053522ca9c9
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Nov 22 17:01:19 2020 +0100

    libmm-glib,common-helpers: make hexstr2bin() return a GError

    This util method checks whether the input string is a valid hex
    string, so make sure we return a GError on failure.

    (cherry picked from commit 657cabcfce6794d2a2f629d63dbd56fc149dab2e)

 libmm-glib/mm-common-helpers.c               | 18 ++++--
 libmm-glib/mm-common-helpers.h               |  2 +-
 plugins/altair/mm-modem-helpers-altair-lte.c | 56 ++++++------------
 plugins/huawei/mm-broadband-modem-huawei.c   | 19 +++----
 plugins/huawei/mm-modem-helpers-huawei.c     |  2 +-
 src/mm-base-sim.c                            | 85
 ++++++++++------------------
 src/mm-charsets.c                            |  2 +-
 src/mm-modem-helpers-qmi.c                   | 20 +++----
 src/mm-modem-helpers.c                       |  5 +-
 src/mm-sms-part-3gpp.c                       | 17 ++----
 src/mm-sms-part-cdma.c                       | 17 ++----
 11 files changed, 90 insertions(+), 153 deletions(-)

commit 24b276a5cbe70b8b283142be6cda251274c7c5af
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Nov 22 16:10:06 2020 +0100

    charsets: remove unused charset_utf8_to_hex() method

    (cherry picked from commit dbdf67e9f7c55d7f70ed94449160a7ff254359a2)

 src/mm-charsets.c | 28 ----------------------------
 src/mm-charsets.h |  6 ------
 2 files changed, 34 deletions(-)

commit 69fcaf3b5c154712bac705f8326210e25b72ca4d
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Nov 22 15:05:56 2020 +0100

    charsets: don't allow quoting in byte_array_append()

    There's no point in adding a quoting option to this method; if the
    caller needs the appended string quoted, it should quote it before
    passing it to this method.

    It was nowhere used anyway.

    (cherry picked from commit 8b590721dfdff5c4382dbc3498d92035b2d4ad64)

 src/mm-broadband-modem-mbim.c |  2 +-
 src/mm-broadband-modem-qmi.c  |  2 +-
 src/mm-broadband-modem.c      |  6 +-----
 src/mm-charsets.c             |  5 -----
 src/mm-charsets.h             |  1 -
 src/mm-sms-part-3gpp.c        |  2 +-
 src/mm-sms-part-cdma.c        | 12 ++----------
 7 files changed, 6 insertions(+), 24 deletions(-)

commit 021093232dc1b8f8257ef10e667fceb3f1383ab9
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Nov 22 15:02:07 2020 +0100

    charsets: remove HEX charset type

    This is no real charset, it is the fake one we used to represent a
    UCS2 hex-encoded string.

    (cherry picked from commit 38a4a9c842bcb0c87bca7b1a5595556fe2c144fc)

 src/mm-charsets.c | 10 ----------
 src/mm-charsets.h |  3 +--
 2 files changed, 1 insertion(+), 12 deletions(-)

commit 2122de4a1db0f215b75e20c505a8ada5ff07a195
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Sun Nov 22 15:00:23 2020 +0100

    charsets: define charset enum explicitly as flags

    (cherry picked from commit a025e83e5ab10147861334fd94682fdd20fb69d2)

 src/mm-charsets.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

commit 36974af255ad5a96824de21400d935a6d2ee0ab2
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Mar 15 17:46:49 2021 +0100

    shared-qmi: acquisition order preference TLV always same items

    The acquisition order preference TLV must always have the same number
    of elements, just the order of the elements should be different.

    Also, always prefer the acquisition order preference TLV to the
    GSM+WCDMA specific one, which is the same logic the modem applies.

    Fixes
    https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/340

    (cherry picked from commit fdfd4b270aa3bb31185feb833691f134c887f869)

 src/mm-modem-helpers-qmi.c | 108
 ++++++++++++++++++++++++---------------------
 src/mm-modem-helpers-qmi.h |   9 ++--
 src/mm-shared-qmi.c        |  64 ++++++++++++++++-----------
 3 files changed, 100 insertions(+), 81 deletions(-)

commit aae5fe5f5bc49fa0ecb87b2b714611ce16744d66
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Mar 15 15:19:38 2021 +0100

    shared-qmi: process all feature checks in SSP response together

    Loading capabilities is the very first step of the state machines, and
    so we can rely on the "NAS Get SSP" method performed there to process
    all feature checks of the SSP response.

    (cherry picked from commit bb5bc9c8c560a24ef2951bdb9e1da18dedd7c5b0)

 src/mm-shared-qmi.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

commit 6f68efc862ca92fcc5d28103224dfdcd31ae10e0
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Mar 15 15:11:41 2021 +0100

    shared-qmi: if getting TP/SSP fails, assume unsupported

    Until now we were only considering TP/SSP unsupported if we received
    a QMI protocol error (e.g. reporting unknown command).

    We now also consider TP/SSP unsupported if the actual request
    succeeds, but an error is reported in the response. There is no point
    in considering TP/SSP supported if the plain get request without input
    TLVs given fails.

    (cherry picked from commit 65a7624ffdd39b015d5013743913af8361e83513)

 src/mm-shared-qmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

commit c96524ca7b822341f227bf7b4b8bc9a5c4c2392a
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Mar 15 17:20:30 2021 +0100

    shared-qmi: add missing feature check flag initialization to UNKNOWN

    (cherry picked from commit 1a5f90f15bda7b939c75c6b8c7d0022c8f919b42)

 src/mm-shared-qmi.c | 1 +
 1 file changed, 1 insertion(+)

commit 2f42f208ba9dc2a29548e8f7010d08fd45b3bee0
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Mar 15 14:58:12 2021 +0100

    shared-qmi: rename feature check variables

    We want the "extended_lte_band_preference" with the "nas_ssp" prefix,
    as we're going to add more checks for SSP features.

    (cherry picked from commit 67b64eb7eeab5c50381014945cfbd73ebc4cbe11)

 src/mm-shared-qmi.c | 68
 ++++++++++++++++++++++++++---------------------------
 1 file changed, 34 insertions(+), 34 deletions(-)

commit fb0670637687d77cd8de584dcf7961d76c17e9b1
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Thu Mar 11 10:33:00 2021 +0100

    bearer-mbim: plug MbimDevice leak in disconnection context

    (cherry picked from commit a772b70632008d6c375487a8e711b80bb343a931)

 src/mm-bearer-mbim.c | 1 +
 1 file changed, 1 insertion(+)

commit 00ee27b075562814f0a9eee386d033245abf981d
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Tue Mar 2 17:18:39 2021 +0100

    broadband-modem-qmi: use updated system info API if libqmi >= 1.29.2

    (cherry picked from commit b509229d5747434be06e17af26c33fd8072a55f9)

 src/mm-broadband-modem-qmi.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

commit f776e6ba27f4ffa4d722a48ec1c86ea3e0566dea
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Tue Mar 2 15:02:37 2021 +0100

    build: post-release version bump to 1.16.3

 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 52df1aa4b938e0dbbdfd780befa54fce3bfdf875
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Tue Mar 2 14:45:57 2021 +0100

    release: bump version to 1.16.2

 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 35962825c035651df39f698c2bef0e5049deab00
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Tue Mar 2 14:45:33 2021 +0100

    NEWS: update for 1.16.2

 NEWS | 7 +++++++
 1 file changed, 7 insertions(+)

commit 64ea5d1e8170ad8de8432024f5137d63d2395663
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Mar 1 16:02:33 2021 +0100

    libmm-glib,tests: include string.h explicitly

    For strlen()

    (cherry picked from commit 438ff54d0308427dd629e2dbb43b12dc7295873b)

 libmm-glib/tests/test-common-helpers.c | 1 +
 1 file changed, 1 insertion(+)

commit d8539adbe211ad6b20749df24bb5be403b25a0f7
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Mar 1 15:56:14 2021 +0100

    modem-helpers-mbim: include string.h explicitly

    For strstr()

    (cherry picked from commit da0e610f5f020775e32f43b3343a02d864492224)

 src/mm-modem-helpers-mbim.c | 2 ++
 1 file changed, 2 insertions(+)

commit ef6e6c5303efe613479dae655962c6395321aed3
Author: Aleksander Morgado <aleksander@aleksander.es>
Date:   Mon Mar 1 15:55:22 2021 +0100

    utils: import ptr array lookup with GEqualFunc from GLib 2.54

    This fixes the build when using GLib < 2.54.
