[Android password settings] Separate reauthentication helper

Currently the logic for reauthentication is scattered over these files:

PasswordEntryEditor.java
SavePasswordsPreferences.java

where SavePasswordsPreferences take care of resetting and own the
timer for reauthentication validity (because it should be tied to the
passwords settings lifetime), and PasswordEntryEditor contains logic
to decide about reauthentication steps based on that timer and on
other device state.

This alone is already a little disorganised. In a follow-up CL, one
more callsite for the reauth logic will be added, in
SavePasswordsPreferences.java, meaning that there would be
difficulties reusing the code currently in PasswordEntryEditor.java.

For that reason, this CL introduces a new class,
ReauthenticationManager.java, which encapsulates the logic. Because
the timer has been a static value, the new class is also composed of
static methods.

Bug: 788701
Change-Id: Iea2007fdd9c89bff77595b2cf5ea8ac4e1501792
Reviewed-on: https://chromium-review.googlesource.com/797510
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Maria Khomenko <mariakhomenko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520536}
7 files changed