Merge "Added check of the restriction if a user is allowed to change their icon. BUG: 25305966"

This commit is contained in:
Oleksandr Peletskyi
2016-01-22 20:31:41 +00:00
committed by Android (Google) Code Review

View File

@@ -32,6 +32,7 @@ import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.UserManager;
import android.provider.ContactsContract.DisplayPhoto;
import android.provider.MediaStore;
import android.support.v4.content.FileProvider;
@@ -95,6 +96,10 @@ public class EditUserPhotoController {
showUpdatePhotoPopup();
}
});
final UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
if (um.hasUserRestriction(UserManager.DISALLOW_SET_USER_ICON)) {
mImageView.setEnabled(false);
}
mNewUserPhotoBitmap = bitmap;
mNewUserPhotoDrawable = drawable;
}