TokencodeWidgetService: Make our PendingIntent work like a launcher click

When the user clicks on the tokencode widget, it (re)starts MainActivity.
Under some circumstances this can result in a task history that involves
duplicate copies of the activity, e.g.

  Stack #1:
    Task id #1088
      TaskRecord{426608e8 #1088 A=app.easytoken U=0 sz=2}
      Intent { flg=0x10000000 cmp=app.easytoken/.MainActivity }
        Hist #1: ActivityRecord{419e21d0 u0 app.easytoken/.MainActivity t1088}
          Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10600000 cmp=app.easytoken/.MainActivity bnds=[540,853][804,1152] }
          ProcessRecord{4290c760 10102:app.easytoken/u0a86}
        Hist #0: ActivityRecord{42660700 u0 app.easytoken/.MainActivity t1088}
          Intent { flg=0x10000000 cmp=app.easytoken/.MainActivity bnds=[86,919][465,1085] }

If we start MainActivity with the same intent settings as the Launcher,
it will operate as though the user clicked the Launcher icon.  This is
exactly what we want.

Reference:

http://stackoverflow.com/questions/5502427/resume-application-and-stack-from-notification

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
TokenInfo: Track "last_modified" time

Keep track of the last time of any token/settings changes (including
changes resulting from ImportActivity getting involved by another app).
This allows activities and widgets to reload the configuration when
appropriate.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
MainActivity: Refresh fragments on resume if lastModified time changed

This mostly reflects changes caused by importing a new token (whether
initiated from MainActivity/GettingStartedFragment/actionbar or from an
external app).

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
TokenInfo: Trigger widget restart on any preference update

This triggers the event from a central location, instead of having to find
every place in the app that might change a setting that is relevant to
the widget.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
TokencodeFragment: Clean up setPin() logic

Split the UI PIN setup apart from the code that saves a newly-set PIN to
disk.  This prevents issues with restored fragments inadvertently saving
a cached PIN after importing a new token.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
TokencodeWidgetService: Allow toggling between tokencode/clock on lock screen

The default Android lock screen clock widget typically shows time+date,
which is lost if we replace it with a tokencode.  So let the user toggle
between tokencode or clock by clicking the widget.

This applies to the lock screen only; home screen widgets will still open
the app.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
MainActivity: Don't draw divider if only frag_0 is present

It was observed that on screen rotation, the frag_0/frag_1 divider
suddenly reappeared - even if we were using TokencodeFragment.  So we
will need to cache the visibility status and set it up if the activity
is ever re-created.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
external: Add scripted libstoken.so build

This builds for all three architectures plus Java, and drops the results
under libs/.

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

We will always build from source from here on out.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Initial commit of build.xml

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Initial commit of README/CHANGES/travis files

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