diff options
author | Elliott Hughes <enh@google.com> | 2013-08-01 00:49:09 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-08-01 00:49:09 +0000 |
commit | c67b2ed50226c4758d0fc1434d39f6add6a0a533 (patch) | |
tree | 550cc7ef92d52ab54c29ba82f275194ca3703471 /core/java/android | |
parent | f2d643cfc7405c1f771cacab365a0a5d9b547f36 (diff) | |
parent | 6d4b1e24aef5b74b40de4d8f6e63c21874ce8e3a (diff) | |
download | frameworks_base-c67b2ed50226c4758d0fc1434d39f6add6a0a533.zip frameworks_base-c67b2ed50226c4758d0fc1434d39f6add6a0a533.tar.gz frameworks_base-c67b2ed50226c4758d0fc1434d39f6add6a0a533.tar.bz2 |
Merge changes I80eaecff,Ia2b4f79b
* changes:
Switch Process.myTid over to the libcore JNI too.
Replace native Process getpid/getuid with calls to libcore equivalents.
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/ddm/DdmHandleHello.java | 4 | ||||
-rw-r--r-- | core/java/android/os/Process.java | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/core/java/android/ddm/DdmHandleHello.java b/core/java/android/ddm/DdmHandleHello.java index 842a482..220b40d 100644 --- a/core/java/android/ddm/DdmHandleHello.java +++ b/core/java/android/ddm/DdmHandleHello.java @@ -97,7 +97,9 @@ public class DdmHandleHello extends ChunkHandler { } /* - * Handle introductory packet. + * Handle introductory packet. This is called during JNI_CreateJavaVM + * before frameworks native methods are registered, so be careful not + * to call any APIs that depend on frameworks native code. */ private Chunk handleHELO(Chunk request) { if (false) diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index 476b4ea..ebeb9f8 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -27,6 +27,8 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.util.ArrayList; +import libcore.io.Libcore; + /*package*/ class ZygoteStartFailedEx extends Exception { /** * Something prevented the zygote process startup from happening normally @@ -647,13 +649,17 @@ public class Process { * Returns the identifier of this process, which can be used with * {@link #killProcess} and {@link #sendSignal}. */ - public static final native int myPid(); + public static final int myPid() { + return Libcore.os.getpid(); + } /** * Returns the identifier of the calling thread, which be used with * {@link #setThreadPriority(int, int)}. */ - public static final native int myTid(); + public static final int myTid() { + return Libcore.os.gettid(); + } /** * Returns the identifier of this process's uid. This is the kernel uid @@ -661,7 +667,9 @@ public class Process { * app-specific sandbox. It is different from {@link #myUserHandle} in that * a uid identifies a specific app sandbox in a specific user. */ - public static final native int myUid(); + public static final int myUid() { + return Libcore.os.getuid(); + } /** * Returns this process's user handle. This is the |