public class

PerformanceManager

extends Object
java.lang.Object
   ↳ lineageos.power.PerformanceManager

Class Overview

Summary

Constants
String POWER_PROFILE_CHANGED Broadcast sent when profile is changed
int PROFILE_BALANCED Balanced power profile The default mode for balanced power savings and performance
int PROFILE_BIAS_PERFORMANCE Performance bias profile This mode improves performance at the cost of some power.
int PROFILE_BIAS_POWER_SAVE Power save bias profile This mode decreases performance slightly to improve power savings.
int PROFILE_HIGH_PERFORMANCE High-performance profile This mode sacrifices power for maximum performance
int PROFILE_POWER_SAVE Power save profile This mode sacrifices performance for maximum power saving.
String TAG
Public Methods
PerformanceProfile getActivePowerProfile()
Gets the currently active performance profile Returns null if no profiles are available.
static PerformanceManager getInstance(Context context)
int getNumberOfProfiles()
Returns the number of supported profiles, -1 if unsupported This is queried via the PowerHAL.
PerformanceProfile getPowerProfile(int profile)
Gets the specified power profile Returns null if power profiles are not enabled or the profile was not found
int getPowerProfile()
Gets the current power profile Returns -1 if power profiles are not enabled
SortedSet<PerformanceProfile> getPowerProfiles()
Gets a set, sorted by weight, of all supported power profiles Returns an empty set if power profiles are not enabled
boolean setPowerProfile(int profile)
Set the system power profile
boolean setPowerProfile(PerformanceProfile profile)
Set the system power profile
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String POWER_PROFILE_CHANGED

added in API level 4

Broadcast sent when profile is changed

Constant Value: "lineageos.power.PROFILE_CHANGED"

public static final int PROFILE_BALANCED

added in API level 4

Balanced power profile The default mode for balanced power savings and performance

Constant Value: 1 (0x00000001)

public static final int PROFILE_BIAS_PERFORMANCE

added in API level 4

Performance bias profile This mode improves performance at the cost of some power.

Constant Value: 4 (0x00000004)

public static final int PROFILE_BIAS_POWER_SAVE

added in API level 4

Power save bias profile This mode decreases performance slightly to improve power savings.

Constant Value: 3 (0x00000003)

public static final int PROFILE_HIGH_PERFORMANCE

added in API level 4

High-performance profile This mode sacrifices power for maximum performance

Constant Value: 2 (0x00000002)

public static final int PROFILE_POWER_SAVE

added in API level 4

Power save profile This mode sacrifices performance for maximum power saving.

Constant Value: 0 (0x00000000)

public static final String TAG

added in API level 4

Constant Value: "PerformanceManager"

Public Methods

public PerformanceProfile getActivePowerProfile ()

added in API level 8

Gets the currently active performance profile Returns null if no profiles are available.

Returns
PerformanceProfile

public static PerformanceManager getInstance (Context context)

added in API level 4

Parameters
context Context
Returns
PerformanceManager

public int getNumberOfProfiles ()

added in API level 4

Returns the number of supported profiles, -1 if unsupported This is queried via the PowerHAL.

Returns
int

public PerformanceProfile getPowerProfile (int profile)

added in API level 8

Gets the specified power profile Returns null if power profiles are not enabled or the profile was not found

Parameters
profile int
Returns
PerformanceProfile

public int getPowerProfile ()

added in API level 4

Gets the current power profile Returns -1 if power profiles are not enabled

Returns
int

public SortedSet<PerformanceProfile> getPowerProfiles ()

added in API level 8

Gets a set, sorted by weight, of all supported power profiles Returns an empty set if power profiles are not enabled

Returns
SortedSet<PerformanceProfile>

public boolean setPowerProfile (int profile)

added in API level 4

Set the system power profile

Parameters
profile int
Returns
boolean
Throws
IllegalArgumentException if invalid

public boolean setPowerProfile (PerformanceProfile profile)

added in API level 8

Set the system power profile

Parameters
profile PerformanceProfile
Returns
boolean
Throws
IllegalArgumentException if invalid