OSDN Git Service

Eliminate unnecessary object churn in job scheduler updating
authorChristopher Tate <ctate@google.com>
Tue, 4 Oct 2016 23:34:48 +0000 (16:34 -0700)
committerChristopher Tate <ctate@google.com>
Tue, 4 Oct 2016 23:42:52 +0000 (16:42 -0700)
commiteafb535072698b0559d8919db4b18618359c11b9
treea2731e21cd885b95d1b755033ba653855a59eff7
parent7d25ab7b11f95d7df1c078f2fc37ce122b61534e
Eliminate unnecessary object churn in job scheduler updating

The arbitrary-caller "what job is currently running?" state inspector
returns a clone of the JobStatus record for it, not a live reference
to the scheduler's active state.  That's appropriate for most cases
but when doing its own internal bookkeeping, the object churn in cloning
(especially, an unneeded clone just for purposes of comparing to some
other job!) is merely a huge waste of CPU and GC load.

So now we don't do that unnecessarily, and everything is much leaner.

Bug 31751985

Change-Id: Idacb52e9e5ca17b9e12b7ccd2fc2e1ec8b3547f6
services/core/java/com/android/server/job/JobSchedulerService.java
services/core/java/com/android/server/job/JobServiceContext.java