Defer sending broadcasts to when the user switch is complete.
Send the following broadcasts after a user switch is complete, instead of while the switch is happening. * ACTION_USER_BACKGROUND * ACTION_USER_FOREGROUND * ACTION_USER_SWITCHED Otherwise managing these broadcasts occupy system_server process and make the user switch longer than it could be. If a code should be run while the user switch is happening, in other words while the screen is frozen, (because possibly they move things around on the screen), they should register a UserSwitchObserver and override its onUserSwitching method. Then when they are done, they should call reply.sendResult(null); on the provided reply parameter. Bug: 257437695 Test: atest FrameworksServicesTests:UserControllerTest Change-Id: I7b8662600b45459cd83653ac6f15e73335903262
Loading
Please register or sign in to comment