Begin to add support for USB Connection in AI2.

Begin to add support for USB Connection in AI2. Add “secure” mode in
the HTTP Daemon so when we are the emulator or the USB connection we
only accept connections from localhost. Otherwise malware could launch
us with an Intent and then have a remote host take advantage of us
without any end-user intervention.

Added “connect USB” button to UI (note: Someone with better design
skills then me should probably re-do this button :-) ).

Change-Id: I818ae86e39fa4804139cce92f5c9f58323901077
Use “extras” field in Intent to start the Companion in “direct” mode.

Direct mode is used by the emulator and USB support to bypass the
Rendezvous server and accept connections from the blocks editor from
localhost (ip address 127.0.0.1).

Change-Id: Ic8ac879884205509644fc44ac6e8a6dbc8dc63a5
Eliminate the “connectUSB” button.

OK. So it wasn’t such a good idea. Also, rename PhoneStatus_isEmulator
to PhoneStatus_isDirect to reflect that it isn’t just for testing if
we are in the emulator.

Change-Id: I00882020ebd34db5a9a1f3b81fc979f0ed31b36d
Update aiDaemon to use subprocess instead of os.system.

This permits us to close lingering file descriptors, including the
listening socket. This means that the adb server doesn’t keep the
socket open which causes problems when you attempt to restart the
aiDaemon process.

Change-Id: Id04745a361864f13b4e2038ac729ed87fdb3bb10
Fix up confusion between “Boolean” and “boolean.”

Don’t ask...

Change-Id: I30092535989ed634aed33efaa14350537d0a0338
WORK IN PROGRESS: Update ReplMgr and aiDaemon for usb.

Update ReplMgr to support usb and emulators, at the same time!

Change-Id: I9f5bf3b19f8b7b4067bea032ed35037adcc39c79
Add UI for USB Connection.

Change-Id: Iee8e94a601020cb351fc964443fae534fa3f3bdc