Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
power.h
Go to the documentation of this file.
1// Copyright 2026 The Symbian SDK Authors.
2// Licensed under the Apache License, Version 2.0.
3
4#ifndef SYMBIAN_API_POWER_POWER_H_
5#define SYMBIAN_API_POWER_POWER_H_
6
7#include <optional>
8
9#include "absl/status/statusor.h"
10
12
13// The platform's qualitative battery state. This is not a charge percentage.
15
16// A point-in-time collection of independently supported power observations.
18 // Whether the platform reports sufficient power to continue operating.
19 std::optional<bool> power_good;
20 // Whether an external supply is in use; charging is not implied.
21 std::optional<bool> external_power;
22 // Main battery's qualitative state, if the platform exposes it.
23 std::optional<BatteryCondition> battery;
24};
25
26// Reads supported native power attributes. Unsupported fields remain empty.
27// Returns a status if no attribute can be read. This is a synchronous query;
28// schedule it on a worker when the event thread must stay bounded-fast.
29absl::StatusOr<PowerSnapshot> ReadPowerSnapshot();
30
31} // namespace symbian::api::power
32
33#endif // SYMBIAN_API_POWER_POWER_H_
Definition power.h:11
absl::StatusOr< PowerSnapshot > ReadPowerSnapshot()
Definition power.cc:11
BatteryCondition
Definition power.h:14
std::optional< bool > power_good
Definition power.h:19
std::optional< BatteryCondition > battery
Definition power.h:23
std::optional< bool > external_power
Definition power.h:21