BackgroundEnergyManager
BackgroundEnergyManager
BackgroundEnergyManager
BackgroundEnergyManager
Class
Definition
Provides information about your app's background energy usage.
public : static class BackgroundEnergyManagerpublic static class BackgroundEnergyManagerPublic Static Class BackgroundEnergyManager// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
The energy usage of a background task is classified into one of these predefined levels, from lowest to highest energy consumption: LowUsageLevel, NearMaxAcceptableUsageLevel, MaxAcceptableUsageLevel, ExcessiveUsageLevel, NearTerminationUsageLevel, or TerminationUsageLevel.
Properties
ExcessiveUsageLevel ExcessiveUsageLevel ExcessiveUsageLevel ExcessiveUsageLevel
Gets the excessive usage level, expressed as a percentage of normal energy usage.
public : static unsigned int ExcessiveUsageLevel { get; }public static uint ExcessiveUsageLevel { get; }Public Static ReadOnly Property ExcessiveUsageLevel As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The excessive usage level, expressed as a percentage of normal energy usage.
Remarks
A background task operating at this level has exceeded the maximum acceptable level.
LowUsageLevel LowUsageLevel LowUsageLevel LowUsageLevel
Gets the low usage level, expressed as a percentage of normal energy consumption.
public : static unsigned int LowUsageLevel { get; }public static uint LowUsageLevel { get; }Public Static ReadOnly Property LowUsageLevel As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The low usage level, expressed as a percentage of normal energy consumption.
Remarks
A background task operating at this level is "safe" from termination and does not require throttling.
MaxAcceptableUsageLevel MaxAcceptableUsageLevel MaxAcceptableUsageLevel MaxAcceptableUsageLevel
Gets the maximum acceptable usage level, expressed as a percentage of normal energy consumption.
public : static unsigned int MaxAcceptableUsageLevel { get; }public static uint MaxAcceptableUsageLevel { get; }Public Static ReadOnly Property MaxAcceptableUsageLevel As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The maximum acceptable usage level, expressed as a percentage of normal energy consumption.
Remarks
A background task operating at this level has reached the maximum acceptable level and is at risk of being reported to the Battery Saver app as a high energy consumer.
NearMaxAcceptableUsageLevel NearMaxAcceptableUsageLevel NearMaxAcceptableUsageLevel NearMaxAcceptableUsageLevel
Gets the near-maximum acceptable usage level, expressed as a percentage of normal energy usage.
public : static unsigned int NearMaxAcceptableUsageLevel { get; }public static uint NearMaxAcceptableUsageLevel { get; }Public Static ReadOnly Property NearMaxAcceptableUsageLevel As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The near-maximum acceptable usage level, expressed as a percentage of normal energy usage.
Remarks
A background task operating at this level is getting close to the maximum acceptable level.
NearTerminationUsageLevel NearTerminationUsageLevel NearTerminationUsageLevel NearTerminationUsageLevel
Gets the near-termination usage level, expressed as a percentage of normal energy usage.
public : static unsigned int NearTerminationUsageLevel { get; }public static uint NearTerminationUsageLevel { get; }Public Static ReadOnly Property NearTerminationUsageLevel As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The near-termination usage level, expressed as a percentage of normal energy usage.
Remarks
A background task operating at this level is at risk of being terminated by the operating system (if it's not directly contributing to the foreground experience).
RecentEnergyUsage RecentEnergyUsage RecentEnergyUsage RecentEnergyUsage
Gets the energy usage of the app's background task for the current 30 minute period, expressed as a percentage of normal.
public : static unsigned int RecentEnergyUsage { get; }public static uint RecentEnergyUsage { get; }Public Static ReadOnly Property RecentEnergyUsage As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The energy usage of the app's background task for the current 30 minute period, expressed as a percentage of normal.
Remarks
The RecentEnergyUsage property is a more accurate measure of energy usage than RecentEnergyUsageLevel. The RecentEnergyUsage value will typically fall between predefined energy levels. The RecentEnergyUsageLevel will always equal the nearest predefined energy level.
RecentEnergyUsageLevel RecentEnergyUsageLevel RecentEnergyUsageLevel RecentEnergyUsageLevel
Gets the nearest predefined energy level of the app's background task for the current 30 minute period, equal to LowUsageLevel, NearMaxAcceptableUsageLevel, MaxAcceptableUsageLevel, ExcessiveUsageLevel, NearTerminationUsageLevel, or TerminationUsageLevel.
public : static unsigned int RecentEnergyUsageLevel { get; }public static uint RecentEnergyUsageLevel { get; }Public Static ReadOnly Property RecentEnergyUsageLevel As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The nearest predefined energy level of the app's background task for the current 30 minute period.
TerminationUsageLevel TerminationUsageLevel TerminationUsageLevel TerminationUsageLevel
Gets the termination usage level, expressed as a percentage of normal energy usage.
public : static unsigned int TerminationUsageLevel { get; }public static uint TerminationUsageLevel { get; }Public Static ReadOnly Property TerminationUsageLevel As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The termination usage level, expressed as a percentage of normal energy usage.
Remarks
A background task operating at this level will be terminated by the operating system if it's not directly contributing to the foreground experience.
Events
RecentEnergyUsageIncreased RecentEnergyUsageIncreased RecentEnergyUsageIncreased RecentEnergyUsageIncreased
Occurs when the background task's energy usage has increased significantly.
public : static event EventHandler RecentEnergyUsageIncreased<object>public static event EventHandler RecentEnergyUsageIncreased<object>Public Static Event RecentEnergyUsageIncreased<object>// You can use this event in JavaScript.
Remarks
Notifications are sent at each significant increase up to the termination usage level.
RecentEnergyUsageReturnedToLow RecentEnergyUsageReturnedToLow RecentEnergyUsageReturnedToLow RecentEnergyUsageReturnedToLow
Occurs when the background task's energy usage has decreased to a low usage level.
public : static event EventHandler RecentEnergyUsageReturnedToLow<object>public static event EventHandler RecentEnergyUsageReturnedToLow<object>Public Static Event RecentEnergyUsageReturnedToLow<object>// You can use this event in JavaScript.
Remarks
A background task operating at this level is consuming significantly less energy than normal and does not require throttling.