Add a factory method to create a Lifecycle.

Some unit tests in other packages want to override the mLifecycle member
with their own value. When the Lifecycle class moves into SettingsLib,
the classpath of ObservableDialogFragment and Lifecycle have to remain
consistent. This change allows dependent classes to remain agnostic to
Lifecycle's classpath.

Test: make RunSettingsGoogleRoboTests && make RunSettingsLibRoboTests &&
      make RunSettingsRoboTests

Change-Id: I594e447741aeeb3ba95afb4044d496b1540bd92c
1 file changed