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

Commit 0e9cbfc8 authored by Andras Kloczl's avatar Andras Kloczl Committed by Automerger Merge Worker
Browse files

Prevent using invalid result uri during multi user image change am: 07e41401

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13815798

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I98dd17745edd2e700169959537e640a33b81e07b
parents eda1be64 07e41401
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.provider.ContactsContract.DisplayPhoto;
import android.provider.MediaStore;
import android.util.EventLog;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
@@ -116,6 +117,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);