Commit graph

6 commits

Author SHA1 Message Date
Daniel Verkamp
22af5965e8 power_monitor: convert to ThisError and sort
BUG=b:197143586
TEST=cargo check

Change-Id: Iab4eaa40f9b642d294fcd3a6b85b8f09954c120a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3105084
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2021-09-24 21:13:19 +00:00
Ryo Hashimoto
bf0294eb7f power_monitor: Upgrade dbus to 0.9
BUG=b:197638022, b:190791826
TEST=`cat $(find /sys -name voltage_now 2>/dev/null)` in adb shell

Change-Id: Ie195abeee7aa601d6b42b900d2197f30a128e8e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3135100
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
2021-09-01 18:21:42 +00:00
Allen Webb
c6fa73d76f Fix clippy warnings and Cargo.lock
This fixes:
* version mismatches in Cargo.lock
* style issues
* implementations of Into that should be From
* deprecated protobuf APIs

It also adds RUST_BACKTRACE=1 to the kokoro tests.

BUG=None
TEST=./bin/preupload-clippy

Change-Id: I8e9157c903f2080a5fdcc4d3e4ed72fbad41c64f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3024427
Auto-Submit: Allen Webb <allenwebb@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Allen Webb <allenwebb@google.com>
2021-07-15 03:33:17 +00:00
Ryo Hashimoto
c54cf6c8e9 power_monitor: Upgrade dbus to 0.8
To be consistent with other Chromium OS rust code.

BUG=b:190791826
TEST=cat $(find /sys -name voltage_now 2>/dev/null)

Change-Id: I578bddc14259b32ffed709a8d4b490cabb6a435d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2970820
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
2021-06-22 05:44:42 +00:00
Alex Lau
852411e746 crosvm: power_monitor: Populate more battery fields.
This adds support for battery charge, voltage, battery charge counter
in power_monitor and populates these fields from powerd data.

BUG=b:162479956
TEST=Compare voltage_now, charge_full, charge_now/charge_counter,
  current_now fields in sysfs on host and in ARCVM
TEST=CTS tests android.cts.statsd.atom.HostAtomTests#testBatteryVoltage,
  android.cts.statsd.atom.HostAtomTests#testFullBatteryCapacity
  and android.cts.statsd.atom.HostAtomTests#testRemainingBatteryCapacity
  pass in ARCVM

Change-Id: I3f93f499fa7d00cc5a0a2b69e7cfbcd233a2983a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2681212
Tested-by: Alex Lau <alexlau@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Alex Lau <alexlau@chromium.org>
2021-02-09 04:41:52 +00:00
Alex Lau
0d6ae7abf7 Add power_monitor crate.
PowerMonitor trait objects can be used as a source of power supply data
and will be used by the goldfish battery. This CL includes a powerd backed
implementation of PowerMonitor available behind a feature flag which
receives updated data over D-Bus.

BUG=b:137890633
TEST=observe updated power data in ARCVM's /sys/class/power_supply at the end of this chain

Cq-Depend: chromium:2550102
Change-Id: Iacdc9bc7d11454d5b4f5d2639d19281174ad7e20
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2537349
Commit-Queue: Alex Lau <alexlau@chromium.org>
Tested-by: Alex Lau <alexlau@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2020-12-02 10:48:40 +00:00