Check for null before using user switcher view
On certain platforms, this view may not be relevant or set when switch is called via an alternative method (such as a guest exit notification). Therefore, if the null state is not accounted for, sysui will crash. Bug: 239738046 Test: manual Change-Id: Ief87945e3811b74c6a44c29ae029343663f085bb
This commit is contained in:
@@ -167,6 +167,7 @@ public class UserSwitcherController implements Dumpable {
|
||||
private final AtomicBoolean mGuestIsResetting;
|
||||
private final AtomicBoolean mGuestCreationScheduled;
|
||||
private FalsingManager mFalsingManager;
|
||||
@Nullable
|
||||
private View mView;
|
||||
private String mCreateSupervisedUserPackage;
|
||||
private GlobalSettings mGlobalSettings;
|
||||
@@ -572,9 +573,11 @@ public class UserSwitcherController implements Dumpable {
|
||||
|
||||
protected void switchToUserId(int id) {
|
||||
try {
|
||||
mInteractionJankMonitor.begin(InteractionJankMonitor.Configuration.Builder
|
||||
.withView(InteractionJankMonitor.CUJ_USER_SWITCH, mView)
|
||||
.setTimeout(MULTI_USER_JOURNEY_TIMEOUT));
|
||||
if (mView != null) {
|
||||
mInteractionJankMonitor.begin(InteractionJankMonitor.Configuration.Builder
|
||||
.withView(InteractionJankMonitor.CUJ_USER_SWITCH, mView)
|
||||
.setTimeout(MULTI_USER_JOURNEY_TIMEOUT));
|
||||
}
|
||||
mLatencyTracker.onActionStart(LatencyTracker.ACTION_USER_SWITCH);
|
||||
pauseRefreshUsers();
|
||||
mActivityManager.switchUser(id);
|
||||
|
||||
Reference in New Issue
Block a user