Don't stop scheduled background user near alarm
If a user's alarm is going to go off in the next X minutes, don't
automatically stop a background user. There's no point automatically
stopping a user that we're just going to (or want to) restart soon
due to its alarm.
Bug: 353734966
Bug: 330351042
Flag: android.multiuser.schedule_stop_of_background_user
Test: atest FrameworksServicesTests:UserControllerTest#testScheduleStopOfBackgroundUser_rescheduleIfAlarm
Change-Id: I4813804f2646279871717be723d33e6c66d10033
4 files changed