From ae26189aa9a1a2d20ca2006d591d50d7338eb917 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Mon, 27 Jun 2016 10:40:09 -0700 Subject: [PATCH] Don't reuse userids that are being cleaned up on boot During the current session, if we're cleaning up some old users, mark them as being in the remove pile so that the userIds are not reused right away. Otherwise there's a potential for confusing the file-based crypto layer. Bug: 29635364 Change-Id: I57a868fbe6c58a02ffcea63809d25eba01360e1e --- .../core/java/com/android/server/pm/UserManagerService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java index 627cdd0161154..d128252e80631 100644 --- a/services/core/java/com/android/server/pm/UserManagerService.java +++ b/services/core/java/com/android/server/pm/UserManagerService.java @@ -471,6 +471,8 @@ public class UserManagerService extends IUserManager.Stub { UserInfo ui = mUsers.valueAt(i).info; if ((ui.partial || ui.guestToRemove || ui.isEphemeral()) && i != 0) { partials.add(ui); + mRemovingUserIds.append(ui.id, true); + ui.partial = true; } } }