java.lang.Object | |
↳ | android.os.Process |
Tools for managing OS processes.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | FIRST_APPLICATION_UID | Defines the start of a range of UIDs (and GIDs), going from this
number to LAST_APPLICATION_UID that are reserved for assigning
to applications. |
|||||||||
int | LAST_APPLICATION_UID | Last of application-specific UIDs starting at
FIRST_APPLICATION_UID . |
|||||||||
int | PHONE_UID | Defines the UID/GID under which the telephony code runs. | |||||||||
int | SIGNAL_KILL | ||||||||||
int | SIGNAL_QUIT | ||||||||||
int | SIGNAL_USR1 | ||||||||||
int | SYSTEM_UID | Defines the UID/GID under which system code runs. | |||||||||
int | THREAD_PRIORITY_AUDIO | Standard priority of audio threads. | |||||||||
int | THREAD_PRIORITY_BACKGROUND | Standard priority background threads. | |||||||||
int | THREAD_PRIORITY_DEFAULT | Standard priority of application threads. | |||||||||
int | THREAD_PRIORITY_DISPLAY | Standard priority of system display threads, involved in updating the user interface. | |||||||||
int | THREAD_PRIORITY_FOREGROUND | Standard priority of threads that are currently running a user interface that the user is interacting with. | |||||||||
int | THREAD_PRIORITY_LESS_FAVORABLE | Minimum increment to make a priority less favorable. | |||||||||
int | THREAD_PRIORITY_LOWEST | Lowest available thread priority. | |||||||||
int | THREAD_PRIORITY_MORE_FAVORABLE | Minimum increment to make a priority more favorable. | |||||||||
int | THREAD_PRIORITY_URGENT_AUDIO | Standard priority of the most important audio threads. | |||||||||
int | THREAD_PRIORITY_URGENT_DISPLAY | Standard priority of the most important display threads, for compositing the screen and retrieving input events. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns elapsed milliseconds of the time this process has run.
| |||||||||||
Returns the GID assigned to a particular user name, or -1 if there is
none.
| |||||||||||
Return the current priority of a thread, based on Linux priorities.
| |||||||||||
Returns the UID assigned to a particular user name, or -1 if there is
none.
| |||||||||||
Kill the process with the given PID.
| |||||||||||
Returns the identifier of this process, which can be used with
killProcess(int) and sendSignal(int, int) . | |||||||||||
Returns the identifier of the calling thread, which be used with
setThreadPriority(int, int) . | |||||||||||
Returns the identifier of this process's uid.
| |||||||||||
Returns this process's user handle.
| |||||||||||
Send a signal to the given process.
| |||||||||||
Set the priority of a thread, based on Linux priorities.
| |||||||||||
Set the priority of the calling thread, based on Linux priorities.
| |||||||||||
This method was deprecated
in API level 14.
This method always returns true. Do not use.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Defines the start of a range of UIDs (and GIDs), going from this
number to LAST_APPLICATION_UID
that are reserved for assigning
to applications.
Last of application-specific UIDs starting at
FIRST_APPLICATION_UID
.
Defines the UID/GID under which the telephony code runs.
Defines the UID/GID under which system code runs.
Standard priority of audio threads. Applications can not normally
change to this priority.
Use with setThreadPriority(int)
and
setThreadPriority(int, int)
, not with the normal
Thread
class.
Standard priority background threads. This gives your thread a slightly
lower than normal priority, so that it will have less chance of impacting
the responsiveness of the user interface.
Use with setThreadPriority(int)
and
setThreadPriority(int, int)
, not with the normal
Thread
class.
Standard priority of application threads.
Use with setThreadPriority(int)
and
setThreadPriority(int, int)
, not with the normal
Thread
class.
Standard priority of system display threads, involved in updating
the user interface. Applications can not
normally change to this priority.
Use with setThreadPriority(int)
and
setThreadPriority(int, int)
, not with the normal
Thread
class.
Standard priority of threads that are currently running a user interface
that the user is interacting with. Applications can not normally
change to this priority; the system will automatically adjust your
application threads as the user moves through the UI.
Use with setThreadPriority(int)
and
setThreadPriority(int, int)
, not with the normal
Thread
class.
Minimum increment to make a priority less favorable.
Lowest available thread priority. Only for those who really, really
don't want to run if anything else is happening.
Use with setThreadPriority(int)
and
setThreadPriority(int, int)
, not with the normal
Thread
class.
Minimum increment to make a priority more favorable.
Standard priority of the most important audio threads.
Applications can not normally change to this priority.
Use with setThreadPriority(int)
and
setThreadPriority(int, int)
, not with the normal
Thread
class.
Standard priority of the most important display threads, for compositing
the screen and retrieving input events. Applications can not normally
change to this priority.
Use with setThreadPriority(int)
and
setThreadPriority(int, int)
, not with the normal
Thread
class.
Returns elapsed milliseconds of the time this process has run.
Returns the GID assigned to a particular user name, or -1 if there is none. If the given string consists of only numbers, it is converted directly to a gid.
Return the current priority of a thread, based on Linux priorities.
tid | The identifier of the thread/process to change. |
---|
IllegalArgumentException | Throws IllegalArgumentException if tid does not exist. |
---|
Returns the UID assigned to a particular user name, or -1 if there is none. If the given string consists of only numbers, it is converted directly to a uid.
Kill the process with the given PID. Note that, though this API allows us to request to kill any process based on its PID, the kernel will still impose standard restrictions on which PIDs you are actually able to kill. Typically this means only the process running the caller's packages/application and any additional processes created by that app; packages sharing a common UID will also be able to kill each other's processes.
Returns the identifier of this process, which can be used with
killProcess(int)
and sendSignal(int, int)
.
Returns the identifier of the calling thread, which be used with
setThreadPriority(int, int)
.
Returns the identifier of this process's uid. This is the kernel uid
that the process is running under, which is the identity of its
app-specific sandbox. It is different from myUserHandle()
in that
a uid identifies a specific app sandbox in a specific user.
Returns this process's user handle. This is the
user the process is running under. It is distinct from
myUid()
in that a particular user will have multiple
distinct apps running under it each with their own uid.
Send a signal to the given process.
pid | The pid of the target process. |
---|---|
signal | The signal to send. |
Set the priority of a thread, based on Linux priorities.
tid | The identifier of the thread/process to change. |
---|---|
priority | A Linux priority level, from -20 for highest scheduling priority to 19 for lowest scheduling priority. |
IllegalArgumentException | Throws IllegalArgumentException if tid does not exist. |
---|---|
SecurityException | Throws SecurityException if your process does not have permission to modify the given thread, or to use the given priority. |
Set the priority of the calling thread, based on Linux priorities. See
setThreadPriority(int, int)
for more information.
priority | A Linux priority level, from -20 for highest scheduling priority to 19 for lowest scheduling priority. |
---|
IllegalArgumentException | Throws IllegalArgumentException if tid does not exist. |
---|---|
SecurityException | Throws SecurityException if your process does not have permission to modify the given thread, or to use the given priority. |
This method was deprecated
in API level 14.
This method always returns true. Do not use.
Determine whether the current environment supports multiple processes.