OpenVpnService: Add getConnectionStateName() method

Several different activities/fragments will need this, so put it in a
common place.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Add new VPNConnector class

Provide common functions allowing UI elements to listen for VPN status
changes.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
MainActivity: Create new STATUS tab

Allow the user to view basic VPN status from MainActivity via the new
StatusFragment.  Profiles/Settings will be unavailable while the VPN is
up, to avoid changing settings that affect a running connection.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
MainActivity: Remember which tab was active if the Activity is redrawn

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
LogWindow: Convert to use common VPNConnector functions

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
OpenVpnService: Allow multiple activities to show the auth dialog

This isn't 100% stable yet but it "sorta" works.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
VPNConnector: Call from onResume/onPause not onStart/onStop

In order to allow the auth dialog to be shown on different activities,
it is necessary to tear down the form if an activity is paused so that
it can be rendered on the new foreground activity.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
VPNLog: Move LogItem into a standalone "VPNLogItem" class

This allows it to implement Serializable so we can easily cache the
log data on disk.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Save/restore the log buffer across sessions

OpenVpnService can be stopped by the OS after the VPN disconnects, and
we would not want to lose the log data if the disconnection was due to
an error.  So cache it on disk, and restore it when somebody binds to
the service again.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
LogWindow: Don't intercept the back button anymore

We'll just let the user navigate back to MainActivity, since there is
now a way to switch back and forth between the two interfaces.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
OpenVpnService: Fix NPE if there is no saved UUID in the prefs

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
VPNConnector: Use different stop* methods for Activity vs. Fragment

The parent Activity will handle the auth dialog, so split up the stop
methods so there is no confusion.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
external: Sync with openconnect rev 9ebb45129

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
libs: Sync openconnect with latest sources

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>