Merge cros/upstream to cros/main - 1.29.6-dev

Part of an uprev that contains the following commits:

" 0761e7a build: unstable release version bump to 1.29.6 (Aleksander Morgado)"
" a7cba43 build-aux,mkenums: remove obsolete comment (Aleksander Morgado)"
" 8d2415d libmbim-glib: separate files for flags and enums types (Aleksander Morgado)"
" a1ce199 build-aux,mkenums: allow having separate files for flags and enums (Aleksander Morgado)"
" 4db9ad5 docs,reference: add missing mbim_registration_flag_build_string_from_mask() doc (Aleksander Morgado)"
" 88155f4 compat: add missing deprecation flags in mbim_sms_status_flag_get_string() (Aleksander Morgado)"
" 39b3dcc google: new service to support carrier-lock operations (som)"
" 4f916f4 mbim-codegen: fix including missing printable fields (Aleksander Morgado)"
" 7e35c35 build: version bump to flag existence of new API (NONE flags) (Aleksander Morgado)"
" 561c888 libmbim-glib,enums: add missing NONE entries in flag types (Aleksander Morgado)"
" c1f9b61 docs: update copyright (Aleksander Morgado)"
" af996f0 mbim-proxy: update copyright (Aleksander Morgado)"
" 90551cc mbimcli: update copyright (Aleksander Morgado)"
" 3b3fa0a ci: add explicit debug build with all features (Aleksander Morgado)"
" a144173 ci: don't attempt to build container on branches or pushes (Aleksander Morgado)"
" ced99f4 ci: test build without deprecated symbols support (Aleksander Morgado)"

BUG=b:276453081
FIXED=b:276453081

TEST=None

Change-Id: I614c9ed915288a7eeb9f9f0d601da672b3b3d456
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ccc1086..8d7a365 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,10 +25,9 @@
   stage: container prep
   only:
     - main
-    - branches
     - merge_requests
     - tags
-    - pushes
+    - schedules
 
 build-no-introspection:
   stage: build
@@ -45,7 +44,7 @@
     - ninja -C build
     - ninja -C build install
 
-build-introspection:
+build-debug:
   stage: build
   extends:
   - .fdo.distribution-image@ubuntu
@@ -56,7 +55,24 @@
     - tags
     - schedules
   script:
-    - meson setup build --prefix=/usr -Dwerror=true
+    - meson setup build --buildtype=debug --prefix=/usr -Dgtk_doc=true -Dwerror=true
+    - ninja -C build
+    - ninja -C build install
+    - ninja -C build dist
+    - ninja -C build uninstall
+
+build-no-deprecated:
+  stage: build
+  extends:
+  - .fdo.distribution-image@ubuntu
+  - .common_variables
+  only:
+    - main
+    - merge_requests
+    - tags
+    - schedules
+  script:
+    - CFLAGS="-DMBIM_DISABLE_DEPRECATED" meson setup build --prefix=/usr -Dwerror=true -Dintrospection=false
     - ninja -C build
     - ninja -C build install
 
diff --git a/build-aux/mbim-codegen/Message.py b/build-aux/mbim-codegen/Message.py
index 6db9103..fe5f501 100644
--- a/build-aux/mbim-codegen/Message.py
+++ b/build-aux/mbim-codegen/Message.py
@@ -1271,11 +1271,22 @@
                     '    show_field = mbim_utils_get_show_personal_info ();\n')
                 break
 
-        if message_type == 'response':
-            template += (
-                '\n'
-                '    if (!mbim_message_response_get_result (message, MBIM_MESSAGE_TYPE_COMMAND_DONE, NULL))\n'
-                '        return NULL;\n')
+        if fields != []:
+            if message_type == 'set' or message_type == 'query':
+                template += (
+                    '\n'
+                    '    if (!mbim_message_command_get_raw_information_buffer (message, NULL))\n'
+                    '        return NULL;\n')
+            elif message_type == 'response':
+                template += (
+                    '\n'
+                    '    if (!mbim_message_command_done_get_raw_information_buffer (message, NULL))\n'
+                    '        return NULL;\n')
+            elif message_type == 'notification':
+                template += (
+                    '\n'
+                    '    if (!mbim_message_indicate_status_get_raw_information_buffer (message, NULL))\n'
+                    '        return NULL;\n')
 
         template += (
             '\n'
diff --git a/build-aux/mbim-codegen/utils.py b/build-aux/mbim-codegen/utils.py
index 8f39b8b..8ae85bb 100644
--- a/build-aux/mbim-codegen/utils.py
+++ b/build-aux/mbim-codegen/utils.py
@@ -98,6 +98,7 @@
         "#include \"mbim-message-private.h\"\n"
         "#include \"mbim-tlv-private.h\"\n"
         "#include \"mbim-enum-types.h\"\n"
+        "#include \"mbim-flag-types.h\"\n"
         "#include \"mbim-error-types.h\"\n"
         "#include \"mbim-device.h\"\n"
         "#include \"mbim-utils.h\"\n")
diff --git a/build-aux/mbim-mkenums b/build-aux/mbim-mkenums
index 7077e34..e1b2e32 100755
--- a/build-aux/mbim-mkenums
+++ b/build-aux/mbim-mkenums
@@ -2,8 +2,6 @@
 
 # qmi-mkenums is ported from glib-mkenums.
 # Same license applies.
-# The 'since' tag support was introduced in upstream GLib 2.66,
-# so remove this custom mkenums once 2.66 is required in the project.
 
 # If the code below looks horrible and unpythonic, do not panic.
 #
@@ -262,7 +260,7 @@
   \u0040ENUMNAME\u0040            PREFIX_THE_XENUM
   \u0040ENUMSHORT\u0040           THE_XENUM
   \u0040ENUMPREFIX\u0040          PREFIX
-  \u0040enumsince\u0040           the user-provided since value given (qmi-mkenums only)
+  \u0040enumsince\u0040           the user-provided since value given (mbim-mkenums only)
   \u0040VALUENAME\u0040           PREFIX_THE_XVALUE
   \u0040valuenick\u0040           the-xvalue
   \u0040valuenum\u0040            the integer value (limited support, Since: 2.26)
@@ -350,6 +348,10 @@
                     help='Value tail, produced after iterating over enum values')
 parser.add_argument('--comments', default='', dest='comment_tmpl',
                     help='Comment structure')
+parser.add_argument('--enums-only', default=False, action='store_true', dest='enumsonly',
+                    help='Only process enums, not flags')
+parser.add_argument('--flags-only', default=False, action='store_true', dest='flagsonly',
+                    help='Only process flags, not enums')
 parser.add_argument('--template', default='', dest='template',
                     help='Template file')
 parser.add_argument('--output', default=None, dest='output')
@@ -383,6 +385,9 @@
 idprefix += options.idprefix
 symprefix += options.symprefix
 
+enumsonly = options.enumsonly
+flagsonly = options.flagsonly
+
 # This is a hack to maintain some semblance of backward compatibility with
 # the old, Perl-based glib-mkenums. The old tool had an implicit ordering
 # on the arguments and templates; each argument was parsed in order, and
@@ -556,6 +561,11 @@
             if flags is None:
                 flags = seenbitshift
 
+            if flags and enumsonly:
+                continue
+            elif not flags and flagsonly:
+                continue
+
             # Autogenerate a prefix
             if enum_prefix is None:
                 for entry in entries:
diff --git a/build-aux/templates/mbim-enum-types.c.template b/build-aux/templates/mbim-enum-types.c.template
index fd3d47e..0fa59a6 100644
--- a/build-aux/templates/mbim-enum-types.c.template
+++ b/build-aux/templates/mbim-enum-types.c.template
@@ -36,7 +36,6 @@
 /* Enum-specific method to get the value as a string.
  * We get the nick of the GEnumValue. Note that this will be
  * valid even if the GEnumClass is not referenced anywhere. */
-#if defined __@ENUMNAME@_IS_ENUM__
 const gchar *
 @enum_name@_get_string (@EnumName@ val)
 {
@@ -49,51 +48,6 @@
 
     return NULL;
 }
-#endif /* __@ENUMNAME@_IS_ENUM__ */
-
-/* Flags-specific method to build a string with the given mask.
- * We get a comma separated list of the nicks of the GFlagsValues.
- * Note that this will be valid even if the GFlagsClass is not referenced
- * anywhere. */
-#if defined __@ENUMNAME@_IS_FLAGS__
-gchar *
-@enum_name@_build_string_from_mask (@EnumName@ mask)
-{
-    guint i;
-    gboolean first = TRUE;
-    GString *str = NULL;
-
-    for (i = 0; @enum_name@_values[i].value_nick; i++) {
-        /* We also look for exact matches */
-        if ((guint)mask == @enum_name@_values[i].value) {
-            if (str)
-                g_string_free (str, TRUE);
-            return g_strdup (@enum_name@_values[i].value_nick);
-        }
-
-        /* Build list with single-bit masks */
-        if (mask & @enum_name@_values[i].value) {
-            guint c;
-            gulong number = @enum_name@_values[i].value;
-
-            for (c = 0; number; c++)
-                number &= number - 1;
-
-            if (c == 1) {
-                if (!str)
-                    str = g_string_new ("");
-                g_string_append_printf (str, "%s%s",
-                                        first ? "" : ", ",
-                                        @enum_name@_values[i].value_nick);
-                if (first)
-                    first = FALSE;
-            }
-        }
-    }
-
-    return (str ? g_string_free (str, FALSE) : NULL);
-}
-#endif /* __@ENUMNAME@_IS_FLAGS__ */
 
 /*** END value-tail ***/
 
diff --git a/build-aux/templates/mbim-enum-types.h.template b/build-aux/templates/mbim-enum-types.h.template
index c72f7d9..c4eeed9 100644
--- a/build-aux/templates/mbim-enum-types.h.template
+++ b/build-aux/templates/mbim-enum-types.h.template
@@ -17,7 +17,6 @@
 /* Define type-specific symbols */
 #define __@ENUMNAME@_IS_@TYPE@__
 
-#if defined __@ENUMNAME@_IS_ENUM__
 /**
  * @enum_name@_get_string:
  * @val: a @EnumName@.
@@ -29,22 +28,6 @@
  * Since: @enumsince@
  */
 const gchar *@enum_name@_get_string (@EnumName@ val);
-#endif
-
-#if defined __@ENUMNAME@_IS_FLAGS__
-/**
- * @enum_name@_build_string_from_mask:
- * @mask: bitmask of @EnumName@ values.
- *
- * Builds a string containing a comma-separated list of nicknames for
- * each #@EnumName@ in @mask.
- *
- * Returns: (transfer full): a string with the list of nicknames, or %NULL if none given. The returned value should be freed with g_free().
- *
- * Since: @enumsince@
- */
-gchar *@enum_name@_build_string_from_mask (@EnumName@ mask);
-#endif
 
 /*** END value-header ***/
 
diff --git a/build-aux/templates/mbim-flag-types.c.template b/build-aux/templates/mbim-flag-types.c.template
new file mode 100644
index 0000000..d2877b7
--- /dev/null
+++ b/build-aux/templates/mbim-flag-types.c.template
@@ -0,0 +1,81 @@
+/*** BEGIN file-header ***/
+
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+static const G@Type@Value @enum_name@_values[] = {
+/*** END value-header ***/
+/*** BEGIN value-production ***/
+    { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+/*** BEGIN value-tail ***/
+    { 0, NULL, NULL }
+};
+
+/* Define type-specific symbols */
+
+GType
+@enum_name@_get_type (void)
+{
+    static gsize g_define_type_id_initialized = 0;
+
+    if (g_once_init_enter (&g_define_type_id_initialized)) {
+        GType g_define_type_id =
+            g_@type@_register_static (g_intern_static_string ("@EnumName@"),
+                                      @enum_name@_values);
+        g_once_init_leave (&g_define_type_id_initialized, g_define_type_id);
+    }
+
+    return g_define_type_id_initialized;
+}
+
+/* Flags-specific method to build a string with the given mask.
+ * We get a comma separated list of the nicks of the GFlagsValues.
+ * Note that this will be valid even if the GFlagsClass is not referenced
+ * anywhere. */
+gchar *
+@enum_name@_build_string_from_mask (@EnumName@ mask)
+{
+    guint i;
+    gboolean first = TRUE;
+    GString *str = NULL;
+
+    for (i = 0; @enum_name@_values[i].value_nick; i++) {
+        /* We also look for exact matches */
+        if ((guint)mask == @enum_name@_values[i].value) {
+            if (str)
+                g_string_free (str, TRUE);
+            return g_strdup (@enum_name@_values[i].value_nick);
+        }
+
+        /* Build list with single-bit masks */
+        if (mask & @enum_name@_values[i].value) {
+            guint c;
+            gulong number = @enum_name@_values[i].value;
+
+            for (c = 0; number; c++)
+                number &= number - 1;
+
+            if (c == 1) {
+                if (!str)
+                    str = g_string_new ("");
+                g_string_append_printf (str, "%s%s",
+                                        first ? "" : ", ",
+                                        @enum_name@_values[i].value_nick);
+                if (first)
+                    first = FALSE;
+            }
+        }
+    }
+
+    return (str ? g_string_free (str, FALSE) : NULL);
+}
+
+/*** END value-tail ***/
+
+/*** BEGIN file-tail ***/
+/*** END file-tail ***/
diff --git a/build-aux/templates/mbim-flag-types.h.template b/build-aux/templates/mbim-flag-types.h.template
new file mode 100644
index 0000000..4742b6d
--- /dev/null
+++ b/build-aux/templates/mbim-flag-types.h.template
@@ -0,0 +1,38 @@
+/*** BEGIN file-header ***/
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType @enum_name@_get_type (void) G_GNUC_CONST;
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
+
+/* Define type-specific symbols */
+#define __@ENUMNAME@_IS_@TYPE@__
+
+/**
+ * @enum_name@_build_string_from_mask:
+ * @mask: bitmask of @EnumName@ values.
+ *
+ * Builds a string containing a comma-separated list of nicknames for
+ * each #@EnumName@ in @mask.
+ *
+ * Returns: (transfer full): a string with the list of nicknames, or %NULL if none given. The returned value should be freed with g_free().
+ *
+ * Since: @enumsince@
+ */
+gchar *@enum_name@_build_string_from_mask (@EnumName@ mask);
+
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+/*** END file-tail ***/
diff --git a/data/mbim-service-google.json b/data/mbim-service-google.json
new file mode 100644
index 0000000..364c0dc
--- /dev/null
+++ b/data/mbim-service-google.json
@@ -0,0 +1,31 @@
+[
+  // *********************************************************************************
+  { "type" : "Service",
+    "name" : "Google" },
+
+  // *********************************************************************************
+  { "name"         : "Carrier Lock",
+    "type"         : "Command",
+    "since"        : "1.30",
+    "set"          : [ { "name"        : "Data",
+                         "format"      : "ref-byte-array-no-offset" } ],
+    "query"        : [],
+    "response"     : [ { "name"          : "CarrierLockStatus",
+                         "format"        : "guint32",
+                         "public-format" : "MbimCarrierLockStatus" },
+                       { "name"          : "CarrierLockModemState",
+                         "format"        : "guint32",
+                         "public-format" : "MbimCarrierLockModemState" },
+                       { "name"          : "CarrierLockCause",
+                         "format"        : "guint32",
+                         "public-format" : "MbimCarrierLockCause" } ],
+    "notification" : [ { "name"          : "CarrierLockStatus",
+                         "format"        : "guint32",
+                         "public-format" : "MbimCarrierLockStatus" },
+                       { "name"          : "CarrierLockModemState",
+                         "format"        : "guint32",
+                         "public-format" : "MbimCarrierLockModemState" },
+                       { "name"          : "CarrierLockCause",
+                         "format"        : "guint32",
+                         "public-format" : "MbimCarrierLockCause" } ] }
+]
diff --git a/docs/reference/libmbim-glib/libmbim-glib-common.sections b/docs/reference/libmbim-glib/libmbim-glib-common.sections
index 8de81d4..e22acc3 100644
--- a/docs/reference/libmbim-glib/libmbim-glib-common.sections
+++ b/docs/reference/libmbim-glib/libmbim-glib-common.sections
@@ -35,6 +35,7 @@
 MBIM_UUID_MS_VOICE_EXTENSIONS
 MBIM_UUID_INTEL_MUTUAL_AUTHENTICATION
 MBIM_UUID_INTEL_TOOLS
+MBIM_UUID_GOOGLE
 <SUBSECTION Methods>
 mbim_service_get_string
 mbim_service_lookup_name
@@ -79,6 +80,7 @@
 MbimCidMsVoiceExtensions
 MbimCidIntelMutualAuthentication
 MbimCidIntelTools
+MbimCidGoogle
 <SUBSECTION Methods>
 mbim_cid_can_set
 mbim_cid_can_query
@@ -106,6 +108,7 @@
 mbim_cid_ms_voice_extensions_get_string
 mbim_cid_intel_mutual_authentication_get_string
 mbim_cid_intel_tools_get_string
+mbim_cid_google_get_string
 <SUBSECTION Private>
 mbim_cid_atds_build_string_from_mask
 mbim_cid_basic_connect_build_string_from_mask
@@ -129,6 +132,7 @@
 mbim_cid_ms_voice_extensions_build_string_from_mask
 mbim_cid_intel_mutual_authentication_build_string_from_mask
 mbim_cid_intel_tools_build_string_from_mask
+mbim_cid_google_build_string_from_mask
 <SUBSECTION Standard>
 MBIM_TYPE_CID_ATDS
 MBIM_TYPE_CID_AUTH
@@ -152,6 +156,7 @@
 MBIM_TYPE_CID_MS_VOICE_EXTENSIONS
 MBIM_TYPE_CID_INTEL_MUTUAL_AUTHENTICATION
 MBIM_TYPE_CID_INTEL_TOOLS
+MBIM_TYPE_CID_GOOGLE
 mbim_cid_atds_get_type
 mbim_cid_auth_get_type
 mbim_cid_basic_connect_get_type
@@ -174,6 +179,7 @@
 mbim_cid_ms_voice_extensions_get_type
 mbim_cid_intel_mutual_authentication_get_type
 mbim_cid_intel_tools_get_type
+mbim_cid_google_get_type
 </SECTION>
 
 <SECTION>
@@ -428,6 +434,9 @@
 MbimUiccFileType
 MbimUiccFileStructure
 MbimTraceCommand
+MbimCarrierLockStatus
+MbimCarrierLockModemState
+MbimCarrierLockCause
 <SUBSECTION Methods>
 mbim_device_type_get_string
 mbim_cellular_class_build_string_from_mask
@@ -450,6 +459,7 @@
 mbim_register_action_get_string
 mbim_register_state_get_string
 mbim_register_mode_get_string
+mbim_registration_flag_build_string_from_mask
 mbim_packet_service_action_get_string
 mbim_packet_service_state_get_string
 mbim_activation_command_get_string
@@ -524,103 +534,9 @@
 mbim_uicc_file_type_get_string
 mbim_uicc_file_structure_get_string
 mbim_trace_command_get_string
-<SUBSECTION Private>
-mbim_device_type_build_string_from_mask
-mbim_cellular_class_get_string
-mbim_voice_class_build_string_from_mask
-mbim_sim_class_get_string
-mbim_data_class_get_string
-mbim_sms_caps_get_string
-mbim_ctrl_caps_get_string
-mbim_subscriber_ready_state_build_string_from_mask
-mbim_ready_info_flag_get_string
-mbim_radio_switch_state_build_string_from_mask
-mbim_pin_type_build_string_from_mask
-mbim_pin_state_build_string_from_mask
-mbim_pin_operation_build_string_from_mask
-mbim_pin_mode_build_string_from_mask
-mbim_pin_format_build_string_from_mask
-mbim_provider_state_get_string
-mbim_visible_providers_action_build_string_from_mask
-mbim_nw_error_build_string_from_mask
-mbim_register_action_build_string_from_mask
-mbim_register_state_build_string_from_mask
-mbim_register_mode_build_string_from_mask
-mbim_registration_flag_get_string
-mbim_registration_flag_build_string_from_mask
-mbim_packet_service_action_build_string_from_mask
-mbim_packet_service_state_build_string_from_mask
-mbim_activation_command_build_string_from_mask
-mbim_compression_build_string_from_mask
-mbim_auth_protocol_build_string_from_mask
-mbim_context_ip_type_build_string_from_mask
-mbim_activation_state_build_string_from_mask
-mbim_voice_call_state_build_string_from_mask
-mbim_ip_configuration_available_flag_get_string
-mbim_sms_cdma_encoding_build_string_from_mask
-mbim_sms_cdma_lang_build_string_from_mask
-mbim_sms_flag_build_string_from_mask
-mbim_sms_format_build_string_from_mask
-mbim_sms_status_build_string_from_mask
-mbim_sms_storage_state_build_string_from_mask
-mbim_ussd_action_build_string_from_mask
-mbim_ussd_response_build_string_from_mask
-mbim_ussd_session_state_build_string_from_mask
-mbim_phonebook_flag_build_string_from_mask
-mbim_phonebook_state_build_string_from_mask
-mbim_phonebook_write_flag_build_string_from_mask
-mbim_stk_pac_profile_build_string_from_mask
-mbim_stk_pac_type_build_string_from_mask
-mbim_network_idle_hint_state_build_string_from_mask
-mbim_emergency_mode_state_build_string_from_mask
-mbim_dss_link_state_build_string_from_mask
-mbim_atds_provider_plmn_mode_build_string_from_mask
-mbim_atds_rat_mode_build_string_from_mask
-mbim_pco_type_build_string_from_mask
-mbim_context_source_build_string_from_mask
-mbim_lte_attach_context_operation_build_string_from_mask
-mbim_lte_attach_context_roaming_control_build_string_from_mask
-mbim_lte_attach_state_build_string_from_mask
-mbim_sar_backoff_state_build_string_from_mask
-mbim_sar_control_mode_build_string_from_mask
-mbim_sar_wifi_hardware_state_build_string_from_mask
-mbim_transmission_notification_status_build_string_from_mask
-mbim_transmission_state_build_string_from_mask
-mbim_qdu_file_type_build_string_from_mask
-mbim_qdu_session_action_build_string_from_mask
-mbim_qdu_session_result_build_string_from_mask
-mbim_qdu_session_status_build_string_from_mask
-mbim_qdu_session_type_build_string_from_mask
-mbim_qdu_quectel_reboot_type_build_string_from_mask
-mbim_qdu_quectel_version_type_build_string_from_mask
-mbim_uicc_slot_state_build_string_from_mask
-mbim_uicc_secure_messaging_build_string_from_mask
-mbim_uicc_class_byte_type_build_string_from_mask
-mbim_uicc_pass_through_action_build_string_from_mask
-mbim_uicc_pass_through_status_build_string_from_mask
-mbim_frequency_range_get_string
-mbim_context_roaming_control_build_string_from_mask
-mbim_context_media_type_build_string_from_mask
-mbim_context_state_build_string_from_mask
-mbim_context_operation_build_string_from_mask
-mbim_mico_mode_build_string_from_mask
-mbim_default_pdu_activation_hint_build_string_from_mask
-mbim_ladn_info_build_string_from_mask
-mbim_drx_cycle_build_string_from_mask
-mbim_subscriber_ready_status_flag_get_string
-mbim_data_class_v3_get_string
-mbim_data_subclass_get_string
-mbim_modem_configuration_status_build_string_from_mask
-mbim_wake_type_build_string_from_mask
-mbim_quectel_radio_switch_state_build_string_from_mask
-mbim_access_media_type_build_string_from_mask
-mbim_intel_serving_cell_info_build_string_from_mask
-mbim_intel_boot_mode_build_string_from_mask
-mbim_uicc_application_type_build_string_from_mask
-mbim_uicc_file_accessibility_build_string_from_mask
-mbim_uicc_file_type_build_string_from_mask
-mbim_uicc_file_structure_build_string_from_mask
-mbim_trace_command_build_string_from_mask
+mbim_carrier_lock_status_get_string
+mbim_carrier_lock_modem_state_get_string
+mbim_carrier_lock_cause_get_string
 <SUBSECTION Standard>
 MBIM_TYPE_ACTIVATION_COMMAND
 MBIM_TYPE_ACTIVATION_STATE
@@ -722,6 +638,9 @@
 MBIM_TYPE_UICC_FILE_TYPE
 MBIM_TYPE_UICC_FILE_STRUCTURE
 MBIM_TYPE_TRACE_COMMAND
+MBIM_TYPE_CARRIER_LOCK_STATUS
+MBIM_TYPE_CARRIER_LOCK_MODEM_STATE
+MBIM_TYPE_CARRIER_LOCK_CAUSE
 mbim_activation_command_get_type
 mbim_activation_state_get_type
 mbim_auth_protocol_get_type
@@ -822,6 +741,9 @@
 mbim_uicc_file_type_get_type
 mbim_uicc_file_structure_get_type
 mbim_trace_command_get_type
+mbim_carrier_lock_status_get_type
+mbim_carrier_lock_modem_state_get_type
+mbim_carrier_lock_cause_get_type
 </SECTION>
 
 <SECTION>
diff --git a/docs/reference/libmbim-glib/libmbim-glib-docs.xml b/docs/reference/libmbim-glib/libmbim-glib-docs.xml
index ccf939b..84d322f 100644
--- a/docs/reference/libmbim-glib/libmbim-glib-docs.xml
+++ b/docs/reference/libmbim-glib/libmbim-glib-docs.xml
@@ -24,6 +24,7 @@
       <year>2020</year>
       <year>2021</year>
       <year>2022</year>
+      <year>2023</year>
       <holder>The libmbim-glib authors</holder>
     </copyright>
 
@@ -114,6 +115,11 @@
   </chapter>
 
   <chapter>
+    <title>Google-defined Services</title>
+    <xi:include href="xml/mbim-google.xml"/>
+  </chapter>
+
+  <chapter>
     <title>libmbim-defined Services</title>
     <xi:include href="xml/mbim-proxy-control.xml"/>
   </chapter>
diff --git a/meson.build b/meson.build
index a536a84..0287fe7 100644
--- a/meson.build
+++ b/meson.build
@@ -3,7 +3,7 @@
 
 project(
   'libmbim', 'c',
-  version: '1.29.4',
+  version: '1.29.6',
   license: ['GPL-2.0-or-later', 'LGPL-2.1-or-later'],
   default_options: [
     'buildtype=debugoptimized',
diff --git a/src/libmbim-glib/generated/meson.build b/src/libmbim-glib/generated/meson.build
index cd13cb6..0153c22 100644
--- a/src/libmbim-glib/generated/meson.build
+++ b/src/libmbim-glib/generated/meson.build
@@ -55,7 +55,7 @@
   capture: true,
 )
 
-# Enum/Flag types
+# Enum types
 enum_types = 'mbim-enum-types'
 
 gen_headers += custom_target(
@@ -65,6 +65,7 @@
   command: [
     python,
     mbim_mkenums,
+    '--enums-only',
     '--fhead', '#ifndef __LIBMBIM_GLIB_ENUM_TYPES_H__\n#define __LIBMBIM_GLIB_ENUM_TYPES_H__\n#include "mbim-uuid.h"\n#include "mbim-cid.h"\n#include "mbim-message.h"\n#include "mbim-enums.h"\n#include "mbim-tlv.h"\n',
     '--template', files(templates_dir / enum_types + '.h.template'),
     '--ftail', '#endif /* __LIBMBIM_GLIB_ENUM_TYPES_H__ */\n',
@@ -81,12 +82,47 @@
   command: [
     python,
     mbim_mkenums,
+    '--enums-only',
     '--fhead', '#include "mbim-enum-types.h"\n',
     '--template', files(templates_dir / enum_types + '.c.template'),
     '@INPUT@'],
   capture: true,
 )
 
+# Flag types
+enum_types = 'mbim-flag-types'
+
+gen_headers += custom_target(
+  enum_types + '.h',
+  input: mbim_enums_headers,
+  output: enum_types + '.h',
+  command: [
+    python,
+    mbim_mkenums,
+    '--flags-only',
+    '--fhead', '#ifndef __LIBMBIM_GLIB_FLAG_TYPES_H__\n#define __LIBMBIM_GLIB_FLAG_TYPES_H__\n#include "mbim-uuid.h"\n#include "mbim-cid.h"\n#include "mbim-message.h"\n#include "mbim-enums.h"\n#include "mbim-tlv.h"\n',
+    '--template', files(templates_dir / enum_types + '.h.template'),
+    '--ftail', '#endif /* __LIBMBIM_GLIB_FLAG_TYPES_H__ */\n',
+    '@INPUT@'],
+  capture: true,
+  install: true,
+  install_dir: mbim_glib_pkgincludedir,
+)
+
+gen_sources += custom_target(
+  enum_types + '.c',
+  input: mbim_enums_headers,
+  output: enum_types + '.c',
+  command: [
+    python,
+    mbim_mkenums,
+    '--flags-only',
+    '--fhead', '#include "mbim-flag-types.h"\n',
+    '--template', files(templates_dir / enum_types + '.c.template'),
+    '@INPUT@'],
+  capture: true,
+)
+
 services_data = [
   ['atds'],
   ['auth'],
@@ -110,6 +146,7 @@
   ['ussd'],
   ['intel-mutual-authentication'],
   ['intel-tools'],
+  ['google'],
 ]
 
 foreach service_data: services_data
diff --git a/src/libmbim-glib/libmbim-glib.h b/src/libmbim-glib/libmbim-glib.h
index 6b963c8..d096051 100644
--- a/src/libmbim-glib/libmbim-glib.h
+++ b/src/libmbim-glib/libmbim-glib.h
@@ -26,6 +26,7 @@
 
 /* generated */
 #include "mbim-enum-types.h"
+#include "mbim-flag-types.h"
 #include "mbim-error-types.h"
 #include "mbim-basic-connect.h"
 #include "mbim-sms.h"
@@ -48,6 +49,7 @@
 #include "mbim-ms-voice-extensions.h"
 #include "mbim-intel-mutual-authentication.h"
 #include "mbim-intel-tools.h"
+#include "mbim-google.h"
 
 /* backwards compatibility */
 #include "mbim-compat.h"
diff --git a/src/libmbim-glib/mbim-cid.c b/src/libmbim-glib/mbim-cid.c
index fec3515..cb8ee6e 100644
--- a/src/libmbim-glib/mbim-cid.c
+++ b/src/libmbim-glib/mbim-cid.c
@@ -248,6 +248,13 @@
     { SET   , QUERY   , NO_NOTIFY }, /* MBIM_CID_INTEL_TOOLS_TRACE_CONFIG */
 };
 
+/* Note: index of the array is CID-1 */
+#define MBIM_CID_GOOGLE_LAST MBIM_CID_GOOGLE_CARRIER_LOCK
+static const CidConfig cid_google_config [MBIM_CID_GOOGLE_LAST] = {
+    { SET, QUERY, NOTIFY }, /* MBIM_CID_GOOGLE_CARRIER_LOCK */
+};
+
+
 gboolean
 mbim_cid_can_set (MbimService service,
                   guint       cid)
@@ -303,6 +310,8 @@
         return cid_intel_mutual_authentication_config[cid - 1].set;
     case MBIM_SERVICE_INTEL_TOOLS:
         return cid_intel_tools_config[cid - 1].set;
+    case MBIM_SERVICE_GOOGLE:
+        return cid_google_config[cid - 1].set;
     case MBIM_SERVICE_INVALID:
     case MBIM_SERVICE_LAST:
     default:
@@ -366,6 +375,8 @@
         return cid_intel_mutual_authentication_config[cid - 1].query;
     case MBIM_SERVICE_INTEL_TOOLS:
         return cid_intel_tools_config[cid - 1].query;
+    case MBIM_SERVICE_GOOGLE:
+        return cid_google_config[cid - 1].query;
     case MBIM_SERVICE_INVALID:
     case MBIM_SERVICE_LAST:
     default:
@@ -429,6 +440,8 @@
         return cid_intel_mutual_authentication_config[cid - 1].notify;
     case MBIM_SERVICE_INTEL_TOOLS:
         return cid_intel_tools_config[cid - 1].notify;
+    case MBIM_SERVICE_GOOGLE:
+        return cid_google_config[cid - 1].notify;
     case MBIM_SERVICE_INVALID:
     case MBIM_SERVICE_LAST:
     default:
@@ -493,6 +506,8 @@
         return mbim_cid_intel_mutual_authentication_get_string (cid);
     case MBIM_SERVICE_INTEL_TOOLS:
         return mbim_cid_intel_tools_get_string (cid);
+    case MBIM_SERVICE_GOOGLE:
+        return mbim_cid_google_get_string (cid);
     case MBIM_SERVICE_LAST:
     default:
         g_assert_not_reached ();
diff --git a/src/libmbim-glib/mbim-cid.h b/src/libmbim-glib/mbim-cid.h
index 5d20a76..0666be0 100644
--- a/src/libmbim-glib/mbim-cid.h
+++ b/src/libmbim-glib/mbim-cid.h
@@ -472,6 +472,20 @@
 } MbimCidIntelTools;
 
 /**
+ * MbimCidGoogle:
+ * @MBIM_CID_GOOGLE_UNKNOWN: Unknown command.
+ * @MBIM_CID_GOOGLE_CARRIER_LOCK: Carrier lock.
+ *
+ * MBIM commands in the %MBIM_SERVICE_GOOGLE service.
+ *
+ * Since: 1.30
+ */
+typedef enum { /*< since=1.30 >*/
+    MBIM_CID_GOOGLE_UNKNOWN      = 0,
+    MBIM_CID_GOOGLE_CARRIER_LOCK = 1,
+} MbimCidGoogle;
+
+/**
  * mbim_cid_can_set:
  * @service: a #MbimService.
  * @cid: a command ID.
diff --git a/src/libmbim-glib/mbim-compat.h b/src/libmbim-glib/mbim-compat.h
index c3587ad..4e3f8b4 100644
--- a/src/libmbim-glib/mbim-compat.h
+++ b/src/libmbim-glib/mbim-compat.h
@@ -302,6 +302,7 @@
  * Since: 1.4
  * Deprecated: 1.30: Use mbim_sms_status_flag_build_string_from_mask() instead.
  */
+G_DEPRECATED_FOR (mbim_sms_status_flag_build_string_from_mask)
 const gchar *mbim_sms_status_flag_get_string (MbimSmsStatusFlag val);
 
 #endif /* MBIM_DISABLE_DEPRECATED */
diff --git a/src/libmbim-glib/mbim-enums.h b/src/libmbim-glib/mbim-enums.h
index b38e572..f96de0c 100644
--- a/src/libmbim-glib/mbim-enums.h
+++ b/src/libmbim-glib/mbim-enums.h
@@ -46,6 +46,7 @@
 
 /**
  * MbimCellularClass:
+ * @MBIM_CELLULAR_CLASS_NONE: None. Since 1.30.
  * @MBIM_CELLULAR_CLASS_GSM: Device is 3GPP.
  * @MBIM_CELLULAR_CLASS_CDMA: Device is 3GPP2.
  *
@@ -54,6 +55,7 @@
  * Since: 1.0
  */
 typedef enum { /*< since=1.0 >*/
+    MBIM_CELLULAR_CLASS_NONE = 0,
     MBIM_CELLULAR_CLASS_GSM  = 1 << 0,
     MBIM_CELLULAR_CLASS_CDMA = 1 << 1
 } MbimCellularClass;
@@ -78,6 +80,7 @@
 
 /**
  * MbimSimClass:
+ * @MBIM_SIM_CLASS_NONE: None. Since 1.30.
  * @MBIM_SIM_CLASS_LOGICAL: No physical SIM.
  * @MBIM_SIM_CLASS_REMOVABLE: Physical removable SIM.
  *
@@ -86,12 +89,14 @@
  * Since: 1.0
  */
 typedef enum { /*< since=1.0 >*/
+    MBIM_SIM_CLASS_NONE      = 0,
     MBIM_SIM_CLASS_LOGICAL   = 1 << 0,
     MBIM_SIM_CLASS_REMOVABLE = 1 << 1
 } MbimSimClass;
 
 /**
  * MbimDataClass:
+ * @MBIM_DATA_CLASS_NONE: None. Since 1.30.
  * @MBIM_DATA_CLASS_GPRS: GPRS.
  * @MBIM_DATA_CLASS_EDGE: EDGE.
  * @MBIM_DATA_CLASS_UMTS: UMTS.
@@ -121,6 +126,7 @@
  * Since: 1.0
  */
 typedef enum { /*< since=1.0 >*/
+    MBIM_DATA_CLASS_NONE        = 0,
     MBIM_DATA_CLASS_GPRS        = 1 << 0,
     MBIM_DATA_CLASS_EDGE        = 1 << 1,
     MBIM_DATA_CLASS_UMTS        = 1 << 2,
@@ -143,6 +149,7 @@
 
 /**
  * MbimSmsCaps:
+ * @MBIM_SMS_CAPS_NONE: None. Since 1.30.
  * @MBIM_SMS_CAPS_PDU_RECEIVE: Can receive in PDU mode.
  * @MBIM_SMS_CAPS_PDU_SEND: Can send in PDU mode.
  * @MBIM_SMS_CAPS_TEXT_RECEIVE: Can receive in text mode.
@@ -153,6 +160,7 @@
  * Since: 1.0
  */
 typedef enum { /*< since=1.0 >*/
+    MBIM_SMS_CAPS_NONE         = 0,
     MBIM_SMS_CAPS_PDU_RECEIVE  = 1 << 0,
     MBIM_SMS_CAPS_PDU_SEND     = 1 << 1,
     MBIM_SMS_CAPS_TEXT_RECEIVE = 1 << 2,
@@ -1795,6 +1803,7 @@
 
 /**
  * MbimDataClassV3:
+ * @MBIM_DATA_CLASS_V3_NONE: None. Since 1.30.
  * @MBIM_DATA_CLASS_V3_GPRS: GPRS.
  * @MBIM_DATA_CLASS_V3_EDGE: EDGE.
  * @MBIM_DATA_CLASS_V3_UMTS: UMTS.
@@ -1821,6 +1830,7 @@
  * Since: 1.28
  */
 typedef enum { /*< since=1.28 >*/
+    MBIM_DATA_CLASS_V3_NONE        = 0,
     MBIM_DATA_CLASS_V3_GPRS        = 1 << 0,
     MBIM_DATA_CLASS_V3_EDGE        = 1 << 1,
     MBIM_DATA_CLASS_V3_UMTS        = 1 << 2,
@@ -2025,6 +2035,57 @@
     MBIM_TRACE_COMMAND_FLASH_INTERVAL = 3,
 } MbimTraceCommand;
 
+/*****************************************************************************/
+/* 'Google Carrier Lock' enums */
+
+/**
+ * MbimCarrierLockStatus:
+ * @MBIM_CARRIER_LOCK_STATUS_NOT_APPLIED: Carrier lock not applied.
+ * @MBIM_CARRIER_LOCK_STATUS_APPLIED: Carrier lock applied.
+ *
+ * Status of carrier lock.
+ *
+ * Since: 1.30
+ */
+typedef enum { /*< since=1.30 >*/
+    MBIM_CARRIER_LOCK_STATUS_NOT_APPLIED = 0,
+    MBIM_CARRIER_LOCK_STATUS_APPLIED     = 1,
+} MbimCarrierLockStatus;
+
+/**
+ * MbimCarrierLockModemState:
+ * @MBIM_CARRIER_LOCK_MODEM_STATE_DEREGISTERED: Modem deregistered.
+ * @MBIM_CARRIER_LOCK_MODEM_STATE_DEREGISTRATION_IN_PROGRESS: Modem de-registration in progress.
+ * @MBIM_CARRIER_LOCK_MODEM_STATE_REGISTRATION_IN_PROGRESS: Modem registration state in progress.
+ * @MBIM_CARRIER_LOCK_MODEM_STATE_REGISTERED: Modem registered.
+ *
+ * State of modem after a carrier lock state update.
+ *
+ * Since: 1.30
+ */
+typedef enum { /*< since=1.30 >*/
+    MBIM_CARRIER_LOCK_MODEM_STATE_DEREGISTERED               = 0,
+    MBIM_CARRIER_LOCK_MODEM_STATE_DEREGISTRATION_IN_PROGRESS = 1,
+    MBIM_CARRIER_LOCK_MODEM_STATE_REGISTRATION_IN_PROGRESS   = 2,
+    MBIM_CARRIER_LOCK_MODEM_STATE_REGISTERED                 = 3,
+} MbimCarrierLockModemState;
+
+/**
+ * MbimCarrierLockCause:
+ * @MBIM_CARRIER_LOCK_CAUSE_NOT_APPLICABLE: Cause not applicable.
+ * @MBIM_CARRIER_LOCK_CAUSE_SIM_LOCK_POLICY_MISMATCH: Sim lock policy mismatch.
+ * @MBIM_CARRIER_LOCK_CAUSE_SIM_LOCK_POLICY_MATCHED: Sim lock policy matched.
+ *
+ * Carrier lock cause.
+ *
+ * Since: 1.30
+ */
+typedef enum { /*< since=1.30 >*/
+    MBIM_CARRIER_LOCK_CAUSE_NOT_APPLICABLE           = 0,
+    MBIM_CARRIER_LOCK_CAUSE_SIM_LOCK_POLICY_MISMATCH = 1,
+    MBIM_CARRIER_LOCK_CAUSE_SIM_LOCK_POLICY_MATCHED  = 2,
+} MbimCarrierLockCause;
+
 G_END_DECLS
 
 #endif /* _LIBMBIM_GLIB_MBIM_ENUMS_H_ */
diff --git a/src/libmbim-glib/mbim-errors.h b/src/libmbim-glib/mbim-errors.h
index 19e1793..7f8fc23 100644
--- a/src/libmbim-glib/mbim-errors.h
+++ b/src/libmbim-glib/mbim-errors.h
@@ -4,6 +4,7 @@
  * libmbim-glib -- GLib/GIO based library to control MBIM devices
  *
  * Copyright (C) 2013 - 2014 Aleksander Morgado <aleksander@aleksander.es>
+ * Copyright (C) 2022 Intel Corporation
  */
 
 #ifndef _LIBMBIM_GLIB_MBIM_ERRORS_H_
@@ -129,6 +130,13 @@
  * @MBIM_STATUS_ERROR_SMS_LANG_NOT_SUPPORTED: Language not supported in SMS.
  * @MBIM_STATUS_ERROR_SMS_ENCODING_NOT_SUPPORTED: Encoding not supported in SMS.
  * @MBIM_STATUS_ERROR_SMS_FORMAT_NOT_SUPPORTED: Format not supported in SMS.
+ * @MBIM_STATUS_ERROR_INVALID_SIGNATURE: Invalid signature. Defined by Google for the carrier lock operation. Since 1.30.
+ * @MBIM_STATUS_ERROR_INVALID_IMEI: Invalid IMEI. Defined by Google for the carrier lock operation. Since 1.30.
+ * @MBIM_STATUS_ERROR_INVALID_TIMESTAMP: Invalid timestamp. Defined by Google for the carrier lock operation. Since 1.30.
+ * @MBIM_STATUS_ERROR_NETWORK_LIST_TOO_LARGE: List of networks too large. Defined by Google for the carrier lock operation. Since 1.30.
+ * @MBIM_STATUS_ERROR_SIGNATURE_ALGORITHM_NOT_SUPPORTED: Signature algorithm not supported. Defined by Google for the carrier lock operation. Since 1.30.
+ * @MBIM_STATUS_ERROR_FEATURE_NOT_SUPPORTED: Feature not supported. Defined by Google for the carrier lock operation. Since 1.30.
+ * @MBIM_STATUS_ERROR_DECODE_OR_PARSING_ERROR: Decode or parsing error. Defined by Google for the carrier lock operation. Since 1.30.
  *
  * Status of the MBIM request.
  *
@@ -178,7 +186,15 @@
     MBIM_STATUS_ERROR_SMS_NETWORK_TIMEOUT              = 101, /*< nick=SmsNetworkTimeout >*/
     MBIM_STATUS_ERROR_SMS_LANG_NOT_SUPPORTED           = 102, /*< nick=SmsLangNotSupported >*/
     MBIM_STATUS_ERROR_SMS_ENCODING_NOT_SUPPORTED       = 103, /*< nick=SmsEncodingNotSupported >*/
-    MBIM_STATUS_ERROR_SMS_FORMAT_NOT_SUPPORTED         = 104  /*< nick=SmsFormatNotSupported >*/
+    MBIM_STATUS_ERROR_SMS_FORMAT_NOT_SUPPORTED         = 104, /*< nick=SmsFormatNotSupported >*/
+    /* google defined error for carrier lock */
+    MBIM_STATUS_ERROR_INVALID_SIGNATURE                 = 0x91000001, /*< nick=InvalidSignature >*/
+    MBIM_STATUS_ERROR_INVALID_IMEI                      = 0x91000002, /*< nick=InvalidImei >*/
+    MBIM_STATUS_ERROR_INVALID_TIMESTAMP                 = 0x91000003, /*< nick=InvalidTimeStamp >*/
+    MBIM_STATUS_ERROR_NETWORK_LIST_TOO_LARGE            = 0x91000004, /*< nick=NetworkListTooLarge >*/
+    MBIM_STATUS_ERROR_SIGNATURE_ALGORITHM_NOT_SUPPORTED = 0x91000005, /*< nick=SignatureAlgorithmNotSupported >*/
+    MBIM_STATUS_ERROR_FEATURE_NOT_SUPPORTED             = 0x91000006, /*< nick=FeatureNotSupported >*/
+    MBIM_STATUS_ERROR_DECODE_OR_PARSING_ERROR           = 0x91000007, /*< nick=DecodeOrParsingError >*/
 } MbimStatusError;
 
 #endif /* _LIBMBIM_GLIB_MBIM_ERRORS_H_ */
diff --git a/src/libmbim-glib/mbim-message.c b/src/libmbim-glib/mbim-message.c
index 6a362ac..edd9e55 100644
--- a/src/libmbim-glib/mbim-message.c
+++ b/src/libmbim-glib/mbim-message.c
@@ -42,6 +42,7 @@
 #include "mbim-ms-voice-extensions.h"
 #include "mbim-intel-mutual-authentication.h"
 #include "mbim-intel-tools.h"
+#include "mbim-google.h"
 
 /*****************************************************************************/
 
@@ -2210,6 +2211,9 @@
         case MBIM_SERVICE_INTEL_TOOLS:
             fields_printable = __mbim_message_intel_tools_get_printable_fields (self, line_prefix, &inner_error);
             break;
+        case MBIM_SERVICE_GOOGLE:
+            fields_printable = __mbim_message_google_get_printable_fields (self, line_prefix, &inner_error);
+            break;
         case MBIM_SERVICE_INVALID:
         case MBIM_SERVICE_LAST:
             g_assert_not_reached ();
diff --git a/src/libmbim-glib/mbim-uuid.c b/src/libmbim-glib/mbim-uuid.c
index 4c5aac9..d212831 100644
--- a/src/libmbim-glib/mbim-uuid.c
+++ b/src/libmbim-glib/mbim-uuid.c
@@ -273,6 +273,14 @@
     .e = { 0x97, 0xf2, 0x0f, 0x99, 0x4a, 0xbb }
 };
 
+static const MbimUuid uuid_google = {
+    .a = { 0x3e, 0x1e, 0x92, 0xcf },
+    .b = { 0xc5, 0x3d },
+    .c = { 0x4f, 0x14 },
+    .d = { 0x85, 0xd0 },
+    .e = { 0xa8, 0x6a, 0xd9, 0xe1, 0x22, 0x45 }
+};
+
 static GList *mbim_custom_service_list = NULL;
 
 typedef struct {
@@ -412,6 +420,8 @@
         return &uuid_intel_mutual_authentication;
     case MBIM_SERVICE_INTEL_TOOLS:
         return &uuid_intel_tools;
+    case MBIM_SERVICE_GOOGLE:
+        return &uuid_google;
     case MBIM_SERVICE_LAST:
         g_assert_not_reached ();
     default:
@@ -494,6 +504,9 @@
     if (mbim_uuid_cmp (uuid, &uuid_intel_tools))
         return MBIM_SERVICE_INTEL_TOOLS;
 
+    if (mbim_uuid_cmp (uuid, &uuid_google))
+        return MBIM_SERVICE_GOOGLE;
+
     for (l = mbim_custom_service_list; l != NULL; l = l->next) {
         if (mbim_uuid_cmp (&((MbimCustomService *)l->data)->uuid, uuid))
             return ((MbimCustomService *)l->data)->service_id;
diff --git a/src/libmbim-glib/mbim-uuid.h b/src/libmbim-glib/mbim-uuid.h
index 7bcf321..dfc26e1 100644
--- a/src/libmbim-glib/mbim-uuid.h
+++ b/src/libmbim-glib/mbim-uuid.h
@@ -116,6 +116,7 @@
  * @MBIM_SERVICE_MS_VOICE_EXTENSIONS: Microsoft Voice extensions service. Since 1.28.
  * @MBIM_SERVICE_INTEL_MUTUAL_AUTHENTICATION: Intel mutual authentication commands. Since 1.30.
  * @MBIM_SERVICE_INTEL_TOOLS: Intel tools service. Since 1.30.
+ * @MBIM_SERVICE_GOOGLE: Google specific service. Since 1.30
  * @MBIM_SERVICE_LAST: Internal value.
  *
  * Enumeration of the generic MBIM services.
@@ -146,6 +147,7 @@
     MBIM_SERVICE_MS_VOICE_EXTENSIONS         = 20,
     MBIM_SERVICE_INTEL_MUTUAL_AUTHENTICATION = 21,
     MBIM_SERVICE_INTEL_TOOLS                 = 22,
+    MBIM_SERVICE_GOOGLE        = 23,
 #if defined LIBMBIM_GLIB_COMPILATION
     MBIM_SERVICE_LAST /*< skip >*/
 #endif
@@ -371,7 +373,6 @@
  */
 #define MBIM_UUID_INTEL_THERMAL_RF mbim_uuid_from_service (MBIM_SERVICE_INTEL_THERMAL_RF)
 
-
 /**
  * MBIM_UUID_MS_VOICE_EXTENSIONS:
  *
@@ -406,6 +407,17 @@
 #define MBIM_UUID_INTEL_TOOLS mbim_uuid_from_service (MBIM_SERVICE_INTEL_TOOLS)
 
 /**
+ * MBIM_UUID_GOOGLE:
+ *
+ * Get the UUID of the %MBIM_SERVICE_GOOGLE service.
+ *
+ * Returns: (transfer none): a #MbimUuid.
+ *
+ * Since: 1.30
+ */
+#define MBIM_UUID_GOOGLE mbim_uuid_from_service (MBIM_SERVICE_GOOGLE)
+
+/**
  * mbim_service_lookup_name:
  * @service: a MbimService or custom service.
  *
diff --git a/src/libmbim-glib/test/test-message-builder.c b/src/libmbim-glib/test/test-message-builder.c
index ad16abd..bfd51d4 100644
--- a/src/libmbim-glib/test/test-message-builder.c
+++ b/src/libmbim-glib/test/test-message-builder.c
@@ -2,6 +2,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
  * Copyright (C) 2013 - 2014 Aleksander Morgado <aleksander@aleksander.es>
+ * Copyright (C) 2023 Intel Corporation
  */
 
 #include <config.h>
@@ -19,6 +20,7 @@
 #include "mbim-dss.h"
 #include "mbim-ms-host-shutdown.h"
 #include "mbim-ms-basic-connect-extensions.h"
+#include "mbim-google.h"
 
 static void
 test_message_trace (const guint8 *computed,
@@ -1771,6 +1773,70 @@
     mbim_message_unref (message);
 }
 
+static void
+test_google_carrier_lock_set (void)
+{
+    g_autoptr(GError)      error = NULL;
+    g_autoptr(MbimMessage) message = NULL;
+
+    const guint8 expected_message [] = {
+        /* header */
+        0x03, 0x00, 0x00, 0x00, /* type */
+        0x40, 0x00, 0x00, 0x00, /* length */
+        0x01, 0x00, 0x00, 0x00, /* transaction id */
+        /* fragment header */
+        0x01, 0x00, 0x00, 0x00, /* total */
+        0x00, 0x00, 0x00, 0x00, /* current */
+        /* command_message */
+        0x3E, 0x1E, 0x92, 0xCF, /* service id */
+        0xC5, 0x3D, 0x4F, 0x14,
+        0x85, 0xD0, 0xA8, 0x6A,
+        0xD9, 0xE1, 0x22, 0x45,
+        0x01, 0x00, 0x00, 0x00, /* command id */
+        0x01, 0x00, 0x00, 0x00, /* command type */
+        0x10, 0x00, 0x00, 0x00, /* buffer length */
+        /* information buffer */
+        0x0A, 0x00, 0x00, 0x00, /* data buffer */
+        0x56, 0x24, 0x46, 0x95,
+        0xAB, 0xCD, 0x25, 0x59,
+        0x14, 0x35, 0x00, 0x00,
+    };
+
+    const guint8 data [] = {
+        0x56, 0x24, 0x46, 0x95,
+        0xAB, 0xCD, 0x25, 0x59,
+        0x14, 0x35,
+    };
+    message = mbim_message_google_carrier_lock_set_new (
+                  sizeof (data),
+                  data,
+                  &error);
+
+    g_assert_no_error (error);
+    g_assert (message != NULL);
+    g_assert (mbim_message_validate (message, &error));
+
+    mbim_message_set_transaction_id (message, 1);
+
+    test_message_trace ((const guint8 *)((GByteArray *)message)->data,
+                        ((GByteArray *)message)->len,
+                        expected_message,
+                        sizeof (expected_message));
+
+    g_assert_cmpuint (mbim_message_get_transaction_id (message), ==, 1);
+    g_assert_cmpuint (mbim_message_get_message_type   (message), ==, MBIM_MESSAGE_TYPE_COMMAND);
+    g_assert_cmpuint (mbim_message_get_message_length (message), ==, sizeof (expected_message));
+
+    g_assert_cmpuint (mbim_message_command_get_service      (message), ==, MBIM_SERVICE_GOOGLE);
+    g_assert_cmpuint (mbim_message_command_get_cid          (message), ==, MBIM_CID_GOOGLE_CARRIER_LOCK);
+    g_assert_cmpuint (mbim_message_command_get_command_type (message), ==, MBIM_MESSAGE_COMMAND_TYPE_SET);
+
+    g_assert_cmpuint (((GByteArray *)message)->len, ==, sizeof (expected_message));
+    g_assert (memcmp (((GByteArray *)message)->data, expected_message, sizeof (expected_message)) == 0);
+
+    test_message_printable (message, 1, 0);
+}
+
 int main (int argc, char **argv)
 {
     g_test_init (&argc, &argv, NULL);
@@ -1798,6 +1864,7 @@
     g_test_add_func (PREFIX "/ms-basic-connect-extensions/registration-parameters/set/1-unnamed-tlv", test_ms_basic_connect_extensions_registration_parameters_set_1_unnamed_tlv);
     g_test_add_func (PREFIX "/ms-basic-connect-extensions/registration-parameters/set/3-unnamed-tlvs", test_ms_basic_connect_extensions_registration_parameters_set_3_unnamed_tlvs);
     g_test_add_func (PREFIX "/ms-basic-connect-v3/connect/set", test_ms_basic_connect_v3_connect_set);
+    g_test_add_func (PREFIX "/google/carrier-lock/set", test_google_carrier_lock_set);
 
 #undef PREFIX
 
diff --git a/src/libmbim-glib/test/test-message-parser.c b/src/libmbim-glib/test/test-message-parser.c
index e13d94f..e30aecd 100644
--- a/src/libmbim-glib/test/test-message-parser.c
+++ b/src/libmbim-glib/test/test-message-parser.c
@@ -15,6 +15,7 @@
 #include "mbim-ms-firmware-id.h"
 #include "mbim-ms-basic-connect-extensions.h"
 #include "mbim-ms-uicc-low-level-access.h"
+#include "mbim-google.h"
 #include "mbim-message.h"
 #include "mbim-tlv.h"
 #include "mbim-cid.h"
@@ -2141,7 +2142,7 @@
     g_autoptr(MbimMessage)                         response = NULL;
     gboolean                                       result;
     MbimDataClass                                  system_type;
-	g_autoptr(MbimCellInfoServingGsm)              gsm_serving_cell = NULL;
+    g_autoptr(MbimCellInfoServingGsm)              gsm_serving_cell = NULL;
     g_autoptr(MbimCellInfoServingUmts)             umts_serving_cell = NULL;
     g_autoptr(MbimCellInfoServingTdscdma)          tdscdma_serving_cell = NULL;
     g_autoptr(MbimCellInfoServingLte)              lte_serving_cell = NULL;
@@ -3392,6 +3393,109 @@
     g_assert (memcmp (applications[0]->pin_key_references, expected_pin_key_references, sizeof (expected_pin_key_references)) == 0);
 }
 
+static void
+test_google_carrier_lock (void)
+{
+    g_autoptr(GError)         error = NULL;
+    g_autoptr(MbimMessage)    response = NULL;
+    gboolean                  result;
+    MbimCarrierLockStatus     carrier_lock_status;
+    MbimCarrierLockModemState modem_state;
+    MbimCarrierLockCause      carrier_lock_cause;
+
+    const guint8 buffer [] =  {
+        /* header */
+        0x03, 0x00, 0x00, 0x80, /* type */
+        0x3C, 0x00, 0x00, 0x00, /* length */
+        0x03, 0x00, 0x00, 0x00, /* transaction id */
+        /* fragment header */
+        0x01, 0x00, 0x00, 0x00, /* total */
+        0x00, 0x00, 0x00, 0x00, /* current */
+        /* command_done message */
+        0x3E, 0x1E, 0x92, 0xCF, /* service id */
+        0xC5, 0x3D, 0x4F, 0x14,
+        0x85, 0xD0, 0xA8, 0x6A,
+        0xD9, 0xE1, 0x22, 0x45,
+        0x01, 0x00, 0x00, 0x00, /* command id */
+        0x00, 0x00, 0x00, 0x00, /* status code */
+        0x0C, 0x00, 0x00, 0x00, /* buffer length */
+        /* information buffer */
+        0x01, 0x00, 0x00, 0x00, /* carrier lock status*/
+        0x00, 0x00, 0x00, 0x00, /* modem state */
+        0x00, 0x00, 0x00, 0x00, /* carrier lock cause */
+    };
+
+    response = mbim_message_new (buffer, sizeof (buffer));
+    g_assert (mbim_message_validate (response, &error));
+    g_assert_no_error (error);
+
+    test_message_printable (response, 1, 0);
+
+    result = mbim_message_google_carrier_lock_response_parse (
+                 response,
+                 &carrier_lock_status,
+                 &modem_state,
+                 &carrier_lock_cause,
+                 &error);
+    g_assert_no_error (error);
+    g_assert (result);
+
+    g_assert_cmpuint (carrier_lock_status, ==, MBIM_CARRIER_LOCK_STATUS_APPLIED);
+    g_assert_cmpuint (modem_state, ==, MBIM_CARRIER_LOCK_MODEM_STATE_DEREGISTERED);
+    g_assert_cmpuint (carrier_lock_cause, ==, MBIM_CARRIER_LOCK_CAUSE_NOT_APPLICABLE);
+}
+
+static void
+test_google_carrier_lock_notification (void)
+{
+    g_autoptr(GError)         error = NULL;
+    g_autoptr(MbimMessage)    response = NULL;
+    gboolean                  result;
+    MbimCarrierLockStatus     carrier_lock_status;
+    MbimCarrierLockModemState modem_state;
+    MbimCarrierLockCause      carrier_lock_cause;
+
+    const guint8 buffer [] =  {
+        /* header */
+        0x07, 0x00, 0x00, 0x80, /* type */
+        0x38, 0x00, 0x00, 0x00, /* length */
+        0x03, 0x00, 0x00, 0x00, /* transaction id */
+        /* fragment header */
+        0x01, 0x00, 0x00, 0x00, /* total */
+        0x00, 0x00, 0x00, 0x00, /* current */
+        /* command_done message */
+        0x3E, 0x1E, 0x92, 0xCF, /* service id */
+        0xC5, 0x3D, 0x4F, 0x14,
+        0x85, 0xD0, 0xA8, 0x6A,
+        0xD9, 0xE1, 0x22, 0x45,
+        0x01, 0x00, 0x00, 0x00, /* command id */
+        0x0C, 0x00, 0x00, 0x00, /* buffer length */
+        /* information buffer */
+        0x01, 0x00, 0x00, 0x00, /* carrier lock status */
+        0x00, 0x00, 0x00, 0x00, /* modem state */
+        0x00, 0x00, 0x00, 0x00, /* carrier lock cause */
+    };
+
+    response = mbim_message_new (buffer, sizeof (buffer));
+    g_assert (mbim_message_validate (response, &error));
+    g_assert_no_error (error);
+
+    test_message_printable (response, 1, 0);
+
+    result = mbim_message_google_carrier_lock_notification_parse (
+                 response,
+                 &carrier_lock_status,
+                 &modem_state,
+                 &carrier_lock_cause,
+                 &error);
+    g_assert_no_error (error);
+    g_assert (result);
+
+    g_assert_cmpuint (carrier_lock_status, ==, MBIM_CARRIER_LOCK_STATUS_APPLIED);
+    g_assert_cmpuint (modem_state, ==, MBIM_CARRIER_LOCK_MODEM_STATE_DEREGISTERED);
+    g_assert_cmpuint (carrier_lock_cause, ==, MBIM_CARRIER_LOCK_CAUSE_NOT_APPLICABLE);
+}
+
 int main (int argc, char **argv)
 {
     g_test_init (&argc, &argv, NULL);
@@ -3434,6 +3538,8 @@
     g_test_add_func (PREFIX "/basic-connect-extensions/wake-reason/command/payload", test_ms_basic_connect_extensions_wake_reason_command_payload);
     g_test_add_func (PREFIX "/basic-connect-extensions/wake-reason/packet", test_ms_basic_connect_extensions_wake_reason_packet);
     g_test_add_func (PREFIX "/ms-uicc-low-level-access/application-list", test_ms_uicc_low_level_access_application_list);
+    g_test_add_func (PREFIX "/google/carrier-lock-response", test_google_carrier_lock);
+    g_test_add_func (PREFIX "/google/carrier-lock-notify", test_google_carrier_lock_notification);
 
 #undef PREFIX
 
diff --git a/src/mbim-proxy/mbim-proxy.c b/src/mbim-proxy/mbim-proxy.c
index 955e630..fb3a556 100644
--- a/src/mbim-proxy/mbim-proxy.c
+++ b/src/mbim-proxy/mbim-proxy.c
@@ -3,7 +3,7 @@
 /*
  * mbim-proxy -- A proxy to communicate with MBIM ports
  *
- * Copyright (C) 2014 Aleksander Morgado <aleksander@gnu.org>
+ * Copyright (C) 2014-2023 Aleksander Morgado <aleksander@aleksander.es>
  * Copyright (C) 2014 Smith Micro Software, Inc.
  */
 
@@ -134,7 +134,7 @@
 {
     g_print ("\n"
              PROGRAM_NAME " " PROGRAM_VERSION "\n"
-             "Copyright (C) 2013-2021 Aleksander Morgado\n"
+             "Copyright (C) 2013-2023 Aleksander Morgado\n"
              "Copyright (C) 2014-2018 Greg Suarez\n"
              "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>\n"
              "This is free software: you are free to change and redistribute it.\n"
diff --git a/src/mbimcli/mbimcli-google.c b/src/mbimcli/mbimcli-google.c
new file mode 100644
index 0000000..69948d6
--- /dev/null
+++ b/src/mbimcli/mbimcli-google.c
@@ -0,0 +1,230 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * mbimcli -- Command line interface to control MBIM devices
+ *
+ * Copyright (C) 2023 Intel Corporation
+ */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <locale.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gio/gio.h>
+
+#include <libmbim-glib.h>
+
+#include "mbimcli.h"
+#include "mbimcli-helpers.h"
+
+/* Context */
+typedef struct {
+    MbimDevice   *device;
+    GCancellable *cancellable;
+} Context;
+static Context *ctx;
+
+/* Options */
+static gchar    *set_carrier_lock_str;
+static gboolean  query_carrier_lock_flag;
+
+static GOptionEntry entries[] = {
+    { "google-set-carrier-lock", 0, 0, G_OPTION_ARG_STRING, &set_carrier_lock_str,
+      "Set Google Carrier Lock",
+      "[(Data)]"
+    },
+    { "google-query-carrier-lock", 0, 0, G_OPTION_ARG_NONE, &query_carrier_lock_flag,
+      "Query Google Carrier Lock",
+      NULL
+    },
+    { NULL }
+};
+
+GOptionGroup *
+mbimcli_google_get_option_group (void)
+{
+    GOptionGroup *group;
+
+    group = g_option_group_new ("google",
+                                "Google options:",
+                                "Show Google Service options",
+                                NULL,
+                                NULL);
+    g_option_group_add_entries (group, entries);
+
+    return group;
+}
+
+gboolean
+mbimcli_google_options_enabled (void)
+{
+    static guint    n_actions = 0;
+    static gboolean checked = FALSE;
+
+    if (checked)
+        return !!n_actions;
+
+    n_actions = (!!set_carrier_lock_str +
+                 query_carrier_lock_flag);
+
+    if (n_actions > 1) {
+        g_printerr ("error: too many google actions requested\n");
+        exit (EXIT_FAILURE);
+    }
+
+    checked = TRUE;
+    return !!n_actions;
+}
+
+static void
+context_free (Context *context)
+{
+    if (!context)
+        return;
+
+    if (context->cancellable)
+        g_object_unref (context->cancellable);
+    if (context->device)
+        g_object_unref (context->device);
+    g_slice_free (Context, context);
+}
+
+static void
+shutdown (gboolean operation_status)
+{
+    /* Cleanup context and finish async operation */
+    context_free (ctx);
+    mbimcli_async_operation_done (operation_status);
+}
+
+static void
+set_carrier_lock_ready (MbimDevice   *device,
+                        GAsyncResult *res)
+{
+    g_autoptr(MbimMessage)  response = NULL;
+    g_autoptr(GError)       error = NULL;
+
+    response = mbim_device_command_finish (device, res, &error);
+    if (!response || !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) {
+        g_printerr ("error: operation failed: %s\n", error->message);
+        shutdown (FALSE);
+        return;
+    }
+
+    g_print ("[%s] Successfully set carrier lock: \n",
+             mbim_device_get_path_display (device));
+
+    shutdown (TRUE);
+}
+
+static void
+query_carrier_lock_ready (MbimDevice   *device,
+                          GAsyncResult *res)
+{
+    g_autoptr(MbimMessage)     response = NULL;
+    g_autoptr(GError)          error = NULL;
+    const gchar               *carrier_lock_status_str;
+    const gchar               *carrier_lock_modem_state_str;
+    const gchar               *carrier_lock_cause_str;
+    MbimCarrierLockStatus      carrier_lock_status;
+    MbimCarrierLockModemState  carrier_lock_modem_state;
+    MbimCarrierLockCause       carrier_lock_cause;
+
+    response = mbim_device_command_finish (device, res, &error);
+    if (!response || !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) {
+        g_printerr ("error: operation failed: %s\n", error->message);
+        shutdown (FALSE);
+        return;
+    }
+
+    if (!mbim_message_google_carrier_lock_response_parse (
+            response,
+            &carrier_lock_status,
+            &carrier_lock_modem_state,
+            &carrier_lock_cause,
+            &error)) {
+        g_printerr ("error: couldn't parse response message: %s\n", error->message);
+        return;
+    }
+
+    carrier_lock_status_str      = mbim_carrier_lock_status_get_string (carrier_lock_status);
+    carrier_lock_modem_state_str = mbim_carrier_lock_modem_state_get_string (carrier_lock_modem_state);
+    carrier_lock_cause_str       = mbim_carrier_lock_cause_get_string (carrier_lock_cause);
+
+    g_print ("[%s] Successfully queried carrier lock: \n"
+             "\t     Carrier lock status: '%s'\n"
+             "\tCarrier lock modem state: '%s'\n"
+             "\t      Carrier lock cause: '%s'\n",
+             mbim_device_get_path_display (device),
+             VALIDATE_UNKNOWN (carrier_lock_status_str),
+             VALIDATE_UNKNOWN (carrier_lock_modem_state_str),
+             VALIDATE_UNKNOWN (carrier_lock_cause_str));
+
+    shutdown (TRUE);
+}
+
+void
+mbimcli_google_run (MbimDevice   *device,
+                    GCancellable *cancellable)
+{
+    g_autoptr(MbimMessage) request = NULL;
+    g_autoptr(GError)      error = NULL;
+
+    /* Initialize context */
+    ctx = g_slice_new (Context);
+    ctx->device = g_object_ref (device);
+    ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
+
+    /* Request to set carrier lock */
+    if (set_carrier_lock_str) {
+        gsize               data_size = 0;
+        g_autofree guint8  *data      = NULL;
+
+        data = mbimcli_read_buffer_from_string (set_carrier_lock_str, -1, &data_size, &error);
+        if (!data) {
+            g_printerr ("Failed to read data: %s\n", error->message);
+            shutdown (FALSE);
+            return;
+        }
+
+        g_debug ("Asynchronously setting carrier lock...");
+        request = mbim_message_google_carrier_lock_set_new ((guint32)data_size, data, &error);
+        if (!request) {
+            g_printerr ("error: couldn't create request: %s\n", error->message);
+            shutdown (FALSE);
+            return;
+        }
+
+        mbim_device_command (ctx->device,
+                             request,
+                             10,
+                             ctx->cancellable,
+                             (GAsyncReadyCallback)set_carrier_lock_ready,
+                             NULL);
+        return;
+    }
+
+    /* Query carrier lock information */
+    if (query_carrier_lock_flag) {
+        request = mbim_message_google_carrier_lock_query_new (&error);
+        if (!request) {
+            g_printerr ("error: couldn't create request: %s\n", error->message);
+            shutdown (FALSE);
+            return;
+        }
+
+        mbim_device_command (ctx->device,
+                             request,
+                             10,
+                             ctx->cancellable,
+                             (GAsyncReadyCallback)query_carrier_lock_ready,
+                             NULL);
+        return;
+    }
+
+    g_warn_if_reached ();
+}
diff --git a/src/mbimcli/mbimcli-ms-basic-connect-extensions.c b/src/mbimcli/mbimcli-ms-basic-connect-extensions.c
index 89e5902..ae83e8f 100644
--- a/src/mbimcli/mbimcli-ms-basic-connect-extensions.c
+++ b/src/mbimcli/mbimcli-ms-basic-connect-extensions.c
@@ -479,23 +479,23 @@
 {
     g_autoptr(MbimMessage)  response = NULL;
     g_autoptr(GError)       error = NULL;
-    MbimDeviceType          device_type;
-    const gchar            *device_type_str;
-    MbimVoiceClass          voice_class;
-    const gchar            *voice_class_str;
-    MbimCellularClass       cellular_class;
+    MbimDeviceType          device_type = MBIM_DEVICE_TYPE_UNKNOWN;
+    const gchar            *device_type_str = NULL;
+    MbimVoiceClass          voice_class = MBIM_VOICE_CLASS_UNKNOWN;
+    const gchar            *voice_class_str = NULL;
+    MbimCellularClass       cellular_class = MBIM_CELLULAR_CLASS_NONE;
     g_autofree gchar       *cellular_class_str = NULL;
-    MbimSimClass            sim_class;
+    MbimSimClass            sim_class = MBIM_SIM_CLASS_NONE;
     g_autofree gchar       *sim_class_str = NULL;
-    MbimDataClass           data_class = 0;
-    MbimDataClassV3         data_class_v3 = 0;
+    MbimDataClass           data_class = MBIM_DATA_CLASS_NONE;
+    MbimDataClassV3         data_class_v3 = MBIM_DATA_CLASS_V3_NONE;
     g_autofree gchar       *data_class_str = NULL;
-    MbimDataSubclass        data_subclass;
-    MbimSmsCaps             sms_caps;
+    MbimDataSubclass        data_subclass = MBIM_DATA_SUBCLASS_NONE;
+    MbimSmsCaps             sms_caps = MBIM_SMS_CAPS_NONE;
     g_autofree gchar       *sms_caps_str = NULL;
-    MbimCtrlCaps            ctrl_caps;
+    MbimCtrlCaps            ctrl_caps = MBIM_CTRL_CAPS_NONE;
     g_autofree gchar       *ctrl_caps_str = NULL;
-    guint32                 max_sessions;
+    guint32                 max_sessions = 0;
     guint32                 wcdma_band_class = 0;
     guint32                 lte_band_class_array_size = 0;
     g_autofree guint16     *lte_band_class_array = NULL;
@@ -505,7 +505,7 @@
     g_autofree gchar       *device_id = NULL;
     g_autofree gchar       *firmware_info = NULL;
     g_autofree gchar       *hardware_info = NULL;
-    guint32                 executor_index;
+    guint32                 executor_index = 0;
 
     response = mbim_device_command_finish(device, res, &error);
     if (!response || !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) {
diff --git a/src/mbimcli/mbimcli.c b/src/mbimcli/mbimcli.c
index f059b7b..e2e929e 100644
--- a/src/mbimcli/mbimcli.c
+++ b/src/mbimcli/mbimcli.c
@@ -3,7 +3,7 @@
 /*
  * mbimcli -- Command line interface to control MBIM devices
  *
- * Copyright (C) 2013 - 2014 Aleksander Morgado <aleksander@aleksander.es>
+ * Copyright (C) 2013 - 2023 Aleksander Morgado <aleksander@aleksander.es>
  * Copyright (C) 2022 Intel Corporation
  */
 
@@ -182,7 +182,7 @@
 print_version_and_exit (void)
 {
     g_print (PROGRAM_NAME " " PROGRAM_VERSION "\n"
-             "Copyright (C) 2013-2021 Aleksander Morgado\n"
+             "Copyright (C) 2013-2023 Aleksander Morgado\n"
              "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>\n"
              "This is free software: you are free to change and redistribute it.\n"
              "There is NO WARRANTY, to the extent permitted by law.\n"
@@ -315,6 +315,9 @@
     case MBIM_SERVICE_INTEL_MUTUAL_AUTHENTICATION:
         mbimcli_intel_mutual_authentication_run (dev, cancellable);
         return;
+    case MBIM_SERVICE_GOOGLE:
+        mbimcli_google_run (dev, cancellable);
+        return;
     case MBIM_SERVICE_SMS:
     case MBIM_SERVICE_USSD:
     case MBIM_SERVICE_STK:
@@ -464,6 +467,11 @@
         actions_enabled++;
     }
 
+    if (mbimcli_google_options_enabled ()) {
+        service = MBIM_SERVICE_GOOGLE;
+        actions_enabled++;
+    }
+
     /* Noop */
     if (noop_flag)
         actions_enabled++;
@@ -514,6 +522,7 @@
     g_option_context_add_group (context, mbimcli_ms_uicc_low_level_access_get_option_group ());
     g_option_context_add_group (context, mbimcli_intel_mutual_authentication_get_option_group ());
     g_option_context_add_group (context, mbimcli_intel_tools_get_option_group ());
+    g_option_context_add_group (context, mbimcli_google_get_option_group());
     g_option_context_add_main_entries (context, main_entries, NULL);
     if (!g_option_context_parse (context, &argc, &argv, &error)) {
         g_printerr ("error: %s\n", error->message);
diff --git a/src/mbimcli/mbimcli.h b/src/mbimcli/mbimcli.h
index 0989106..7bd23b6 100644
--- a/src/mbimcli/mbimcli.h
+++ b/src/mbimcli/mbimcli.h
@@ -33,6 +33,7 @@
 GOptionGroup *mbimcli_ms_uicc_low_level_access_get_option_group    (void);
 GOptionGroup *mbimcli_intel_mutual_authentication_get_option_group (void);
 GOptionGroup *mbimcli_intel_tools_get_option_group                 (void);
+GOptionGroup *mbimcli_google_get_option_group                      (void);
 
 gboolean      mbimcli_basic_connect_options_enabled               (void);
 gboolean      mbimcli_phonebook_options_enabled                   (void);
@@ -49,6 +50,7 @@
 gboolean      mbimcli_ms_uicc_low_level_access_options_enabled    (void);
 gboolean      mbimcli_intel_mutual_authentication_options_enabled (void);
 gboolean      mbimcli_intel_tools_options_enabled                 (void);
+gboolean      mbimcli_google_options_enabled                      (void);
 
 void          mbimcli_basic_connect_run                 (MbimDevice   *device,
                                                          GCancellable *cancellable);
@@ -80,6 +82,8 @@
                                                          GCancellable *cancellable);
 void          mbimcli_intel_tools_run                   (MbimDevice   *device,
                                                          GCancellable *cancellable);
+void          mbimcli_google_run                        (MbimDevice   *device,
+                                                         GCancellable *cancellable);
 
 
 /* link management */
diff --git a/src/mbimcli/meson.build b/src/mbimcli/meson.build
index ae659cb..9dc8cc3 100644
--- a/src/mbimcli/meson.build
+++ b/src/mbimcli/meson.build
@@ -10,6 +10,7 @@
   'mbimcli-intel-thermal-rf.c',
   'mbimcli-ms-basic-connect-extensions.c',
   'mbimcli-ms-firmware-id.c',
+  'mbimcli-google.c',
   'mbimcli-ms-host-shutdown.c',
   'mbimcli-ms-sar.c',
   'mbimcli-ms-uicc-low-level-access.c',