public class GPUManager
extends java.lang.Object
This manager allows applications to get and set the current GPU multiplier and the multiplier that will be applied when the module's temperature reaches the hot trip point.
Unless noted, all GPU API methods require the
com.digi.android.permission.GPU
permission. If your application does
not have this permission it will not have access to any GPU service feature.
Modifier and Type | Field | Description |
---|---|---|
static int |
MAX_MULTIPLIER |
Maximum value for the GPU multiplier:
.
|
static int |
MIN_MULTIPLIER |
Minimum value for the GPU multiplier:
.
|
Constructor | Description |
---|---|
GPUManager(android.content.Context context) |
Class constructor.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getMinMultiplier() |
Returns the the GPU multiplier that will be set when the module's
temperature reaches the hot trip point.
|
int |
getMultiplier() |
Returns the current GPU multiplier.
|
int |
setMinMultiplier(int multiplier) |
Configures the GPU multiplier that will be set when the module's
temperature reaches the hot trip point.
|
int |
setMultiplier(int multiplier) |
Configures the new GPU multiplier.
|
public static final int MIN_MULTIPLIER
public static final int MAX_MULTIPLIER
public GPUManager(android.content.Context context)
Instantiates a new object of type GPUManager with the given context.
context
- The context to get the internal GPU handler.java.lang.NullPointerException
- If context == null
.public int getMultiplier() throws java.io.IOException
The value of the multiplier is between 1 and 64. When set to 1, the GPU is configured with the minimum frequency, while when set to 64 it is configured with the maximum one.
java.io.IOException
- If an I/O error occurs.java.lang.UnsupportedOperationException
- If this functionality is not supported.setMultiplier(int)
public int setMultiplier(int multiplier) throws java.io.IOException
The value of the multiplier must be between 1 and 64. When set to 1, the GPU is configured with the minimum frequency, while when set to 64 it is configured with the maximum one.
Note that in some modules the minimum allowed value of the GPU multiplier may be more than 1, so it is recommended to check the returned value.
multiplier
- The new GPU multiplier.java.lang.IllegalArgumentException
- If multiplier < 1
or
multiplier > 64
.java.io.IOException
- If an I/O error occurs.java.lang.UnsupportedOperationException
- If this functionality is not supported.getMultiplier()
public int getMinMultiplier() throws java.io.IOException
The value of the multiplier is between 1 and 64. When set to 1, the GPU is configured with the minimum frequency, while when set to 64 it is configured with the maximum one.
When the module's temperature drops 10 degrees from the hot trip point, the previous configured multiplier is restored.
java.io.IOException
- If an I/O error occurs.setMinMultiplier(int)
public int setMinMultiplier(int multiplier) throws java.io.IOException
The value of the multiplier must be between 1 and 64. When set to 1, the GPU is configured with the minimum frequency, while when set to 64 it is configured with the maximum one.
When the module's temperature drops 10 degrees from the hot trip point, the previous configured multiplier is restored.
Note that in some modules the minimum allowed value of the GPU multiplier may be more than 1, so it is recommended to check the returned value.
multiplier
- The GPU multiplier that will be set when the module's
temperature reaches the hot trip point.java.lang.IllegalArgumentException
- If multiplier < 1
or
multiplier > 64
.java.io.IOException
- If an I/O error occurs.getMinMultiplier()