Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 34309071 authored by Yasin Kilicdere's avatar Yasin Kilicdere
Browse files

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
parent 8c6312f1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment