OSDN Git Service

android-x86/packages-apps-AndroidTerm.git
12 years agouse LOCAL_REQUIRED_MODULES to build with android tree honeycomb-x86
Chih-Wei Huang [Mon, 21 Nov 2011 06:53:49 +0000 (14:53 +0800)]
use LOCAL_REQUIRED_MODULES to build with android tree

12 years agofix LOCAL_MODULE_TAGS issue
Chih-Wei Huang [Mon, 21 Nov 2011 06:53:07 +0000 (14:53 +0800)]
fix LOCAL_MODULE_TAGS issue

12 years agoRevert "Make sure we build on API level 10."
Chih-Wei Huang [Wed, 9 Nov 2011 16:38:42 +0000 (00:38 +0800)]
Revert "Make sure we build on API level 10."

This reverts commit b2d747b905222292b97ea9736c70cf83debc6120.

12 years agoColor tweaks
Steven Luo [Sun, 6 Nov 2011 08:25:10 +0000 (01:25 -0700)]
Color tweaks

Other terminals which offer color support generally have two sets of
colors, a "dim" set for regular text and backgrounds and a "bright" set
for use with bold text.  At the moment, Android Terminal Emulator uses
the same set of eight colors for backgrounds, normal text, and bold
text, which causes one notable problem: applications generally expect
bold text colored black to be displayed as "bright black" (a dark gray),
but this text is invisible in Android Terminal Emulator in the
white-on-black configuration.

Fix this by extending the array of foreground colors to include "bright"
colors (actually, the same colors we were using before, except for the
addition of a "bright black"), taking advantage of the fact that we're
using the high bit of the foreground color to store bold information.
We dim the regular set of colors slightly, to distinguish them from the
bright colors.

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoMake changes to UTF-8 preference take effect immediately in running sessions
Steven Luo [Sun, 6 Nov 2011 08:24:40 +0000 (01:24 -0700)]
Make changes to UTF-8 preference take effect immediately in running sessions

Add a updatePrefs() method in TermSession and TerminalEmulator and call
it from Term's updatePrefs(), so that changes to the UTF-8 preference
will be picked up immediately by running terminal sessions.

Note that a terminal emulator will ignore the UTF-8 preference once any
application running in it uses one of the ESC % codes to request a
specific character set.

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoFix fast resize when screen shrinks
Steven Luo [Sun, 6 Nov 2011 08:24:31 +0000 (01:24 -0700)]
Fix fast resize when screen shrinks

When the line containing the cursor is blank, and the cursor is not at
the bottom edge of the screen, fast resize will move the line containing
the cursor off the screen.  Fix this by ensuring that fast resize never
considers lines at or above the cursor for shrinking.

This patch prevents a crash which occurs when a full resize operation is
conducted immediately after this bug is triggered (the full resize
attempts to fetch the character at the cursor, which is off the screen,
causing an IllegalArgumentException).

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoDeclare version 1.0.35
Jack Palevich [Mon, 24 Oct 2011 17:05:48 +0000 (10:05 -0700)]
Declare version 1.0.35

12 years agoCreate Android 1.5 version of notification icon.
Jack Palevich [Mon, 24 Oct 2011 16:50:26 +0000 (09:50 -0700)]
Create Android 1.5 version of notification icon.

Use MDPI version, as Android 1.5 devices are defined to be MDPI.

12 years agoUpdate documentation checklist.
Jack Palevich [Mon, 24 Oct 2011 16:41:58 +0000 (09:41 -0700)]
Update documentation checklist.

12 years agoAdd notification icon for use with Android 1.5
Jack Palevich [Mon, 24 Oct 2011 16:41:31 +0000 (09:41 -0700)]
Add notification icon for use with Android 1.5

12 years agoUpdate service notification icon.
Jack Palevich [Mon, 24 Oct 2011 16:34:18 +0000 (09:34 -0700)]
Update service notification icon.

Used "Android Asset Studio" to create the icons from a template.

12 years agoUpdate checklist.
Jack Palevich [Sun, 23 Oct 2011 17:49:10 +0000 (10:49 -0700)]
Update checklist.

12 years agoAdd a publish checklist.
Jack Palevich [Sun, 23 Oct 2011 17:29:27 +0000 (10:29 -0700)]
Add a publish checklist.

12 years agoBump version number.
Jack Palevich [Sun, 23 Oct 2011 17:13:52 +0000 (10:13 -0700)]
Bump version number.

12 years agoRevert "Return empty ExtractedText instead of null from getExtractedText()"
Jack Palevich [Sun, 23 Oct 2011 17:07:28 +0000 (10:07 -0700)]
Revert "Return empty ExtractedText instead of null from getExtractedText()"

This reverts commit 2d640ff2381925d9784248712671b7c47f2b7f56.

The original commit broke Swype soft keyboard support.

12 years agoMake sure we build on API level 10.
Jack Palevich [Sun, 23 Oct 2011 13:56:22 +0000 (06:56 -0700)]
Make sure we build on API level 10.

(Previously our manifest said we used API level 10, but we actually built
against API level 11.)

12 years agoAvoid possible overflow if the text ends in a high surrogate.
Jack Palevich [Sun, 23 Oct 2011 01:39:24 +0000 (18:39 -0700)]
Avoid possible overflow if the text ends in a high surrogate.

12 years agoAdd link to Android Market.
Jack Palevich [Sat, 22 Oct 2011 12:57:23 +0000 (05:57 -0700)]
Add link to Android Market.

12 years agoA UTF-8 encoded text file
Jack Palevich [Sat, 22 Oct 2011 12:24:24 +0000 (05:24 -0700)]
A UTF-8 encoded text file

From http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt

This test file shows that we don't currently handle many obscure parts
of unicode rendering, including combining diacritics, brail, etc.

12 years agoCreate a status bar notification icon.
Jack Palevich [Sat, 22 Oct 2011 03:58:24 +0000 (20:58 -0700)]
Create a status bar notification icon.

See http://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html

12 years agoRemove executable bit.
Jack Palevich [Sat, 22 Oct 2011 03:21:57 +0000 (20:21 -0700)]
Remove executable bit.

These files are not executable, and should not have executable bits
set.

These bits sometimes gets set when importing files from Windows.

12 years agoMove atari font notice out of res directory.
Jack Palevich [Sat, 22 Oct 2011 03:06:41 +0000 (20:06 -0700)]
Move atari font notice out of res directory.

12 years agoIncrement version number.
Jack Palevich [Sat, 22 Oct 2011 03:01:22 +0000 (20:01 -0700)]
Increment version number.

12 years agoImplement fast resize for cases where width remains constant
Steven Luo [Tue, 11 Oct 2011 10:20:14 +0000 (03:20 -0700)]
Implement fast resize for cases where width remains constant

A resize operation currently requires getting the entire transcript
text, throwing away the backing store, constructing a new one, and then
writing the transcript to the new store.  Particularly when the
transcript is large, this is a slow and inefficient operation.

As it turns out, it's really quite easy to change the number of screen
rows for a particular backing store, which allows much faster resize
operations in the case where the number of columns does not change.
This is particularly useful when using soft keyboards, where the number
of rows will change depending on whether the keyboard is displayed, but
the number of columns doesn't.

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoMake the screen a movable window in the transcript buffer
Steven Luo [Tue, 11 Oct 2011 10:20:08 +0000 (03:20 -0700)]
Make the screen a movable window in the transcript buffer

Instead of the current scheme of having 0..mScreenRows-1 be the screen,
and everything else be the transcript, let the screen be a movable
window into the circular buffer.  This allows scrolling the whole screen
to be much faster (just move the window), and should make fast resize
easier.

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoPreserve colors and formatting across screen size changes
Steven Luo [Tue, 11 Oct 2011 10:05:26 +0000 (03:05 -0700)]
Preserve colors and formatting across screen size changes

Currently, getTranscriptText() has no option for preserving
color/formatting information, so this information is lost when resizing
the screen.  Fix this by adding a variant of getTranscriptText() which
accepts a StringBuilder in which color information will be stored, and
using it during resize operations.

To save memory, this implementation only preserves color information for
regions of the screen which contain text, so blank areas of the screen
with colored backgrounds will still revert to the default background
color.

(Why StringBuilder?  Post-Unicode, we cannot store information in the
upper bits of a char, as we would have before.  An ArrayList<Byte> would
be the most natural fit, but the need to box the values creates serious
memory overhead.  StringBuilder handles dynamic sizing of the array for
us and uses less memory per cell than an ArrayList.)

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoAdd a hack to remember the cursor position across screen size changes
Steven Luo [Tue, 11 Oct 2011 10:05:20 +0000 (03:05 -0700)]
Add a hack to remember the cursor position across screen size changes

As it stands, the cursor ends up immediately after the last
non-whitespace character in the transcript after a screen resize, which
is very frequently incorrect (the last character in the output is
often a space or newline, and it's possible the cursor has been moved,
as during command line editing).

Since lines could be re-wrapped during the screen size update, there's
no easy way to calculate where the cursor should end up.  Therefore, we
use a hack: since ASCII ESC (\033) is non-printable and should never be
part of the transcript, we mark the cursor location with an ESC before
resizing, and restore the cursor to the location where the ESC ends up
afterwards (taking care to save and restore the real character at the
cursor position correctly).

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoReturn empty ExtractedText instead of null from getExtractedText()
Steven Luo [Tue, 11 Oct 2011 10:05:11 +0000 (03:05 -0700)]
Return empty ExtractedText instead of null from getExtractedText()

This silences the following error message in logs:

E/InputMethodService(29043): Unexpected null in startExtractingText : mExtractedText = null, input connection = com.android.internal.view.InputConnectionWrapper@405ef968

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoHide the soft keyboard when pausing the activity
Steven Luo [Tue, 11 Oct 2011 10:04:48 +0000 (03:04 -0700)]
Hide the soft keyboard when pausing the activity

Otherwise, the keyboard will remain open after the user leaves the
activity, possibly covering up part of whatever the user is now doing.

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoReturn early from charWidth() for all ASCII printable chars, not just space
Steven Luo [Tue, 11 Oct 2011 10:04:33 +0000 (03:04 -0700)]
Return early from charWidth() for all ASCII printable chars, not just space

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoFix off-by-one error in getting selected text
Steven Luo [Tue, 11 Oct 2011 10:04:15 +0000 (03:04 -0700)]
Fix off-by-one error in getting selected text

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoFix getTranscriptText() behavior with autowrapped lines
Steven Luo [Tue, 11 Oct 2011 10:04:10 +0000 (03:04 -0700)]
Fix getTranscriptText() behavior with autowrapped lines

Since the Unicode patches, internalGetTranscriptText() has been
ignoring trailing whitespace for lines that were autowrapped, which
causes the content which was wrapped to the next line to be appended
immediately after the last printing character -- not its original
location.  This patch fixes that regression.

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoAvoid going off end of offset array when going from width 2 to 1 at end of line
Steven Luo [Tue, 11 Oct 2011 10:04:06 +0000 (03:04 -0700)]
Avoid going off end of offset array when going from width 2 to 1 at end of line

Why this is happening is somewhat puzzling in the first place (since a
width 2 character doesn't fit at the end of the line), but this prevents
a crash.

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agogetEastAsianWidth: Actually invoke method after initializing when first called
Jack Palevich [Sat, 22 Oct 2011 02:39:41 +0000 (19:39 -0700)]
getEastAsianWidth: Actually invoke method after initializing when first called

Signed-off-by: Jack Palevich <jackpal@google.com>
12 years agoUpdate project organization for SDK version 14
Jack Palevich [Sat, 22 Oct 2011 02:37:20 +0000 (19:37 -0700)]
Update project organization for SDK version 14

12 years agoEnable code to run pre-SDK-level 8.
Jack Palevich [Mon, 10 Oct 2011 00:14:21 +0000 (17:14 -0700)]
Enable code to run pre-SDK-level 8.

Introduce a utility class to deal with post-SDK-level-3 APIs.

Cache the SDK level as an integer at start-up.

Use reflection to access post-SDK-level-3 APIs.

Add early out for space character, which shows up frequently.

12 years agoMicro optimization: avoid unnescessary shifts.
Jack Palevich [Mon, 10 Oct 2011 00:09:57 +0000 (17:09 -0700)]
Micro optimization: avoid unnescessary shifts.

12 years agoShorten UI message for "Default to UTF-8 mode".
Jack Palevich [Mon, 10 Oct 2011 00:08:44 +0000 (17:08 -0700)]
Shorten UI message for "Default to UTF-8 mode".

The original message text, while more accurate, did not fit in the UI.

12 years agoRestore SCREEN_CHECK_PERIOD constant.
Jack Palevich [Sun, 9 Oct 2011 22:15:34 +0000 (15:15 -0700)]
Restore SCREEN_CHECK_PERIOD constant.

(I think Steven has a patch in his source tree that removes the need to
use SCREEN_CHECK_PERIOD, but that patch wasn't accepted for the main
branch, so SCREEN_CHECK_PERIOD is unused in Steven's tree, but is still
required for the main branch.)

12 years agoSupport for Unicode text input and UTF-8 I/O to process
Steven Luo [Sat, 1 Oct 2011 05:48:47 +0000 (22:48 -0700)]
Support for Unicode text input and UTF-8 I/O to process

* Ensure all output paths produce UTF-8
* Decode UTF-8 sequences in the input
* Support switching to/from UTF-8 mode using ESC % escape codes
* Add a preference to control whether the emulator is in UTF-8 mode by
  default

Signed-off-by: Jack Palevich <jack.palevich@gmail.com>
12 years agoSupport displaying Unicode text
Steven Luo [Sat, 1 Oct 2011 05:48:35 +0000 (22:48 -0700)]
Support displaying Unicode text

The current scheme, whereby we store the contents of our screen in an
array of char (two bytes in Java) with the upper byte used to encode
color and formatting information, is fundamentally incompatible with
Unicode, where the available encodings all either need more than one
byte per character or are variable-length encodings.

Instead, we use a new UnicodeTranscript class, which stores the
transcript row by row and includes facilities to handle combining
characters and East Asian wide characters.

We also need to make some minor changes to the code which displays text
on screen to support Unicode output.

Signed-off-by: Jack Palevich <jack.palevich@gmail.com>
12 years agoAdd a transcript backing store suitable for Unicode text
Steven Luo [Sat, 1 Oct 2011 05:48:23 +0000 (22:48 -0700)]
Add a transcript backing store suitable for Unicode text

Storing Unicode text in a form suitable for a terminal emulator poses
several challenges:

* In Java's native UTF-16 encoding, some Unicode code points (those
  outside the Basic Multilingual Plane) require two chars to express.
* The use of combining characters means that it's possible for the
  character displayed in one column/screen position to require several
  Unicode code points to express.
* Some Unicode code points (particularly East Asian wide characters,
  which include all of the CJK ideographs) take up two columns/screen
  positions.

The UnicodeTranscript class is designed to make the operations we need
most frequently -- storing a character to a particular screen position,
and getting all or part of a line -- as fast as possible.  The design
uses an array of two types of lines: "basic", which is just an array of
char[], and is used to store a line as long as it has no combining
characters, wide characters, or non-BMP characters; and "full", which is
an array of char[] together with an array of offsets allowing us to
easily find a particular column in the line.  Basic lines in the
transcript are automatically converted to full lines as needed.
Color/formatting information and line wrapping information are stored in
separate arrays.

We also expose a static method, charWidth(), which returns the number of
columns/screen positions that a particular Unicode code point will use.
This information is needed by other parts of the emulator to correctly
handle Unicode.

Correct support for East Asian wide characters requires Android 2.2 or
later -- 2.2 introduced a getEastAsianWidth() method, which we use to
determine the width of a character.  On older platforms, we just pretend
all characters which aren't combining or control characters have width
1.

Signed-off-by: Jack Palevich <jack.palevich@gmail.com>
12 years agoOptimize getTranscriptText()
Steven Luo [Sat, 1 Oct 2011 05:48:08 +0000 (22:48 -0700)]
Optimize getTranscriptText()

The current implementation is going through each line character by
character, even for lines that are known to be unwanted in the final
output; this is silly and easy to fix.

Signed-off-by: Jack Palevich <jack.palevich@gmail.com>
12 years agoBasque localization.
Jack Palevich [Thu, 29 Sep 2011 04:56:45 +0000 (21:56 -0700)]
Basque localization.

Courtesy asier.iturralde@gmail.com

12 years agoUpdate Italian translations
Jack Palevich [Thu, 29 Sep 2011 04:42:00 +0000 (21:42 -0700)]
Update Italian translations

Courtesy fireb33@gmail.com

12 years agoGenerate native code for x86 as well as armeabi.
Jack Palevich [Sun, 18 Sep 2011 17:13:05 +0000 (10:13 -0700)]
Generate native code for x86 as well as armeabi.

In theory this will allow Android Terminal Emulator to run on an
x86 version of Android.

12 years agoUpdate config file for latest Android SDK
Jack Palevich [Sun, 18 Sep 2011 17:11:20 +0000 (10:11 -0700)]
Update config file for latest Android SDK

12 years agoUpdate private build tool to support NDK r6b
Jack Palevich [Sun, 18 Sep 2011 17:09:24 +0000 (10:09 -0700)]
Update private build tool to support NDK r6b

12 years agoIncrement version number.
Jack Palevich [Mon, 29 Aug 2011 23:52:45 +0000 (16:52 -0700)]
Increment version number.

12 years agoHandle fractional-pixel-width fixed-width fonts.
Jack Palevich [Sun, 28 Aug 2011 18:34:21 +0000 (11:34 -0700)]
Handle fractional-pixel-width fixed-width fonts.

This should fix the problems people have been having with text rendering
when using non-standard fixed-width fonts.

12 years agoRemove JDK 1.5-incompatible interface method @Override annotations
Jack Palevich [Sun, 28 Aug 2011 17:29:52 +0000 (10:29 -0700)]
Remove JDK 1.5-incompatible interface method @Override annotations

Allows building with JDK 1.5.

12 years agoAvoid accessing a finished TranscriptScreen when resuming the terminal activity
Steven Luo [Sun, 28 Aug 2011 16:43:09 +0000 (09:43 -0700)]
Avoid accessing a finished TranscriptScreen when resuming the terminal activity

updatePrefs() may ask each terminal session in the list to update its
size, which requires accessing the TranscriptScreen.  Therefore, we need
to update the list of running terminal sessions before calling
updatePrefs(), to preclude the possibility of accessing a finished
TranscriptScreen.

Also, if a window was closed in the WindowList activity, and then the
user selected a specific window, the window number passed to us in
onActivityResult() refers to the window list *after* taking window
closures into account.  We therefore need to defer switching to the
user's selected window until after the list of running sessions is
updated (onActivityResult() is called before onResume(), so it can't be
done there); this avoids calling onResume() on a stale EmulatorView,
which results in an attempt to access a finished TranscriptScreen.

12 years agoFix resource-related problems when running on Android 1.5 to 2.2
Jack Palevich [Sun, 28 Aug 2011 04:43:09 +0000 (21:43 -0700)]
Fix resource-related problems when running on Android 1.5 to 2.2

Hurray for the emulator for making it easy to test older versions

+ Use our own copies of system drawables not available in older versions.

+ Make sure there's a (mdpi resolution) copy of every drawable in the
 plain "drawable" directory, since that's where Android 1.5 looks.

12 years agoAdd UI for switching and managing terminal sessions.
Steven Luo [Sat, 27 Aug 2011 20:33:30 +0000 (13:33 -0700)]
Add UI for switching and managing terminal sessions.

We expose three different ways to manage terminal sessions:

* Options menu items to open a new window and close the current window.
* A WindowList activity, reachable from the options menu, which lists
  all the open windows and allows opening, closing, and switching of
  windows.  The behavior is patterned after the window list activity in
  the Android browser.
* Gestures to change windows -- swipe right-to-left for the next window,
  left-to-right for the previous window.

The options menu items have been reordered to make what should be the
five most frequently used items (new window, close window, window list,
toggle keyboard, special keys reference) appear in the icon menu so that
the user doesn't have to touch "More" to reach them.

This patch adds several icons.  btn_close_window and ic_menu_windows
come from the Android browser source, while the rest come from the
Android 2.3.3 SDK platform, revision 2 (platforms/android-10/data/res).

12 years agoSupport multiple sessions per terminal activity.
Steven Luo [Sat, 27 Aug 2011 20:23:52 +0000 (13:23 -0700)]
Support multiple sessions per terminal activity.

This patch does the following:

* Replace the EmulatorView widget in the activity layout with a
  TermViewFlipper, which is a ViewFlipper with a couple of added
  conveniences for dealing with EmulatorViews (e.g. pausing/resuming
  them when changing the view).
* Add an ArrayList in the service to hold TermSessions, and make the
  activity bind to the service so that it can retrieve the list.  This isn't
  strictly necessary for multisession support, but allows us to decouple
  the activity from the sessions, which will (in the future) allow us to
  restart or even close the activity without losing running sessions.
* Now that EmulatorViews aren't being created automatically when the
  layout is inflated, but are instead created by hand, move a bunch of
  initialization stuff to the EmulatorView constructor.
* Make the input reader threads for each session exit on EOF.  These
  threads hold a reference to their TermSession objects, which would
  leak otherwise.

For now, one EmulatorView and TermSession are created as soon as the
activity binds to the service, if none exist; no UI to create additional
sessions is included.

12 years agoDon't accept input from process after TranscriptScreen is finished.
Steven Luo [Sat, 27 Aug 2011 20:22:21 +0000 (13:22 -0700)]
Don't accept input from process after TranscriptScreen is finished.

This prevents a bunch of noise in the logs.

12 years agoThrow away TranscriptScreen backing store on session finish
Steven Luo [Sat, 27 Aug 2011 19:37:47 +0000 (12:37 -0700)]
Throw away TranscriptScreen backing store on session finish

Android's InputMethodManager seems to hold a reference to a finished
activity object for a while after the activity is destroyed.  This
keeps everything the activity holds a reference to in memory, which in
our case includes a fairly significant chunk of memory: the backing
store to the TranscriptScreen.  Throw this away when it's not needed, to
reduce the memory impact of this behavior.

12 years agoUse TermSession in activity and view instead of old terminal-handling code
Steven Luo [Sat, 27 Aug 2011 19:33:24 +0000 (12:33 -0700)]
Use TermSession in activity and view instead of old terminal-handling code

This completes the process of isolating the code for each terminal
session, which should considerably simplify the task of adding support
for multiple sessions.

12 years agoAdd TermSession class to represent a terminal session
Steven Luo [Sat, 27 Aug 2011 19:29:49 +0000 (12:29 -0700)]
Add TermSession class to represent a terminal session

At the moment, the assumption that each terminal activity contains only
one EmulatorView and hosts only one terminal session is fairly deeply
embedded into the code.  To help break this assumption, we introduce a
new TermSession class, which holds the TerminalEmulator and
TranscriptScreen for a session, and handles the launching and watching
of the process and the setup of the I/O streams.

12 years agoModify the activity and view to use the new TermSettings class.
Steven Luo [Sat, 27 Aug 2011 19:24:29 +0000 (12:24 -0700)]
Modify the activity and view to use the new TermSettings class.

12 years agoFor multisession support, we eventually want to keep the terminal
Steven Luo [Sat, 27 Aug 2011 19:20:44 +0000 (12:20 -0700)]
For multisession support, we eventually want to keep the terminal
sessions in the service instead of tying them to the activity.  This
implies that we have to stop holding SharedPreferences objects in all of
the classes tied to the session.  To this end, introduce a new
TermSettings class, which is responsible for reading SharedPreferences
and holding the current value of config settings.

12 years agoThis patch isn't really necessary, but it makes life easier for me. For
Steven Luo [Sat, 27 Aug 2011 19:12:54 +0000 (12:12 -0700)]
This patch isn't really necessary, but it makes life easier for me.  For
local builds, I change the package name to
net.steven676.android.terminal, which allows co-installation with the
Market version; however, if the debug constants stay in the Term class,
I have to change every file using them to either belong to the new
package, or else import net.steven676.android.terminal.Term.

12 years agoThe fact that Term.java contains substantially all of the classes of the
Steven Luo [Sat, 27 Aug 2011 19:02:31 +0000 (12:02 -0700)]
The fact that Term.java contains substantially all of the classes of the
application clashes with Java's model of one class per file, and is
inconvenient when refactoring the code to allow for multiple terminal
sessions in the activity.  This patch splits out all of the classes into
separate files, and groups related classes into packages; no actual
changes to the code are made.

12 years agoIgnore local.properties
Jack Palevich [Sat, 27 Aug 2011 18:38:01 +0000 (11:38 -0700)]
Ignore local.properties

contains machine-specific information, not useful to save in repo.

12 years agoShrink market icon to match "safe" bounds
Jack Palevich [Tue, 23 Aug 2011 03:53:29 +0000 (20:53 -0700)]
Shrink market icon to match "safe" bounds

See http://www.google.com/support/androidmarket/developer/bin/answer.py?answer=1078870

12 years agoImprove market icon.
Jack Palevich [Tue, 23 Aug 2011 03:39:40 +0000 (20:39 -0700)]
Improve market icon.

Shinier, and more like a terminal.

12 years agoUpdated translations
Jack Palevich [Sun, 21 Aug 2011 23:44:04 +0000 (16:44 -0700)]
Updated translations

Thanks to fireb33@gmail.com

12 years agoIncrement version number.
Jack Palevich [Sat, 25 Jun 2011 12:11:04 +0000 (20:11 +0800)]
Increment version number.

12 years agoUpdate in-app documentation for special keys
Jack Palevich [Sat, 25 Jun 2011 12:09:29 +0000 (20:09 +0800)]
Update in-app documentation for special keys

Contributed by Steven Luo steven+android@steven676.net

12 years agoAdd F1-F12 and Ins/Del/Home/End keys
Jack Palevich [Sat, 25 Jun 2011 12:07:44 +0000 (20:07 +0800)]
Add F1-F12 and Ins/Del/Home/End keys

Contributed by Steven Luo steven+android@steven676.net who writes:

The mapping is as follows:

Fn-[1-9]: F1-F9
Fn-0: F10
Ctrl-9: F11
Ctrl-0: F12
Fn-I: Ins
Fn-X: Del
Fn-H: Home
Fn-F: End

It should be noted that a real VT100 does not have Home/End keys, and as
such, the terminfo entry for TERM=vt100 doesn't contain escape codes for
Home and End.  This bothers some applications, but not others.  The
codes generated match those sent by the Linux console (TERM=linux),
which appears to work fine as a TERM setting since the emulation fixes
in 1.0.30.  xterm sends different escape codes, though; I left the
escape codes at their present values because TERM=xterm causes problems
with some applications.

Addresses GitHub issue #9.
---
I'm unhappy with the reintroduction of different behaviors for the Ctrl
key, but I couldn't think of another choice that's guaranteed to make
sense on any soft keyboard layout.  (Fn-J/K and Fn-(/) are the two other
possibilities that occurred to me.)  Feel free to change.

12 years agoFix behavior of Ctrl-[0-9]
Jack Palevich [Sat, 25 Jun 2011 12:03:30 +0000 (20:03 +0800)]
Fix behavior of Ctrl-[0-9]

Patch contributed by Steven Luo. steven+android@steven676.net

Steven writes:

In xterm on my Debian system, the Ctrl-[0-9] combinations appear to map
to the following:

Ctrl-2: ^@ (NUL)
Ctrl-3: ^[ (ESC)
Ctrl-4: ^\
Ctrl-5: ^]
Ctrl-6: ^^
Ctrl-7: ^_
Ctrl-8: \177 (DEL)

Ctrl-1, Ctrl-9, and Ctrl-0 appear to send 1, 9, and 0 respectively.

I have no idea whether anyone actually seriously uses these, but make
these key combinations behave in that manner, and remove the bogus
Ctrl-[0-9] and superfluous Fn-[234] combos.

12 years agoMake Ctrl/Fn-[A-Z] work with uppercase as well as lowercase letters
Jack Palevich [Sat, 25 Jun 2011 12:00:54 +0000 (20:00 +0800)]
Make Ctrl/Fn-[A-Z] work with uppercase as well as lowercase letters

Patch courtesy Steven Luo steven+android@steven676.net

Steven says:
For Ctrl-[A-Z], this matches the behavior of xterm running on my Debian
box; for Fn-[A-Z], there are no possible compatibility issues and it
seems like the most natural thing to do.

12 years agoAdd link to Downloads page to README file.
Jack Palevich [Sat, 25 Jun 2011 11:50:56 +0000 (19:50 +0800)]
Add link to Downloads page to README file.

12 years agoEnable an initial command string to be passed as part of the intent.
Jack Palevich [Sat, 25 Jun 2011 11:45:32 +0000 (19:45 +0800)]
Enable an initial command string to be passed as part of the intent.

Thanks to Christoph Schmidt-Hieber, M.D., c.schmidt-hieber@ucl.ac.uk
for the idea and the patch.

12 years agoUpdate Italian localization
Jack Palevich [Sat, 25 Jun 2011 11:35:39 +0000 (19:35 +0800)]
Update Italian localization

Thanks to fireb33@gmail.com

12 years agoIncrement version number.
Jack Palevich [Sat, 18 Jun 2011 11:43:58 +0000 (19:43 +0800)]
Increment version number.

12 years agoImplement a "None" setting for control and function keys.
Jack Palevich [Sat, 18 Jun 2011 13:16:32 +0000 (21:16 +0800)]
Implement a "None" setting for control and function keys.

Thanks to Eli Grey <me@eligrey.com> for the idea.

Also made the "Special keys" dialog text localizable.

12 years agoRename the rt tool to pushAndRun
Jack Palevich [Sat, 18 Jun 2011 13:11:42 +0000 (21:11 +0800)]
Rename the rt tool to pushAndRun

This tool is used to build and test the terminal emulator.

12 years agoAllow application to be installed on the SD Card.
Jack Palevich [Sat, 18 Jun 2011 11:43:22 +0000 (19:43 +0800)]
Allow application to be installed on the SD Card.

12 years agoFix insert and delete line code.
Jack Palevich [Sat, 18 Jun 2011 11:40:54 +0000 (19:40 +0800)]
Fix insert and delete line code.

Thanks to Sam Jacobson <sam.jacobson@snitchinc.com> for the
bug report and fix!

12 years agoImplement missing SGR escape codes
Jack Palevich [Sat, 18 Jun 2011 11:37:15 +0000 (19:37 +0800)]
Implement missing SGR escape codes

Thanks to Sam Jacobson <sam.jacobson@snitchinc.com> for the bug report!

12 years agoEscape single quote character so string resource compiles.
Jack Palevich [Sat, 18 Jun 2011 13:17:09 +0000 (21:17 +0800)]
Escape single quote character so string resource compiles.

12 years agoMerge pull request #20 from cpasmoi/master
Jack Palevich [Sat, 18 Jun 2011 11:02:36 +0000 (04:02 -0700)]
Merge pull request #20 from cpasmoi/master

missing translations

12 years agomissing translations
cpasmoi [Mon, 30 May 2011 00:51:05 +0000 (17:51 -0700)]
missing translations

12 years agomissing translations
cpasmoi [Mon, 30 May 2011 00:38:40 +0000 (17:38 -0700)]
missing translations

12 years agoIncrement version number.
Jack Palevich [Tue, 24 May 2011 22:51:17 +0000 (06:51 +0800)]
Increment version number.

12 years agoUse a global reference to hold onto a class object between JNI calls.
Jack Palevich [Tue, 24 May 2011 22:49:02 +0000 (06:49 +0800)]
Use a global reference to hold onto a class object between JNI calls.

This bug was detected by using CheckJNI

(setprop dalvik.vm.checkjni true; stop; start).

12 years agoUpdate local properties for building on a new machine.
Jack Palevich [Tue, 24 May 2011 12:15:51 +0000 (20:15 +0800)]
Update local properties for building on a new machine.

(Maybe I shouldn't check this file in at all.)

12 years agoIncrement version number.
Jack Palevich [Tue, 24 May 2011 12:15:15 +0000 (20:15 +0800)]
Increment version number.

12 years agoChange shared library name (again) to make sure our copy takes precedence on CyanogenMod
Steven Luo [Tue, 24 May 2011 07:39:15 +0000 (00:39 -0700)]
Change shared library name (again) to make sure our copy takes precedence on CyanogenMod

Commit 28d47b8... ("Fix java.lang.UnsatisfiedLinkError error.") changed
the name of the shared library from libandroidterm to libandroidterm2,
to avoid a potential library conflict with API/ABI incompatible versions
being shipped in some custom firmwares.  Unfortunately, CyanogenMod also
uses the name libandroidterm2:

https://github.com/CyanogenMod/android_packages_apps_AndroidTerm/commit/7d0de89f0ed5231a7d7eb3ca7917accb83c8eaee

Change the name again, this time to something that should hopefully be
unique, which should fix the problems that CyanogenMod users have been
reporting in the Android Market comments.  (A big scary warning to
firmware distributors that the shared library ABI must not be modified
without consulting upstream might be appropriate somewhere ...)

Signed-off-by: Jack Palevich <jackpal@google.com>
13 years agoBump version number.
Jack Palevich [Mon, 25 Apr 2011 17:27:50 +0000 (10:27 -0700)]
Bump version number.

13 years agoFix java.lang.UnsatisfiedLinkError error.
Jack Palevich [Mon, 25 Apr 2011 17:27:33 +0000 (10:27 -0700)]
Fix java.lang.UnsatisfiedLinkError error.

Change shared library name from libandroidterm to libandroidterm2

My theory is that this bug is happening on systems that have
system versions of the libandroidterm shared library.

Version 1.0.26 of Android Terminal Emulator added a new API,
hangupProcessGroup, to the libandroidterm library.

I think on devices that have libandroidterm in their system library,
that version takes precedence over the version in the application,
and so the hangupProcessGroup API is not found.

By changing the name of the libandroidterm library to libandroidterm2
we should avoid loading the system version of the
libandroidterm library.

13 years agoHousekeeping odds-and-ends.
Jack Palevich [Mon, 25 Apr 2011 17:13:02 +0000 (10:13 -0700)]
Housekeeping odds-and-ends.

Make sure the release build is a clean build.
Regenerate build.xml
Add update.sh script for regenerating build.xml

13 years agoRename buld tool, and make it build the JNI code as well.
Jack Palevich [Sat, 23 Apr 2011 19:15:23 +0000 (12:15 -0700)]
Rename buld tool, and make it build the JNI code as well.

13 years agoBump version number.
Jack Palevich [Sat, 23 Apr 2011 18:39:59 +0000 (11:39 -0700)]
Bump version number.

13 years agoAdd commitCorrection() to our InputConnection
Jack Palevich [Sat, 23 Apr 2011 18:37:01 +0000 (11:37 -0700)]
Add commitCorrection() to our InputConnection

Required in order to compile under API level 10.

13 years agoAdd setComposingRegion() and getSelectedText() to our InputConnection
Jack Palevich [Sat, 23 Apr 2011 18:29:57 +0000 (11:29 -0700)]
Add setComposingRegion() and getSelectedText() to our InputConnection

The definition of the InputConnection interface for SDK version >= 9
includes new functions setComposingRegion() and getSelectedText().  If
we don't include them in our implementation, the build fails with

   [javac] /home/steven/devel/android-terminal-emulator/src/jackpal/androidterm/Term.java:2955: <anonymous jackpal.androidterm.EmulatorView$4> is not abstract and does not override abstract method setComposingRegion(int,int) in android.view.inputmethod.InputConnection

(at least when building with SDK 10).

13 years agoMake the Terminal activity singleTask instead of singleInstance
Jack Palevich [Sat, 23 Apr 2011 18:21:27 +0000 (11:21 -0700)]
Make the Terminal activity singleTask instead of singleInstance

With the Terminal activity's launchMode set to singleInstance, the
Preferences activity starts a new task, which can lead to some very
strange back stack behavior.  Set launchMode to singleTask instead,
which will allow the Preferences activity into the same task.

13 years agoAdd menu options to take WakeLock and WifiLock
Jack Palevich [Sat, 23 Apr 2011 18:17:29 +0000 (11:17 -0700)]
Add menu options to take WakeLock and WifiLock

It can be very useful to prevent the device from sleeping or from
turning off the wifi radio -- but in a general terminal application it's
difficult to guess when this is wanted.  Consider the following:

(1) Nothing is happening.  We don't want to hold either a WakeLock or
WifiLock.
(2) The user is logged into a remote system via SSH on wifi.  We don't
need to hold a WakeLock, but should take a WifiLock to prevent the SSH
session from being disconnected.
(3) The user is doing some long-running computation (locally on the
device) in the shell.  We should take a WakeLock, but not a WifiLock.
(4) The user is doing apt-get dist-upgrade in her Debian chroot on the
device.  We should hold both a WakeLock and a WifiLock.

Therefore, assume the user knows best, and add menu options to take/drop
a WakeLock and a WifiLock.  Note that this requires adding WAKE_LOCK to
the set of permissions we use.

13 years agoAdd a service to prevent Android from killing our process
Jack Palevich [Sat, 23 Apr 2011 18:13:25 +0000 (11:13 -0700)]
Add a service to prevent Android from killing our process

By default, an Android process is liable to be killed whenever it's
not in the foreground.  When this happens to us, it leaves the user
unable to resume her terminal session, which is still running.

By starting a service in our process (even one which, like this one,
does nothing at all) and marking it as a foreground service, we prevent
the system from killing our process except in out-of-memory situations.