Skip to content

Commit 2512151

Browse files
muhomorrthestinger
authored andcommitted
add workaround for SSM.newTargetUser() system_server crash
1 parent 6be1f35 commit 2512151

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

services/core/java/com/android/server/SystemServiceManager.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,13 @@ public void preSystemReady() {
379379
}
380380

381381
private @NonNull TargetUser newTargetUser(@UserIdInt int userId) {
382+
if (mUserManagerInternal == null) {
383+
// see https://github.com/GrapheneOS/os-issue-tracker/issues/4510
384+
var um = LocalServices.getService(UserManagerInternal.class);
385+
if (um != null) {
386+
mUserManagerInternal = um;
387+
}
388+
}
382389
final UserInfo userInfo = mUserManagerInternal.getUserInfo(userId);
383390
Preconditions.checkState(userInfo != null, "No UserInfo for " + userId);
384391
return new TargetUser(userInfo);

0 commit comments

Comments
 (0)