summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjgu21 <jinghui.gu@intel.com>2014-09-06 01:36:04 -0400
committerAndreas Gampe <agampe@google.com>2014-09-24 14:57:19 -0700
commita1bb82d0c77c4f0f1c7807caac2a4e526ffe4240 (patch)
tree646fe0e368cd94069296ac5e7765373649680a06
parent352ffc52af68c7f37dc6848f158d66253c11379d (diff)
downloadlibcore-a1bb82d0c77c4f0f1c7807caac2a4e526ffe4240.zip
libcore-a1bb82d0c77c4f0f1c7807caac2a4e526ffe4240.tar.gz
libcore-a1bb82d0c77c4f0f1c7807caac2a4e526ffe4240.tar.bz2
Libcore: Allow "os.arch" system property to be changed
In a native bridge environment, it is necessary to change the "os.arch" system property to reflect the emulated architecture. Change-Id: I0b93da93251c6b4638de786bf98cf99df07c3fc2 Signed-off-by: jgu21 <jinghui.gu@intel.com>
-rw-r--r--luni/src/main/java/java/lang/System.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/luni/src/main/java/java/lang/System.java b/luni/src/main/java/java/lang/System.java
index 6cc77e6..bc45196 100644
--- a/luni/src/main/java/java/lang/System.java
+++ b/luni/src/main/java/java/lang/System.java
@@ -763,7 +763,6 @@ public final class System {
}
StructUtsname info = Libcore.os.uname();
- p.put("os.arch", info.machine);
p.put("os.name", info.sysname);
p.put("os.version", info.release);
@@ -781,6 +780,10 @@ public final class System {
private static Properties createSystemProperties() {
Properties p = new PropertiesWithNonOverrideableDefaults(unchangeableSystemProperties);
+
+ // "os.arch" is a property that changes under native bridge emulation.
+ p.put("os.arch", Libcore.os.uname().machine);
+
// On Android, each app gets its own temporary directory.
// (See android.app.ActivityThread.) This is just a fallback default,
// useful only on the host.