From f7fb59f46848901875d317fdaa1008b63fd74ad2 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 16 Mar 2010 16:43:17 -0700 Subject: 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 --- luni-kernel/src/main/java/java/lang/System.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'luni-kernel/src') 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. -- cgit v1.1