Język

PowerMonitorReadings.GetConsumedEnergy(PowerMonitor) Method

Definition

Returns energy consumed by the specified power monitor since boot in microwatt-seconds.

[Android.Runtime.Register("getConsumedEnergy", "(Landroid/os/PowerMonitor;)J", "", ApiSince=35)]
public long GetConsumedEnergy(Android.OS.PowerMonitor powerMonitor);
[<Android.Runtime.Register("getConsumedEnergy", "(Landroid/os/PowerMonitor;)J", "", ApiSince=35)>]
member this.GetConsumedEnergy : Android.OS.PowerMonitor -> int64

Parameters

powerMonitor
PowerMonitor

The value cannot be null.

Returns

The consumed energy in microwatt-seconds, or EnergyUnavailable if no reading is available for the monitor, for example because it is not in this snapshot or the device did not report a value.

Attributes

Remarks

Returns energy consumed by the specified power monitor since boot in microwatt-seconds. Does not persist across reboots. Represents total energy: both on-battery and plugged-in.

Java documentation for android.os.PowerMonitorReadings.getConsumedEnergy(android.os.PowerMonitor).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to