plugin: let vendor/product filter be complementary

So that a plugin can specify a full VID and a specific PID subset of another VID
as supported.
This commit is contained in:
Aleksander Morgado
2015-02-06 18:38:32 +01:00
parent b115945399
commit 51ab292802

View File

@@ -308,6 +308,14 @@ apply_pre_probing_filters (MMPlugin *self,
if (!self->priv->product_ids[i].l)
product_filtered = TRUE;
}
/* When both vendor ids and product ids are given, it may be the case that
* we're allowing a full VID1 and only a subset of another VID2, so try to
* handle that properly. */
if (vendor_filtered && !product_filtered)
vendor_filtered = FALSE;
if (product_filtered && self->priv->vendor_ids && !vendor_filtered)
product_filtered = FALSE;
}
/* If we got filtered by vendor or product IDs; mark it as unsupported only if: