summaryrefslogtreecommitdiffstats
path: root/cmds/app_process
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-03-14 16:31:34 -0700
committerNick Kralevich <nnk@google.com>2013-03-14 16:31:34 -0700
commit5fa1ee779e2170fd2e3e96b1e0887f15b04b1f76 (patch)
treebb51821e615f0a1b70dc962cbac893106ce9f024 /cmds/app_process
parentf732108e86fcc9825d5ecaa0b65ee91469c4a24c (diff)
downloadframeworks_base-5fa1ee779e2170fd2e3e96b1e0887f15b04b1f76.zip
frameworks_base-5fa1ee779e2170fd2e3e96b1e0887f15b04b1f76.tar.gz
frameworks_base-5fa1ee779e2170fd2e3e96b1e0887f15b04b1f76.tar.bz2
Don't use ADDR_COMPAT_LAYOUT on the emulator
For the emulator, we want people to see memory as it actually is, not how we're hacking around buggy apps. Don't set ADDR_COMPAT_LAYOUT on the emulator. For reasons that I don't understand, personality(ADDR_COMPAT_LAYOUT) does not persist across an exec on the emulator. app_main gets into a tight loop restarting itself because of this. This change also works around that bug. Change-Id: Ia73a7d2d623c25cf39d248145d97307945d554da
Diffstat (limited to 'cmds/app_process')
-rw-r--r--cmds/app_process/app_main.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp
index de7931d..b54774e 100644
--- a/cmds/app_process/app_main.cpp
+++ b/cmds/app_process/app_main.cpp
@@ -12,6 +12,7 @@
#include <utils/Log.h>
#include <cutils/process_name.h>
#include <cutils/memory.h>
+#include <cutils/properties.h>
#include <android_runtime/AndroidRuntime.h>
#include <sys/personality.h>
@@ -143,11 +144,15 @@ int main(int argc, char* const argv[])
* This breaks some programs which improperly embed
* an out of date copy of Android's linker.
*/
- int current = personality(0xFFFFFFFF);
- if ((current & ADDR_COMPAT_LAYOUT) == 0) {
- personality(current | ADDR_COMPAT_LAYOUT);
- execv("/system/bin/app_process", argv);
- return -1;
+ char value[PROPERTY_VALUE_MAX];
+ property_get("ro.kernel.qemu", value, "");
+ if (strcmp(value, "1") != 0) {
+ int current = personality(0xFFFFFFFF);
+ if ((current & ADDR_COMPAT_LAYOUT) == 0) {
+ personality(current | ADDR_COMPAT_LAYOUT);
+ execv("/system/bin/app_process", argv);
+ return -1;
+ }
}
#endif