Browse Source

fix: `serial-port-added` should respect filters (#41637)

fix: serial-port-added should respect filters

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
trop[bot] 1 year ago
parent
commit
c2184ad4ff
1 changed files with 3 additions and 0 deletions
  1. 3 0
      shell/browser/serial/serial_chooser_controller.cc

+ 3 - 0
shell/browser/serial/serial_chooser_controller.cc

@@ -93,6 +93,9 @@ api::Session* SerialChooserController::GetSession() {
 
 void SerialChooserController::OnPortAdded(
     const device::mojom::SerialPortInfo& port) {
+  if (!FilterMatchesAny(port))
+    return;
+
   ports_.push_back(port.Clone());
   api::Session* session = GetSession();
   if (session) {