summaryrefslogtreecommitdiffstats
path: root/luni-kernel/src
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2010-03-16 16:43:17 -0700
committerElliott Hughes <enh@google.com>2010-03-16 17:28:06 -0700
commitf7fb59f46848901875d317fdaa1008b63fd74ad2 (patch)
tree2fc985c2c36b32da80cc5abbc6b29e58401f8bd4 /luni-kernel/src
parent9f013cac04b2b24101ee97b92944706140a81760 (diff)
downloadlibcore-f7fb59f46848901875d317fdaa1008b63fd74ad2.zip
libcore-f7fb59f46848901875d317fdaa1008b63fd74ad2.tar.gz
libcore-f7fb59f46848901875d317fdaa1008b63fd74ad2.tar.bz2
Add Java 6's java.io.Console.
This is actually functional, if you're in the mood to "adb shell". The implementation is based on harmony's, but with the initialization and native code rewritten, with readPassword responsible for echoing a newline (so we don't have to play silly tricks with the ECHONL flag), and a vastly simplified ConsoleReader class. I've also rewritten the documentation. Change-Id: I902b47fb27a8fdb2d6f067bb905ee02c6a10e454
Diffstat (limited to 'luni-kernel/src')
-rw-r--r--luni-kernel/src/main/java/java/lang/System.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/luni-kernel/src/main/java/java/lang/System.java b/luni-kernel/src/main/java/java/lang/System.java
index aa78b1b..6a69c2e 100644
--- a/luni-kernel/src/main/java/java/lang/System.java
+++ b/luni-kernel/src/main/java/java/lang/System.java
@@ -32,6 +32,7 @@
package java.lang;
+import java.io.Console;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -496,6 +497,17 @@ public final class System {
}
/**
+ * Returns the {@link java.io.Console} associated with this VM, or null.
+ * Not all VMs will have an associated console. A console is typically only
+ * available for programs run from the command line.
+ * @since 1.6
+ * @hide
+ */
+ public static Console console() {
+ return Console.getConsole();
+ }
+
+ /**
* Returns the active security manager.
*
* @return the system security manager object.