summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-04-03 16:56:32 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-04-03 16:56:32 +0000
commitc6f6ba3265d2b07649277682fd3ca0f9ce4d011a (patch)
tree94f163ea0ae453d5beb396fc82b250924bf89895 /core
parent33822312e65a38400b189c6deda59b8d047b89cf (diff)
parent71ae2bd42be21de6d25d1f8c52e3973c172462df (diff)
downloadframeworks_base-c6f6ba3265d2b07649277682fd3ca0f9ce4d011a.zip
frameworks_base-c6f6ba3265d2b07649277682fd3ca0f9ce4d011a.tar.gz
frameworks_base-c6f6ba3265d2b07649277682fd3ca0f9ce4d011a.tar.bz2
am 71ae2bd4: am f87b3a25: am 374db6c3: Merge "Remove ProcessState::mArgc,mArgV,mArgLen"
* commit '71ae2bd42be21de6d25d1f8c52e3973c172462df': Remove ProcessState::mArgc,mArgV,mArgLen
Diffstat (limited to 'core')
-rw-r--r--core/jni/AndroidRuntime.cpp11
-rw-r--r--core/jni/android_util_Process.cpp6
2 files changed, 12 insertions, 5 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 6afeb86..4759451 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -229,9 +229,10 @@ int register_com_android_internal_os_RuntimeInit(JNIEnv* env)
/*static*/ JavaVM* AndroidRuntime::mJavaVM = NULL;
-
-AndroidRuntime::AndroidRuntime() :
- mExitWithoutCleanup(false)
+AndroidRuntime::AndroidRuntime(char* argBlockStart, const size_t argBlockLength) :
+ mExitWithoutCleanup(false),
+ mArgBlockStart(argBlockStart),
+ mArgBlockLength(argBlockLength)
{
SkGraphics::Init();
// this sets our preference for 16bit images during decode
@@ -266,6 +267,10 @@ AndroidRuntime::~AndroidRuntime()
return jniRegisterNativeMethods(env, className, gMethods, numMethods);
}
+void AndroidRuntime::setArgv0(const char* argv0) {
+ strlcpy(mArgBlockStart, argv0, mArgBlockLength);
+}
+
status_t AndroidRuntime::callMain(const char* className,
jclass clazz, int argc, const char* const argv[])
{
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index cbed99f..a4efed7 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -19,8 +19,8 @@
#include <utils/Log.h>
#include <binder/IPCThreadState.h>
-#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
+#include <cutils/process_name.h>
#include <cutils/sched_policy.h>
#include <utils/String8.h>
#include <utils/Vector.h>
@@ -385,7 +385,9 @@ void android_os_Process_setArgV0(JNIEnv* env, jobject clazz, jstring name)
}
if (name8.size() > 0) {
- ProcessState::self()->setArgV0(name8.string());
+ const char* procName = name8.string();
+ set_process_name(procName);
+ AndroidRuntime::getRuntime()->setArgv0(procName);
}
}