Added check of the restriction if a user is allowed to change their icon.
BUG: 25305966 Change-Id: I35fda2e4f157463d69a109409c3f8767d54eab4a
This commit is contained in:
@@ -32,6 +32,7 @@ import android.graphics.Rect;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.os.UserManager;
|
||||||
import android.provider.ContactsContract.DisplayPhoto;
|
import android.provider.ContactsContract.DisplayPhoto;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.support.v4.content.FileProvider;
|
import android.support.v4.content.FileProvider;
|
||||||
@@ -95,6 +96,10 @@ public class EditUserPhotoController {
|
|||||||
showUpdatePhotoPopup();
|
showUpdatePhotoPopup();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
final UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
|
||||||
|
if (um.hasUserRestriction(UserManager.DISALLOW_SET_USER_ICON)) {
|
||||||
|
mImageView.setEnabled(false);
|
||||||
|
}
|
||||||
mNewUserPhotoBitmap = bitmap;
|
mNewUserPhotoBitmap = bitmap;
|
||||||
mNewUserPhotoDrawable = drawable;
|
mNewUserPhotoDrawable = drawable;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user