summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-10-29 15:48:11 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-29 15:48:12 +0000
commitef0a7e8fdbf60d6e5cc5f274f94516c3077895e5 (patch)
treef8c712f520369599e42b6c5d75307f395e7020aa
parent5b0f193d25218557a23bdd7b4ee44d6932b71115 (diff)
parente11952ecd5f170b66f6fe9e13d927c233777d65e (diff)
downloadframeworks_base-ef0a7e8fdbf60d6e5cc5f274f94516c3077895e5.zip
frameworks_base-ef0a7e8fdbf60d6e5cc5f274f94516c3077895e5.tar.gz
frameworks_base-ef0a7e8fdbf60d6e5cc5f274f94516c3077895e5.tar.bz2
Merge "Use native brige only if we have a private data directory." into lmp-mr1-dev
-rw-r--r--core/jni/com_android_internal_os_Zygote.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 1eb83b2..4f5e08b 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -436,10 +436,6 @@ static pid_t ForkAndSpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArra
pid_t pid = fork();
if (pid == 0) {
- if (!is_system_server && dataDir == NULL) {
- ALOGE("Application private dir cannot be null");
- RuntimeAbort(env);
- }
// The child process.
gMallocLeakZygoteChild = 1;
@@ -462,6 +458,14 @@ static pid_t ForkAndSpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArra
ScopedUtfChars isa_string(env, instructionSet);
use_native_bridge = android::NeedsNativeBridge(isa_string.c_str());
}
+ if (use_native_bridge && dataDir == NULL) {
+ // dataDir should never be null if we need to use a native bridge.
+ // In general, dataDir will never be null for normal applications. It can only happen in
+ // special cases (for isolated processes which are not associated with any app). These are
+ // launched by the framework and should not be emulated anyway.
+ use_native_bridge = false;
+ ALOGW("Native bridge will not be used because dataDir == NULL.");
+ }
if (!MountEmulatedStorage(uid, mount_external, use_native_bridge)) {
ALOGW("Failed to mount emulated storage: %s", strerror(errno));