summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-10-01 22:37:56 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-01 22:37:56 +0000
commitac650337dd922d742b609f30df922adf2ab8f38d (patch)
tree7d4764f30e363f030603ee805b3a384a4e6fcf14
parent6acfbbd43381d0d3a43952bc0896fd9f203bc191 (diff)
parentf8638c30c92778d307d056fa61448584141c3f05 (diff)
downloadlibcore-ac650337dd922d742b609f30df922adf2ab8f38d.zip
libcore-ac650337dd922d742b609f30df922adf2ab8f38d.tar.gz
libcore-ac650337dd922d742b609f30df922adf2ab8f38d.tar.bz2
am f8638c30: Add method for initializing unchangeable system properties.
* commit 'f8638c30c92778d307d056fa61448584141c3f05': Add method for initializing unchangeable system properties.
-rw-r--r--luni/src/main/java/java/lang/System.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/luni/src/main/java/java/lang/System.java b/luni/src/main/java/java/lang/System.java
index bc45196..ed75534 100644
--- a/luni/src/main/java/java/lang/System.java
+++ b/luni/src/main/java/java/lang/System.java
@@ -763,6 +763,7 @@ 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);
@@ -778,12 +779,18 @@ public final class System {
return p;
}
+ /**
+ * Inits an unchangeable system property with the given value.
+ * This is useful when the environment needs to change under native bridge emulation.
+ */
+ private static void initUnchangeableSystemProperty(String name, String value) {
+ checkPropertyName(name);
+ unchangeableSystemProperties.put(name, value);
+ }
+
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.