Commit 9a38b001 authored by Michael Sun's avatar Michael Sun Committed by Commit Bot

[Bluetooth] Treat connection failure as non-fatal error and omit dialog

Stop displaying the dialog window when user initiated connection failed.
If the device status changing from "Not Connect" to "Connecting" and
then to "Not Connected", it is very clear to the user that previously
initiated connection was not succeeded. Displaying a pop-up dialog
showing connection failed is disturbing and unnecessary since a failure
notification is shown.

BUG=b/147671276

Change-Id: I2a27ea6c14225dd8cd0249559dda3228d1ec0f00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031600
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Auto-Submit: Michael Sun <michaelfsun@google.com>
Cr-Commit-Position: refs/heads/master@{#742273}
parent a9570cae
...@@ -184,6 +184,13 @@ Polymer({ ...@@ -184,6 +184,13 @@ Polymer({
// Attempting to connect and pair has failed. Remove listeners. // Attempting to connect and pair has failed. Remove listeners.
this.endPairing(); this.endPairing();
if (!wasPairing && !this.getDialog_().open &&
(result === chrome.bluetoothPrivate.ConnectResultType.FAILED)) {
// Inform the caller to not open the dialog; the user is informed by
// other UI that the connection failed.
return false;
}
const name = device.name || device.address; const name = device.name || device.address;
let id = 'bluetooth_connect_' + error; let id = 'bluetooth_connect_' + error;
if (!this.i18nExists(id)) { if (!this.i18nExists(id)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment