Refactor JobScheduler to handle user switch via onUserSwitching method
JobSchedulerService will handle SystemService's onUserSwitching method
in order to remove the previous user from its internal started users
array in the case the previous user is stopped during user switch.
With respect to the stopping previous user apps feature, this will
prevent JobSchedulerService from restarting packages that were early
killed during the user switch system event.
Test: Manually run user switch on device
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
Test: atest CtsJobSchedulerTestCases
Bug: 323200731
Flag: com.android.server.job.remove_user_during_user_switch
Change-Id: Ie2813482db061c8b2f21ce0731bbf5cf23897158
2 files changed