mash: Move update-over-cellular UI code into //ash from SystemTrayDelegateChromeOS |
||||||
Issue descriptionThis is necessary to support go/mustash. I think the right thing to do is to make the ash process to have a dbus UpdateEngineClient like Chrome does. It can use this to read the update state. See issue 644362 If that isn't possible, add mojo methods to ash/public/interfaces/system_tray.mojom so code in chrome can send IPCs to ash to control the update-over-cellular UI state. References: https://codereview.chromium.org/2881473002 https://codereview.chromium.org/2933923002 https://chromium-review.googlesource.com/c/479467/ go/cros-cellular-updates
,
Jul 19 2017
I think we're going to need to add a mojo method to system_tray.mojom. update_engine doesn't broadcast signals for some of the cellular-download state changes, so it's hard to have multiple dbus clients listen to them. It looks like this code is only used to hide a row in the system tray menu when the user responds to the "do you want to download over cellular" webui dialog. (Does the row always go away, or only if the user says no? Says yes?) It might be possible to change mojom::SystemTray::ShowUpdateOverCellularAvailableIcon() to take a "bool visible" parameter, but I'm not sure if calling that with false is semantically equivalent to OnUpdateOverCellularTargetSet(true).
,
Jul 19 2017
Right now, SystemTrayDelegateChromeOS is an observer of UpdateEngineClient. And it triggers the icon disappear in OnUpdateOverCellularTargetSet. I could make a change using the same path as update icon shows up in system tray instead. Old path: UpdateEngineClient -> SystemTrayDelegateChromeOS::OnUpdateOverCellularTargetSet -> SystemTrayNotifier::NotifyUpdateOverCellularTargetSet -> TrayUpdate::OnUpdateOverCellularTargetSet New path: UpdateEngineClient -> UpgradeDetectorChromeos::OnUpdateOverCellularTargetSet -> SystemTrayClient::NotifyUpdateOverCellularTargetSet -> mojom::SystemTray::ShowUpdateOverCellularAvailableIcon(false) -> TrayUpdate::ShowUpdateOverCellularAvailableIcon(false) Does that make sense?
,
Jul 19 2017
I'll have a draft CL available soon.
,
Jul 19 2017
,
Jul 19 2017
Draft CL available at https://chromium-review.googlesource.com/578062 Feel free to take over that CL, or throw it away and do something different. The important part is eliminating the code in SystemTrayDelegateChromeOS and only sending data to ash over mojo. Your approach in comment #3 sounds reasonable. You'll need to be sure ShowUpdateOverCellularAvailableIcon(false) is what you want. I don't know if we want the tray icon to disappear while downloading the update, or just to hide the row in the menu. Since I don't have a good way to test this feature on a device I don't know how it behaves in production.
,
Jul 19 2017
Ok, I would take over the CL and implement the approach in #3. The tray icon disappears when a setting is successfully enabled in Update Engine. So It should be before downloading begins. Thanks.
,
Jul 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8f8b70016a2958cc84e4f10cfe53e193be61cc37 commit 8f8b70016a2958cc84e4f10cfe53e193be61cc37 Author: Weidong Guo <weidongg@chromium.org> Date: Fri Jul 28 19:37:02 2017 cros: Support update-over-cellular for mash For go/mustash code in chrome browser and code in ash run in separate processes, so code in chrome must use mojo interfaces to send data to ash. Migrate update-over-cellular code from SystemTrayDelegateChromeOS (where it calls directly into ash) to SystemTrayClient (which uses mojo). Eliminate some layers of observers in ash. Change FakeUpdateEngineClient to support testing cellular updates. Add test coverage. BUG= 746574 , 745975 TEST=SystemTrayClientTest.CellularUpdateTrayIcon Change-Id: I9a908e08011fed08204ba7fdea31a27d00a7e552 Reviewed-on: https://chromium-review.googlesource.com/583558 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: James Cook <jamescook@chromium.org> Reviewed-by: Michael Wasserman <msw@chromium.org> Reviewed-by: Steven Bennetts <stevenjb@chromium.org> Commit-Queue: Weidong Guo <weidongg@chromium.org> Cr-Commit-Position: refs/heads/master@{#490487} [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/ash/public/interfaces/system_tray.mojom [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/ash/system/tray/system_tray_controller.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/ash/system/tray/system_tray_controller.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/ash/system/tray/system_tray_notifier.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/ash/system/tray/system_tray_notifier.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/ash/system/update/tray_update.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/ash/system/update/tray_update.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/ash/system/update/tray_update_unittest.cc [delete] https://crrev.com/889b291c4123f1e38f49327aa67026b894964d83/ash/system/update/update_observer.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/chromeos/upgrade_detector_chromeos.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/chromeos/upgrade_detector_chromeos.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/ui/ash/system_tray_client.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/ui/ash/system_tray_client.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/ui/ash/system_tray_client_browsertest.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/ui/ash/system_tray_delegate_chromeos.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/ui/webui/help/version_updater.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/ui/webui/help/version_updater_chromeos.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/ui/webui/help/version_updater_chromeos.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/ui/webui/settings/about_handler.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/ui/webui/settings/about_handler.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/upgrade_detector.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/upgrade_detector.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chrome/browser/upgrade_observer.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chromeos/dbus/fake_update_engine_client.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chromeos/dbus/fake_update_engine_client.h [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chromeos/dbus/update_engine_client.cc [modify] https://crrev.com/8f8b70016a2958cc84e4f10cfe53e193be61cc37/chromeos/dbus/update_engine_client.h
,
Jul 28 2017
I would mark this as fixed, please feel free to reopen it.
,
Jan 22 2018
,
Feb 26 2018
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by jamescook@chromium.org
, Jul 18 2017