aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin-base.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-plugin-base.c')
-rw-r--r--src/mm-plugin-base.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c
index 80d0f904..b34ec50a 100644
--- a/src/mm-plugin-base.c
+++ b/src/mm-plugin-base.c
@@ -890,8 +890,8 @@ mm_plugin_base_get_device_ids (MMPluginBase *self,
guint16 *product)
{
MMPluginBasePrivate *priv;
- GUdevDevice *device = NULL;
- const char *vid, *pid;
+ GUdevDevice *device = NULL, *parent = NULL;
+ const char *vid, *pid, *parent_subsys;
gboolean success = FALSE;
g_return_val_if_fail (self != NULL, FALSE);
@@ -909,6 +909,18 @@ mm_plugin_base_get_device_ids (MMPluginBase *self,
if (!device)
goto out;
+ /* Bluetooth devices report the VID/PID of the BT adapter here, which
+ * isn't really what we want. Just return null IDs instead.
+ */
+ parent = g_udev_device_get_parent (device);
+ if (parent) {
+ parent_subsys = g_udev_device_get_subsystem (parent);
+ if (parent_subsys && !strcmp (parent_subsys, "bluetooth")) {
+ success = TRUE;
+ goto out;
+ }
+ }
+
vid = g_udev_device_get_property (device, "ID_VENDOR_ID");
if (!vid || (strlen (vid) != 4))
goto out;
@@ -934,6 +946,8 @@ mm_plugin_base_get_device_ids (MMPluginBase *self,
out:
if (device)
g_object_unref (device);
+ if (parent)
+ g_object_unref (parent);
return success;
}