Merge "Add null check since LauncherUserInfo can be null." into main

This commit is contained in:
Anushree Ganjam
2024-01-13 05:04:14 +00:00
committed by Android (Google) Code Review

View File

@@ -80,6 +80,9 @@ public class ApiWrapper {
if (android.os.Flags.allowPrivateProfile() && Flags.enablePrivateSpace()) {
LauncherApps launcherApps = context.getSystemService(LauncherApps.class);
LauncherUserInfo launcherUserInfo = launcherApps.getLauncherUserInfo(user);
if (launcherUserInfo == null) {
continue;
}
// UserTypes not supported in Launcher are deemed to be the current
// Foreground User.
int userType = switch (launcherUserInfo.getUserType()) {