public class DisplayUtilities
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DisplayUtilities.SleepTime
Available sleep time values.
|
static class |
DisplayUtilities.SuspendTime
Available suspend time values.
|
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
SetStayAwakeCommand
Set stay awake command.
|
protected static java.lang.String |
SetStayAwakeOff
Set stay awake "off" command argument.
|
protected static java.lang.String |
SetStayAwakeOn
Set stay awake "on" command argument.
|
Constructor and Description |
---|
DisplayUtilities() |
Modifier and Type | Method and Description |
---|---|
protected static int |
getSleepTime(Context context)
Get the sleep time value.
|
protected static int |
getSuspendTime()
Get the suspend time value.
|
protected static boolean |
sendDeveloperOptions(Context context,
java.lang.String cmd,
java.lang.String args)
Send the developer options command.
|
protected static boolean |
sendScreenBrightness(Context context,
int brightness)
Sends a command to set the screen br.
|
protected static boolean |
setSleepTime(Context context,
DisplayUtilities.SleepTime sleepTime)
Set the sleep time value.
|
protected static boolean |
setSuspendTime(Context context,
DisplayUtilities.SuspendTime suspendTime)
Set the sleep time value.
|
protected static java.lang.String SetStayAwakeCommand
protected static java.lang.String SetStayAwakeOn
protected static java.lang.String SetStayAwakeOff
protected static int getSleepTime(Context context)
context
- Activity
context.protected static boolean setSleepTime(Context context, DisplayUtilities.SleepTime sleepTime)
context
- Activity
context.sleepTime
- SleepTime
value.true
if operation was successful,
otherwise false.
.protected static int getSuspendTime()
protected static boolean setSuspendTime(Context context, DisplayUtilities.SuspendTime suspendTime)
context
- Activity
context.suspendTime
- SuspendTime
value.true
if operation was successful,
otherwise false.
.protected static boolean sendScreenBrightness(Context context, int brightness)
context
- brightness
- Value for the brightness, range 25-255protected static boolean sendDeveloperOptions(Context context, java.lang.String cmd, java.lang.String args)
cmd
- Developer options command.args
- Command argument.