OSDN Git Service

Support multiple sessions per terminal activity.
authorSteven Luo <steven+android@steven676.net>
Sat, 27 Aug 2011 20:23:52 +0000 (13:23 -0700)
committerJack Palevich <jack.palevich@gmail.com>
Sat, 27 Aug 2011 20:23:52 +0000 (13:23 -0700)
commit5f4114849ba84e8bbab65ca8076915173bb95f7d
tree8f912101026467d12613a3ff0d4c3c2eea08ea09
parentf44119c2118cab693fd0bd67c64e13e0817c9279
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.
res/layout/term_activity.xml
src/jackpal/androidterm/EmulatorView.java
src/jackpal/androidterm/Term.java
src/jackpal/androidterm/TermService.java
src/jackpal/androidterm/TermViewFlipper.java [new file with mode: 0644]
src/jackpal/androidterm/session/TermSession.java
src/jackpal/androidterm/session/TerminalEmulator.java