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

Commit f1125282 authored by András Klöczl's avatar András Klöczl Committed by Android (Google) Code Review
Browse files

Merge "Prevent using invalid result uri during multi user image change" into pi-dev

parents 32d5d3a3 9c0024f4
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.provider.ContactsContract.DisplayPhoto;
import android.provider.MediaStore;
import android.util.EventLog;
import android.support.v4.content.FileProvider;
import android.util.Log;
import android.view.Gravity;
@@ -114,6 +115,14 @@ public class EditUserPhotoController {
        }
        final Uri pictureUri = data != null && data.getData() != null
                ? data.getData() : mTakePictureUri;

        // Check if the result is a content uri
        if (!ContentResolver.SCHEME_CONTENT.equals(pictureUri.getScheme())) {
            Log.e(TAG, "Invalid pictureUri scheme: " + pictureUri.getScheme());
            EventLog.writeEvent(0x534e4554, "172939189", -1, pictureUri.getPath());
            return false;
        }

        switch (requestCode) {
            case REQUEST_CODE_CROP_PHOTO:
                onPhotoCropped(pictureUri, true);