UserManager.setUserName: clearCallingId pre-Broadcast

UserManagerService.setUserName sends a broadcast to all users.
Without doing clearCallingIdentity first, it would require
INTERACT_ACROSS_USERS permission, which is not required for
this function.

Bug: 128576953
Test: Manual
Change-Id: Ia577248f48234eb9b73e53f9f9da04a86c324e12
This commit is contained in:
Bookatz
2019-03-14 11:57:09 -07:00
parent a091cc2d8b
commit f936855d4a

View File

@@ -1299,7 +1299,12 @@ public class UserManagerService extends IUserManager.Stub {
}
}
if (changed) {
sendUserInfoChangedBroadcast(userId);
long ident = Binder.clearCallingIdentity();
try {
sendUserInfoChangedBroadcast(userId);
} finally {
Binder.restoreCallingIdentity(ident);
}
}
}