OSDN Git Service

Replace ad-hoc intent script execution with more formal interface
authorJack Palevich <jackpal@google.com>
Sat, 10 Mar 2012 19:27:33 +0000 (11:27 -0800)
committerJack Palevich <jackpal@google.com>
Sat, 10 Mar 2012 19:27:33 +0000 (11:27 -0800)
commita25ac82d2ee62c75ac3a90651d387d2f7001f66d
treeb5c67dd28bd28a281f1cab78e06472571f4074fc
parent833fdc5be18ea19219d8a71189326e179d593761
Replace ad-hoc intent script execution with more formal interface

The current intent script execution mechanism has at least two
serious problems:

* If a Term activity is already running, it will just bring the activity
  to the top, without opening a new window or running the provided
  script.
* It allows any other application to use our permissions, even if they
  don't have those permissions themselves.

Replace the current ad-hoc mechanism with a more formally defined remote
intent interface, which provides two actions:

* jackpal.androidterm.OPEN_NEW_WINDOW opens a new terminal window.  No
  script execution is allowed, and no permissions are required to use
  this action.
* jackpal.androidterm.RUN_SCRIPT opens a new window and runs the script
  specified in the jackpal.androidterm.iInitialCommand extra.
  Applications using this intent must have the
  jackpal.androidterm.permission.RUN_SCRIPT permission, which must be
  approved by the user at install time.

Signed-off-by: Jack Palevich <jackpal@google.com>
AndroidManifest.xml
res/values/strings.xml
src/jackpal/androidterm/RemoteInterface.java [new file with mode: 0644]
src/jackpal/androidterm/Term.java