Refactored NMS to handle user switch via the onUserSwitching method
The NotificationManagerService listens for user switch events via the ACTION_USER_SWITCHED broadcast intent. This change refactors the logic to handle user switch events by overriding SystemService's onUserSwitching method. The onUserSwitching method is an earlier and more stable signal for user switch than the broadcast. SystemServices should rely on SystemService user lifecycle methods for user-aware operations. With respect to the stopping previous user apps feature, this results in the early killing ocurring after NotificationManagerService has handled the user switch events, which avoids it from restarting early killed packages. Test: atest NotificationManagerServiceTest Test: Manually run user switch on device Bug: 337077643 Bug: 323200731 Change-Id: I90c2ecb2fcfd0693bdc6c01aa9f4b83705e56ce8
Loading
Please register or sign in to comment