Commit 1e8d3cf5 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Always start brltty on ChromeVox load

Recently, the way in which brltty launches for usb changed. Previously, when a
display plugs in via usb, a udev rule triggers a shell script.  Now, the udev
rule triggers a pre-existing Upstart job which triggers the original shell
script.
https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1869773

The pre-existing Upstart job had been used to launch brltty for bluetooth and
provided programmatic start/stop via dbus from Chrome client code.

As of the above change, there now exists a scenario in which Chrome client code
might stop brltty but not re-start it.

1. plug in a usb display. This triggers udev -> start the Upstart job
which correctly launches brltty.
2. toggle off ChromeVox. (this triggers a stop on the Upstart job).
3. toggle back on ChromeVox. (no action occurs from either udev or
Chrome).

result:
no re-start occurs.

This used to work because in 1, we directly launched brltty via a shell
script. In 2, we stopped the Upstart job, which was never started. In 3, brltty
is still around and never lost its connection to the display.

The fix is to always start the Upstart job in 3.

Bug: 1020394
Change-Id: Ied46d71852e97c750573fe0e79f03a2d2feabe3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893930Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711782}
parent d897e236
...@@ -1343,10 +1343,18 @@ void AccessibilityManager::PostLoadChromeVox() { ...@@ -1343,10 +1343,18 @@ void AccessibilityManager::PostLoadChromeVox() {
return; return;
// Do any setup work needed immediately after ChromeVox actually loads. // Do any setup work needed immediately after ChromeVox actually loads.
// Maybe start brltty, if we have a bluetooth device stored for connection.
const std::string& address = GetBluetoothBrailleDisplayAddress(); const std::string& address = GetBluetoothBrailleDisplayAddress();
if (!address.empty()) if (!address.empty()) {
// Maybe start brltty, when we have a bluetooth device stored for
// connection.
RestartBrltty(address); RestartBrltty(address);
} else {
// Otherwise, start brltty without an address. This covers cases when
// ChromeVox is toggled off then back on all while a usb braille display is
// connected.
chromeos::UpstartClient::Get()->StartJob(kBrlttyUpstartJobName, {},
EmptyVoidDBusMethodCallback());
}
PlayEarcon(SOUND_SPOKEN_FEEDBACK_ENABLED, PlaySoundOption::ALWAYS); PlayEarcon(SOUND_SPOKEN_FEEDBACK_ENABLED, PlaySoundOption::ALWAYS);
......
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