Adds Flexibility Controller and its supporting JobStatus functions.

This CL adds the Flexibility Controller and Flexibility Constraints. The
constraint will be added to jobs that are not expedited and have a long
enough duration of time between their earliest allowed runtime and
latest allowed runtime. The controller will satisfy the constraint
whenever a majority of "flexible constraints" are satisfied. Flexible
constraints include idle, battery not low, charging, and (for jobs that
require the internet) connectivity to an unmetered network.

This CL does not change any current functionality. It adds the
foundation for future CL's that plug in to other controllers.

The flexibility controller listens to other controllers and keeps track
of the actively satisfied flexible constraints. As a job approaches its
deadline, the number of flexible constraints that are required to
satisfy the flexibility constraint decreases so that only a majority
must be satisfied. Towards the very end of a jobs life cycle no flexible
constraints are required.

Test: JobThrottlingTest
Test: JobStatusTest
Test: JobSchedulingTest
Test: FlexibilityControllerTest

Bug: 236261941
Change-Id: I460fc8565d5dba69ab2012142423d96745af8e1d
3 files changed