Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef158431 authored by Oleksandr Peletskyi's avatar Oleksandr Peletskyi
Browse files

Added check of the restriction if a user is allowed to change their icon.

BUG: 25305966

Change-Id: I35fda2e4f157463d69a109409c3f8767d54eab4a
parent 703dae96
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;
    }