diff options
| -rw-r--r-- | services/core/java/com/android/server/am/UserController.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java index 36f6b111d56a..055c9f63b600 100644 --- a/services/core/java/com/android/server/am/UserController.java +++ b/services/core/java/com/android/server/am/UserController.java @@ -115,7 +115,18 @@ import java.util.concurrent.atomic.AtomicInteger; class UserController implements Handler.Callback { private static final String TAG = TAG_WITH_CLASS_NAME ? "UserController" : TAG_AM; - // Maximum number of users we allow to be running at a time. + /** + * Maximum number of users we allow to be running at a time, including the system user and + * its profiles. + * Note changing this to 2 is not recommended, since that would mean, if the user uses + * work profile and then switch to a secondary user, then the work profile user would be killed, + * which should work fine, but aggressively killing the work profile user that has just been + * running could cause data loss. (Even without work profile, witching from secondary user A + * to secondary user B would cause similar issues on user B.) + * + * TODO: Consider adding or replacing with "MAX_RUNNING_*SECONDARY*_USERS", which is the max + * number of running *secondary, switchable* users. + */ static final int MAX_RUNNING_USERS = 3; // Amount of time we wait for observers to handle a user switch before |