Merge "Restriction setters were not getting called since we changed the boot sequence for multi-user model."
diff --git a/user/car-user-lib/src/android/car/userlib/CarUserManagerHelper.java b/user/car-user-lib/src/android/car/userlib/CarUserManagerHelper.java
index 23186aa..d1ecf13 100644
--- a/user/car-user-lib/src/android/car/userlib/CarUserManagerHelper.java
+++ b/user/car-user-lib/src/android/car/userlib/CarUserManagerHelper.java
@@ -781,6 +781,9 @@
return null;
}
assignDefaultIcon(user);
+
+ // Set disallow background run for admin users, users will be killed when switched away.
+ setUserRestriction(user, UserManager.DISALLOW_RUN_IN_BACKGROUND, /* enable= */ true);
return user;
}