Merge "Fix bug in UserManager#getUserName" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f3d4c0f977
@@ -1544,7 +1544,7 @@ public class UserManagerService extends IUserManager.Stub {
|
|||||||
public String getUserName() {
|
public String getUserName() {
|
||||||
final int callingUid = Binder.getCallingUid();
|
final int callingUid = Binder.getCallingUid();
|
||||||
if (!hasManageOrCreateUsersPermission()
|
if (!hasManageOrCreateUsersPermission()
|
||||||
|| hasPermissionGranted(
|
&& !hasPermissionGranted(
|
||||||
android.Manifest.permission.GET_ACCOUNTS_PRIVILEGED, callingUid)) {
|
android.Manifest.permission.GET_ACCOUNTS_PRIVILEGED, callingUid)) {
|
||||||
throw new SecurityException("You need MANAGE_USERS or CREATE_USERS or "
|
throw new SecurityException("You need MANAGE_USERS or CREATE_USERS or "
|
||||||
+ "GET_ACCOUNTS_PRIVILEGED permissions to: get user name");
|
+ "GET_ACCOUNTS_PRIVILEGED permissions to: get user name");
|
||||||
|
|||||||
Reference in New Issue
Block a user