diff options
| author | Dianne Hackborn <hackbod@google.com> | 2010-05-10 17:27:14 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-05-10 17:27:14 -0700 |
| commit | 6d00151c519d5c131cc1480978fe4417cc7bcc79 (patch) | |
| tree | 78e489c6a334e598aa55c2b0b917ebfe6980a1f3 /core | |
| parent | 1926c471a3acde38931f2cbd55415decc9879d2d (diff) | |
| parent | 906497c574d45d8dfd295b16dece0d0bc32c0895 (diff) | |
| download | frameworks_base-6d00151c519d5c131cc1480978fe4417cc7bcc79.zip frameworks_base-6d00151c519d5c131cc1480978fe4417cc7bcc79.tar.gz frameworks_base-6d00151c519d5c131cc1480978fe4417cc7bcc79.tar.bz2 | |
Merge "Hopefully fix issue #2662536: Why is launcher being killed?" into froyo
Diffstat (limited to 'core')
| -rw-r--r-- | core/java/android/os/Process.java | 18 | ||||
| -rw-r--r-- | core/jni/android_util_Process.cpp | 10 |
2 files changed, 27 insertions, 1 deletions
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index 4887783..5640a06 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -747,6 +747,24 @@ public class Process { */ public static final native void sendSignal(int pid, int signal); + /** + * @hide + * Private impl for avoiding a log message... DO NOT USE without doing + * your own log, or the Android Illuminati will find you some night and + * beat you up. + */ + public static final void killProcessQuiet(int pid) { + sendSignalQuiet(pid, SIGNAL_KILL); + } + + /** + * @hide + * Private impl for avoiding a log message... DO NOT USE without doing + * your own log, or the Android Illuminati will find you some night and + * beat you up. + */ + public static final native void sendSignalQuiet(int pid, int signal); + /** @hide */ public static final native long getFreeMemory(); diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp index e84f2e5..68be741 100644 --- a/core/jni/android_util_Process.cpp +++ b/core/jni/android_util_Process.cpp @@ -311,8 +311,8 @@ jboolean android_os_Process_setOomAdj(JNIEnv* env, jobject clazz, sprintf(text, "%d", adj); write(fd, text, strlen(text)); close(fd); - return true; } + return true; } #endif return false; @@ -797,6 +797,13 @@ void android_os_Process_sendSignal(JNIEnv* env, jobject clazz, jint pid, jint si } } +void android_os_Process_sendSignalQuiet(JNIEnv* env, jobject clazz, jint pid, jint sig) +{ + if (pid > 0) { + kill(pid, sig); + } +} + static jlong android_os_Process_getElapsedCpuTime(JNIEnv* env, jobject clazz) { struct timespec ts; @@ -854,6 +861,7 @@ static const JNINativeMethod methods[] = { {"setUid", "(I)I", (void*)android_os_Process_setUid}, {"setGid", "(I)I", (void*)android_os_Process_setGid}, {"sendSignal", "(II)V", (void*)android_os_Process_sendSignal}, + {"sendSignalQuiet", "(II)V", (void*)android_os_Process_sendSignalQuiet}, {"supportsProcesses", "()Z", (void*)android_os_Process_supportsProcesses}, {"getFreeMemory", "()J", (void*)android_os_Process_getFreeMemory}, {"readProcLines", "(Ljava/lang/String;[Ljava/lang/String;[J)V", (void*)android_os_Process_readProcLines}, |
