Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/os/Process#constants) \| [Ctors](https://developer.android.com/reference/android/os/Process#pubctors) \| [Methods](https://developer.android.com/reference/android/os/Process#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/os/Process#inhmethods)

# Process

*** ** * ** ***


`
public


class
Process
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.Process |

<br />

*** ** * ** ***

Tools for managing OS processes.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/os/Process#BLUETOOTH_UID` Defines the UID/GID for the Bluetooth service process. |
| `int` | `https://developer.android.com/reference/android/os/Process#FIRST_APPLICATION_UID` Defines the start of a range of UIDs (and GIDs), going from this number to `https://developer.android.com/reference/android/os/Process#LAST_APPLICATION_UID` that are reserved for assigning to applications. |
| `int` | `https://developer.android.com/reference/android/os/Process#INVALID_PID` An invalid PID value. |
| `int` | `https://developer.android.com/reference/android/os/Process#INVALID_UID` An invalid UID value. |
| `int` | `https://developer.android.com/reference/android/os/Process#LAST_APPLICATION_UID` Last of application-specific UIDs starting at `https://developer.android.com/reference/android/os/Process#FIRST_APPLICATION_UID`. |
| `int` | `https://developer.android.com/reference/android/os/Process#PHONE_UID` Defines the UID/GID under which the telephony code runs. |
| `int` | `https://developer.android.com/reference/android/os/Process#ROOT_UID` Defines the root UID. |
| `int` | `https://developer.android.com/reference/android/os/Process#SHELL_UID` Defines the UID/GID for the user shell. |
| `int` | `https://developer.android.com/reference/android/os/Process#SIGNAL_KILL` |
| `int` | `https://developer.android.com/reference/android/os/Process#SIGNAL_QUIT` |
| `int` | `https://developer.android.com/reference/android/os/Process#SIGNAL_USR1` |
| `int` | `https://developer.android.com/reference/android/os/Process#SYSTEM_UID` Defines the UID/GID under which system code runs. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_AUDIO` Standard priority of audio threads. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_BACKGROUND` Standard priority background threads. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_DEFAULT` Standard priority of application threads. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_DISPLAY` Standard priority of system display threads, involved in updating the user interface. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_FOREGROUND` Standard priority of threads that are currently running a user interface that the user is interacting with. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_LESS_FAVORABLE` Minimum increment to make a priority less favorable. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_LOWEST` Lowest available thread priority. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_MORE_FAVORABLE` Minimum increment to make a priority more favorable. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_URGENT_AUDIO` Standard priority of the most important audio threads. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_URGENT_DISPLAY` Standard priority of the most important display threads, for compositing the screen and retrieving input events. |
| `int` | `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_VIDEO` Standard priority of video threads. |
| `int` | `https://developer.android.com/reference/android/os/Process#WIFI_UID` Defines the UID/GID for the WIFI native processes like wificond, supplicant, hostapd, vendor HAL, etc. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/os/Process#Process()() ` |

| ### Public methods ||
|---|---|
| ` static final boolean` | ` https://developer.android.com/reference/android/os/Process#areUidsForSameApplication(int,%20int)(int uid1, int uid2) ` Returns true if the two UIDs belong to the same application, taking mathematically mapped UIDs (such as Private Compute Core sandbox) into account. |
| ` static final int` | ` https://developer.android.com/reference/android/os/Process#getAppUidForPrivateComputeCoreUid(int)(int uid) ` Returns the app UID corresponding to a Private Compute Core UID. |
| ` static final int` | ` https://developer.android.com/reference/android/os/Process#getAppUidForSdkSandboxUid(int)(int uid) ` Returns the app uid corresponding to an sdk sandbox uid. |
| ` static final long` | ` https://developer.android.com/reference/android/os/Process#getElapsedCpuTime()() ` Returns elapsed milliseconds of the time this process has run. |
| ` static final int[]` | ` https://developer.android.com/reference/android/os/Process#getExclusiveCores()() ` On some devices, the foreground process may have one or more CPU cores exclusively reserved for it. |
| ` static final int` | ` https://developer.android.com/reference/android/os/Process#getGidForName(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Returns the GID assigned to a particular user name, or -1 if there is none. |
| ` static final int` | ` https://developer.android.com/reference/android/os/Process#getPrivateComputeCoreUidForAppUid(int)(int uid) ` Returns the Private Compute Core UID corresponding to an app UID. |
| ` static final int` | ` https://developer.android.com/reference/android/os/Process#getSdkSandboxUidForAppUid(int)(int uid) ` Returns the sdk sandbox uid corresponding to an app uid. |
| ` static long` | ` https://developer.android.com/reference/android/os/Process#getStartElapsedRealtime()() ` Return the `https://developer.android.com/reference/android/os/SystemClock#elapsedRealtime()` at which this process was started, but before any of the application code was executed. |
| ` static long` | ` https://developer.android.com/reference/android/os/Process#getStartRequestedElapsedRealtime()() ` Return the `https://developer.android.com/reference/android/os/SystemClock#elapsedRealtime()` at which the system was about to start this process. |
| ` static long` | ` https://developer.android.com/reference/android/os/Process#getStartRequestedUptimeMillis()() ` Return the `https://developer.android.com/reference/android/os/SystemClock#uptimeMillis()` at which the system was about to start this process. |
| ` static long` | ` https://developer.android.com/reference/android/os/Process#getStartUptimeMillis()() ` Return the `https://developer.android.com/reference/android/os/SystemClock#uptimeMillis()` at which this process was started, but before any of the application code was executed. |
| ` static final int` | ` https://developer.android.com/reference/android/os/Process#getThreadPriority(int)(int tid) ` Return the current priority of a thread, based on Linux priorities. |
| ` static final int` | ` https://developer.android.com/reference/android/os/Process#getUidForName(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Returns the UID assigned to a particular user name, or -1 if there is none. |
| ` static final boolean` | ` https://developer.android.com/reference/android/os/Process#is64Bit()() ` Returns true if the current process is a 64-bit runtime. |
| ` static boolean` | ` https://developer.android.com/reference/android/os/Process#isApplicationUid(int)(int uid) ` Returns whether the given uid belongs to an application. |
| ` static final boolean` | ` https://developer.android.com/reference/android/os/Process#isIsolated()() ` Returns whether the current process is in an isolated sandbox. |
| ` static final boolean` | ` https://developer.android.com/reference/android/os/Process#isIsolatedUid(int)(int uid) ` Returns whether the process with the given `uid` is an isolated sandbox. |
| ` static final boolean` | ` https://developer.android.com/reference/android/os/Process#isPrivateComputeCoreUid(int)(int uid) ` Returns whether the provided UID belongs to components running in a Private Compute Core sandbox process. |
| ` static final boolean` | ` https://developer.android.com/reference/android/os/Process#isSdkSandbox()() ` Returns whether the current process is a sdk sandbox process. |
| ` static final boolean` | ` https://developer.android.com/reference/android/os/Process#isSdkSandboxUid(int)(int uid) ` Returns whether the provided UID belongs to an sdk sandbox process |
| ` static final void` | ` https://developer.android.com/reference/android/os/Process#killProcess(int)(int pid) ` Kill the process with the given PID. |
| ` static final int` | ` https://developer.android.com/reference/android/os/Process#myPid()() ` Returns the identifier of this process, which can be used with `https://developer.android.com/reference/android/os/Process#killProcess(int)` and `https://developer.android.com/reference/android/os/Process#sendSignal(int,%20int)`. |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/os/Process#myProcessName()() ` Return the name of this process. |
| ` static final int` | ` https://developer.android.com/reference/android/os/Process#myTid()() ` Returns the identifier of the calling thread, which be used with `https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`. |
| ` static final int` | ` https://developer.android.com/reference/android/os/Process#myUid()() ` Returns the identifier of this process's uid. |
| ` static https://developer.android.com/reference/android/os/UserHandle` | ` https://developer.android.com/reference/android/os/Process#myUserHandle()() ` Returns this process's user handle. |
| ` static final void` | ` https://developer.android.com/reference/android/os/Process#sendSignal(int,%20int)(int pid, int signal) ` Send a signal to the given process. |
| ` static final void` | ` https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)(int tid, int priority) ` Set the OS priority of a thread, using Linux niceness priorities. |
| ` static final void` | ` https://developer.android.com/reference/android/os/Process#setThreadPriority(int)(int priority) ` Set the priority of the calling thread, based on Linux niceness priorities. |
| ` static final boolean` | ` https://developer.android.com/reference/android/os/Process#supportsProcesses()() ` *This method was deprecated in API level 15. This method always returns true. Do not use.* |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Constants

### BLUETOOTH_UID

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int BLUETOOTH_UID
```

Defines the UID/GID for the Bluetooth service process.

<br />

Constant Value:

1002
(0x000003ea)


### FIRST_APPLICATION_UID

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int FIRST_APPLICATION_UID
```

Defines the start of a range of UIDs (and GIDs), going from this
number to `https://developer.android.com/reference/android/os/Process#LAST_APPLICATION_UID` that are reserved for assigning
to applications.

<br />

Constant Value:

10000
(0x00002710)


### INVALID_PID

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int INVALID_PID
```

An invalid PID value.

<br />

Constant Value:

-1
(0xffffffff)


### INVALID_UID

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int INVALID_UID
```

An invalid UID value.

<br />

Constant Value:

-1
(0xffffffff)


### LAST_APPLICATION_UID

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int LAST_APPLICATION_UID
```

Last of application-specific UIDs starting at
`https://developer.android.com/reference/android/os/Process#FIRST_APPLICATION_UID`.

<br />

Constant Value:

19999
(0x00004e1f)


### PHONE_UID

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHONE_UID
```

Defines the UID/GID under which the telephony code runs.

<br />

Constant Value:

1001
(0x000003e9)


### ROOT_UID

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ROOT_UID
```

Defines the root UID.

<br />

Constant Value:

0
(0x00000000)


### SHELL_UID

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SHELL_UID
```

Defines the UID/GID for the user shell.

<br />

Constant Value:

2000
(0x000007d0)


### SIGNAL_KILL

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SIGNAL_KILL
```

<br />

<br />

Constant Value:

9
(0x00000009)


### SIGNAL_QUIT

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SIGNAL_QUIT
```

<br />

<br />

Constant Value:

3
(0x00000003)


### SIGNAL_USR1

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SIGNAL_USR1
```

<br />

<br />

Constant Value:

10
(0x0000000a)


### SYSTEM_UID

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SYSTEM_UID
```

Defines the UID/GID under which system code runs.

<br />

Constant Value:

1000
(0x000003e8)


### THREAD_PRIORITY_AUDIO

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_AUDIO
```

Standard priority of audio threads. Applications should not normally
change to this priority.
Use with `https://developer.android.com/reference/android/os/Process#setThreadPriority(int)` and
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`, **not** with the normal
`https://developer.android.com/reference/java/lang/Thread` class.

<br />

Constant Value:

-16
(0xfffffff0)


### THREAD_PRIORITY_BACKGROUND

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_BACKGROUND
```

Standard priority background threads. This gives your thread a significantly
lower than normal priority, so that it will have less chance of impacting
the responsiveness of the user interface.
Use with `https://developer.android.com/reference/android/os/Process#setThreadPriority(int)` and
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`, **not** with the normal
`https://developer.android.com/reference/java/lang/Thread` class.

<br />

Constant Value:

10
(0x0000000a)


### THREAD_PRIORITY_DEFAULT

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_DEFAULT
```

Standard priority of application threads.
Use with `https://developer.android.com/reference/android/os/Process#setThreadPriority(int)` and
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`, **not** with the normal
`https://developer.android.com/reference/java/lang/Thread` class.

<br />

Constant Value:

0
(0x00000000)


### THREAD_PRIORITY_DISPLAY

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_DISPLAY
```

Standard priority of system display threads, involved in updating
the user interface.
Use with `https://developer.android.com/reference/android/os/Process#setThreadPriority(int)` and
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`, **not** with the normal
`https://developer.android.com/reference/java/lang/Thread` class.

<br />

Constant Value:

-4
(0xfffffffc)


### THREAD_PRIORITY_FOREGROUND

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_FOREGROUND
```

Standard priority of threads that are currently running a user interface
that the user is interacting with. Applications do not normally
change to this priority; the system will automatically adjust your
application threads as the user moves through the UI.
Use with `https://developer.android.com/reference/android/os/Process#setThreadPriority(int)` and
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`, **not** with the normal
`https://developer.android.com/reference/java/lang/Thread` class.

<br />

Constant Value:

-2
(0xfffffffe)


### THREAD_PRIORITY_LESS_FAVORABLE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_LESS_FAVORABLE
```

Minimum increment to make a priority less favorable.

<br />

Constant Value:

1
(0x00000001)


### THREAD_PRIORITY_LOWEST

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_LOWEST
```

Lowest available thread priority. Only for those who really, really
don't want to run if anything else is happening.
Use with `https://developer.android.com/reference/android/os/Process#setThreadPriority(int)` and
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`, **not** with the normal
`https://developer.android.com/reference/java/lang/Thread` class.

<br />

Constant Value:

19
(0x00000013)


### THREAD_PRIORITY_MORE_FAVORABLE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_MORE_FAVORABLE
```

Minimum increment to make a priority more favorable.

<br />

Constant Value:

-1
(0xffffffff)


### THREAD_PRIORITY_URGENT_AUDIO

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_URGENT_AUDIO
```

Standard priority of the most important audio threads.
Applications should not normally change to this priority.
Use with `https://developer.android.com/reference/android/os/Process#setThreadPriority(int)` and
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`, **not** with the normal
`https://developer.android.com/reference/java/lang/Thread` class.

<br />

Constant Value:

-19
(0xffffffed)


### THREAD_PRIORITY_URGENT_DISPLAY

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_URGENT_DISPLAY
```

Standard priority of the most important display threads, for compositing
the screen and retrieving input events.
Use with `https://developer.android.com/reference/android/os/Process#setThreadPriority(int)` and
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`, **not** with the normal
`https://developer.android.com/reference/java/lang/Thread` class.

<br />

Constant Value:

-8
(0xfffffff8)


### THREAD_PRIORITY_VIDEO

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int THREAD_PRIORITY_VIDEO
```

Standard priority of video threads. Applications should not normally
change to this priority.
Use with `https://developer.android.com/reference/android/os/Process#setThreadPriority(int)` and
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`, **not** with the normal
`https://developer.android.com/reference/java/lang/Thread` class.

<br />

Constant Value:

-10
(0xfffffff6)


### WIFI_UID

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int WIFI_UID
```

Defines the UID/GID for the WIFI native processes like wificond, supplicant, hostapd,
vendor HAL, etc.

<br />

Constant Value:

1010
(0x000003f2)


## Public constructors

### Process

```
public Process ()
```

<br />

<br />

## Public methods

### areUidsForSameApplication

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final boolean areUidsForSameApplication (int uid1, 
                int uid2)
```

Returns true if the two UIDs belong to the same application, taking mathematically mapped
UIDs (such as Private Compute Core sandbox) into account.

This method is user-aware. It will return false if the UIDs belong to different users,
even if they map to the same base App ID.

<br />

| Parameters ||
|---|---|
| `uid1` | `int` <br /> |
| `uid2` | `int` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### getAppUidForPrivateComputeCoreUid

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int getAppUidForPrivateComputeCoreUid (int uid)
```

Returns the app UID corresponding to a Private Compute Core UID.

<br />

| Parameters ||
|---|---|
| `uid` | `int`: the Private Compute Core UID <br /> |

| Returns ||
|---|---|
| `int` | the app UID for the given Private Compute Core UID <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if input is not a Private Compute Core UID |

### getAppUidForSdkSandboxUid

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int getAppUidForSdkSandboxUid (int uid)
```

Returns the app uid corresponding to an sdk sandbox uid.

<br />

| Parameters ||
|---|---|
| `uid` | `int`: the sdk sandbox uid <br /> |

| Returns ||
|---|---|
| `int` | the app uid for the given sdk sandbox uid <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if input is not an sdk sandbox uid |

**See also:**

- `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager`

### getElapsedCpuTime

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final long getElapsedCpuTime ()
```

Returns elapsed milliseconds of the time this process has run.

<br />

| Returns ||
|---|---|
| `long` | Returns the number of milliseconds this process has return. <br /> |

### getExclusiveCores

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int[] getExclusiveCores ()
```

On some devices, the foreground process may have one or more CPU
cores exclusively reserved for it. This method can be used to
retrieve which cores that are (if any), so the calling process
can then use sched_setaffinity() to lock a thread to these cores.
Note that the calling process must currently be running in the
foreground for this method to return any cores.

The CPU core(s) exclusively reserved for the foreground process will
stay reserved for as long as the process stays in the foreground.

As soon as a process leaves the foreground, those CPU cores will
no longer be reserved for it, and will most likely be reserved for
the new foreground process. It's not necessary to change the affinity
of your process when it leaves the foreground (if you had previously
set it to use a reserved core); the OS will automatically take care
of resetting the affinity at that point.

<br />

| Returns ||
|---|---|
| `int[]` | an array of integers, indicating the CPU cores exclusively reserved for this process. The array will have length zero if no CPU cores are exclusively reserved for this process at this point in time. <br /> |

### getGidForName

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int getGidForName (String name)
```

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.

<br />

| Parameters ||
|---|---|
| `name` | `String` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### getPrivateComputeCoreUidForAppUid

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int getPrivateComputeCoreUidForAppUid (int uid)
```

Returns the Private Compute Core UID corresponding to an app UID.

<br />

| Parameters ||
|---|---|
| `uid` | `int`: the app UID <br /> |

| Returns ||
|---|---|
| `int` | the Private Compute Core UID for the given app UID <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if input is not an app UID |

### getSdkSandboxUidForAppUid

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int getSdkSandboxUidForAppUid (int uid)
```

Returns the sdk sandbox uid corresponding to an app uid.

<br />

| Parameters ||
|---|---|
| `uid` | `int`: the app uid <br /> |

| Returns ||
|---|---|
| `int` | the sdk sandbox uid for the given app uid <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if input is not an app uid |

**See also:**

- `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager`

### getStartElapsedRealtime

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static long getStartElapsedRealtime ()
```

Return the `https://developer.android.com/reference/android/os/SystemClock#elapsedRealtime()` at which this process was started,
but before any of the application code was executed.


Value is a non-negative timestamp in the
`https://developer.android.com/reference/android/os/SystemClock#elapsedRealtime()` time base.

<br />

| Returns ||
|---|---|
| `long` | Value is a non-negative timestamp in the `https://developer.android.com/reference/android/os/SystemClock#elapsedRealtime()` time base. <br /> |

### getStartRequestedElapsedRealtime

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static long getStartRequestedElapsedRealtime ()
```

Return the `https://developer.android.com/reference/android/os/SystemClock#elapsedRealtime()` at which the system was about to
start this process. i.e. before a zygote fork.

More precisely, the system may start app processes before there's a start request,
in order to reduce the process start up latency, in which case this is set when the system
decides to "specialize" the process into a requested app.


Value is a non-negative timestamp in the
`https://developer.android.com/reference/android/os/SystemClock#elapsedRealtime()` time base.

<br />

| Returns ||
|---|---|
| `long` | Value is a non-negative timestamp in the `https://developer.android.com/reference/android/os/SystemClock#elapsedRealtime()` time base. <br /> |

### getStartRequestedUptimeMillis

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static long getStartRequestedUptimeMillis ()
```

Return the `https://developer.android.com/reference/android/os/SystemClock#uptimeMillis()` at which the system was about to
start this process. i.e. before a zygote fork.

More precisely, the system may start app processes before there's a start request,
in order to reduce the process start up latency, in which case this is set when the system
decides to "specialize" the process into a requested app.


Value is a non-negative timestamp in the
`https://developer.android.com/reference/android/os/SystemClock#uptimeMillis()` time base.

<br />

| Returns ||
|---|---|
| `long` | Value is a non-negative timestamp in the `https://developer.android.com/reference/android/os/SystemClock#uptimeMillis()` time base. <br /> |

### getStartUptimeMillis

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static long getStartUptimeMillis ()
```

Return the `https://developer.android.com/reference/android/os/SystemClock#uptimeMillis()` at which this process was started,
but before any of the application code was executed.


Value is a non-negative timestamp in the
`https://developer.android.com/reference/android/os/SystemClock#uptimeMillis()` time base.

<br />

| Returns ||
|---|---|
| `long` | Value is a non-negative timestamp in the `https://developer.android.com/reference/android/os/SystemClock#uptimeMillis()` time base. <br /> |

### getThreadPriority

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int getThreadPriority (int tid)
```

Return the current priority of a thread, based on Linux priorities.
Ignores the `java.lang.Thread.getPriority()` cached priority, which is used
to set the priority of newly created child Java threads.

<br />

| Parameters ||
|---|---|
| `tid` | `int`: The identifier of the thread/process. If tid equals zero, the priority of the calling process/thread will be returned. <br /> |

| Returns ||
|---|---|
| `int` | Returns the current priority, as a Linux priority level, from -20 for highest scheduling priority to 19 for lowest scheduling priority. Value is between -20 and `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_LOWEST` inclusive <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | Throws IllegalArgumentException if <var translate="no">tid</var> does not exist. |

### getUidForName

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int getUidForName (String name)
```

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.

<br />

| Parameters ||
|---|---|
| `name` | `String` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### is64Bit

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean is64Bit ()
```

Returns true if the current process is a 64-bit runtime.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isApplicationUid

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static boolean isApplicationUid (int uid)
```

Returns whether the given uid belongs to an application.

<br />

| Parameters ||
|---|---|
| `uid` | `int`: A kernel uid. <br /> |

| Returns ||
|---|---|
| `boolean` | Whether the uid corresponds to an application sandbox running in a specific user. <br /> |

### isIsolated

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean isIsolated ()
```

Returns whether the current process is in an isolated sandbox.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isIsolatedUid

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean isIsolatedUid (int uid)
```

Returns whether the process with the given `uid` is an isolated sandbox.

<br />

| Parameters ||
|---|---|
| `uid` | `int` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### isPrivateComputeCoreUid

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean isPrivateComputeCoreUid (int uid)
```

Returns whether the provided UID belongs to components running in a
Private Compute Core sandbox process.

<br />

| Parameters ||
|---|---|
| `uid` | `int` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### isSdkSandbox

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean isSdkSandbox ()
```

Returns whether the current process is a sdk sandbox process.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isSdkSandboxUid

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean isSdkSandboxUid (int uid)
```

Returns whether the provided UID belongs to an sdk sandbox process

<br />

| Parameters ||
|---|---|
| `uid` | `int` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager`

### killProcess

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final void killProcess (int pid)
```

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.

<br />

| Parameters ||
|---|---|
| `pid` | `int` <br /> |

### myPid

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int myPid ()
```

Returns the identifier of this process, which can be used with
`https://developer.android.com/reference/android/os/Process#killProcess(int)` and `https://developer.android.com/reference/android/os/Process#sendSignal(int,%20int)`.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### myProcessName

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static String myProcessName ()
```

Return the name of this process. By default, the process name is the same as the app's
package name, but this can be changed using `android:process`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### myTid

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int myTid ()
```

Returns the identifier of the calling thread, which be used with
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)`.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### myUid

Added in [API level 2](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int myUid ()
```

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 `https://developer.android.com/reference/android/os/Process#myUserHandle()` in that
a uid identifies a specific app sandbox in a specific user.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### myUserHandle

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static UserHandle myUserHandle ()
```

Returns this process's user handle. This is the
user the process is running under. It is distinct from
`https://developer.android.com/reference/android/os/Process#myUid()` in that a particular user will have multiple
distinct apps running under it each with their own uid.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/UserHandle` | <br /> |

### sendSignal

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final void sendSignal (int pid, 
                int signal)
```

Send a signal to the given process.

<br />

| Parameters ||
|---|---|
| `pid` | `int`: The pid of the target process. <br /> |
| `signal` | `int`: The signal to send. <br /> |

### setThreadPriority

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final void setThreadPriority (int tid, 
                int priority)
```

Set the OS priority of a thread, using Linux niceness priorities. Does not affect the value
cached for use by `java.lang.Thread.getPriority()`. If this is used with a
non-negative priority (Linux niceness), the priority may, on rare occasion, be reset
by the runtime to its cached value, especially when setting the priority of another thread.

The new priority is not inherited by Java-created child threads. It may or may not
be inherited by threads created from native code. Use `java/lang/Thread.setPriority()` to allow child threads to inherit the new priority.

<br />

| Parameters ||
|---|---|
| `tid` | `int`: The identifier of the thread/process to change. <br /> |
| `priority` | `int`: A Linux priority a.k.a. "niceness" level, from -20 for highest scheduling priority to 19 for lowest scheduling priority. Value is between -20 and `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_LOWEST` inclusive <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | Throws IllegalArgumentException if <var translate="no">tid</var> does not exist, or <var translate="no">priority</var> is out of range. |
| `https://developer.android.com/reference/java/lang/SecurityException` | Throws SecurityException if your process does not have permission to modify the given thread, or to use the given priority. |

### setThreadPriority

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final void setThreadPriority (int priority)
```

Set the priority of the calling thread, based on Linux niceness priorities. See
`https://developer.android.com/reference/android/os/Process#setThreadPriority(int,%20int)` for more information. This is preferred over
the two argument version when possible. The new priority is not inherited by Java
child threads.

<br />

| Parameters ||
|---|---|
| `priority` | `int`: A Linux priority level, from -20 for highest scheduling priority to 19 for lowest scheduling priority. Value is between -20 and `https://developer.android.com/reference/android/os/Process#THREAD_PRIORITY_LOWEST` inclusive <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | Throws IllegalArgumentException if <var translate="no">priority</var> is out of range. |
| `https://developer.android.com/reference/java/lang/SecurityException` | Throws SecurityException if your process does not have permission to modify the given thread, or to use the given priority. |

### supportsProcesses

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final boolean supportsProcesses ()
```


**This method was deprecated
in API level 15.**   

This method always returns true. Do not use.

Determine whether the current environment supports multiple processes.

<br />

| Returns ||
|---|---|
| `boolean` | Returns true if the system can run in multiple processes, else false if everything is running in a single process. <br /> |