diff options
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 |