Create the workchain by default when acquiring the wakelock.

The APIs to create and use workchains have been available for
a while. So, it should be safe to create a workchain by default.

Since the System acquires the wakelock on behalf of the apps
when scheduling jobs, the worksource should include the System uid
to correctly indicate the wakelock acquirer and will allow us to
differentiate between system-held and app-held wakelocks.

Bug: 352676818
Test: atest services/tests/mockingservicestests/src/com/android/server/job/JobSchedulerServiceTest.java
Test: statsd_testdrive 10
Flag: com.android.server.job.create_work_chain_by_default
Change-Id: Ib135729df1a1bcaace2d01ce1a94ec16094b264a
3 files changed