Class PowerUsage
Definition
- Namespace:
- Tizen.System
- Assembly:
- Tizen.System.PowerUsage.dll
- API Level:
- 7
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Feature:
- http://tizen.org/feature/battery
Provides information related to the power consumption by applications or by hardware resources on a battery-powered device for a given duration of time.
public static class PowerUsage
- Inheritance
-
PowerUsage
Methods
View SourceGetPowerUsage(String, IList<PowerUsageResourceType>, DateTime, DateTime)
Gets the battery consumption in mAh(milli-Ampere hour) for the resources specified by the application in custom interval.
Declaration
public static IDictionary<PowerUsageResourceType, double> GetPowerUsage(string appID, IList<PowerUsageResourceType> rtypes, DateTime start, DateTime end)
Parameters
Type | Name | Description |
---|---|---|
String | appID | Application ID of the application for which battery usage is required. |
IList<PowerUsageResourceType> | rtypes | list of resource type identifiers like BLE, WiFi, CPU etc. |
DateTime | start | Start Time for data in DateTime. |
DateTime | end | End Time for data in DateTime. |
Returns
Type | Description |
---|---|
IDictionary<PowerUsageResourceType, Double> | Returns the battery consumption in mAh(milli-Ampere hour) for the resources specified by the application in custom interval. |
Exceptions
Type | Condition |
---|---|
ArgumentException | When an invalid parameter value is set. |
UnauthorizedAccessException | If the privilege is not set. |
InvalidOperationException | In case of any system error. |
NotSupportedException | In case power usage is not supported |
API Level: 7
Privilege Level: public
Privilege: http://tizen.org/privilege/systemmonitor
Feature: http://tizen.org/feature/battery
View SourceGetPowerUsage(String, DateTime, DateTime)
Gets the total battery usage in mAh(milli-Ampere hour) by an application for certain time interval.
Declaration
public static double GetPowerUsage(string appID, DateTime start, DateTime end)
Parameters
Type | Name | Description |
---|---|---|
String | appID | Application ID of the application for which battery usage is required. |
DateTime | start | Start Time for data in DateTime. |
DateTime | end | End Time for data in DateTime. |
Returns
Type | Description |
---|---|
Double | Returns the total battery usage in mAh(milli-Ampere hour) by an application for certain time interval. |
Exceptions
Type | Condition |
---|---|
ArgumentException | When an invalid parameter value is set. |
UnauthorizedAccessException | If the privilege is not set. |
InvalidOperationException | In case of any system error. |
NotSupportedException | In case power usage is not supported |
API Level: 7
Privilege Level: public
Privilege: http://tizen.org/privilege/systemmonitor
Feature: http://tizen.org/feature/battery
View SourceGetPowerUsage(String, PowerUsageResourceType, DateTime, DateTime)
Gets the battery consumption in mAh(milli-Ampere hour) for the specific resource for the given application in custom interval.
Declaration
public static double GetPowerUsage(string appID, PowerUsageResourceType rtype, DateTime start, DateTime end)
Parameters
Type | Name | Description |
---|---|---|
String | appID | Application ID of the application for which battery usage is required. |
PowerUsageResourceType | rtype | Identifier of resource type. BLE, WiFi, CPU etc. |
DateTime | start | Start Time for data in DateTime. |
DateTime | end | End Time for data in DateTime. |
Returns
Type | Description |
---|---|
Double | Returns the battery consumption in mAh(milli-Ampere hour) for the specific resource for the given application in custom interval. |
Exceptions
Type | Condition |
---|---|
ArgumentException | When an invalid parameter value is set. |
UnauthorizedAccessException | If the privilege is not set. |
InvalidOperationException | In case of any system error. |
NotSupportedException | In case power usage is not supported |
API Level: 7
Privilege Level: public
Privilege: http://tizen.org/privilege/systemmonitor
Feature: http://tizen.org/feature/battery
View SourceGetPowerUsage(PowerUsageResourceType, DateTime, DateTime)
Gets the battery usage in mAh(milli-Ampere hour) by a resource for certain time interval.
Declaration
public static double GetPowerUsage(PowerUsageResourceType rtype, DateTime start, DateTime end)
Parameters
Type | Name | Description |
---|---|---|
PowerUsageResourceType | rtype | Identifier of resource type. BLE, WiFi, CPU etc. |
DateTime | start | Start Time for data in DateTime. |
DateTime | end | End Time for data in DateTime. |
Returns
Type | Description |
---|---|
Double | Returns the battery usage in mAh(milli-Ampere hour) by a resource for certain time interval. |
Exceptions
Type | Condition |
---|---|
ArgumentException | When an invalid parameter value is set. |
UnauthorizedAccessException | If the privilege is not set. |
InvalidOperationException | In case of any system error. |
NotSupportedException | In case power usage is not supported |