summaryrefslogtreecommitdiff
path: root/core/java/android/os/Process.java
diff options
context:
space:
mode:
authorSrinath Sridharan <srinathsr@google.com>2016-07-19 15:16:11 -0700
committerSrinath Sridharan <srinathsr@google.com>2016-07-20 13:20:21 -0700
commit1b15d13243d7e7f672713f21f0c46d88c3c067a2 (patch)
treeaf45d18e30af5077fe30e869881c5472acbdf831 /core/java/android/os/Process.java
parent586f23c14b95037ad799ca0f0828184db5b0e1bf (diff)
Adding a new getThreadScheduler() method.
bug: 30226969 Change-Id: Icbd57e99740ebf6ba744a103e6fa69a3160c9422
Diffstat (limited to 'core/java/android/os/Process.java')
-rw-r--r--core/java/android/os/Process.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 57b40e559ccd..4ef882e1aa78 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -16,6 +16,7 @@
package android.os;
+import android.annotation.TestApi;
import android.net.LocalSocket;
import android.net.LocalSocketAddress;
import android.system.Os;
@@ -1068,6 +1069,24 @@ public class Process {
throws IllegalArgumentException;
/**
+ * Return the current scheduling policy of a thread, based on Linux.
+ *
+ * @param tid The identifier of the thread/process to get the scheduling policy.
+ *
+ * @throws IllegalArgumentException Throws IllegalArgumentException if
+ * <var>tid</var> does not exist, or if <var>priority</var> is out of range for the policy.
+ * @throws SecurityException Throws SecurityException if your process does
+ * not have permission to modify the given thread, or to use the given
+ * scheduling policy or priority.
+ *
+ * {@hide}
+ */
+
+ @TestApi
+ public static final native int getThreadScheduler(int tid)
+ throws IllegalArgumentException;
+
+ /**
* Set the scheduling policy and priority of a thread, based on Linux.
*
* @param tid The identifier of the thread/process to change.
@@ -1082,6 +1101,7 @@ public class Process {
*
* {@hide}
*/
+
public static final native void setThreadScheduler(int tid, int policy, int priority)
throws IllegalArgumentException;