Keun young Park f992cb3101 add cancellation to background dexopt
- Completely refactored BackgroundDexOptimizationService to make it work
  under PackageManagerService : BackgroundDexOptJobService is added for
  JobService.
- Merged all post boot update code with idle opt code.
- added dump through adb shell dumpsys package dexopt
- cancel background dexopt when idle job is stopped.

Bug: 179094324
Bug: 156537504

TODO: add unit test as separate CL

Test: run idle job, stop it repeatedly and check cancellation
  $ adb shell cmd jobscheduler run android [800|801]
  $ adb shell cmd jobscheduler timeout android
  $ adb shell cmd jobscheduler run android [800|801]
  $ adb shell pm bg-dexopt-job
ex) $ adb shell cmd jobscheduler run android 801; sleep 1; adb shell cmd jobscheduler timeout android
ex) adb shell pm bg-dexopt-job, in a separate termainal: adb shell pm cancel-bg-dexopt-job
  $ adb shell dumpsys package dexopt

Change-Id: Ifa706fe44b0be76d393608646ea9e98169ea8916
2021-10-14 11:33:20 -07:00
..